[PATCH] progress: add output-prefix for GUI clients

Jason Harris jason.f.harris at gmail.com
Sat Nov 5 00:41:07 CDT 2011


# HG changeset patch
# User Jason Harris <jason at jasonfharris.com>
# Date 1320467623 -3600
# Node ID a823f38e2cfc127234e594232bc529ac6faacc5c
# Parent  dc9d0189f60e6d216e79bbc162525b1d0324752c
progress: add output-prefix for GUI clients

For GUI clients which use the progress extension, the progress gets
reported on stderr and so to differentiate progress from errors it is
convenient to be able to specify a prefix before any progress reporting.

diff --git a/hgext/progress.py b/hgext/progress.py
--- a/hgext/progress.py
+++ b/hgext/progress.py
@@ -38,6 +38,8 @@
   disable = False # if true, don't show a progress bar
   assume-tty = False # if true, ALWAYS show a progress bar, unless
                      # disable is given
+  output-prefix = <none> # if given then any output shown by progress is
+                         # prefixed by the given prefix
 
 Valid entries for the format field are topic, bar, number, unit,
 estimate, speed, and item. item defaults to the last 20 characters of
@@ -124,7 +126,7 @@
             return
         termwidth = self.width()
         self.printed = True
-        head = ''
+        head = str(self.ui.config('progress', 'output-prefix', default=''))
         needprogress = False
         tail = ''
         for indicator in self.order:


More information about the Mercurial-devel mailing list