Bug 1300779 - [mozlint] Redirect stderr when detecting version control root, r=smacleod
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Tue, 06 Sep 2016 10:36:45 -0400
changeset 313059 68d9ee3993176dfbf39afd7a757b09dd2677d997
parent 313058 b84791fdddb2458fe44a22dafe714426b569b20a
child 313060 c71a80c9b8e971a3588bf2d0d2261e797cbb305a
push id20479
push userkwierso@gmail.com
push dateThu, 08 Sep 2016 01:08:46 +0000
treeherderfx-team@fb7c6b034329 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmacleod
bugs1300779
milestone51.0a1
Bug 1300779 - [mozlint] Redirect stderr when detecting version control root, r=smacleod This avoids printing harmless (but confusing) errors to the log. For instance, git users will see a '.hg not found!' error in the output even though not finding an hg repo is expected in that case. MozReview-Commit-ID: DBPOabcV7PA
python/mozlint/mozlint/vcs.py
--- a/python/mozlint/mozlint/vcs.py
+++ b/python/mozlint/mozlint/vcs.py
@@ -18,17 +18,17 @@ class VCSFiles(object):
 
         # First check if we're in an hg repo, if not try git
         commands = (
             ['hg', 'root'],
             ['git', 'rev-parse', '--show-toplevel'],
         )
 
         for cmd in commands:
-            proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+            proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
             output = proc.communicate()[0].strip()
 
             if proc.returncode == 0:
                 self._vcs = cmd[0]
                 self._root = output
                 return self._root
 
     @property