diff --git a/hgext/progress.py b/hgext/progress.py --- a/hgext/progress.py +++ b/hgext/progress.py @@ -312,13 +312,15 @@ def uisetup(ui): 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 @@ -282,18 +282,11 @@ enable progress extension: $ 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) diff --git a/tests/test-debugbuilddag.t b/tests/test-debugbuilddag.t --- a/tests/test-debugbuilddag.t +++ b/tests/test-debugbuilddag.t @@ -10,37 +10,20 @@ plain \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) diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t --- a/tests/test-patchbomb.t +++ b/tests/test-patchbomb.t @@ -289,18 +289,11 @@ Test breaking format changes aren't \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 ... 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 @@ -273,29 +273,19 @@ only show up in the test output, not in $ 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 @@ -315,29 +305,19 @@ Test archiving to zip file (unzip output $ 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) @@ -383,12 +363,8 @@ cloned: $ 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) @@ -403,12 +379,8 @@ cloned: \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) @@ -420,10 +392,8 @@ cloned: 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)