comparison mercurial/merge.py @ 2911:95cc73523983

Use revlog hash comparison technique in merge
author Matt Mackall <mpm@selenic.com>
date Tue, 15 Aug 2006 15:45:45 -0500
parents bee4b7abcb01
children dd41ad984f71
comparison
equal deleted inserted replaced
2910:5df3e5cf16bc 2911:95cc73523983
88 ma = repo.manifest.read(man) 88 ma = repo.manifest.read(man)
89 89
90 if not force: 90 if not force:
91 for f in unknown: 91 for f in unknown:
92 if f in m2: 92 if f in m2:
93 t1 = repo.wread(f) 93 if repo.file(f).cmp(m2[f], repo.wread(f)):
94 t2 = repo.file(f).read(m2[f])
95 if cmp(t1, t2) != 0:
96 raise util.Abort(_("'%s' already exists in the working" 94 raise util.Abort(_("'%s' already exists in the working"
97 " dir and differs from remote") % f) 95 " dir and differs from remote") % f)
98 96
99 # resolve the manifest to determine which files 97 # resolve the manifest to determine which files
100 # we care about merging 98 # we care about merging
135 if f in m2: 133 if f in m2:
136 s = 0 134 s = 0
137 135
138 # is the wfile new since m1, and match m2? 136 # is the wfile new since m1, and match m2?
139 if f not in m1: 137 if f not in m1:
140 t1 = repo.wread(f) 138 if not repo.file(f).cmp(m2[f], repo.wread(f)):
141 t2 = repo.file(f).read(m2[f])
142 if cmp(t1, t2) == 0:
143 n = m2[f] 139 n = m2[f]
144 del t1, t2
145 140
146 # are files different? 141 # are files different?
147 if n != m2[f]: 142 if n != m2[f]:
148 a = ma.get(f, nullid) 143 a = ma.get(f, nullid)
149 # are both different from the ancestor? 144 # are both different from the ancestor?