Patchwork [04,of,12,v2] copies: compute a suitable TCA if base turns out to be unsuitable

login
register
mail settings
Submitter Gábor Stefanik
Date Oct. 16, 2016, 3:15 p.m.
Message ID <1f91343556e7cef7a71e.1476630941@GSTEFANIK.NavnGo.local>
Download mbox | patch
Permalink /patch/17133/
State Accepted
Headers show

Comments

Gábor Stefanik - Oct. 16, 2016, 3:15 p.m.
# HG changeset patch
# User Gábor Stefanik <gabor.stefanik@nng.com>
# Date 1476317029 -7200
#      Thu Oct 13 02:03:49 2016 +0200
# Node ID 1f91343556e7cef7a71edf512b02f7e0f09d5e9b
# Parent  981a622717343796f65b5858f4d4b89f81cb437a
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.)

Patch

diff -r 981a62271734 -r 1f91343556e7 mercurial/copies.py
--- a/mercurial/copies.py	Thu Oct 13 01:47:33 2016 +0200
+++ b/mercurial/copies.py	Thu Oct 13 02:03:49 2016 +0200
@@ -338,6 +338,10 @@ 
     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