Show More
@@ -328,12 +328,10 b' def mergecopies(repo, c1, c2, ca):' | |||||
328 | u1, u2 = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2) |
|
328 | u1, u2 = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2) | |
329 |
|
329 | |||
330 | for f in u1: |
|
330 | for f in u1: | |
331 | getfctx = _makegetfctx(c1) |
|
331 | checkcopies(c1, f, m1, m2, ca, limit, diverge, copy1, fullcopy1) | |
332 | checkcopies(getfctx, f, m1, m2, ca, limit, diverge, copy1, fullcopy1) |
|
|||
333 |
|
332 | |||
334 | for f in u2: |
|
333 | for f in u2: | |
335 | getfctx = _makegetfctx(c2) |
|
334 | checkcopies(c2, f, m2, m1, ca, limit, diverge, copy2, fullcopy2) | |
336 | checkcopies(getfctx, f, m2, m1, ca, limit, diverge, copy2, fullcopy2) |
|
|||
337 |
|
335 | |||
338 | copy = dict(copy1.items() + copy2.items()) |
|
336 | copy = dict(copy1.items() + copy2.items()) | |
339 | movewithdir = dict(movewithdir1.items() + movewithdir2.items()) |
|
337 | movewithdir = dict(movewithdir1.items() + movewithdir2.items()) | |
@@ -359,12 +357,8 b' def mergecopies(repo, c1, c2, ca):' | |||||
359 | % "\n ".join(bothnew)) |
|
357 | % "\n ".join(bothnew)) | |
360 | bothdiverge, _copy, _fullcopy = {}, {}, {} |
|
358 | bothdiverge, _copy, _fullcopy = {}, {}, {} | |
361 | for f in bothnew: |
|
359 | for f in bothnew: | |
362 | getfctx = _makegetfctx(c1) |
|
360 | checkcopies(c1, f, m1, m2, ca, limit, bothdiverge, _copy, _fullcopy) | |
363 |
checkcopies( |
|
361 | checkcopies(c2, f, m2, m1, ca, limit, bothdiverge, _copy, _fullcopy) | |
364 | _copy, _fullcopy) |
|
|||
365 | getfctx = _makegetfctx(c2) |
|
|||
366 | checkcopies(getfctx, f, m2, m1, ca, limit, bothdiverge, |
|
|||
367 | _copy, _fullcopy) |
|
|||
368 | for of, fl in bothdiverge.items(): |
|
362 | for of, fl in bothdiverge.items(): | |
369 | if len(fl) == 2 and fl[0] == fl[1]: |
|
363 | if len(fl) == 2 and fl[0] == fl[1]: | |
370 | copy[fl[0]] = of # not actually divergent, just matching renames |
|
364 | copy[fl[0]] = of # not actually divergent, just matching renames | |
@@ -444,11 +438,11 b' def mergecopies(repo, c1, c2, ca):' | |||||
444 |
|
438 | |||
445 | return copy, movewithdir, diverge, renamedelete |
|
439 | return copy, movewithdir, diverge, renamedelete | |
446 |
|
440 | |||
447 |
def checkcopies( |
|
441 | def checkcopies(ctx, f, m1, m2, ca, limit, diverge, copy, fullcopy): | |
448 | """ |
|
442 | """ | |
449 | check possible copies of f from m1 to m2 |
|
443 | check possible copies of f from m1 to m2 | |
450 |
|
444 | |||
451 | getfctx = function accepting (filename, node) that returns a filectx. |
|
445 | ctx = starting context for f in m1 | |
452 | f = the filename to check |
|
446 | f = the filename to check | |
453 | m1 = the source manifest |
|
447 | m1 = the source manifest | |
454 | m2 = the destination manifest |
|
448 | m2 = the destination manifest | |
@@ -460,6 +454,7 b' def checkcopies(getfctx, f, m1, m2, ca, ' | |||||
460 | """ |
|
454 | """ | |
461 |
|
455 | |||
462 | ma = ca.manifest() |
|
456 | ma = ca.manifest() | |
|
457 | getfctx = _makegetfctx(ctx) | |||
463 |
|
458 | |||
464 | def _related(f1, f2, limit): |
|
459 | def _related(f1, f2, limit): | |
465 | # Walk back to common ancestor to see if the two files originate |
|
460 | # Walk back to common ancestor to see if the two files originate |
General Comments 0
You need to be logged in to leave comments.
Login now