summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorgavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 20:18:59 +0000
committergavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 20:18:59 +0000
commita1f86ac9c5ef63723516c046f87aec7f2103f080 (patch)
treed56586b9aee81c071a6365cb30a08448b826151e /tools
parent0753ea46dfdeef01ee4a966d103293aa60b61438 (diff)
downloadchromium_src-a1f86ac9c5ef63723516c046f87aec7f2103f080.zip
chromium_src-a1f86ac9c5ef63723516c046f87aec7f2103f080.tar.gz
chromium_src-a1f86ac9c5ef63723516c046f87aec7f2103f080.tar.bz2
Make safely-roll-webkit.py more configurable.
While webkit gardening today, I ran into trouble with my old git workflow: the origin is origin/trunk, not the origin/master which was hard baked into this script. I've added a new option --upstream to set any origin you'd like for more complex scenarios, and left the default intact. As long as I was here, I added some help strings and an option to not auto commit-queue the CL. TEST=manual R=maruel@chromium.org,pdr@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/10907010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/safely-roll-webkit.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/safely-roll-webkit.py b/tools/safely-roll-webkit.py
index f810ce0..e028c90 100755
--- a/tools/safely-roll-webkit.py
+++ b/tools/safely-roll-webkit.py
@@ -45,6 +45,15 @@ def main():
tool_dir = os.path.dirname(os.path.abspath(__file__))
parser = optparse.OptionParser(usage='<new webkit rev>')
parser.add_option('-v', '--verbose', action='count', default=0)
+ parser.add_option('--commit', action='store_true', default=True,
+ help='(default) Put change in commit queue on upload.')
+ parser.add_option('--no-commit', action='store_false', dest='commit',
+ help='Don\'t put change in commit queue on upload.')
+ parser.add_option('--upstream', default='origin/master',
+ help='(default "%default") Use given start point for change'
+ ' to upload. For instance, if you use the old git workflow,'
+ ' you might set it to "origin/trunk".')
+
options, args = parser.parse_args()
logging.basicConfig(
level=
@@ -67,13 +76,16 @@ def main():
parser.error(
'Please delete the branch webkit_roll and move to a different branch')
subprocess2.check_output(
- ['git', 'checkout', '-b', 'webkit_roll', 'origin/master'])
+ ['git', 'checkout', '-b', 'webkit_roll', options.upstream])
try:
old_rev = process_deps(os.path.join(root_dir, 'DEPS'), new_rev)
commit_msg = 'Webkit roll %s:%s\n\nTBR=\n' % (old_rev, new_rev)
subprocess2.check_output(['git', 'commit', '-m', commit_msg, 'DEPS'])
- subprocess2.check_call(['git', 'diff', 'origin/master'])
- subprocess2.check_call(['git', 'cl', 'upload', '--use-commit-queue'])
+ subprocess2.check_call(['git', 'diff', options.upstream])
+ upload_cmd = ['git', 'cl', 'upload']
+ if options.commit:
+ upload_cmd.append('--use-commit-queue')
+ subprocess2.check_call(upload_cmd)
finally:
subprocess2.check_output(['git', 'checkout', old_branch])
subprocess2.check_output(['git', 'branch', '-D', 'webkit_roll'])