Patchwork [1,of,2] progress: stop double wrapping of ui class

login
register
mail settings
Submitter Pierre-Yves David
Date June 8, 2015, 3:08 a.m.
Message ID <567035f46c6e91ef9420.1433732886@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/9550/
State Accepted
Headers show

Comments

Pierre-Yves David - June 8, 2015, 3:08 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1433725883 25200
#      Sun Jun 07 18:11:23 2015 -0700
# Node ID 567035f46c6e91ef9420739bb7f21b7e3b9a6d10
# Parent  6fabde6ef4453ee6c2aa964184f6cf2c54483621
progress: stop double wrapping of ui class

We were wrapping the ui class again and again (uisetup, reposetup, subrepo
setup, remote repo setup, etc). We now avoid that.  This has impact on test that were double printing data because of this.
Augie Fackler - June 8, 2015, 2:36 p.m.
On Sun, Jun 07, 2015 at 08:08:06PM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1433725883 25200
> #      Sun Jun 07 18:11:23 2015 -0700
> # Node ID 567035f46c6e91ef9420739bb7f21b7e3b9a6d10
> # Parent  6fabde6ef4453ee6c2aa964184f6cf2c54483621
> progress: stop double wrapping of ui class

Woohoo! I've been meaning to hunt this down forever, but never got
bothered enough by the test output. Thanks!

Queued with enthusiasm.

>
> We were wrapping the ui class again and again (uisetup, reposetup, subrepo
> setup, remote repo setup, etc). We now avoid that.  This has impact on test that were double printing data because of this.
>
> diff --git a/hgext/progress.py b/hgext/progress.py
> --- a/hgext/progress.py
> +++ b/hgext/progress.py
> @@ -310,15 +310,17 @@ def uisetup(ui):
>      # Apps that derive a class from ui.ui() can use
>      # setconfig('progress', 'disable', 'True') to disable this extension
>      if ui.configbool('progress', 'disable'):
>          return
>      if shouldprint(ui) and not ui.debugflag and not ui.quiet:
> -        ui.__class__ = progressui
> -        # we instantiate one globally shared progress bar to avoid
> -        # competing progress bars when multiple UI objects get created
> -        if not progressui._progbar:
> -            if _singleton is None:
> -                _singleton = progbar(ui)
> -            progressui._progbar = _singleton
> +        dval = object()
> +        if getattr(ui, '_progbar', dval) is dval:
> +            ui.__class__ = progressui
> +            # we instantiate one globally shared progress bar to avoid
> +            # competing progress bars when multiple UI objects get created
> +            if not progressui._progbar:
> +                if _singleton is None:
> +                    _singleton = progbar(ui)
> +                progressui._progbar = _singleton
>
>  def reposetup(ui, repo):
>      uisetup(repo.ui)
> diff --git a/tests/test-archive.t b/tests/test-archive.t
> --- a/tests/test-archive.t
> +++ b/tests/test-archive.t
> @@ -280,22 +280,15 @@ enable progress extension:
>    > EOF
>
>    $ hg archive ../with-progress
>    \r (no-eol) (esc)
>    archiving [                                           ] 0/6\r (no-eol) (esc)
> -  archiving [                                           ] 0/6\r (no-eol) (esc)
> -  archiving [======>                                    ] 1/6\r (no-eol) (esc)
>    archiving [======>                                    ] 1/6\r (no-eol) (esc)
>    archiving [=============>                             ] 2/6\r (no-eol) (esc)
> -  archiving [=============>                             ] 2/6\r (no-eol) (esc)
> -  archiving [====================>                      ] 3/6\r (no-eol) (esc)
>    archiving [====================>                      ] 3/6\r (no-eol) (esc)
>    archiving [===========================>               ] 4/6\r (no-eol) (esc)
> -  archiving [===========================>               ] 4/6\r (no-eol) (esc)
>    archiving [==================================>        ] 5/6\r (no-eol) (esc)
> -  archiving [==================================>        ] 5/6\r (no-eol) (esc)
> -  archiving [==========================================>] 6/6\r (no-eol) (esc)
>    archiving [==========================================>] 6/6\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>
>  cleanup after progress extension test:
>
> diff --git a/tests/test-debugbuilddag.t b/tests/test-debugbuilddag.t
> --- a/tests/test-debugbuilddag.t
> +++ b/tests/test-debugbuilddag.t
> @@ -8,41 +8,24 @@ plain
>    > --config progress.format=topic,bar,number \
>    > --config progress.width=60
>    \r (no-eol) (esc)
>    building [                                          ]  0/12\r (no-eol) (esc)
>    building [                                          ]  0/12\r (no-eol) (esc)
> -  building [                                          ]  0/12\r (no-eol) (esc)
> -  building [                                          ]  0/12\r (no-eol) (esc)
> -  building [==>                                       ]  1/12\r (no-eol) (esc)
> -  building [==>                                       ]  1/12\r (no-eol) (esc)
>    building [==>                                       ]  1/12\r (no-eol) (esc)
>    building [==>                                       ]  1/12\r (no-eol) (esc)
>    building [======>                                   ]  2/12\r (no-eol) (esc)
> -  building [======>                                   ]  2/12\r (no-eol) (esc)
> -  building [=========>                                ]  3/12\r (no-eol) (esc)
>    building [=========>                                ]  3/12\r (no-eol) (esc)
>    building [=============>                            ]  4/12\r (no-eol) (esc)
>    building [=============>                            ]  4/12\r (no-eol) (esc)
>    building [=============>                            ]  4/12\r (no-eol) (esc)
> -  building [=============>                            ]  4/12\r (no-eol) (esc)
> -  building [=============>                            ]  4/12\r (no-eol) (esc)
> -  building [=============>                            ]  4/12\r (no-eol) (esc)
> -  building [================>                         ]  5/12\r (no-eol) (esc)
>    building [================>                         ]  5/12\r (no-eol) (esc)
>    building [====================>                     ]  6/12\r (no-eol) (esc)
> -  building [====================>                     ]  6/12\r (no-eol) (esc)
> -  building [=======================>                  ]  7/12\r (no-eol) (esc)
>    building [=======================>                  ]  7/12\r (no-eol) (esc)
>    building [===========================>              ]  8/12\r (no-eol) (esc)
>    building [===========================>              ]  8/12\r (no-eol) (esc)
> -  building [===========================>              ]  8/12\r (no-eol) (esc)
> -  building [===========================>              ]  8/12\r (no-eol) (esc)
> -  building [==============================>           ]  9/12\r (no-eol) (esc)
>    building [==============================>           ]  9/12\r (no-eol) (esc)
>    building [==================================>       ] 10/12\r (no-eol) (esc)
> -  building [==================================>       ] 10/12\r (no-eol) (esc)
> -  building [=====================================>    ] 11/12\r (no-eol) (esc)
>    building [=====================================>    ] 11/12\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>
>  tags
>    $ cat .hg/localtags
> diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
> --- a/tests/test-patchbomb.t
> +++ b/tests/test-patchbomb.t
> @@ -287,22 +287,15 @@ Test breaking format changes aren't
>
>    Write the introductory message for the patch series.
>
>    \r (no-eol) (esc)
>    sending [                                             ] 0/3\r (no-eol) (esc)
> -  sending [                                             ] 0/3\r (no-eol) (esc)
> -                                                              \r (no-eol) (esc)
> -  \r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    \r (no-eol) (esc)
>    sending [==============>                              ] 1/3\r (no-eol) (esc)
> -  sending [==============>                              ] 1/3\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    \r (no-eol) (esc)
> -                                                              \r (no-eol) (esc)
> -  \r (no-eol) (esc)
> -  sending [=============================>               ] 2/3\r (no-eol) (esc)
>    sending [=============================>               ] 2/3\r (no-eol) (esc)
>                                                                \r (esc)
>    sending [PATCH 0 of 2] test ...
>    sending [PATCH 1 of 2] a ...
>    sending [PATCH 2 of 2] b ...
> diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t
> --- a/tests/test-subrepo-recursion.t
> +++ b/tests/test-subrepo-recursion.t
> @@ -271,33 +271,23 @@ Test archiving to a directory tree (the
>  only show up in the test output, not in real usage):
>
>    $ hg archive --subrepos ../archive
>    \r (no-eol) (esc)
>    archiving [                                           ] 0/3\r (no-eol) (esc)
> -  archiving [                                           ] 0/3\r (no-eol) (esc)
> -  archiving [=============>                             ] 1/3\r (no-eol) (esc)
>    archiving [=============>                             ] 1/3\r (no-eol) (esc)
>    archiving [===========================>               ] 2/3\r (no-eol) (esc)
> -  archiving [===========================>               ] 2/3\r (no-eol) (esc)
> -  archiving [==========================================>] 3/3\r (no-eol) (esc)
>    archiving [==========================================>] 3/3\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    \r (no-eol) (esc)
>    archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
> -  archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
> -  archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
>    archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
>    archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
> -  archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
> -  archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
>    archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    \r (no-eol) (esc)
> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
> -  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
> -  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
> +  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (esc)
> +  archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    $ find ../archive | sort
>    ../archive
>    ../archive/.hg_archival.txt
>    ../archive/.hgsub
> @@ -313,33 +303,23 @@ only show up in the test output, not in
>  Test archiving to zip file (unzip output is unstable):
>
>    $ hg archive --subrepos --prefix '.' ../archive.zip
>    \r (no-eol) (esc)
>    archiving [                                           ] 0/3\r (no-eol) (esc)
> -  archiving [                                           ] 0/3\r (no-eol) (esc)
> -  archiving [=============>                             ] 1/3\r (no-eol) (esc)
>    archiving [=============>                             ] 1/3\r (no-eol) (esc)
>    archiving [===========================>               ] 2/3\r (no-eol) (esc)
> -  archiving [===========================>               ] 2/3\r (no-eol) (esc)
> -  archiving [==========================================>] 3/3\r (no-eol) (esc)
>    archiving [==========================================>] 3/3\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    \r (no-eol) (esc)
>    archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
> -  archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
> -  archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
>    archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
>    archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
> -  archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
> -  archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
>    archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    \r (no-eol) (esc)
> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
> -  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
> -  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
> +  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (esc)
> +  archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>
>  (unzip date formating is unstable, we do not care about it and glob it out)
>
>    $ unzip -l ../archive.zip
> @@ -381,16 +361,12 @@ cloned:
>    $ cd ../empty
>  #if hardlink
>    $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
>    \r (no-eol) (esc)
>    archiving [                                           ] 0/3\r (no-eol) (esc)
> -  archiving [                                           ] 0/3\r (no-eol) (esc)
> -  archiving [=============>                             ] 1/3\r (no-eol) (esc)
>    archiving [=============>                             ] 1/3\r (no-eol) (esc)
>    archiving [===========================>               ] 2/3\r (no-eol) (esc)
> -  archiving [===========================>               ] 2/3\r (no-eol) (esc)
> -  archiving [==========================================>] 3/3\r (no-eol) (esc)
>    archiving [==========================================>] 3/3\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    \r (no-eol) (esc)
>    linking [ <=>                                           ] 1\r (no-eol) (esc)
>    linking [  <=>                                          ] 2\r (no-eol) (esc)
> @@ -401,16 +377,12 @@ cloned:
>    linking [       <=>                                     ] 7\r (no-eol) (esc)
>    linking [        <=>                                    ] 8\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    \r (no-eol) (esc)
>    archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
> -  archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
> -  archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
>    archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
>    archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
> -  archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
> -  archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
>    archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    \r (no-eol) (esc)
>    linking [ <=>                                           ] 1\r (no-eol) (esc)
>    linking [  <=>                                          ] 2\r (no-eol) (esc)
> @@ -418,14 +390,12 @@ cloned:
>    linking [    <=>                                        ] 4\r (no-eol) (esc)
>    linking [     <=>                                       ] 5\r (no-eol) (esc)
>    linking [      <=>                                      ] 6\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    \r (no-eol) (esc)
> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
> -  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
> -  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
> +  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (esc)
> +  archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
>                                                                \r (no-eol) (esc)
>    cloning subrepo foo from $TESTTMP/repo/foo
>    cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
>  #else
>  Note there's a slight output glitch on non-hardlink systems: the last
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
Matt Harbison - June 9, 2015, 2:22 a.m.
On Mon, 08 Jun 2015 10:36:19 -0400, Augie Fackler <raf@durin42.com> wrote:

> On Sun, Jun 07, 2015 at 08:08:06PM -0700, Pierre-Yves David wrote:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david@fb.com>
>> # Date 1433725883 25200
>> #      Sun Jun 07 18:11:23 2015 -0700
>> # Node ID 567035f46c6e91ef9420739bb7f21b7e3b9a6d10
>> # Parent  6fabde6ef4453ee6c2aa964184f6cf2c54483621
>> progress: stop double wrapping of ui class
>
> Woohoo! I've been meaning to hunt this down forever, but never got
> bothered enough by the test output. Thanks!
>
> Queued with enthusiasm.

If it's not too late, there an #if hardlink test at the bottom, and the  
#else case isn't updated.

>> diff --git a/tests/test-subrepo-recursion.t  
>> b/tests/test-subrepo-recursion.t
>> --- a/tests/test-subrepo-recursion.t
>> +++ b/tests/test-subrepo-recursion.t
>> @@ -271,33 +271,23 @@ Test archiving to a directory tree (the
>>  only show up in the test output, not in real usage):
>>
>>    $ hg archive --subrepos ../archive
>>    \r (no-eol) (esc)
>>    archiving [                                           ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving [                                           ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving [=============>                             ] 1/3\r  
>> (no-eol) (esc)
>>    archiving [=============>                             ] 1/3\r  
>> (no-eol) (esc)
>>    archiving [===========================>               ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving [===========================>               ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving [==========================================>] 3/3\r  
>> (no-eol) (esc)
>>    archiving [==========================================>] 3/3\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>    \r (no-eol) (esc)
>>    archiving (foo) [                                     ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [                                     ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [===========>                         ] 1/3\r  
>> (no-eol) (esc)
>>    archiving (foo) [===========>                         ] 1/3\r  
>> (no-eol) (esc)
>>    archiving (foo) [=======================>             ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [=======================>             ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [====================================>] 3/3\r  
>> (no-eol) (esc)
>>    archiving (foo) [====================================>] 3/3\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>    \r (no-eol) (esc)
>> -  archiving (foo/bar) [                                 ] 0/1\r  
>> (no-eol) (glob) (esc)
>> -  archiving (foo/bar) [                                 ] 0/1\r  
>> (no-eol) (glob) (esc)
>> -  archiving (foo/bar) [================================>] 1/1\r  
>> (no-eol) (glob) (esc)
>> -  archiving (foo/bar) [================================>] 1/1\r  
>> (no-eol) (glob) (esc)
>> +  archiving (foo/bar) [                                 ] 0/1\r  
>> (no-eol) (esc)
>> +  archiving (foo/bar) [================================>] 1/1\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>    $ find ../archive | sort
>>    ../archive
>>    ../archive/.hg_archival.txt
>>    ../archive/.hgsub
>> @@ -313,33 +303,23 @@ only show up in the test output, not in
>>  Test archiving to zip file (unzip output is unstable):
>>
>>    $ hg archive --subrepos --prefix '.' ../archive.zip
>>    \r (no-eol) (esc)
>>    archiving [                                           ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving [                                           ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving [=============>                             ] 1/3\r  
>> (no-eol) (esc)
>>    archiving [=============>                             ] 1/3\r  
>> (no-eol) (esc)
>>    archiving [===========================>               ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving [===========================>               ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving [==========================================>] 3/3\r  
>> (no-eol) (esc)
>>    archiving [==========================================>] 3/3\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>    \r (no-eol) (esc)
>>    archiving (foo) [                                     ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [                                     ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [===========>                         ] 1/3\r  
>> (no-eol) (esc)
>>    archiving (foo) [===========>                         ] 1/3\r  
>> (no-eol) (esc)
>>    archiving (foo) [=======================>             ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [=======================>             ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [====================================>] 3/3\r  
>> (no-eol) (esc)
>>    archiving (foo) [====================================>] 3/3\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>    \r (no-eol) (esc)
>> -  archiving (foo/bar) [                                 ] 0/1\r  
>> (no-eol) (glob) (esc)
>> -  archiving (foo/bar) [                                 ] 0/1\r  
>> (no-eol) (glob) (esc)
>> -  archiving (foo/bar) [================================>] 1/1\r  
>> (no-eol) (glob) (esc)
>> -  archiving (foo/bar) [================================>] 1/1\r  
>> (no-eol) (glob) (esc)
>> +  archiving (foo/bar) [                                 ] 0/1\r  
>> (no-eol) (esc)
>> +  archiving (foo/bar) [================================>] 1/1\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>
>>  (unzip date formating is unstable, we do not care about it and glob it  
>> out)
>>
>>    $ unzip -l ../archive.zip
>> @@ -381,16 +361,12 @@ cloned:
>>    $ cd ../empty
>>  #if hardlink
>>    $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
>>    \r (no-eol) (esc)
>>    archiving [                                           ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving [                                           ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving [=============>                             ] 1/3\r  
>> (no-eol) (esc)
>>    archiving [=============>                             ] 1/3\r  
>> (no-eol) (esc)
>>    archiving [===========================>               ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving [===========================>               ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving [==========================================>] 3/3\r  
>> (no-eol) (esc)
>>    archiving [==========================================>] 3/3\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>    \r (no-eol) (esc)
>>    linking [ <=>                                           ] 1\r  
>> (no-eol) (esc)
>>    linking [  <=>                                          ] 2\r  
>> (no-eol) (esc)
>> @@ -401,16 +377,12 @@ cloned:
>>    linking [       <=>                                     ] 7\r  
>> (no-eol) (esc)
>>    linking [        <=>                                    ] 8\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>    \r (no-eol) (esc)
>>    archiving (foo) [                                     ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [                                     ] 0/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [===========>                         ] 1/3\r  
>> (no-eol) (esc)
>>    archiving (foo) [===========>                         ] 1/3\r  
>> (no-eol) (esc)
>>    archiving (foo) [=======================>             ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [=======================>             ] 2/3\r  
>> (no-eol) (esc)
>> -  archiving (foo) [====================================>] 3/3\r  
>> (no-eol) (esc)
>>    archiving (foo) [====================================>] 3/3\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>    \r (no-eol) (esc)
>>    linking [ <=>                                           ] 1\r  
>> (no-eol) (esc)
>>    linking [  <=>                                          ] 2\r  
>> (no-eol) (esc)
>> @@ -418,14 +390,12 @@ cloned:
>>    linking [    <=>                                        ] 4\r  
>> (no-eol) (esc)
>>    linking [     <=>                                       ] 5\r  
>> (no-eol) (esc)
>>    linking [      <=>                                      ] 6\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>    \r (no-eol) (esc)
>> -  archiving (foo/bar) [                                 ] 0/1\r  
>> (no-eol) (glob) (esc)
>> -  archiving (foo/bar) [                                 ] 0/1\r  
>> (no-eol) (glob) (esc)
>> -  archiving (foo/bar) [================================>] 1/1\r  
>> (no-eol) (glob) (esc)
>> -  archiving (foo/bar) [================================>] 1/1\r  
>> (no-eol) (glob) (esc)
>> +  archiving (foo/bar) [                                 ] 0/1\r  
>> (no-eol) (esc)
>> +  archiving (foo/bar) [================================>] 1/1\r  
>> (no-eol) (esc)
>>                                                                \r  
>> (no-eol) (esc)
>>    cloning subrepo foo from $TESTTMP/repo/foo
>>    cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
>>  #else
>>  Note there's a slight output glitch on non-hardlink systems: the last
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@selenic.com
>> https://selenic.com/mailman/listinfo/mercurial-devel
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
Augie Fackler - June 9, 2015, 5:32 p.m.
On Mon, Jun 8, 2015 at 10:22 PM, Matt Harbison <mharbison72@gmail.com> wrote:
> On Mon, 08 Jun 2015 10:36:19 -0400, Augie Fackler <raf@durin42.com> wrote:
>
>> On Sun, Jun 07, 2015 at 08:08:06PM -0700, Pierre-Yves David wrote:
>>>
>>> # HG changeset patch
>>> # User Pierre-Yves David <pierre-yves.david@fb.com>
>>> # Date 1433725883 25200
>>> #      Sun Jun 07 18:11:23 2015 -0700
>>> # Node ID 567035f46c6e91ef9420739bb7f21b7e3b9a6d10
>>> # Parent  6fabde6ef4453ee6c2aa964184f6cf2c54483621
>>> progress: stop double wrapping of ui class
>>
>>
>> Woohoo! I've been meaning to hunt this down forever, but never got
>> bothered enough by the test output. Thanks!
>>
>> Queued with enthusiasm.
>
>
> If it's not too late, there an #if hardlink test at the bottom, and the
> #else case isn't updated.

Fixed that as a followup, thanks!

>
>
>>> diff --git a/tests/test-subrepo-recursion.t
>>> b/tests/test-subrepo-recursion.t
>>> --- a/tests/test-subrepo-recursion.t
>>> +++ b/tests/test-subrepo-recursion.t
>>> @@ -271,33 +271,23 @@ Test archiving to a directory tree (the
>>>  only show up in the test output, not in real usage):
>>>
>>>    $ hg archive --subrepos ../archive
>>>    \r (no-eol) (esc)
>>>    archiving [                                           ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving [                                           ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving [=============>                             ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving [=============>                             ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving [===========================>               ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving [===========================>               ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving [==========================================>] 3/3\r (no-eol)
>>> (esc)
>>>    archiving [==========================================>] 3/3\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>    \r (no-eol) (esc)
>>>    archiving (foo) [                                     ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [                                     ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [===========>                         ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving (foo) [===========>                         ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving (foo) [=======================>             ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [=======================>             ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [====================================>] 3/3\r (no-eol)
>>> (esc)
>>>    archiving (foo) [====================================>] 3/3\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>    \r (no-eol) (esc)
>>> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol)
>>> (glob) (esc)
>>> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol)
>>> (glob) (esc)
>>> -  archiving (foo/bar) [================================>] 1/1\r (no-eol)
>>> (glob) (esc)
>>> -  archiving (foo/bar) [================================>] 1/1\r (no-eol)
>>> (glob) (esc)
>>> +  archiving (foo/bar) [                                 ] 0/1\r (no-eol)
>>> (esc)
>>> +  archiving (foo/bar) [================================>] 1/1\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>    $ find ../archive | sort
>>>    ../archive
>>>    ../archive/.hg_archival.txt
>>>    ../archive/.hgsub
>>> @@ -313,33 +303,23 @@ only show up in the test output, not in
>>>  Test archiving to zip file (unzip output is unstable):
>>>
>>>    $ hg archive --subrepos --prefix '.' ../archive.zip
>>>    \r (no-eol) (esc)
>>>    archiving [                                           ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving [                                           ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving [=============>                             ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving [=============>                             ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving [===========================>               ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving [===========================>               ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving [==========================================>] 3/3\r (no-eol)
>>> (esc)
>>>    archiving [==========================================>] 3/3\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>    \r (no-eol) (esc)
>>>    archiving (foo) [                                     ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [                                     ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [===========>                         ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving (foo) [===========>                         ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving (foo) [=======================>             ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [=======================>             ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [====================================>] 3/3\r (no-eol)
>>> (esc)
>>>    archiving (foo) [====================================>] 3/3\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>    \r (no-eol) (esc)
>>> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol)
>>> (glob) (esc)
>>> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol)
>>> (glob) (esc)
>>> -  archiving (foo/bar) [================================>] 1/1\r (no-eol)
>>> (glob) (esc)
>>> -  archiving (foo/bar) [================================>] 1/1\r (no-eol)
>>> (glob) (esc)
>>> +  archiving (foo/bar) [                                 ] 0/1\r (no-eol)
>>> (esc)
>>> +  archiving (foo/bar) [================================>] 1/1\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>
>>>  (unzip date formating is unstable, we do not care about it and glob it
>>> out)
>>>
>>>    $ unzip -l ../archive.zip
>>> @@ -381,16 +361,12 @@ cloned:
>>>    $ cd ../empty
>>>  #if hardlink
>>>    $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
>>>    \r (no-eol) (esc)
>>>    archiving [                                           ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving [                                           ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving [=============>                             ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving [=============>                             ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving [===========================>               ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving [===========================>               ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving [==========================================>] 3/3\r (no-eol)
>>> (esc)
>>>    archiving [==========================================>] 3/3\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>    \r (no-eol) (esc)
>>>    linking [ <=>                                           ] 1\r (no-eol)
>>> (esc)
>>>    linking [  <=>                                          ] 2\r (no-eol)
>>> (esc)
>>> @@ -401,16 +377,12 @@ cloned:
>>>    linking [       <=>                                     ] 7\r (no-eol)
>>> (esc)
>>>    linking [        <=>                                    ] 8\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>    \r (no-eol) (esc)
>>>    archiving (foo) [                                     ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [                                     ] 0/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [===========>                         ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving (foo) [===========>                         ] 1/3\r (no-eol)
>>> (esc)
>>>    archiving (foo) [=======================>             ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [=======================>             ] 2/3\r (no-eol)
>>> (esc)
>>> -  archiving (foo) [====================================>] 3/3\r (no-eol)
>>> (esc)
>>>    archiving (foo) [====================================>] 3/3\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>    \r (no-eol) (esc)
>>>    linking [ <=>                                           ] 1\r (no-eol)
>>> (esc)
>>>    linking [  <=>                                          ] 2\r (no-eol)
>>> (esc)
>>> @@ -418,14 +390,12 @@ cloned:
>>>    linking [    <=>                                        ] 4\r (no-eol)
>>> (esc)
>>>    linking [     <=>                                       ] 5\r (no-eol)
>>> (esc)
>>>    linking [      <=>                                      ] 6\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>    \r (no-eol) (esc)
>>> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol)
>>> (glob) (esc)
>>> -  archiving (foo/bar) [                                 ] 0/1\r (no-eol)
>>> (glob) (esc)
>>> -  archiving (foo/bar) [================================>] 1/1\r (no-eol)
>>> (glob) (esc)
>>> -  archiving (foo/bar) [================================>] 1/1\r (no-eol)
>>> (glob) (esc)
>>> +  archiving (foo/bar) [                                 ] 0/1\r (no-eol)
>>> (esc)
>>> +  archiving (foo/bar) [================================>] 1/1\r (no-eol)
>>> (esc)
>>>                                                                \r
>>> (no-eol) (esc)
>>>    cloning subrepo foo from $TESTTMP/repo/foo
>>>    cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
>>>  #else
>>>  Note there's a slight output glitch on non-hardlink systems: the last
>>> _______________________________________________
>>> Mercurial-devel mailing list
>>> Mercurial-devel@selenic.com
>>> https://selenic.com/mailman/listinfo/mercurial-devel
>>
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@selenic.com
>> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/progress.py b/hgext/progress.py
--- a/hgext/progress.py
+++ b/hgext/progress.py
@@ -310,15 +310,17 @@  def uisetup(ui):
     # Apps that derive a class from ui.ui() can use
     # setconfig('progress', 'disable', 'True') to disable this extension
     if ui.configbool('progress', 'disable'):
         return
     if shouldprint(ui) and not ui.debugflag and not ui.quiet:
-        ui.__class__ = progressui
-        # we instantiate one globally shared progress bar to avoid
-        # competing progress bars when multiple UI objects get created
-        if not progressui._progbar:
-            if _singleton is None:
-                _singleton = progbar(ui)
-            progressui._progbar = _singleton
+        dval = object()
+        if getattr(ui, '_progbar', dval) is dval:
+            ui.__class__ = progressui
+            # we instantiate one globally shared progress bar to avoid
+            # competing progress bars when multiple UI objects get created
+            if not progressui._progbar:
+                if _singleton is None:
+                    _singleton = progbar(ui)
+                progressui._progbar = _singleton
 
 def reposetup(ui, repo):
     uisetup(repo.ui)
diff --git a/tests/test-archive.t b/tests/test-archive.t
--- a/tests/test-archive.t
+++ b/tests/test-archive.t
@@ -280,22 +280,15 @@  enable progress extension:
   > EOF
 
   $ hg archive ../with-progress
   \r (no-eol) (esc)
   archiving [                                           ] 0/6\r (no-eol) (esc)
-  archiving [                                           ] 0/6\r (no-eol) (esc)
-  archiving [======>                                    ] 1/6\r (no-eol) (esc)
   archiving [======>                                    ] 1/6\r (no-eol) (esc)
   archiving [=============>                             ] 2/6\r (no-eol) (esc)
-  archiving [=============>                             ] 2/6\r (no-eol) (esc)
-  archiving [====================>                      ] 3/6\r (no-eol) (esc)
   archiving [====================>                      ] 3/6\r (no-eol) (esc)
   archiving [===========================>               ] 4/6\r (no-eol) (esc)
-  archiving [===========================>               ] 4/6\r (no-eol) (esc)
   archiving [==================================>        ] 5/6\r (no-eol) (esc)
-  archiving [==================================>        ] 5/6\r (no-eol) (esc)
-  archiving [==========================================>] 6/6\r (no-eol) (esc)
   archiving [==========================================>] 6/6\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
 
 cleanup after progress extension test:
 
diff --git a/tests/test-debugbuilddag.t b/tests/test-debugbuilddag.t
--- a/tests/test-debugbuilddag.t
+++ b/tests/test-debugbuilddag.t
@@ -8,41 +8,24 @@  plain
   > --config progress.format=topic,bar,number \
   > --config progress.width=60
   \r (no-eol) (esc)
   building [                                          ]  0/12\r (no-eol) (esc)
   building [                                          ]  0/12\r (no-eol) (esc)
-  building [                                          ]  0/12\r (no-eol) (esc)
-  building [                                          ]  0/12\r (no-eol) (esc)
-  building [==>                                       ]  1/12\r (no-eol) (esc)
-  building [==>                                       ]  1/12\r (no-eol) (esc)
   building [==>                                       ]  1/12\r (no-eol) (esc)
   building [==>                                       ]  1/12\r (no-eol) (esc)
   building [======>                                   ]  2/12\r (no-eol) (esc)
-  building [======>                                   ]  2/12\r (no-eol) (esc)
-  building [=========>                                ]  3/12\r (no-eol) (esc)
   building [=========>                                ]  3/12\r (no-eol) (esc)
   building [=============>                            ]  4/12\r (no-eol) (esc)
   building [=============>                            ]  4/12\r (no-eol) (esc)
   building [=============>                            ]  4/12\r (no-eol) (esc)
-  building [=============>                            ]  4/12\r (no-eol) (esc)
-  building [=============>                            ]  4/12\r (no-eol) (esc)
-  building [=============>                            ]  4/12\r (no-eol) (esc)
-  building [================>                         ]  5/12\r (no-eol) (esc)
   building [================>                         ]  5/12\r (no-eol) (esc)
   building [====================>                     ]  6/12\r (no-eol) (esc)
-  building [====================>                     ]  6/12\r (no-eol) (esc)
-  building [=======================>                  ]  7/12\r (no-eol) (esc)
   building [=======================>                  ]  7/12\r (no-eol) (esc)
   building [===========================>              ]  8/12\r (no-eol) (esc)
   building [===========================>              ]  8/12\r (no-eol) (esc)
-  building [===========================>              ]  8/12\r (no-eol) (esc)
-  building [===========================>              ]  8/12\r (no-eol) (esc)
-  building [==============================>           ]  9/12\r (no-eol) (esc)
   building [==============================>           ]  9/12\r (no-eol) (esc)
   building [==================================>       ] 10/12\r (no-eol) (esc)
-  building [==================================>       ] 10/12\r (no-eol) (esc)
-  building [=====================================>    ] 11/12\r (no-eol) (esc)
   building [=====================================>    ] 11/12\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
 
 tags
   $ cat .hg/localtags
diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
--- a/tests/test-patchbomb.t
+++ b/tests/test-patchbomb.t
@@ -287,22 +287,15 @@  Test breaking format changes aren't
   
   Write the introductory message for the patch series.
   
   \r (no-eol) (esc)
   sending [                                             ] 0/3\r (no-eol) (esc)
-  sending [                                             ] 0/3\r (no-eol) (esc)
-                                                              \r (no-eol) (esc)
-  \r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   sending [==============>                              ] 1/3\r (no-eol) (esc)
-  sending [==============>                              ] 1/3\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
-                                                              \r (no-eol) (esc)
-  \r (no-eol) (esc)
-  sending [=============================>               ] 2/3\r (no-eol) (esc)
   sending [=============================>               ] 2/3\r (no-eol) (esc)
                                                               \r (esc)
   sending [PATCH 0 of 2] test ...
   sending [PATCH 1 of 2] a ...
   sending [PATCH 2 of 2] b ...
diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t
--- a/tests/test-subrepo-recursion.t
+++ b/tests/test-subrepo-recursion.t
@@ -271,33 +271,23 @@  Test archiving to a directory tree (the 
 only show up in the test output, not in real usage):
 
   $ hg archive --subrepos ../archive
   \r (no-eol) (esc)
   archiving [                                           ] 0/3\r (no-eol) (esc)
-  archiving [                                           ] 0/3\r (no-eol) (esc)
-  archiving [=============>                             ] 1/3\r (no-eol) (esc)
   archiving [=============>                             ] 1/3\r (no-eol) (esc)
   archiving [===========================>               ] 2/3\r (no-eol) (esc)
-  archiving [===========================>               ] 2/3\r (no-eol) (esc)
-  archiving [==========================================>] 3/3\r (no-eol) (esc)
   archiving [==========================================>] 3/3\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
-  archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
-  archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
   archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
   archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
-  archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
-  archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
   archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
-  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
-  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
-  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
-  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
+  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (esc)
+  archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   $ find ../archive | sort
   ../archive
   ../archive/.hg_archival.txt
   ../archive/.hgsub
@@ -313,33 +303,23 @@  only show up in the test output, not in 
 Test archiving to zip file (unzip output is unstable):
 
   $ hg archive --subrepos --prefix '.' ../archive.zip
   \r (no-eol) (esc)
   archiving [                                           ] 0/3\r (no-eol) (esc)
-  archiving [                                           ] 0/3\r (no-eol) (esc)
-  archiving [=============>                             ] 1/3\r (no-eol) (esc)
   archiving [=============>                             ] 1/3\r (no-eol) (esc)
   archiving [===========================>               ] 2/3\r (no-eol) (esc)
-  archiving [===========================>               ] 2/3\r (no-eol) (esc)
-  archiving [==========================================>] 3/3\r (no-eol) (esc)
   archiving [==========================================>] 3/3\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
-  archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
-  archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
   archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
   archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
-  archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
-  archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
   archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
-  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
-  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
-  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
-  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
+  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (esc)
+  archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
 
 (unzip date formating is unstable, we do not care about it and glob it out)
 
   $ unzip -l ../archive.zip
@@ -381,16 +361,12 @@  cloned:
   $ cd ../empty
 #if hardlink
   $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
   \r (no-eol) (esc)
   archiving [                                           ] 0/3\r (no-eol) (esc)
-  archiving [                                           ] 0/3\r (no-eol) (esc)
-  archiving [=============>                             ] 1/3\r (no-eol) (esc)
   archiving [=============>                             ] 1/3\r (no-eol) (esc)
   archiving [===========================>               ] 2/3\r (no-eol) (esc)
-  archiving [===========================>               ] 2/3\r (no-eol) (esc)
-  archiving [==========================================>] 3/3\r (no-eol) (esc)
   archiving [==========================================>] 3/3\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   linking [ <=>                                           ] 1\r (no-eol) (esc)
   linking [  <=>                                          ] 2\r (no-eol) (esc)
@@ -401,16 +377,12 @@  cloned:
   linking [       <=>                                     ] 7\r (no-eol) (esc)
   linking [        <=>                                    ] 8\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
-  archiving (foo) [                                     ] 0/3\r (no-eol) (esc)
-  archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
   archiving (foo) [===========>                         ] 1/3\r (no-eol) (esc)
   archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
-  archiving (foo) [=======================>             ] 2/3\r (no-eol) (esc)
-  archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
   archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   linking [ <=>                                           ] 1\r (no-eol) (esc)
   linking [  <=>                                          ] 2\r (no-eol) (esc)
@@ -418,14 +390,12 @@  cloned:
   linking [    <=>                                        ] 4\r (no-eol) (esc)
   linking [     <=>                                       ] 5\r (no-eol) (esc)
   linking [      <=>                                      ] 6\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
-  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
-  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (glob) (esc)
-  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
-  archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc)
+  archiving (foo/bar) [                                 ] 0/1\r (no-eol) (esc)
+  archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   cloning subrepo foo from $TESTTMP/repo/foo
   cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
 #else
 Note there's a slight output glitch on non-hardlink systems: the last