Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: presubmit_support.py

Issue 267513002: Add --upstream flag to presubmit_support for Git. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_support.py
diff --git a/presubmit_support.py b/presubmit_support.py
index 594ac6878bf8a05b622ca44d45ed3d7219f8f76d..0b9e75b4c39e1acaaf3522cc40f75e4e07567211 100755
--- a/presubmit_support.py
+++ b/presubmit_support.py
@@ -1458,9 +1458,9 @@ def load_files(options, args):
files = scm.SVN.CaptureStatus([], options.root)
elif change_scm == 'git':
change_class = GitChange
- # TODO(maruel): Get upstream.
+ upstream = options.upstream or None
if not files:
- files = scm.GIT.CaptureStatus([], options.root, None)
+ files = scm.GIT.CaptureStatus([], options.root, upstream)
else:
logging.info('Doesn\'t seem under source control. Got %d files' % len(args))
if not files:
@@ -1532,6 +1532,9 @@ def Main(argv):
"If inherit-review-settings-ok is present in this "
"directory, parent directories up to the root file "
"system directories will also be searched.")
+ parser.add_option("--upstream",
+ help="Git only: the base ref or upstream branch against "
+ "which the diff should be computed.")
parser.add_option("--default_presubmit")
parser.add_option("--may_prompt", action='store_true', default=False)
parser.add_option("--skip_canned", action='append', default=[],
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698