Mercurial > hg-stable
comparison mercurial/copies.py @ 30229:69ffbbe73dd0 stable
merge: avoid superfluous filemerges when grafting through renames (issue5407)
This is a fix for a regression introduced by the patches for issue4028.
The test changes are due to us doing fewer _checkcopies searches now, which
makes some test outputs revert to the pre-issue4028 behavior. That issue itself
remains fixed, we only skip copy tracing for files where it isn't relevant.
As a nice side effect, this makes copy detection much faster when tracing
backwards through lots of renames.
author | Gábor Stefanik <gabor.stefanik@nng.com> |
---|---|
date | Tue, 25 Oct 2016 21:01:53 +0200 |
parents | 87a7c0d403ff |
children | 0298a07f64d9 |
comparison
equal
deleted
inserted
replaced
30228:b9f7b0c10027 | 30229:69ffbbe73dd0 |
---|---|
629 # the base) this is more complicated as we must detect a divergence. | 629 # the base) this is more complicated as we must detect a divergence. |
630 # We use 'backwards = False' in that case. | 630 # We use 'backwards = False' in that case. |
631 backwards = not remotebase and base != tca and f in mb | 631 backwards = not remotebase and base != tca and f in mb |
632 getfctx = _makegetfctx(ctx) | 632 getfctx = _makegetfctx(ctx) |
633 | 633 |
634 if m1[f] == mb.get(f) and not remotebase: | |
635 # Nothing to merge | |
636 return | |
637 | |
634 of = None | 638 of = None |
635 seen = set([f]) | 639 seen = set([f]) |
636 for oc in getfctx(f, m1[f]).ancestors(): | 640 for oc in getfctx(f, m1[f]).ancestors(): |
637 ocr = oc.linkrev() | 641 ocr = oc.linkrev() |
638 of = oc.path() | 642 of = oc.path() |