##// END OF EJS Templates
copies: move _makegetfctx calls into checkcopies
Matt Mackall -
r26657:1ae898cf default
parent child Browse files
Show More
@@ -328,12 +328,10 b' def mergecopies(repo, c1, c2, ca):'
328 328 u1, u2 = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
329 329
330 330 for f in u1:
331 getfctx = _makegetfctx(c1)
332 checkcopies(getfctx, f, m1, m2, ca, limit, diverge, copy1, fullcopy1)
331 checkcopies(c1, f, m1, m2, ca, limit, diverge, copy1, fullcopy1)
333 332
334 333 for f in u2:
335 getfctx = _makegetfctx(c2)
336 checkcopies(getfctx, f, m2, m1, ca, limit, diverge, copy2, fullcopy2)
334 checkcopies(c2, f, m2, m1, ca, limit, diverge, copy2, fullcopy2)
337 335
338 336 copy = dict(copy1.items() + copy2.items())
339 337 movewithdir = dict(movewithdir1.items() + movewithdir2.items())
@@ -359,12 +357,8 b' def mergecopies(repo, c1, c2, ca):'
359 357 % "\n ".join(bothnew))
360 358 bothdiverge, _copy, _fullcopy = {}, {}, {}
361 359 for f in bothnew:
362 getfctx = _makegetfctx(c1)
363 checkcopies(getfctx, f, m1, m2, ca, limit, bothdiverge,
364 _copy, _fullcopy)
365 getfctx = _makegetfctx(c2)
366 checkcopies(getfctx, f, m2, m1, ca, limit, bothdiverge,
367 _copy, _fullcopy)
360 checkcopies(c1, f, m1, m2, ca, limit, bothdiverge, _copy, _fullcopy)
361 checkcopies(c2, f, m2, m1, ca, limit, bothdiverge, _copy, _fullcopy)
368 362 for of, fl in bothdiverge.items():
369 363 if len(fl) == 2 and fl[0] == fl[1]:
370 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 439 return copy, movewithdir, diverge, renamedelete
446 440
447 def checkcopies(getfctx, f, m1, m2, ca, limit, diverge, copy, fullcopy):
441 def checkcopies(ctx, f, m1, m2, ca, limit, diverge, copy, fullcopy):
448 442 """
449 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 446 f = the filename to check
453 447 m1 = the source manifest
454 448 m2 = the destination manifest
@@ -460,6 +454,7 b' def checkcopies(getfctx, f, m1, m2, ca, '
460 454 """
461 455
462 456 ma = ca.manifest()
457 getfctx = _makegetfctx(ctx)
463 458
464 459 def _related(f1, f2, limit):
465 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