changegroup: don't use 'repo' for non-repo 'self'
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 12 Jun 2015 10:54:10 -0700
changeset 25573 3e89e67f17e8
parent 25572 3d8c044ed513
child 25574 88a17ccf0196
changegroup: don't use 'repo' for non-repo 'self' 'repo' is a very confusing name to use for 'self', especially when it's not a repo. Also drop repo.ui member (a.k.a. self.ui) now that 'self' doesn't shadow outer 'repo' variable.
mercurial/changegroup.py
--- a/mercurial/changegroup.py	Sun Jun 14 21:51:57 2015 -0400
+++ b/mercurial/changegroup.py	Fri Jun 12 10:54:10 2015 -0700
@@ -743,12 +743,11 @@
         class prog(object):
             step = _('changesets')
             count = 1
-            ui = repo.ui
             total = expectedtotal
-            def __call__(repo):
-                repo.ui.progress(repo.step, repo.count, unit=_('chunks'),
-                                 total=repo.total)
-                repo.count += 1
+            def __call__(self):
+                repo.ui.progress(self.step, self.count, unit=_('chunks'),
+                                 total=self.total)
+                self.count += 1
         pr = prog()
         source.callback = pr