evolve: move more of the progress-related variables together
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 25 Apr 2019 13:58:29 -0700
changeset 4612 c289f06028d0
parent 4611 c3fb96f9c8de
child 4613 30a544904238
evolve: move more of the progress-related variables together
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Thu Apr 25 14:02:11 2019 -0700
+++ b/hgext3rd/evolve/evolvecmd.py	Thu Apr 25 13:58:29 2019 -0700
@@ -1679,15 +1679,6 @@
     else:
         cmdutil.bailifchanged(repo)
 
-        # Progress handling
-        seen = 1
-        showprogress = allopt or revopt
-
-        def progresscb():
-            if showprogress:
-                compat.progress(ui, _('evolve'), seen, unit=_('changesets'),
-                                total=count)
-
         revs = _selectrevs(repo, allopt, revopt, anyopt, targetcat)
 
         # Case: when wdir parent is obsolete and args passed.
@@ -1702,8 +1693,16 @@
         if not revs:
             return _handlenotrouble(ui, repo, allopt, revopt, anyopt, targetcat)
 
-        # For the progress bar to show
+        # Progress handling
+        seen = 1
+        showprogress = allopt or revopt
         count = len(revs)
+
+        def progresscb():
+            if showprogress:
+                compat.progress(ui, _('evolve'), seen, unit=_('changesets'),
+                                total=count)
+
         # Order the revisions
         revs = _orderrevs(repo, revs)