This is an archive of the discontinued Mercurial Phabricator instance.

revlog: make pure version of _partialmatch() support 40-byte hex nodeids
ClosedPublic

Authored by martinvonz on Apr 25 2018, 12:38 PM.

Details

Summary

Without this patch, test-histedit-arguments.t would fail when run with
--pure. It turned out to be because the pure version of
_partialmatch() does not support full 40-byte hex nodeids. When
histedit's instructions include things like "pick tip", it resolves
the "tip" revision early to a full nodeid (but plain hex nodeid
prefixes are not resolved to full nodeids). Then the nodeid (full or
not) is looked up using to a full nodeid later. This step is what
fails in pure mode. It has been failing since my c4131138eadb
(histedit: look up partial nodeid as partial nodeid, 2018-04-06). I
haven't verified, but I suspect histedit instructions like "pick <full
hex nodeid>" would have been failing before my commit too, though.

The fix is trivial: change a "< 40" to "<= 40".

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

martinvonz created this revision.Apr 25 2018, 12:38 PM
durin42 accepted this revision.Apr 25 2018, 12:51 PM
This revision is now accepted and ready to land.Apr 25 2018, 12:51 PM
This revision was automatically updated to reflect the committed changes.