Bug 1375834 - [mozlint] Stop printing vcs command used if command returns non-zero, r?bc draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 23 Jun 2017 08:55:04 -0400
changeset 599744 74021757861df58bc4d2f14de286c2a38e092015
parent 599733 594cc32b632396a867ef1f98428968b224d82151
child 634830 e9cb84e599904d0fc6a4a7f8e39914c52e24555f
push id65581
push userahalberstadt@mozilla.com
push dateFri, 23 Jun 2017 13:28:31 +0000
reviewersbc
bugs1375834
milestone56.0a1
Bug 1375834 - [mozlint] Stop printing vcs command used if command returns non-zero, r?bc MozReview-Commit-ID: HfG5CqQDIdr
python/mozlint/mozlint/vcs.py
--- a/python/mozlint/mozlint/vcs.py
+++ b/python/mozlint/mozlint/vcs.py
@@ -33,18 +33,19 @@ class VCSHelper(object):
     def create(cls):
         vcs, root = cls.find_vcs()
         return vcs_class[vcs](root)
 
     def run(self, cmd):
         try:
             files = subprocess.check_output(cmd, stderr=subprocess.STDOUT).split()
         except subprocess.CalledProcessError as e:
-            print(' '.join(cmd))
-            print(e.output)
+            if e.output:
+                print(' '.join(cmd))
+                print(e.output)
             return []
         return [os.path.join(self.root, f) for f in files if f]
 
     def by_workdir(self, workdir):
         return []
 
     def by_outgoing(self, dest='default'):
         return []