From 81f6eea287779ea82a62386d4d7a07e73598bffd Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Mon, 8 Feb 2010 02:11:41 +0000 Subject: [PATCH] Make git-try --webkit work like it used to work. TEST=none BUG=none Review URL: http://codereview.chromium.org/570059 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@38337 0039d316-1c4b-4281-b951-d872f2087c98 --- trychange.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/trychange.py b/trychange.py index 31275dbb6..2f3432641 100755 --- a/trychange.py +++ b/trychange.py @@ -512,10 +512,18 @@ def TryChange(argv, "revision/branch to diff against.") # Mostly chromium-specific try: - group.add_option("--webkit", action="append_const", - const="third_party/WebKit", - dest="PATH", - help="Shorthand for -s third_party/WebKit") + def WebKitRevision(options, opt, value, parser): + if parser.rargs and not parser.rargs[0].startswith('-'): + options.sub_rep.append('third_party/WebKit@%s' % parser.rargs.pop(0)) + else: + options.sub_rep.append('third_party/WebKit') + + group.add_option("-W", "--webkit", action="callback", + callback=WebKitRevision, + metavar="BRANCH", + help="Shorthand for -s third_party/WebKit@BRANCH. " + "BRANCH is optional and is the branch the current " + "checkout will be diff'ed against.") except optparse.OptionError: # append_const is not supported on 2.4. Too bad. pass