Bug 1287234 - Do not merge stdout and stderr in get_output. r?gps
The commands get_output is run for may emit messages on stderr that are
only noise for the git mozreview script, altering the expected output.
With current git cinnabar tip of the release branch, a warning may be
emitted when running `git cinnabar hg2git`, which prevents `git mozreview
configure` from finding the right repository because the output contains
more than the expected sha1s.
MozReview-Commit-ID: 5HUvprewVP1
--- a/git/commands/git-mozreview
+++ b/git/commands/git-mozreview
@@ -166,18 +166,19 @@ def sendauthenticatedhttprequest(git_con
req = requests.Request(url=url, auth=BugzillaAPIKeyAuth(git_config),
**kwargs)
return session.send(req.prepare())
def get_output(args, cwd=None):
try:
- output = subprocess.check_output(args, stderr=subprocess.STDOUT,
- cwd=cwd)
+ with open(os.devnull, 'w') as stderr:
+ output = subprocess.check_output(args, stderr=stderr,
+ cwd=cwd)
return 0, output
except subprocess.CalledProcessError as e:
return e.returncode, e.output
def get_git_config():
res, output = get_output(['git', 'config', '--list', '-z'])
if res: