From patchwork Wed May 27 13:17:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D8589: metadata: filter the `removed` set to only contains relevant data From: phabricator X-Patchwork-Id: 46380 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 27 May 2020 13:17:14 +0000 marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The `files` entry can be bogus and contains too many entries. This can badly combines with the computation of `removed` inflating the set size. The can lead to the changesets centric rename computation to process much more data than needed, slowing it down (and increasing space taken by data storage). In practice newer commits already that reduced set, this applies this "fix" to older changeset. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D8589 AFFECTED FILES mercurial/metadata.py CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/metadata.py b/mercurial/metadata.py --- a/mercurial/metadata.py +++ b/mercurial/metadata.py @@ -94,6 +94,9 @@ for f in ctx.files(): if f not in ctx: removed.append(f) + if removed: + rf = get_removal_filter(ctx) + removed = [r for r in removed if not rf(r)] return removed