cmdutil: only output style header once in non-buffered mode (issue2130) stable
authorSimon Howkins <simonh@symbian.org>
Thu, 24 Jun 2010 15:18:47 +0100
branchstable
changeset 11441 d74fe370ab04
parent 11440 5fe4302cfd72
child 11442 ee1ed6afac21
cmdutil: only output style header once in non-buffered mode (issue2130)
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Wed Jun 23 13:38:52 2010 -0500
+++ b/mercurial/cmdutil.py	Thu Jun 24 15:18:47 2010 +0100
@@ -687,6 +687,7 @@
         self.patch = patch
         self.diffopts = diffopts
         self.header = {}
+        self.doneheader = False
         self.hunk = {}
         self.lastheader = None
         self.footer = None
@@ -905,7 +906,9 @@
                 if self.buffered:
                     self.header[ctx.rev()] = h
                 else:
-                    self.ui.write(h)
+                    if not self.doneheader:
+                        self.ui.write(h)
+                        self.doneheader = True
 
             # write changeset metadata, then patch if requested
             key = types['changeset']