diff mercurial/ui.py @ 2033:e3280d350792

Group changes done by the same developer on the same with --style=changelog Changeset and tags are appended to the change message for non-quiet and non-verbose output, so grouping works. Fixes last bit of issue110.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 01 Apr 2006 21:37:08 +0200
parents 65634e1038dd
children 74d3f5336b66
line wrap: on
line diff
--- a/mercurial/ui.py	Sat Apr 01 20:56:55 2006 +0200
+++ b/mercurial/ui.py	Sat Apr 01 21:37:08 2006 +0200
@@ -27,6 +27,8 @@
 
             self.updateopts(verbose, debug, quiet, interactive)
             self.diffcache = None
+            self.header = []
+            self.prev_header = []
         else:
             # parentui may point to an ui object which is already a child
             self.parentui = parentui.parentui or parentui
@@ -184,9 +186,18 @@
         return self.config("paths", loc, loc)
 
     def write(self, *args):
+        if self.header:
+            if self.header != self.prev_header:
+                self.prev_header = self.header
+                self.write(*self.header)
+            self.header = []
         for a in args:
             sys.stdout.write(str(a))
 
+    def write_header(self, *args):
+        for a in args:
+            self.header.append(str(a))
+
     def write_err(self, *args):
         try:
             if not sys.stdout.closed: sys.stdout.flush()