summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdrianDC <radian.dc@gmail.com>2015-12-08 20:19:41 +0100
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-12-19 13:59:29 -0800
commitf0b8bffb663ba15d79d4c7581fe3c12239dcb6fe (patch)
tree3f4722bfd9d631cf9b1822d56d9062a6efa9261c /tools
parente371207107d644340318bff73665c600bb594a58 (diff)
downloadbuild-f0b8bffb663ba15d79d4c7581fe3c12239dcb6fe.zip
build-f0b8bffb663ba15d79d4c7581fe3c12239dcb6fe.tar.gz
build-f0b8bffb663ba15d79d4c7581fe3c12239dcb6fe.tar.bz2
repopick: Allow commits to be excluded from a topic importation
* Add the ability to 'repopick -t TOPIC -e 120586,120587' Change-Id: Ib99c095174a0987f68cb8261b7af3f59272b05b5 Signed-off-by: AdrianDC <radian.dc@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/repopick.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/repopick.py b/tools/repopick.py
index 1e70655..6e9e665 100755
--- a/tools/repopick.py
+++ b/tools/repopick.py
@@ -151,6 +151,7 @@ if __name__ == '__main__':
parser.add_argument('-t', '--topic', help='pick all commits from a specified topic')
parser.add_argument('-Q', '--query', help='pick all commits using the specified query')
parser.add_argument('-g', '--gerrit', default=default_gerrit, help='Gerrit Instance to use. Form proto://[user@]host[:port]')
+ parser.add_argument('-e', '--exclude', nargs=1, help='exclude a list of commit numbers separated by a ,')
args = parser.parse_args()
if not args.start_branch and args.abandon_first:
parser.error('if --abandon-first is set, you must also give the branch name with --start-branch')
@@ -237,12 +238,20 @@ if __name__ == '__main__':
# make list of things to actually merge
mergables = []
+ # If --exclude is given, create the list of commits to ignore
+ exclude = []
+ if args.exclude:
+ exclude = args.exclude[0].split(',')
+
for change in change_numbers:
patchset = None
if '/' in change:
(change, patchset) = change.split('/')
- change = int(change)
+ if change in exclude:
+ continue
+
+ change = int(change)
review = [x for x in reviews if x['number'] == change][0]
mergables.append({
'subject': review['subject'],