# HG changeset patch # User Mads Kiilerich # Date 1400112899 -7200 # Node ID 26b84128c54d5608ae2db97c98ec401855bd8169 # Parent e741972017d9037ee8adc10b981807890d918cf2 merge: move constant assignments a bit and use them more diff -r e741972017d9 -r 26b84128c54d mercurial/merge.py --- a/mercurial/merge.py Fri May 02 01:09:14 2014 +0200 +++ b/mercurial/merge.py Thu May 15 02:14:59 2014 +0200 @@ -650,6 +650,9 @@ moves.append(f1) audit = repo.wopener.audit + _updating = _('updating') + _files = _('files') + progress = repo.ui.progress # remove renamed files after safely stored for f in moves: @@ -670,27 +673,24 @@ if hgsub and hgsub[0] == 'r': subrepo.submerge(repo, wctx, mctx, wctx, overwrite) + # remove in parallel (must come first) z = 0 prog = worker.worker(repo.ui, 0.001, getremove, (repo, mctx, overwrite), removeactions) for i, item in prog: z += i - repo.ui.progress(_('updating'), z, item=item, total=numupdates, - unit=_('files')) + progress(_updating, z, item=item, total=numupdates, unit=_files) + + # get in parallel prog = worker.worker(repo.ui, 0.001, getremove, (repo, mctx, overwrite), updateactions) for i, item in prog: z += i - repo.ui.progress(_('updating'), z, item=item, total=numupdates, - unit=_('files')) + progress(_updating, z, item=item, total=numupdates, unit=_files) if hgsub and hgsub[0] == 'g': subrepo.submerge(repo, wctx, mctx, wctx, overwrite) - _updating = _('updating') - _files = _('files') - progress = repo.ui.progress - for i, a in enumerate(actions): f, m, args, msg = a progress(_updating, z + i + 1, item=f, total=numupdates, unit=_files)