comparison mercurial/merge.py @ 25754:19cc443aac34

merge: remove useless dirstate.normallookup() invocation in applyupdates() Explicit 'dirstate.normallookup()' invocation via 'dirtysubstate()' in 'applyupdates()' is useless now, because previous patch fixed the relevant issue by writing in-memory dirstate changes out at the end of dirty check. 'dirstate.normallookup()' invocation was introduced by 6becb9dbca25 to avoid occasional test failure. This is partial backout of it (added tests are still left).
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 08 Jul 2015 17:01:09 +0900
parents 328739ea70c3
children bf9ea348b487
comparison
equal deleted inserted replaced
25753:fe03f522dda9 25754:19cc443aac34
739 audit(f) 739 audit(f)
740 util.unlinkpath(repo.wjoin(f)) 740 util.unlinkpath(repo.wjoin(f))
741 741
742 numupdates = sum(len(l) for m, l in actions.items() if m != 'k') 742 numupdates = sum(len(l) for m, l in actions.items() if m != 'k')
743 743
744 def dirtysubstate():
745 # mark '.hgsubstate' as possibly dirty forcibly, because
746 # modified '.hgsubstate' is misunderstood as clean,
747 # when both st_size/st_mtime of '.hgsubstate' aren't changed,
748 # even if "submerge" fails and '.hgsubstate' is inconsistent
749 repo.dirstate.normallookup('.hgsubstate')
750
751 if [a for a in actions['r'] if a[0] == '.hgsubstate']: 744 if [a for a in actions['r'] if a[0] == '.hgsubstate']:
752 dirtysubstate()
753 subrepo.submerge(repo, wctx, mctx, wctx, overwrite) 745 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
754 746
755 # remove in parallel (must come first) 747 # remove in parallel (must come first)
756 z = 0 748 z = 0
757 prog = worker.worker(repo.ui, 0.001, batchremove, (repo,), actions['r']) 749 prog = worker.worker(repo.ui, 0.001, batchremove, (repo,), actions['r'])
766 z += i 758 z += i
767 progress(_updating, z, item=item, total=numupdates, unit=_files) 759 progress(_updating, z, item=item, total=numupdates, unit=_files)
768 updated = len(actions['g']) 760 updated = len(actions['g'])
769 761
770 if [a for a in actions['g'] if a[0] == '.hgsubstate']: 762 if [a for a in actions['g'] if a[0] == '.hgsubstate']:
771 dirtysubstate()
772 subrepo.submerge(repo, wctx, mctx, wctx, overwrite) 763 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
773 764
774 # forget (manifest only, just log it) (must come first) 765 # forget (manifest only, just log it) (must come first)
775 for f, args, msg in actions['f']: 766 for f, args, msg in actions['f']:
776 repo.ui.debug(" %s: %s -> f\n" % (f, msg)) 767 repo.ui.debug(" %s: %s -> f\n" % (f, msg))
792 for f, args, msg in actions['m']: 783 for f, args, msg in actions['m']:
793 repo.ui.debug(" %s: %s -> m\n" % (f, msg)) 784 repo.ui.debug(" %s: %s -> m\n" % (f, msg))
794 z += 1 785 z += 1
795 progress(_updating, z, item=f, total=numupdates, unit=_files) 786 progress(_updating, z, item=f, total=numupdates, unit=_files)
796 if f == '.hgsubstate': # subrepo states need updating 787 if f == '.hgsubstate': # subrepo states need updating
797 dirtysubstate()
798 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), 788 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
799 overwrite) 789 overwrite)
800 continue 790 continue
801 audit(f) 791 audit(f)
802 r = ms.resolve(f, wctx, labels=labels) 792 r = ms.resolve(f, wctx, labels=labels)