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

Unified Diff: presubmit_support.py

Issue 9234038: Fix running presubmit_support.py directly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 11 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 79a61f84a7a0f409eeef28aaa1e795591bc0f2db..f583fb67e263c12a1b345d20b05a85bbab32d9c4 100755
--- a/presubmit_support.py
+++ b/presubmit_support.py
@@ -1183,22 +1183,22 @@ def load_files(options, args):
"""Tries to determine the SCM."""
change_scm = scm.determine_scm(options.root)
files = []
+ if args:
+ files = ParseFiles(args, options.recursive)
if change_scm == 'svn':
change_class = SvnChange
- status_fn = scm.SVN.CaptureStatus
+ if not files:
+ files = scm.SVN.CaptureStatus([], options.root)
elif change_scm == 'git':
change_class = GitChange
- status_fn = scm.GIT.CaptureStatus
+ # TODO(maruel): Get upstream.
+ if not files:
+ files = scm.GIT.CaptureStatus([], options.root, None)
else:
logging.info('Doesn\'t seem under source control. Got %d files' % len(args))
- if not args:
+ if not files:
return None, None
change_class = Change
- if args:
- files = ParseFiles(args, options.recursive)
- else:
- # Grab modified files.
- files = status_fn([options.root])
return change_class, files
« 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