# HG changeset patch # User Siddharth Agarwal # Date 2015-09-16 19:36:21 # Node ID 007ac1acfcacbb9ec4fff14924f6afd634c04785 # Parent 1d33842c5b3efb6cc58c99544c7a3a8ef821d04f 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. diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -795,25 +795,6 @@ def applyupdates(repo, actions, wctx, mc repo.ui.debug(" %s: %s -> k\n" % (f, msg)) # no progress - # merge - for f, args, msg in actions['m']: - repo.ui.debug(" %s: %s -> m\n" % (f, msg)) - z += 1 - progress(_updating, z, item=f, total=numupdates, unit=_files) - if f == '.hgsubstate': # subrepo states need updating - subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), - overwrite) - continue - audit(f) - r = ms.resolve(f, wctx, labels=labels) - if r is not None and r > 0: - unresolved += 1 - else: - if r is None: - updated += 1 - else: - merged += 1 - # directory rename, move local for f, args, msg in actions['dm']: repo.ui.debug(" %s: %s -> dm\n" % (f, msg)) @@ -846,6 +827,25 @@ def applyupdates(repo, actions, wctx, mc util.setflags(repo.wjoin(f), 'l' in flags, 'x' in flags) updated += 1 + # merge + for f, args, msg in actions['m']: + repo.ui.debug(" %s: %s -> m\n" % (f, msg)) + z += 1 + progress(_updating, z, item=f, total=numupdates, unit=_files) + if f == '.hgsubstate': # subrepo states need updating + subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), + overwrite) + continue + audit(f) + r = ms.resolve(f, wctx, labels=labels) + if r is not None and r > 0: + unresolved += 1 + else: + if r is None: + updated += 1 + else: + merged += 1 + ms.commit() progress(_updating, None, total=numupdates, unit=_files)