Commit 9b31f167 authored by maruel@chromium.org's avatar maruel@chromium.org

Fix running presubmit_support.py directly

R=cmp@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/9234038

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@119264 0039d316-1c4b-4281-b951-d872f2087c98
parent 2b40b89a
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment