Show More
@@ -184,7 +184,7 class filectx(object): | |||||
184 | def __eq__(self, other): |
|
184 | def __eq__(self, other): | |
185 | try: |
|
185 | try: | |
186 | return (self._path == other._path |
|
186 | return (self._path == other._path | |
187 |
and self._ |
|
187 | and self._fileid == other._fileid) | |
188 | except AttributeError: |
|
188 | except AttributeError: | |
189 | return False |
|
189 | return False | |
190 |
|
190 |
@@ -157,7 +157,7 def findcopies(repo, m1, m2, ma, limit): | |||||
157 | fullcopy = {} |
|
157 | fullcopy = {} | |
158 | diverge = {} |
|
158 | diverge = {} | |
159 |
|
159 | |||
160 | def checkcopies(c, man): |
|
160 | def checkcopies(c, man, aman): | |
161 | '''check possible copies for filectx c''' |
|
161 | '''check possible copies for filectx c''' | |
162 | for of in findold(c): |
|
162 | for of in findold(c): | |
163 | fullcopy[c.path()] = of # remember for dir rename detection |
|
163 | fullcopy[c.path()] = of # remember for dir rename detection | |
@@ -165,6 +165,10 def findcopies(repo, m1, m2, ma, limit): | |||||
165 | if of in ma: |
|
165 | if of in ma: | |
166 | diverge.setdefault(of, []).append(c.path()) |
|
166 | diverge.setdefault(of, []).append(c.path()) | |
167 | continue |
|
167 | continue | |
|
168 | # if the original file is unchanged on the other branch, | |||
|
169 | # no merge needed | |||
|
170 | if man[of] == aman.get(of): | |||
|
171 | continue | |||
168 | c2 = ctx(of, man[of]) |
|
172 | c2 = ctx(of, man[of]) | |
169 | ca = c.ancestor(c2) |
|
173 | ca = c.ancestor(c2) | |
170 | if not ca: # unrelated? |
|
174 | if not ca: # unrelated? | |
@@ -186,10 +190,10 def findcopies(repo, m1, m2, ma, limit): | |||||
186 | u2 = nonoverlap(m2, m1, ma) |
|
190 | u2 = nonoverlap(m2, m1, ma) | |
187 |
|
191 | |||
188 | for f in u1: |
|
192 | for f in u1: | |
189 | checkcopies(ctx(f, m1[f]), m2) |
|
193 | checkcopies(ctx(f, m1[f]), m2, ma) | |
190 |
|
194 | |||
191 | for f in u2: |
|
195 | for f in u2: | |
192 | checkcopies(ctx(f, m2[f]), m1) |
|
196 | checkcopies(ctx(f, m2[f]), m1, ma) | |
193 |
|
197 | |||
194 | d2 = {} |
|
198 | d2 = {} | |
195 | for of, fl in diverge.items(): |
|
199 | for of, fl in diverge.items(): | |
@@ -197,7 +201,6 def findcopies(repo, m1, m2, ma, limit): | |||||
197 | fo = list(fl) |
|
201 | fo = list(fl) | |
198 | fo.remove(f) |
|
202 | fo.remove(f) | |
199 | d2[f] = (of, fo) |
|
203 | d2[f] = (of, fo) | |
200 | #diverge = d2 |
|
|||
201 |
|
204 | |||
202 | if not fullcopy or not repo.ui.configbool("merge", "followdirs", True): |
|
205 | if not fullcopy or not repo.ui.configbool("merge", "followdirs", True): | |
203 | return copy, diverge |
|
206 | return copy, diverge |
General Comments 0
You need to be logged in to leave comments.
Login now