# HG changeset patch # User Boris Feld # Date 1541615748 -3600 # Node ID 4a3d588e53118826ff7e2c154b331e5732995046 # Parent b757f06193d048ef02876a77cde4a7b64ebf1d13 compat: fix fixedcopytracing compatibility with mercurial 4.8 and narrow Mercurial 4.8 version of _fullcopytracing includes some new narrow code. As https://phab.mercurial-scm.org/D3896 has not yet landed, update fixedcopytracing behind a version detection condition. This was spotted by Augie Fackler. diff -r b757f06193d0 -r 4a3d588e5311 CHANGELOG --- a/CHANGELOG Thu Nov 01 21:33:15 2018 +0300 +++ b/CHANGELOG Wed Nov 07 19:35:48 2018 +0100 @@ -6,6 +6,7 @@ ------------------- * evolve: not longer attempt to translate revision's descriptions (issue6016) + * evolve: fix compatibility with mercurial 4.8's narrow extension. 8.3.1 -- 2018-10-25 ------------------- diff -r b757f06193d0 -r 4a3d588e5311 hgext3rd/evolve/compat.py --- a/hgext3rd/evolve/compat.py Thu Nov 01 21:33:15 2018 +0300 +++ b/hgext3rd/evolve/compat.py Wed Nov 07 19:35:48 2018 +0100 @@ -214,6 +214,7 @@ return bool(upres[-1]) return bool(upres.unresolvedcount) +hg48 = util.safehasattr(copies, 'stringutil') # code imported from Mercurial core at ae17555ef93f + patch def fixedcopytracing(repo, c1, c2, base): """A complete copy-patse of copies._fullcopytrace with a one line fix to @@ -280,8 +281,12 @@ } # find interesting file sets from manifests - addedinm1 = m1.filesnotin(mb) - addedinm2 = m2.filesnotin(mb) + if hg48: + addedinm1 = m1.filesnotin(mb, repo.narrowmatch()) + addedinm2 = m2.filesnotin(mb, repo.narrowmatch()) + else: + addedinm1 = m1.filesnotin(mb) + addedinm2 = m2.filesnotin(mb) bothnew = sorted(addedinm1 & addedinm2) if tca == base: # unmatched file from base @@ -294,9 +299,16 @@ # unmatched file from topological common ancestors (no DAG rotation) # need to recompute this for directory move handling when grafting mta = tca.manifest() - u1u, u2u = copies._computenonoverlap(repo, c1, c2, m1.filesnotin(mta), - m2.filesnotin(mta), - baselabel='topological common ancestor') + if hg48: + m1f = m1.filesnotin(mta, repo.narrowmatch()) + m2f = m2.filesnotin(mta, repo.narrowmatch()) + baselabel = 'topological common ancestor' + u1u, u2u = copies._computenonoverlap(repo, c1, c2, m1f, m2f, + baselabel=baselabel) + else: + u1u, u2u = copies._computenonoverlap(repo, c1, c2, m1.filesnotin(mta), + m2.filesnotin(mta), + baselabel='topological common ancestor') for f in u1u: copies._checkcopies(c1, c2, f, base, tca, dirtyc1, limit, data1)