From patchwork Fri Dec 15 13:52:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1695: copies: always respect matcher arg to _forwardcopies() From: phabricator X-Patchwork-Id: 26303 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Fri, 15 Dec 2017 13:52:26 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG7ddc1e96d9b0: copies: always respect matcher arg to _forwardcopies() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1695?vs=4444&id=4476 REVISION DETAIL https://phab.mercurial-scm.org/D1695 AFFECTED FILES mercurial/copies.py CHANGE DETAILS To: martinvonz, #hg-reviewers, yuja Cc: mercurial-devel diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -139,11 +139,11 @@ if limit >= 0 and f.linkrev() < limit and f.rev() < limit: return None -def _dirstatecopies(d): +def _dirstatecopies(d, match=None): ds = d._repo.dirstate c = ds.copies().copy() for k in list(c): - if ds[k] not in 'anm': + if ds[k] not in 'anm' or (match and not match(k)): del c[k] return c @@ -166,7 +166,7 @@ b = w.p1() if a == b: # short-circuit to avoid issues with merge states - return _dirstatecopies(w) + return _dirstatecopies(w, match) # files might have to be traced back to the fctx parent of the last # one-side-only changeset, but not further back than that @@ -202,7 +202,7 @@ # combine copies from dirstate if necessary if w is not None: - cm = _chain(a, w, cm, _dirstatecopies(w)) + cm = _chain(a, w, cm, _dirstatecopies(w, match)) return cm