From 2e9ba2ac6beab32e42751cb821ea355ded270cfb Mon Sep 17 00:00:00 2001 From: "dpranke@google.com" Date: Wed, 15 Dec 2010 20:45:41 +0000 Subject: [PATCH] Add support for an --upstream_branch argument to make diffing against things other than trunk easier. BUG=none R=maruel@chromium.org TEST=none Review URL: http://codereview.chromium.org/5680006 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@69307 0039d316-1c4b-4281-b951-d872f2087c98 --- trychange.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/trychange.py b/trychange.py index d560a78fa..0360d4fa4 100755 --- a/trychange.py +++ b/trychange.py @@ -574,6 +574,9 @@ def TryChange(argv, group.add_option("-E", "--exclude", action="append", default=['ChangeLog'], metavar='REGEXP', help="Regexp patterns to exclude files. Default: %default") + group.add_option("--upstream_branch", action="store", + help="Specify the upstream branch to diff against in the " + "main checkout") parser.add_option_group(group) group = optparse.OptionGroup(parser, "Access the try server by HTTP") @@ -651,7 +654,10 @@ def TryChange(argv, try: # Always include os.getcwd() in the checkout settings. checkouts = [] - checkouts.append(GuessVCS(options, os.getcwd())) + path = os.getcwd() + if options.upstream_branch: + path += '@' + options.upstream_branch + checkouts.append(GuessVCS(options, path)) checkouts[0].AutomagicalSettings() for item in options.sub_rep: checkout = GuessVCS(options, os.path.join(checkouts[0].checkout_root,