comparison mercurial/merge.py @ 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
comparison
equal deleted inserted replaced
21389:e741972017d9 21390:26b84128c54d
648 ms.add(fcl, fco, fca, f) 648 ms.add(fcl, fco, fca, f)
649 if f1 != f and move: 649 if f1 != f and move:
650 moves.append(f1) 650 moves.append(f1)
651 651
652 audit = repo.wopener.audit 652 audit = repo.wopener.audit
653 _updating = _('updating')
654 _files = _('files')
655 progress = repo.ui.progress
653 656
654 # remove renamed files after safely stored 657 # remove renamed files after safely stored
655 for f in moves: 658 for f in moves:
656 if os.path.lexists(repo.wjoin(f)): 659 if os.path.lexists(repo.wjoin(f)):
657 repo.ui.debug("removing %s\n" % f) 660 repo.ui.debug("removing %s\n" % f)
668 671
669 hgsub = [a[1] for a in workeractions if a[0] == '.hgsubstate'] 672 hgsub = [a[1] for a in workeractions if a[0] == '.hgsubstate']
670 if hgsub and hgsub[0] == 'r': 673 if hgsub and hgsub[0] == 'r':
671 subrepo.submerge(repo, wctx, mctx, wctx, overwrite) 674 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
672 675
676 # remove in parallel (must come first)
673 z = 0 677 z = 0
674 prog = worker.worker(repo.ui, 0.001, getremove, (repo, mctx, overwrite), 678 prog = worker.worker(repo.ui, 0.001, getremove, (repo, mctx, overwrite),
675 removeactions) 679 removeactions)
676 for i, item in prog: 680 for i, item in prog:
677 z += i 681 z += i
678 repo.ui.progress(_('updating'), z, item=item, total=numupdates, 682 progress(_updating, z, item=item, total=numupdates, unit=_files)
679 unit=_('files')) 683
684 # get in parallel
680 prog = worker.worker(repo.ui, 0.001, getremove, (repo, mctx, overwrite), 685 prog = worker.worker(repo.ui, 0.001, getremove, (repo, mctx, overwrite),
681 updateactions) 686 updateactions)
682 for i, item in prog: 687 for i, item in prog:
683 z += i 688 z += i
684 repo.ui.progress(_('updating'), z, item=item, total=numupdates, 689 progress(_updating, z, item=item, total=numupdates, unit=_files)
685 unit=_('files'))
686 690
687 if hgsub and hgsub[0] == 'g': 691 if hgsub and hgsub[0] == 'g':
688 subrepo.submerge(repo, wctx, mctx, wctx, overwrite) 692 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
689
690 _updating = _('updating')
691 _files = _('files')
692 progress = repo.ui.progress
693 693
694 for i, a in enumerate(actions): 694 for i, a in enumerate(actions):
695 f, m, args, msg = a 695 f, m, args, msg = a
696 progress(_updating, z + i + 1, item=f, total=numupdates, unit=_files) 696 progress(_updating, z + i + 1, item=f, total=numupdates, unit=_files)
697 if m == "m": # merge 697 if m == "m": # merge