comparison mercurial/copies.py @ 39966:707c3804e607

narrow: move copies overrides to core The copies overrides seems to have been a little complicated just by not being in core. When moved to core, it becomes trivial (at least I think these overrides have the same effect). Differential Revision: https://phab.mercurial-scm.org/D4825
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 28 Sep 2018 12:56:57 -0700
parents 85c8ff26d698
children 25b2868206e2
comparison
equal deleted inserted replaced
39965:1a4c1a3cc3f5 39966:707c3804e607
256 if u1: 256 if u1:
257 repo.ui.debug("%s:\n %s\n" % (header % 'local', "\n ".join(u1))) 257 repo.ui.debug("%s:\n %s\n" % (header % 'local', "\n ".join(u1)))
258 if u2: 258 if u2:
259 repo.ui.debug("%s:\n %s\n" % (header % 'other', "\n ".join(u2))) 259 repo.ui.debug("%s:\n %s\n" % (header % 'other', "\n ".join(u2)))
260 260
261 narrowmatch = repo.narrowmatch()
262 if not narrowmatch.always():
263 u1 = [f for f in u1 if narrowmatch(f)]
264 u2 = [f for f in u2 if narrowmatch(f)]
265 return u1, u2 261 return u1, u2
266 262
267 def _makegetfctx(ctx): 263 def _makegetfctx(ctx):
268 """return a 'getfctx' function suitable for _checkcopies usage 264 """return a 'getfctx' function suitable for _checkcopies usage
269 265
465 'diverge': diverge, 461 'diverge': diverge,
466 'incompletediverge': incompletediverge, 462 'incompletediverge': incompletediverge,
467 } 463 }
468 464
469 # find interesting file sets from manifests 465 # find interesting file sets from manifests
470 addedinm1 = m1.filesnotin(mb) 466 addedinm1 = m1.filesnotin(mb, repo.narrowmatch())
471 addedinm2 = m2.filesnotin(mb) 467 addedinm2 = m2.filesnotin(mb, repo.narrowmatch())
472 bothnew = sorted(addedinm1 & addedinm2) 468 bothnew = sorted(addedinm1 & addedinm2)
473 if tca == base: 469 if tca == base:
474 # unmatched file from base 470 # unmatched file from base
475 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2) 471 u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2)
476 u1u, u2u = u1r, u2r 472 u1u, u2u = u1r, u2r