This is an archive of the discontinued Mercurial Phabricator instance.

bundlerepo: don't insert index tuples with full nodes as linkrev
ClosedPublic

Authored by joerg.sonnenberger on Oct 6 2020, 9:26 PM.

Details

Summary

The index format has a documented format and latter changes will start
to enforce the field types. The bundlerepo uses full nodes for the
linkrev field when it should be using revision numbers. Use the link
mapping to resolve them, except in the special case of self-references.
Those are actually indications of a missing linkrev.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

bundlerepo: don't insert index tuples with full nodes as linkrev

Can you update the commit message to explain why? It might also be good to have a comment in the code (it's not clear to me why it's sometimes fine to have linkrev pointing to nullrev).

martinvonz requested changes to this revision.Oct 27 2020, 7:44 PM
This revision now requires changes to proceed.Oct 27 2020, 7:44 PM

The index has a documented format, but it wasn't enforced so far. With the pending child review, that would change. The case of cs==node is seen when we send full changesets in the bundle. In that case we used to leak the full node id into the index.

joerg.sonnenberger edited the summary of this revision. (Show Details)Nov 2 2020, 5:05 PM
joerg.sonnenberger updated this revision to Diff 23405.
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.