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

login
register
mail settings
Submitter phabricator
Date Sept. 30, 2017, 1:09 p.m.
Message ID <e89ef52df5554927b50be6a18740b601@localhost.localdomain>
Download mbox | patch
Permalink /patch/24258/
State Not Applicable
Headers show

Comments

phabricator - Sept. 30, 2017, 1:09 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0e4bed5c5c38: ui: check for progress singleton when clearing progress bar (issue5684) (authored by mbthomas, committed by ).

REPOSITORY
  rHG Mercurial

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

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, krbullock
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
@@ -1481,7 +1481,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()
@@ -1785,3 +1785,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