context: convert to hex for error message only for 20-byte changeid
Now that 20-byte strings unambiguously mean binary (or a bug), we can
specialize the conversion to hex for that case.
Differential Revision: https://phab.mercurial-scm.org/D3452
context: clarify that only one attempt is made to interpret changeid
We can now tell what type of revision specifier we have just by
looking at it (we no longer attempt to interpret it in one way after
the other -- that's now in scmutil.revsymbol()). Let's clarify this in
the code by swithing to if/elif.
Differential Revision: https://phab.mercurial-scm.org/D3451
context: only bother looking for broken dirstate for 20-byte changeid
If we fail to look up a changeid in changectx.__init__, we check if it
exactly matches any of the dirstate parents, and if it does, we print
a more specific message ("working directory has unknown parent '...'!"
instead of "unknown revision '...'"). The dirstate parents are always
20 bytes, so there's no need to check for a match when the given
changeid is not 20 bytes. (And now that all the other allowed forms of
changeid have been moved out of the constructor, there's no risk that
a changeid that did match a dirstate parent was actually a valid
bookmark.)
Differential Revision: https://phab.mercurial-scm.org/D3450
revset: pass in lookup function to matchany() (
issue5879)
Silly mistake in
f83cb91b052e.
test-hgweb: add test for foo-bar name lookup
This is broken since
f83cb91b052e "revset: pass in lookup function instead
of repo (API)."
context: drop support for looking up context by ambiguous changeid (API)
This removes support for using the changectx constructor (and thereby
repo[x]) for looking up contexts by a stringified int, a namespace key
(e.g. a bookmark), or a partial hex nodeid. This means that
e.g. repo[<hex nodeid>] will now fail even if a bookmark with the same
name exists (which is a good thing IMO). It also means that doing
repo[<non-existent node>] no longer ends up loading namespaces (which
was a surprising side-effect of creating of failing to create a
context object that I recently ran into while debugging something
unrelated to this series).
Differential Revision: https://phab.mercurial-scm.org/D3449
tests: pass parent revision as integer to repo[x] in test-context-metadata.t
Support for looking up by stringified int is going away. It's already
deprecated, but I think I didn't notice this case because the test
case pipes through `grep`.
Differential Revision: https://phab.mercurial-scm.org/D3448