( )⚙ D6277 copies: filter out copies from non-existent source later in _chain()

This is an archive of the discontinued Mercurial Phabricator instance.

copies: filter out copies from non-existent source later in _chain()
ClosedPublic

Authored by martinvonz on Apr 18 2019, 1:58 PM.

Details

Summary

_changesetforwardcopies() repeatedly calls _chain(). That is very
expensive because _chain() does lookups in the manifest. I hope to
split up the function in two parts: 1) simple chaining, not
considering end points, and 2) filter out files that don't exist in
the end points (and ping-pong copies/renames).

This patches gets us closer to that by moving the check for
non-existent source later in the function. Now there are no more
checks for "src" and "dst" in the first loop; all the filtering of
invalid copies is done in the second loop. The code also looks much
more consistent now.

No measureable impact on hg debugpathcopies 4.0 4.8. That shouldn't
be surprising since the only case we're doing more checks now is in
case of chained copies/renames, which are quire rare in practice.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Apr 18 2019, 1:58 PM
martinvonz updated this revision to Diff 14951.Apr 28 2019, 3:00 AM
martinvonz updated this revision to Diff 14972.Apr 29 2019, 6:52 PM
This revision was automatically updated to reflect the committed changes.