Patchwork D3822: progress: enforce use of complete() on the helper class

login
register
mail settings
Submitter phabricator
Date June 21, 2018, 12:44 p.m.
Message ID <000aa22c1850dc7a1e3c82a274ace328@localhost.localdomain>
Download mbox | patch
Permalink /patch/32356/
State Not Applicable
Headers show

Comments

phabricator - June 21, 2018, 12:44 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6dea017eb6ba: progress: enforce use of complete() on the helper class (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3822?vs=9238&id=9243

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

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
@@ -1300,6 +1300,7 @@ 
         self.complete()
 
     def update(self, pos, item="", total=None):
+        assert pos is not None
         if total:
             self.total = total
         self.pos = pos
@@ -1309,7 +1310,7 @@ 
         self.update(self.pos + step, item, total)
 
     def complete(self):
-        self.update(None)
+        self.ui.progress(self.topic, None)
 
     def _print(self, item):
         self.ui.progress(self.topic, self.pos, item, self.unit,