bundle: avoid repo.lookup() for converting revnum to nodeid
Differential Revision: https://phab.mercurial-scm.org/D3048
push: avoid using repo.lookup() for converting to nodeid
repo.lookup(x) currently simply does repo[x].node(), which supports
various types of inputs. As I explained in
0194dac77c93 (scmutil: add
method for looking up a context given a revision symbol, 2018-04-02),
I'd like to split that up so we use the new scmutil.revsymbol() for
string inputs repo[x] for integer revnums and binary nodeids. Since
repo.lookup() seems to exist in order to serve peer.lookup(), I think
it should be calling revsymbol. However, we have several callers that
use repo.lookup() with something that's not a string, so we need to
remove those first. This patch starts doing that. Many more will
follow.
Differential Revision: https://phab.mercurial-scm.org/D3047
addremove: pass command-level similarity value down to scmutil.addremove()
Since we've changed to carry a similarity value by opts dict, it makes sense
to leave a string '0'-'100' value unmodified.
setup: add overlooked hgext.infinitepush package declaration
Will fix infinitepush tests that have been failing when run without --local.
Differential Revision: https://phab.mercurial-scm.org/D3038
tests: remove dependence on repo.changectx()
This was one of few remaining uses of repo.changectx() in core.
Differential Revision: https://phab.mercurial-scm.org/D3036
log: remove dependence on repo.changectx()
This was one of few remaining uses of repo.changectx() in core.
Differential Revision: https://phab.mercurial-scm.org/D3035
verify: remove dependence on repo.changectx()
This was one of few remaining uses of repo.changectx() in core.
Differential Revision: https://phab.mercurial-scm.org/D3034
bookmarks: switch from repo.changectx('.') to repo['.']
The two forms are synonymous and the new form is by far the more
common form.
Differential Revision: https://phab.mercurial-scm.org/D3033
stringutil: add function to pretty print an object
This is inspired by the pprint() module/function (which we can't
use because the output is different on Python 2 and 3 - namely the
use of b'' literals).
We hook it up to `hg debugwireproto` for printing the response to
a wire protocol command.
This foreshadows future peer work, which will support decoding
CBOR responses into rich data structures.
Differential Revision: https://phab.mercurial-scm.org/D2987
wireproto: add frame flag to denote payloads as CBOR
We may eventually want a separate frame type for this. But for
now this is the easiest to implement.
Differential Revision: https://phab.mercurial-scm.org/D2986