revset: add larger test for heads(ancestors(…))
It is important to not regress on this benchmark so we move it into the "base"
file. And we add another benchmark with more than two revisions.
revset-benchmark: use a generic revset to test `heads(commonancestors())`
This allow to benchmark revset performance in other repositories than just
the mercurial one.
revlog: reintroduce `revlog.descendant` as deprecated
Reintroduce `revlog.descendant` to help extensions authors update their
extensions in order to use the new API.
context: reintroduce `ctx.descendant` as deprecated
Reintroduce `ctx.descendant` to help extensions authors update their
extensions in order to use the new API.
obsolete: explode if metadata contains invalid UTF-8 sequence (API)
The current metadata API can be a source of bugs since it forces callers to
process encoding conversion by themselves. So let's make it reject bad data
as a last ditch. I assume there's no metadata field which is supposed to store
arbitrary BLOB like transplant_source.
obsolete: store user name and note in UTF-8 (
issue5754) (BC)
Before, user names were stored in local encoding and transferred across
repositories, which made it impossible to restore non-ASCII user names on
different platforms. This patch fixes new markers to be encoded in UTF-8
and decoded back to local encoding when displaying. Existing markers are
unfixable so they may result in mojibake.
I don't like the API that requires metadata dict to be UTF-8 encoded, which
is a source of bugs, but there's no abstraction layer to process the encoding
thingy efficiently. So we apply the same rule as extras dict to obsstore
metadata.
revset: special case commonancestors(none()) to be empty set
This matches the behavior of ancestor(none()).
From an implementation perspective, ancestor() and commonancestors() are
intersection, and ancestors() is union, so it would make some sense that
commonancestors(none()) returned all revisions. However, ancestor(none())
isn't implemented as such, which breaks ancestor(x) == max(commonancestors(x)).
From a user perspective, ancestors of nothing is nothing whichever type
of operation the ancestor predicate does.