mercurial/subrepo.py
branchstable
changeset 23938 de519517f597
parent 23885 9994f45ba714
child 23963 8f02682ff3b0
--- a/mercurial/subrepo.py	Thu Jan 22 00:10:26 2015 +0900
+++ b/mercurial/subrepo.py	Wed Jan 21 21:47:27 2015 +0100
@@ -1648,13 +1648,17 @@
         if match.anypats():
             return #No support for include/exclude yet
 
+        output = ""
         if match.always():
-            ui.write(self._gitcommand(cmd))
+            output += self._gitcommand(cmd) + '\n'
         elif match.files():
             for f in match.files():
-                ui.write(self._gitcommand(cmd + [f]))
+                output += self._gitcommand(cmd + [f]) + '\n'
         elif match(gitprefix): #Subrepo is matched
-            ui.write(self._gitcommand(cmd))
+            output += self._gitcommand(cmd) + '\n'
+
+        if output.strip():
+            ui.write(output)
 
     @annotatesubrepoerror
     def revert(self, substate, *pats, **opts):