Commit c9144527 authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

depot_tools: Don't use basestring in scm.CaptureStatus.

basestring doesn't exist in Python 3. scm.Capture status doesn't need to support strings either.

Bug: 1002209
Change-Id: Ie9edfdfd09b789bfaace038a6ad8f3a7da344bc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1890925Reviewed-by: 's avatarAnthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 0f993370
...@@ -121,7 +121,7 @@ class GIT(object): ...@@ -121,7 +121,7 @@ class GIT(object):
def CaptureStatus(files, cwd, upstream_branch): def CaptureStatus(files, cwd, upstream_branch):
"""Returns git status. """Returns git status.
@files can be a string (one file) or a list of files. @files is a list of files.
Returns an array of (status, file) tuples.""" Returns an array of (status, file) tuples."""
if upstream_branch is None: if upstream_branch is None:
...@@ -130,11 +130,7 @@ class GIT(object): ...@@ -130,11 +130,7 @@ class GIT(object):
raise gclient_utils.Error('Cannot determine upstream branch') raise gclient_utils.Error('Cannot determine upstream branch')
command = ['-c', 'core.quotePath=false', 'diff', command = ['-c', 'core.quotePath=false', 'diff',
'--name-status', '--no-renames', '-r', '%s...' % upstream_branch] '--name-status', '--no-renames', '-r', '%s...' % upstream_branch]
if not files: if files:
pass
elif isinstance(files, basestring):
command.append(files)
else:
command.extend(files) command.extend(files)
status = GIT.Capture(command, cwd) status = GIT.Capture(command, cwd)
results = [] results = []
......
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