Patchwork D5529: progress: split up _print() method in bar-updating and debug-printing

login
register
mail settings
Submitter phabricator
Date Jan. 9, 2019, 7:40 p.m.
Message ID <7f427776be45718abade9f8082a2f4d3@localhost.localdomain>
Download mbox | patch
Permalink /patch/37579/
State Not Applicable
Headers show

Comments

phabricator - Jan. 9, 2019, 7:40 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3025fd3c2e71: progress: split up _print() method in bar-updating and debug-printing (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5529?vs=13079&id=13099

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1434,18 +1434,20 @@ 
         if total:
             self.total = total
         self.pos = pos
-        self._print(item)
+        self._updatebar(item)
+        if self.debug:
+            self._printdebug(item)
 
     def increment(self, step=1, item="", total=None):
         self.update(self.pos + step, item, total)
 
     def complete(self):
         self.pos = None
         self.unit = ""
         self.total = None
-        self._print("")
+        self._updatebar("")
 
-    def _print(self, item):
+    def _updatebar(self, item):
         if getattr(self.ui._fmsgerr, 'structured', False):
             # channel for machine-readable output with metadata, just send
             # raw information
@@ -1459,9 +1461,7 @@ 
             self.ui._progbar.progress(self.topic, self.pos, item=item,
                                       unit=self.unit, total=self.total)
 
-        if self.pos is None or not self.debug:
-            return
-
+    def _printdebug(self, item):
         if self.unit:
             unit = ' ' + self.unit
         if item: