pager: if old pager extensions is enabled, respect pager.attend
This patch makes us respect pager.attend again if the extension is
enabled. It also brings back the default attend list, so e.g. summary
is not paged by default, just like it used to be before pager was
moved into core.
tests: duplicate test for pager for old extension and for in-core pager
When the old pager extension is enabled, I think we should try to be
as BC as reasonable. To help with that, this patch brings back
test-pager.t as of
65a3b4d67a65 (pager: add a test of --pager=no
functionality, 2017-02-06), but under the name test-pager-legacy.t
However, since the behavior has changed in a few cases (notably by no
longer respecting pager.attend), the file is modified to work with the
current version. We will recover some lost BC in coming patches.
Also, to make sure the in-core pager does not depend on the pager
extension being enabled, this patch disables the extension in
test-pager.t. It turns out that pager.attend-$cmd was only supported
when the pager extension was enabled, so the tests are updated to
reflect that. We will need to decide what to do with these.
util: make strdate's defaults default value a dict
It was specified to be an empty list in
c6adf2be6069 in 2007.
It was correct at the time. But when the function was
refactored in
91bc001a592f (2010), it started expecting a dict.
I guess this code path is untested?
Thanks to Yuya for spotting this.
debuglabelcomplete: fix to call debugnamecomplete in new location
debugnamecomplete was moved in
a9aa67ba from commands to debugcommands, but
debuglabelcomplete was not modified to call it in its new location.
tests: prove that `hg init` works with Python 3
The previous patch made `hg init` work!
pycompat: custom implementation of urllib.parse.quote()
urllib.parse.quote() accepts either str or bytes and returns str.
There exists a urllib.parse.quote_from_bytes() which only accepts
bytes. We should probably use that to retain strong typing and
avoid surprises.
In addition, since nearly all strings in Mercurial are bytes, we
probably don't want quote() returning unicode.
So, this patch implements a custom quote() that only accepts bytes
and returns bytes. The quoted URL should only contain URL safe
characters which is a strict subset of ASCII. So
`.encode('ascii', 'strict')` should be safe.
pycompat: alias urllib symbols directly
urllib.request imports a bunch of symbols from other urllib
modules. We should map to the original symbols not the
re-exported ones because this is more correct. Also, it
will prevent an import of urllib.request if only one of
the lower-level symbols/modules is needed.
tests: clean up bad extension
The presence of the "babar" extension breaks subsequent tests.
So delete the file and create an empty one to return the config
to sanity.