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

Unified Diff: scm.py

Issue 551215: Change CheckCall behavior when print_error=False (Closed)
Patch Set: Created 10 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
« gclient_utils.py ('K') | « gclient_utils.py ('k') | trychange.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scm.py
diff --git a/scm.py b/scm.py
index 1d15243d4691fb024e1ad12ed9094375e98cbe3d..721fb669f01534483420eef0b5e6052f6584c44a 100644
--- a/scm.py
+++ b/scm.py
@@ -78,7 +78,7 @@ class GIT(object):
else:
command.extend(files)
- status = GIT.Capture(command).rstrip()
+ status = GIT.Capture(command)[0].rstrip()
results = []
if status:
for statusline in status.split('\n'):
@@ -126,7 +126,7 @@ class GIT(object):
# We could want to look at the svn cred when it has a svn remote but it
# should be fine for now, users should simply configure their git settings.
return GIT.Capture(['config', 'user.email'],
- repo_root, error_ok=True).strip()
+ repo_root, error_ok=True)[0].strip()
@staticmethod
def ShortBranchName(branch):
@@ -136,7 +136,7 @@ class GIT(object):
@staticmethod
def GetBranchRef(cwd):
"""Returns the full branch reference, e.g. 'refs/heads/master'."""
- return GIT.Capture(['symbolic-ref', 'HEAD'], cwd).strip()
+ return GIT.Capture(['symbolic-ref', 'HEAD'], cwd)[0].strip()
@staticmethod
def GetBranch(cwd):
@@ -167,11 +167,11 @@ class GIT(object):
# Get the refname and svn url for all refs/remotes/*.
remotes = GIT.Capture(
['for-each-ref', '--format=%(refname)', 'refs/remotes'],
- cwd).splitlines()
+ cwd)[0].splitlines()
svn_refs = {}
for ref in remotes:
match = git_svn_re.search(
- GIT.Capture(['cat-file', '-p', ref], cwd))
+ GIT.Capture(['cat-file', '-p', ref], cwd)[0])
if match:
svn_refs[match.group(1)] = ref
@@ -206,11 +206,11 @@ class GIT(object):
upstream_branch = None
upstream_branch = GIT.Capture(
['config', 'branch.%s.merge' % branch], in_directory=cwd,
- error_ok=True).strip()
+ error_ok=True)[0].strip()
if upstream_branch:
remote = GIT.Capture(
['config', 'branch.%s.remote' % branch],
- in_directory=cwd, error_ok=True).strip()
+ in_directory=cwd, error_ok=True)[0].strip()
else:
# Fall back on trying a git-svn upstream branch.
if GIT.IsGitSvn(cwd):
@@ -241,7 +241,7 @@ class GIT(object):
if files:
command.append('--')
command.extend(files)
- diff = GIT.Capture(command, cwd).splitlines(True)
+ diff = GIT.Capture(command, cwd)[0].splitlines(True)
for i in range(len(diff)):
# In the case of added files, replace /dev/null with the path to the
# file being added.
@@ -255,19 +255,19 @@ class GIT(object):
if not branch:
branch = GIT.GetUpstream(cwd)
command = ['diff', '--name-only', branch, branch_head]
- return GIT.Capture(command, cwd).splitlines(False)
+ return GIT.Capture(command, cwd)[0].splitlines(False)
@staticmethod
def GetPatchName(cwd):
"""Constructs a name for this patch."""
- short_sha = GIT.Capture(['rev-parse', '--short=4', 'HEAD'], cwd).strip()
+ short_sha = GIT.Capture(['rev-parse', '--short=4', 'HEAD'], cwd)[0].strip()
return "%s-%s" % (GIT.GetBranch(cwd), short_sha)
@staticmethod
def GetCheckoutRoot(path):
"""Returns the top level directory of a git checkout as an absolute path.
"""
- root = GIT.Capture(['rev-parse', '--show-cdup'], path).strip()
+ root = GIT.Capture(['rev-parse', '--show-cdup'], path)[0].strip()
return os.path.abspath(os.path.join(path, root))
« gclient_utils.py ('K') | « gclient_utils.py ('k') | trychange.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698