equal
deleted
inserted
replaced
186 |
186 |
187 # avoid silly behavior for update from empty dir |
187 # avoid silly behavior for update from empty dir |
188 if not m1 or not m2 or not ma: |
188 if not m1 or not m2 or not ma: |
189 return {}, {} |
189 return {}, {} |
190 |
190 |
|
191 repo.ui.debug(_(" searching for copies back to rev %d\n") % limit) |
|
192 |
191 u1 = nonoverlap(m1, m2, ma) |
193 u1 = nonoverlap(m1, m2, ma) |
192 u2 = nonoverlap(m2, m1, ma) |
194 u2 = nonoverlap(m2, m1, ma) |
|
195 |
|
196 if u1: |
|
197 repo.ui.debug(_(" unmatched files in local:\n %s\n") |
|
198 % "\n ".join(u1)) |
|
199 if u2: |
|
200 repo.ui.debug(_(" unmatched files in other:\n %s\n") |
|
201 % "\n ".join(u2)) |
193 |
202 |
194 for f in u1: |
203 for f in u1: |
195 checkcopies(ctx(f, m1[f]), m2, ma) |
204 checkcopies(ctx(f, m1[f]), m2, ma) |
196 |
205 |
197 for f in u2: |
206 for f in u2: |
202 for f in fl: |
211 for f in fl: |
203 fo = list(fl) |
212 fo = list(fl) |
204 fo.remove(f) |
213 fo.remove(f) |
205 d2[f] = (of, fo) |
214 d2[f] = (of, fo) |
206 |
215 |
|
216 if fullcopy: |
|
217 repo.ui.debug(_(" all copies found (* = to merge, ! = divergent):\n")) |
|
218 for f in fullcopy: |
|
219 note = "" |
|
220 if f in copy: note += "*" |
|
221 if f in diverge: note += "!" |
|
222 repo.ui.debug(_(" %s -> %s %s\n") % (f, fullcopy[f], note)) |
|
223 |
207 if not fullcopy or not repo.ui.configbool("merge", "followdirs", True): |
224 if not fullcopy or not repo.ui.configbool("merge", "followdirs", True): |
208 return copy, diverge |
225 return copy, diverge |
|
226 |
|
227 repo.ui.debug(_(" checking for directory renames\n")) |
209 |
228 |
210 # generate a directory move map |
229 # generate a directory move map |
211 d1, d2 = dirs(m1), dirs(m2) |
230 d1, d2 = dirs(m1), dirs(m2) |
212 invalid = {} |
231 invalid = {} |
213 dirmove = {} |
232 dirmove = {} |
239 del d1, d2, invalid |
258 del d1, d2, invalid |
240 |
259 |
241 if not dirmove: |
260 if not dirmove: |
242 return copy, diverge |
261 return copy, diverge |
243 |
262 |
|
263 for d in dirmove: |
|
264 repo.ui.debug(_(" dir %s -> %s\n") % (d, dirmove[d])) |
|
265 |
244 # check unaccounted nonoverlapping files against directory moves |
266 # check unaccounted nonoverlapping files against directory moves |
245 for f in u1 + u2: |
267 for f in u1 + u2: |
246 if f not in fullcopy: |
268 if f not in fullcopy: |
247 for d in dirmove: |
269 for d in dirmove: |
248 if f.startswith(d): |
270 if f.startswith(d): |
249 # new file added in a directory that was moved, move it |
271 # new file added in a directory that was moved, move it |
250 copy[f] = dirmove[d] + f[len(d):] |
272 copy[f] = dirmove[d] + f[len(d):] |
|
273 repo.ui.debug(_(" file %s -> %s\n") % (f, copy[f])) |
251 break |
274 break |
252 |
275 |
253 return copy, diverge |
276 return copy, diverge |
254 |
277 |
255 def symmetricdifference(repo, rev1, rev2): |
278 def symmetricdifference(repo, rev1, rev2): |