comparison mercurial/copies.py @ 30197:0accd5a5ad04

mergecopies: invoke _computenonoverlap for both base and tca during merges The algorithm of _checkcopies can only walk backwards in the DAG, never forward. Because of this, the two _checkcopies patches need to run from their respective endpoints to the TCA to cover the entire subgraph where the merge is being performed. However, detection of files new in both endpoints, as well as directory rename detection, need to run with respect to the merge base, so we need lists of new files both from the TCA's and the merge base's viewpoint to correctly detect renames in a graft-like merge scenario. (Series reworked by Pierre-Yves David)
author Gábor Stefanik <gabor.stefanik@nng.com>
date Thu, 13 Oct 2016 02:19:43 +0200
parents d738cda70894
children 856ead835f56
comparison
equal deleted inserted replaced
30196:d738cda70894 30197:0accd5a5ad04
371 } 371 }
372 372
373 # find interesting file sets from manifests 373 # find interesting file sets from manifests
374 addedinm1 = m1.filesnotin(mb) 374 addedinm1 = m1.filesnotin(mb)
375 addedinm2 = m2.filesnotin(mb) 375 addedinm2 = m2.filesnotin(mb)
376 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
377 u1u, u2u = u1r, u2r
378 bothnew = sorted(addedinm1 & addedinm2) 376 bothnew = sorted(addedinm1 & addedinm2)
377 if tca == base:
378 # unmatched file from base
379 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
380 u1u, u2u = u1r, u2r
381 else:
382 # unmatched file from base (DAG rotation in the graft case)
383 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2,
384 baselabel='base')
385 # unmatched file from topological common ancestors (no DAG rotation)
386 # need to recompute this for directory move handling when grafting
387 mta = tca.manifest()
388 u1u, u2u = _computenonoverlap(repo, c1, c2, m1.filesnotin(mta),
389 m2.filesnotin(mta),
390 baselabel='topological common ancestor')
379 391
380 for f in u1u: 392 for f in u1u:
381 _checkcopies(c1, f, m1, m2, base, tca, limit, data1) 393 _checkcopies(c1, f, m1, m2, base, tca, limit, data1)
382 394
383 for f in u2u: 395 for f in u2u: