Mercurial > public > mercurial-scm > hg-stable
diff mercurial/merge.py @ 3311:966632304dde
merge: shortcircuit filemerge for identical files
- use filectx.cmp to compare files
- move merge messages into filemerge
- kill the redundant resolving message
- update tests
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 10 Oct 2006 01:16:06 -0500 |
parents | e8be5942335d |
children | c5075ad5e3e9 |
line wrap: on
line diff
--- a/mercurial/merge.py Tue Oct 10 01:13:03 2006 -0500 +++ b/mercurial/merge.py Tue Oct 10 01:16:06 2006 -0500 @@ -32,6 +32,10 @@ fcm = wctx.filectx(fw) fco = mctx.filectx(fo) + + if not fco.cmp(fcm.data()): # files identical? + return 0 + fca = fcm.ancestor(fco) if not fca: fca = repo.filectx(fw, fileid=-1) @@ -39,7 +43,11 @@ b = temp("base", fca) c = temp("other", fco) - repo.ui.note(_("resolving %s\n") % fw) + if fw != fo: + repo.ui.status(_("merging %s and %s\n") % (fw, fo)) + else: + repo.ui.status(_("merging %s\n") % fw) + repo.ui.debug(_("my %s other %s ancestor %s\n") % (fcm, fco, fca)) cmd = (os.environ.get("HGMERGE") or repo.ui.config("ui", "merge") @@ -281,10 +289,6 @@ removed +=1 elif m == "m": # merge f2, fd, flag, move = a[2:] - if f != f2: - repo.ui.status(_("merging %s and %s to %s\n") % (f, f2, fd)) - else: - repo.ui.status(_("merging %s\n") % f) if filemerge(repo, f, f2, wctx, mctx): unresolved += 1 else: