This is an archive of the discontinued Mercurial Phabricator instance.

revlog: don't use slicing to return parents
ClosedPublic

Authored by indygreg on Dec 26 2017, 7:35 PM.

Details

Summary

This is the only place we use a slice on index entries, which
are currently tuples. In preparation for moving away from tuples,
let's stop using slices so we don't have to implement that support
on the new type.

We also tweak the logic slightly so the exception only catches the
IndexError on the index lookup, not on the index entry lookup. The
old code should never have been buggy. But it was semantically wrong.

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

indygreg created this revision.Dec 26 2017, 7:35 PM
yuja accepted this revision.Jan 5 2018, 12:48 AM
This revision is now accepted and ready to land.Jan 5 2018, 12:48 AM
This revision was automatically updated to reflect the committed changes.