aboutsummaryrefslogtreecommitdiff
path: root/repo_to_repo.py
diff options
context:
space:
mode:
authorLuis Lozano <llozano@chromium.org>2015-12-10 10:47:01 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-12-15 01:21:49 +0000
commit036c9233742004aa773a374df381b1cf137484f5 (patch)
treeb1566971ae12ed6ec13f086dd450eca741604f26 /repo_to_repo.py
parente627fd61c2edba668eb2af8221892286b13f05a3 (diff)
downloadtoolchain-utils-036c9233742004aa773a374df381b1cf137484f5.tar.gz
crosperf: RunCommand should return one type of object.
Cleaned up the interfaces for the RunCommand routines. These were returning different types (int or tuple) depending on the value of the return_ouput parameter. Returning different unrelated types from a routine is bad practice. Linter complains about this with several warnings like this: "Attempting to unpack a non-sequence defined at line XY of utils.command_executer" BUG=chromium:566256 TEST=ran crosperf with a example experiment file Ran run_tests. Change-Id: Ibb83ab9322c87558077fc4937ef5c0686bbe5417 Reviewed-on: https://chrome-internal-review.googlesource.com/241459 Commit-Ready: Luis Lozano <llozano@chromium.org> Tested-by: Luis Lozano <llozano@chromium.org> Reviewed-by: Han Shen <shenhan@google.com>
Diffstat (limited to 'repo_to_repo.py')
-rwxr-xr-xrepo_to_repo.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/repo_to_repo.py b/repo_to_repo.py
index 08d61e9a..487bbbbd 100755
--- a/repo_to_repo.py
+++ b/repo_to_repo.py
@@ -134,7 +134,7 @@ class P4Repo(Repo):
ret = self._ce.RunCommand(command)
assert ret == 0, 'Could not setup client.'
command = p4client.InCheckoutDir(p4client.SaveCurrentCLNumber())
- ret, o, _ = self._ce.RunCommand(command, return_output=True)
+ ret, o, _ = self._ce.RunCommandWOutput(command)
assert ret == 0, 'Could not get version from client.'
self.revision = re.search('^\d+$', o.strip(), re.MULTILINE).group(0)
command = p4client.InCheckoutDir(p4client.Remove())
@@ -162,7 +162,7 @@ class SvnRepo(Repo):
for mapping in self.mappings:
remote_path, local_path = SplitMapping(mapping)
command = 'cd %s && svnversion -c .' % (local_path)
- ret, o, _ = self._ce.RunCommand(command, return_output=True)
+ ret, o, _ = self._ce.RunCommandWOutput(command)
self.revision += o.strip().split(":")[-1]
if ret: return ret
return 0
@@ -194,7 +194,7 @@ class GitRepo(Repo):
if ret: return ret
command = 'git describe --always'
- ret, o, _ = self._ce.RunCommand(command, return_output=True)
+ ret, o, _ = self._ce.RunCommandWOutput(command)
self.revision = o.strip()
return ret