Use revlog hash comparison technique in merge
authorMatt Mackall <mpm@selenic.com>
Tue, 15 Aug 2006 15:45:45 -0500
changeset 2891 95cc73523983
parent 2890 5df3e5cf16bc
child 2892 dd41ad984f71
Use revlog hash comparison technique in merge
mercurial/merge.py
--- a/mercurial/merge.py	Tue Aug 15 14:18:13 2006 -0500
+++ b/mercurial/merge.py	Tue Aug 15 15:45:45 2006 -0500
@@ -90,9 +90,7 @@
     if not force:
         for f in unknown:
             if f in m2:
-                t1 = repo.wread(f)
-                t2 = repo.file(f).read(m2[f])
-                if cmp(t1, t2) != 0:
+                if repo.file(f).cmp(m2[f], repo.wread(f)):
                     raise util.Abort(_("'%s' already exists in the working"
                                        " dir and differs from remote") % f)
 
@@ -137,11 +135,8 @@
 
             # is the wfile new since m1, and match m2?
             if f not in m1:
-                t1 = repo.wread(f)
-                t2 = repo.file(f).read(m2[f])
-                if cmp(t1, t2) == 0:
+                if not repo.file(f).cmp(m2[f], repo.wread(f)):
                     n = m2[f]
-                del t1, t2
 
             # are files different?
             if n != m2[f]: