revsymbol: stop delegating to repo.__getitem__ for unhandled symbols (API)
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.
Differential Revision: https://phab.mercurial-scm.org/D3196
$ hg init
$ echo "added file1" > file1
$ echo "added file2" > file2
$ hg add file1 file2
$ hg commit -m "added file1 and file2"
$ echo "changed file1" >> file1
$ hg commit -m "changed file1"
$ hg -q log
1:08a16e8e4408
0:d29c767a4b52
$ hg id
08a16e8e4408 tip
$ hg update -C 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg id
d29c767a4b52
$ echo "changed file1" >> file1
$ hg id
d29c767a4b52+
$ hg revert --all
reverting file1
$ hg diff
$ hg status
? file1.orig
$ hg id
d29c767a4b52
$ hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg diff
$ hg status
? file1.orig
$ hg id
08a16e8e4408 tip
$ hg update -C 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo "changed file1" >> file1
$ hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg diff
$ hg status
? file1.orig
$ hg id
08a16e8e4408 tip
$ hg revert --all
$ hg diff
$ hg status
? file1.orig
$ hg id
08a16e8e4408 tip
$ hg revert -r tip --all
$ hg diff
$ hg status
? file1.orig
$ hg id
08a16e8e4408 tip
$ hg update -C
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg diff
$ hg status
? file1.orig
$ hg id
08a16e8e4408 tip