--- a/mercurial/merge.py Fri Nov 20 16:18:51 2015 -0800
+++ b/mercurial/merge.py Fri Nov 20 16:37:39 2015 -0800
@@ -944,7 +944,7 @@
describes how many files were affected by the update.
"""
- updated, merged, removed, unresolved = 0, 0, 0, 0
+ updated, merged, removed = 0, 0, 0
ms = mergestate.clean(repo, wctx.p1().node(), mctx.node())
moves = []
for m, l in actions.items():
@@ -1084,15 +1084,7 @@
continue
audit(f)
complete, r = ms.preresolve(f, wctx, labels=labels)
- if complete:
- if r is not None and r > 0:
- unresolved += 1
- else:
- if r is None:
- updated += 1
- else:
- merged += 1
- else:
+ if not complete:
numupdates += 1
tocomplete.append((f, args, msg))
@@ -1101,17 +1093,12 @@
repo.ui.debug(" %s: %s -> m (merge)\n" % (f, msg))
z += 1
progress(_updating, z, item=f, total=numupdates, unit=_files)
- 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.resolve(f, wctx, labels=labels)
ms.commit()
+ unresolved = ms.unresolvedcount()
+
if usemergedriver and not unresolved and ms.mdstate() != 's':
if not driverconclude(repo, ms, wctx, labels=labels):
# XXX setting unresolved to at least 1 is a hack to make sure we
@@ -1120,6 +1107,10 @@
ms.commit()
+ msupdated, msmerged, msremoved = ms.counts()
+ updated += msupdated
+ merged += msmerged
+ removed += msremoved
progress(_updating, None, total=numupdates, unit=_files)
return updated, merged, removed, unresolved