[PATCH 08 of 16] copies: compute a suitable TCA if base turns out to be unsuitable

Gábor Stefanik gabor.stefanik at nng.com
Sun Oct 16 10:29:53 EDT 2016


# HG changeset patch
# User Gábor Stefanik <gabor.stefanik at nng.com>
# Date 1476317029 -7200
#      Thu Oct 13 02:03:49 2016 +0200
# Node ID 2284ef0bd7df9b83f10f91f79f74f5b44b6ffde0
# Parent  b3631f615bc2fff5cbce4cde7373dde052197a0e
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 -r b3631f615bc2 -r 2284ef0bd7df 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


More information about the Mercurial-devel mailing list