diff options
author | Danesh M <daneshm90@gmail.com> | 2013-10-30 18:49:09 -0700 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-06 16:12:17 -0700 |
commit | 8033c0067981c41d1c5a89c06a3adb29995eb87f (patch) | |
tree | 0b52fd2d3e7dd027790ff4479cda1a49e28a8fa4 /tools/repopick.py | |
parent | c7821d21473eb49e2a7a60b267dc70dab79facbe (diff) | |
download | build-8033c0067981c41d1c5a89c06a3adb29995eb87f.zip build-8033c0067981c41d1c5a89c06a3adb29995eb87f.tar.gz build-8033c0067981c41d1c5a89c06a3adb29995eb87f.tar.bz2 |
RepoPick : Add support for git pull
Allow user to git pull patchsets and dependencies.
Change-Id: If5520b45fe79836eac628b3caf0526f11f8953d9
(cherry picked from commit df646304bdcef329e3fe7c12b68107de1f4cd42a)
Diffstat (limited to 'tools/repopick.py')
-rwxr-xr-x | tools/repopick.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/repopick.py b/tools/repopick.py index 09d85a9..0278fa3 100755 --- a/tools/repopick.py +++ b/tools/repopick.py @@ -63,6 +63,7 @@ parser.add_argument('-b', '--auto-branch', action='store_true', help='shortcut t parser.add_argument('-q', '--quiet', action='store_true', help='print as little as possible') parser.add_argument('-v', '--verbose', action='store_true', help='print extra information to aid in debug') parser.add_argument('-f', '--force', action='store_true', help='force cherry pick even if commit has been merged') +parser.add_argument('-p', '--pull', action='store_true', help='execute pull instead of cherry-pick') args = parser.parse_args() if args.start_branch == None and args.abandon_first: parser.error('if --abandon-first is set, you must also give the branch name with --start-branch') @@ -266,7 +267,10 @@ for change in args.change_number: # Try fetching from GitHub first if args.verbose: print('Trying to fetch the change from GitHub') - cmd = 'cd %s && git fetch github %s' % (project_path, fetch_ref) + if args.pull: + cmd = 'cd %s && git pull --no-edit github %s' % (project_path, fetch_ref) + else: + cmd = 'cd %s && git fetch github %s' % (project_path, fetch_ref) execute_cmd(cmd) # Check if it worked FETCH_HEAD = '%s/.git/FETCH_HEAD' % project_path @@ -274,11 +278,15 @@ for change in args.change_number: # That didn't work, fetch from Gerrit instead if args.verbose: print('Fetching from GitHub didn\'t work, trying to fetch the change from Gerrit') - cmd = 'cd %s && git fetch %s %s' % (project_path, fetch_url, fetch_ref) + if args.pull: + cmd = 'cd %s && git pull --no-edit %s %s' % (project_path, fetch_url, fetch_ref) + else: + cmd = 'cd %s && git fetch %s %s' % (project_path, fetch_url, fetch_ref) execute_cmd(cmd) # Perform the cherry-pick cmd = 'cd %s && git cherry-pick FETCH_HEAD' % (project_path) - execute_cmd(cmd) + if not args.pull: + execute_cmd(cmd) if not args.quiet: print('') |