[PATCH 1 of 3] progress: move from extension to core

Jason Harris jason at jasonfharris.com
Mon May 21 08:42:35 CDT 2012


Just to confirm Augie's email, for the progress extension MacHg indeed uses:

   progress.assume-tty=True

MacHg also modifies the progress extension to allow the specification of a
progress prefix (so MacHg can disentangle the prefix output from the other
output):

   progress.output-prefix=MHGProgress

Which I added through:

[salt:/Development/MacHgDev/MacHg] MacHg 1132(1133) ⌘ hg diff -c 855 LocalMercurial/hgext/progress.py
diff --git a/LocalMercurial/hgext/progress.py b/LocalMercurial/hgext/progress.py
--- a/LocalMercurial/hgext/progress.py
+++ b/LocalMercurial/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:

I had gathered from previous comments that this prefix wouldn't make it into the
progress extension / main mercurial. I would of course like to roll as many of
the patches MacHg has to do to get certain bits of functionality into standard
Mercurial as possible. I would be very happy to submit a patch for this if it
would be taken...

It is extremely useful and necessary for GUI clients to be able to disentangle
the progress output from the main output of the command...

Cheers,
   Jas

On May 19, 2012, at 4:51 PM, Augie Fackler wrote:

> On 5/18/2012 6:01 PM, Matt Mackall wrote:
>> Btw, I'm not sure what the use case for progress.assume-tty is, you
>> snuck it in here:
>> 
>>  http://www.selenic.com/hg/diff/ca6ba6cac6cd/hgext/progress.py
>> 
>> ...and that will be extra-hard for hgweb to defeat.
> 
> That's used both for testing and (I think) by MacHg to get progress information.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list