comparison mercurial/merge.py @ 26292:007ac1acfcac

merge: move merge step to the end Resolving other conflicts before merge ones is better because the state before the merge is as consistent as possible. It will also help with future work involving automatic resolution of merge conflicts with an external merge driver. There are no ordering issues here because it is easy to verify that the same file is never in both the dg/dm and the m sets.
author Siddharth Agarwal <sid0@fb.com>
date Wed, 16 Sep 2015 12:36:21 -0700
parents 892d601f0d44
children bca60842e22d
comparison
equal deleted inserted replaced
26291:1d33842c5b3e 26292:007ac1acfcac
793 # keep (noop, just log it) 793 # keep (noop, just log it)
794 for f, args, msg in actions['k']: 794 for f, args, msg in actions['k']:
795 repo.ui.debug(" %s: %s -> k\n" % (f, msg)) 795 repo.ui.debug(" %s: %s -> k\n" % (f, msg))
796 # no progress 796 # no progress
797 797
798 # directory rename, move local
799 for f, args, msg in actions['dm']:
800 repo.ui.debug(" %s: %s -> dm\n" % (f, msg))
801 z += 1
802 progress(_updating, z, item=f, total=numupdates, unit=_files)
803 f0, flags = args
804 repo.ui.note(_("moving %s to %s\n") % (f0, f))
805 audit(f)
806 repo.wwrite(f, wctx.filectx(f0).data(), flags)
807 util.unlinkpath(repo.wjoin(f0))
808 updated += 1
809
810 # local directory rename, get
811 for f, args, msg in actions['dg']:
812 repo.ui.debug(" %s: %s -> dg\n" % (f, msg))
813 z += 1
814 progress(_updating, z, item=f, total=numupdates, unit=_files)
815 f0, flags = args
816 repo.ui.note(_("getting %s to %s\n") % (f0, f))
817 repo.wwrite(f, mctx.filectx(f0).data(), flags)
818 updated += 1
819
820 # exec
821 for f, args, msg in actions['e']:
822 repo.ui.debug(" %s: %s -> e\n" % (f, msg))
823 z += 1
824 progress(_updating, z, item=f, total=numupdates, unit=_files)
825 flags, = args
826 audit(f)
827 util.setflags(repo.wjoin(f), 'l' in flags, 'x' in flags)
828 updated += 1
829
798 # merge 830 # merge
799 for f, args, msg in actions['m']: 831 for f, args, msg in actions['m']:
800 repo.ui.debug(" %s: %s -> m\n" % (f, msg)) 832 repo.ui.debug(" %s: %s -> m\n" % (f, msg))
801 z += 1 833 z += 1
802 progress(_updating, z, item=f, total=numupdates, unit=_files) 834 progress(_updating, z, item=f, total=numupdates, unit=_files)
811 else: 843 else:
812 if r is None: 844 if r is None:
813 updated += 1 845 updated += 1
814 else: 846 else:
815 merged += 1 847 merged += 1
816
817 # directory rename, move local
818 for f, args, msg in actions['dm']:
819 repo.ui.debug(" %s: %s -> dm\n" % (f, msg))
820 z += 1
821 progress(_updating, z, item=f, total=numupdates, unit=_files)
822 f0, flags = args
823 repo.ui.note(_("moving %s to %s\n") % (f0, f))
824 audit(f)
825 repo.wwrite(f, wctx.filectx(f0).data(), flags)
826 util.unlinkpath(repo.wjoin(f0))
827 updated += 1
828
829 # local directory rename, get
830 for f, args, msg in actions['dg']:
831 repo.ui.debug(" %s: %s -> dg\n" % (f, msg))
832 z += 1
833 progress(_updating, z, item=f, total=numupdates, unit=_files)
834 f0, flags = args
835 repo.ui.note(_("getting %s to %s\n") % (f0, f))
836 repo.wwrite(f, mctx.filectx(f0).data(), flags)
837 updated += 1
838
839 # exec
840 for f, args, msg in actions['e']:
841 repo.ui.debug(" %s: %s -> e\n" % (f, msg))
842 z += 1
843 progress(_updating, z, item=f, total=numupdates, unit=_files)
844 flags, = args
845 audit(f)
846 util.setflags(repo.wjoin(f), 'l' in flags, 'x' in flags)
847 updated += 1
848 848
849 ms.commit() 849 ms.commit()
850 progress(_updating, None, total=numupdates, unit=_files) 850 progress(_updating, None, total=numupdates, unit=_files)
851 851
852 return updated, merged, removed, unresolved 852 return updated, merged, removed, unresolved