Patchwork D743: ui: check for progress singleton when clearing progress bar (issue5684)

login
register
mail settings
Submitter phabricator
Date Sept. 20, 2017, 4:59 p.m.
Message ID <367e55f37de14d916f4e50347582b145@localhost.localdomain>
Download mbox | patch
Permalink /patch/24061/
State Not Applicable
Headers show

Comments

phabricator - Sept. 20, 2017, 4:59 p.m.
mbthomas updated this revision to Diff 1939.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D743?vs=1917&id=1939

REVISION DETAIL
  https://phab.mercurial-scm.org/D743

AFFECTED FILES
  mercurial/ui.py
  tests/test-subrepo-deep-nested-change.t

CHANGE DETAILS




To: mbthomas, #hg-reviewers, durin42
Cc: durin42, mercurial-devel

Patch

diff --git a/tests/test-subrepo-deep-nested-change.t b/tests/test-subrepo-deep-nested-change.t
--- a/tests/test-subrepo-deep-nested-change.t
+++ b/tests/test-subrepo-deep-nested-change.t
@@ -63,6 +63,14 @@ 
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   updating [===========================================>] 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)
+  linking [   <=>                                         ] 3\r (no-eol) (esc)
+  linking [    <=>                                        ] 4\r (no-eol) (esc)
+  linking [     <=>                                       ] 5\r (no-eol) (esc)
+  linking [      <=>                                      ] 6\r (no-eol) (esc)
   updating [===========================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   updating to branch default
@@ -154,7 +162,25 @@ 
                                                               \r (no-eol) (esc)
   \r (no-eol) (esc)
   updating [===========================================>] 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)
+  linking [   <=>                                         ] 3\r (no-eol) (esc)
+  linking [    <=>                                        ] 4\r (no-eol) (esc)
+  linking [     <=>                                       ] 5\r (no-eol) (esc)
+  linking [      <=>                                      ] 6\r (no-eol) (esc)
+  linking [       <=>                                     ] 7\r (no-eol) (esc)
+  linking [        <=>                                    ] 8\r (no-eol) (esc)
   updating [===========================================>] 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)
+  linking [           <=>                                 ] 3\r (no-eol) (esc)
+  linking [            <=>                                ] 4\r (no-eol) (esc)
+  linking [             <=>                               ] 5\r (no-eol) (esc)
+  linking [              <=>                              ] 6\r (no-eol) (esc)
   updating [===========================================>] 1/1\r (no-eol) (esc)
                                                               \r (no-eol) (esc)
   updating to branch default
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1488,7 +1488,7 @@ 
 
     def _progclear(self):
         """clear progress bar output if any. use it before any output"""
-        if '_progbar' not in vars(self): # nothing loaded yet
+        if not haveprogbar(): # nothing loaded yet
             return
         if self._progbar is not None and self._progbar.printed:
             self._progbar.clear()
@@ -1792,3 +1792,6 @@ 
         # this is how the extension used to work but feel free to rework it.
         _progresssingleton = progress.progbar(ui)
     return _progresssingleton
+
+def haveprogbar():
+    return _progresssingleton is not None