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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Jun 20 05:44:40 UTC 2018


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  complete() is preferred over update(None), so let's enforce that.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS

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,



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


More information about the Mercurial-devel mailing list