This is an archive of the discontinued Mercurial Phabricator instance.

revlog: don't say "not found" on internal error
ClosedPublic

Authored by martinvonz on May 7 2018, 12:55 PM.

Details

Summary

If index_node() returned NULL, then index_find_node() and and
nt_partialmatch() used to return -2 to signal that the node was not
found. However, we were passing in a revnum to index_node() that we
knew should exist, so the only reason it could return NULL was due to
some internal error or perhaps out of memory. Let's not use "not
found" for these cases. I suppose we never noticed this because these
error never happen in practice.

I think there are more places where we should error out instead of
reporting that the node was not found, but the cases mentioned above
were all I cared about right now (because using the same error code
for all failures simplified some future patches).

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

martinvonz created this revision.May 7 2018, 12:55 PM
This revision was automatically updated to reflect the committed changes.