changeset 21390:26b84128c54d

merge: move constant assignments a bit and use them more
author Mads Kiilerich <madski@unity3d.com>
date Thu, 15 May 2014 02:14:59 +0200
parents e741972017d9
children cb15835456cb
files mercurial/merge.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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)