# HG changeset patch # User Martin von Zweigbergk # Date 1556042202 25200 # Node ID 98387ccf0b79b4b69287b96650b7d4532c329278 # Parent e5aa1e23d1464ed2efcbdf39ccfd5cf3ffb1825c evolve: reduce scope of progress-related variables diff -r e5aa1e23d146 -r 98387ccf0b79 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Tue Apr 23 10:49:47 2019 -0700 +++ b/hgext3rd/evolve/evolvecmd.py Tue Apr 23 10:56:42 2019 -0700 @@ -1643,15 +1643,6 @@ ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'evolve') troubled = set(repo.revs('troubled()')) - # Progress handling - seen = 1 - count = allopt and len(troubled) or 1 - showprogress = allopt or revopt - - def progresscb(): - if showprogress: - compat.progress(ui, _('evolve'), seen, unit=_('changesets'), total=count) - evolvestate = state.cmdstate(repo) # Continuation handling if contopt: @@ -1690,6 +1681,16 @@ else: cmdutil.bailifchanged(repo) + # Progress handling + seen = 1 + count = allopt and len(troubled) or 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.