# HG changeset patch # User Gábor Stefanik # Date 2016-10-13 00:03:49 # Node ID 8c69c52ced987df33ea42310920545d766fe7dd0 # Parent 368e27eb1ffaf9dd5aa48771b9a0a3b8795e2955 copies: compute a suitable TCA if base turns out to be unsuitable This will be used later in an update to _checkcopies. (Pierre-Yves David was involved in the cleanup of this patch.) diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -338,6 +338,10 @@ def mergecopies(repo, c1, c2, base): dirtyc1 = not (base == _c1 or base.descendant(_c1)) dirtyc2 = not (base== _c2 or base.descendant(_c2)) graft = dirtyc1 or dirtyc2 + tca = base + if graft: + tca = _c1.ancestor(_c2) + limit = _findlimit(repo, c1.rev(), c2.rev()) if limit is None: # no common ancestor, no copies