--- 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()