Page MenuHomePhabricator

rust-revlog: a trait for the revlog index
ClosedPublic

Authored by gracinet on Jan 6 2020, 2:25 PM.

Details

Summary

As explained in the doc comment, this is the minimum needed
for our immediate concern, which is to implement a nodemap
in Rust.

The trait will be later implemented in hg-cpython by the
index Python object implemented in C, thanks to exposition
of the corresponding functions as a capsule.

The None return cases in node() match what the index_node()
C function does.

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

gracinet created this revision.Jan 6 2020, 2:25 PM

The None return cases in node() match what the index_node()
C function does.

You mean the code on https://www.mercurial-scm.org/repo/hg/file/fdaa4233dc18/mercurial/cext/revlog.c#l388? Line 394 there returns nullid, so does that really match? Why not return the nullid when given nullrev as input?

martinvonz requested changes to this revision.Jan 21 2020, 1:03 PM
This revision now requires changes to proceed.Jan 21 2020, 1:03 PM

@martinvonz yeah, probably wrote the doc-comment too fast

Of course it's meant to match what revlog.c does, since the first implementation willl actually be re-exposure of the C version

gracinet updated this revision to Diff 19629.Jan 27 2020, 10:49 AM
martinvonz accepted this revision.Jan 27 2020, 1:24 PM
This revision is now accepted and ready to land.Jan 27 2020, 1:24 PM
This revision was automatically updated to reflect the committed changes.