This is an archive of the discontinued Mercurial Phabricator instance.

revsymbol: stop delegating to repo.__getitem__ for unhandled symbols (API)
ClosedPublic

Authored by martinvonz on Apr 8 2018, 1:04 PM.

Details

Summary

The only remaining cases where we were delegating unhandled symbols to
repo.getitem should now be when the symbol could not be found. In
that case we just delegated to repo.getitem for the error
message. Let's just copy the error message instead.

If there were any cases where we got e.g. a binary nodeid or an
integer revnum into revsymbol() (e.g. via repo.lookup()), we'd now
start raising an exception instead. That is why this is marked (API).

This affects one test case, but the new behavior seems better to me. I
can't tell if the old behavior was desired or if the test was just
there to document how it happened to work.

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.