changeset 38425:6dea017eb6ba

progress: enforce use of complete() on the helper class complete() is preferred over update(None), so let's enforce that. Differential Revision: https://phab.mercurial-scm.org/D3822
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 19 Jun 2018 22:19:37 -0700
parents b34d0a6ef936
children c1f4364f9336
files mercurial/scmutil.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Tue Jun 19 22:11:34 2018 -0700
+++ b/mercurial/scmutil.py	Tue Jun 19 22:19:37 2018 -0700
@@ -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,