# HG changeset patch # User Martin von Zweigbergk # Date 1556225909 25200 # Node ID c289f06028d0b0c6c75e830b6b3080f2b7a8604f # Parent c3fb96f9c8de11a0fdb672489137e0a6d658b1b4 evolve: move more of the progress-related variables together diff -r c3fb96f9c8de -r c289f06028d0 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)