Skip to content

Instantly share code, notes, and snippets.

@invisiblek
Created August 25, 2016 14:25
Show Gist options
  • Save invisiblek/cb368bafb683b75c8349e0ac6443b51a to your computer and use it in GitHub Desktop.
Save invisiblek/cb368bafb683b75c8349e0ac6443b51a to your computer and use it in GitHub Desktop.
diff --git a/tools/repopick.py b/tools/repopick.py
index a53c043..c2acbf4 100755
--- a/tools/repopick.py
+++ b/tools/repopick.py
@@ -153,6 +153,7 @@ if __name__ == '__main__':
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 ,')
+ parser.add_argument('-pb', '--pick-branch', help='override the default branch and just pick commit')
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')
@@ -217,9 +218,12 @@ if __name__ == '__main__':
for project in projects:
name = project.get('name')
path = project.get('path')
- revision = project.get('revision')
- if revision is None:
- revision = default_revision
+ if args.pick_branch:
+ revision = args.pick_branch
+ else:
+ revision = project.get('revision')
+ if revision is None:
+ revision = default_revision
if not name in project_name_to_data:
project_name_to_data[name] = {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment