scmutil: introduce shortesthexnodeidprefix()
We have scmutil.resolvehexnodeidprefix() for resolving a prefix to a
full nodeid, so it makes sense to have the inverse method next to
it. For now it just delegates to changelog.shortest(), but it will
soon also make sure it's called on the unfiltered repo, to match
resolvehexnodeidprefix().
Note that the change in show.py also makes it so the conversion from
revnum to nodeid is done on the filtered repo, but that should be
inconsequential since the revs are all from the filtered repo anyway.
Differential Revision: https://phab.mercurial-scm.org/D3370
scmutil: use resolvehexnodeidprefix() from revsymbol()
I should have copied this from changectx.__init__ into in
35b34202dd3b
(context: handle partial nodeids in revsymbol(), 2018-04-08).
Differential Revision: https://phab.mercurial-scm.org/D3310
scmutil: rename resolvepartialhexnodeid() to resolvehexnodeidprefix()
I'm going to wrap revlog.shortest() in scmutil. I plan on calling it
shortesthexnodeidprefix(). resolvehexnodeidprefix() matches that
better. Also, "prefix" carries more information than "partial".
Differential Revision: https://phab.mercurial-scm.org/D3309
scmutil: document that isrevsymbol() raises on ambiguous node prefix
Differential Revision: https://phab.mercurial-scm.org/D3308
context: set stack level for deprecation warning
This patch makes the deprecation warning print the caller of
repo.__getitem__. That's not quite correct, since there could also be
other callers of changectx.__init__, but it seems like the most
helpful stack level in practice.
Differential Revision: https://phab.mercurial-scm.org/D3307
util: set correct stack level on deprecation warnings
Without this patch, you'll get something like this:
<path>/mercurial/util.py:3784: DeprecationWarning: 'util.hgexecutable'
is deprecated, use 'utils.procutil.hgexecutable'
(but on one line)
Differential Revision: https://phab.mercurial-scm.org/D3331
revset: pass in lookup function instead of repo (API)
And document that it's only for legacy lookup. If we have a repo, we're
likely to do more things where that shouldn't be done.
revset: drop support for posttreebuilthook() (API)
AFAIK, the only user was the directaccess extension, which is in core now.