This is an archive of the discontinued Mercurial Phabricator instance.

rebase: remove unnecessary and incorrect handling of nullid
ClosedPublic

Authored by martinvonz on Apr 5 2018, 1:46 PM.

Details

Summary

We used to write a nullid as hex to the rebase state file and
interpret it as the "todo" state (value -1). However, when reading it,
we compared the string value to (binary) nullid, which would of course
not match. AFAICT, it still worked because when the read nodeid did
not match nullid (which, again, it didn't), we'd use the normal path
which did repo[<hex nullid>].rev(), and that also happens to return
-1. It seems to have been this way ever since 9972758ab4c5 (rebase:
handle revtodo as a special value when storing/restoring state,
2014-12-02).

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 5 2018, 1:46 PM
quark accepted this revision.Apr 5 2018, 1:55 PM
quark added a subscriber: quark.

Hmm... maybe just remove it.

martinvonz edited the summary of this revision. (Show Details)Apr 5 2018, 2:02 PM
martinvonz retitled this revision from rebase: fix explicit handling of nullid in rebase state to rebase: remove unnecessary and incorrect handling of nullid.
martinvonz updated this revision to Diff 7742.
In D3140#50376, @quark wrote:

Hmm... maybe just remove it.

Done.

pulkit accepted this revision.Apr 5 2018, 3:07 PM
This revision was automatically updated to reflect the committed changes.