Mercurial > evolve
changeset 4602:98387ccf0b79
evolve: reduce scope of progress-related variables
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 23 Apr 2019 10:56:42 -0700 |
parents | e5aa1e23d146 |
children | 8cc329d705f9 |
files | hgext3rd/evolve/evolvecmd.py |
diffstat | 1 files changed, 10 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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.