evolve: move progress-clearing out of _cleanup()
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 23 Apr 2019 10:49:47 -0700
changeset 4601 e5aa1e23d146
parent 4600 ef899ea7456d
child 4602 98387ccf0b79
evolve: move progress-clearing out of _cleanup() The progress is only used with --all or --rev, so there's no need to clean it in any other case. It's therefore easier to clean it specifically in that case.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Tue Apr 23 10:52:33 2019 -0700
+++ b/hgext3rd/evolve/evolvecmd.py	Tue Apr 23 10:49:47 2019 -0700
@@ -1448,10 +1448,7 @@
 
     return opts
 
-def _cleanup(ui, repo, startnode, showprogress, shouldupdate):
-    if showprogress:
-        compat.progress(ui, _('evolve'), None)
-
+def _cleanup(ui, repo, startnode, shouldupdate):
     if not shouldupdate:
         # Move back to startnode, or to its successor if the start node is
         # obsolete (perhaps made obsolete by the current `hg evolve`)
@@ -1759,7 +1756,10 @@
                 evolvestate['orphanmerge'] = False
             seen += 1
 
-    _cleanup(ui, repo, startnode, showprogress, shouldupdate)
+        if showprogress:
+            compat.progress(ui, _('evolve'), None)
+
+    _cleanup(ui, repo, startnode, shouldupdate)
 
 def solveobswdp(ui, repo, opts):
     """this function updates to the successor of obsolete wdir parent"""