packaging: split downloading code into own module
As we will introduce more code to support packaging, it will be
useful to have download code in its own module.
Differential Revision: https://phab.mercurial-scm.org/D6084
packaging: establish hgpackaging package
Previously, contrib/packaging behaved as a root to a
package directory and we had a "packagingutil" module. As I
work more on packaging code, we'll want to have more code
shared between different packaging tools. I think it makes
sense to have a single package containing multiple modules
than multiple top-level modules.
This commit establishes an "hgpackaging" package by moving
the existing packagingutil code to it.
Differential Revision: https://phab.mercurial-scm.org/D6083
py3: use % instead of .format() on a bytestring
Differential Revision: https://phab.mercurial-scm.org/D6112
py3: use r'' for group name arguments to MatchObjects in phabricator.py
MatchObject group names are strings, not bytes. Using bytes in py3 leads to an
IndexError.
Differential Revision: https://phab.mercurial-scm.org/D6111
py3: use %d instead of %s when formatting an int into a byte string
Differential Revision: https://phab.mercurial-scm.org/D6110
py3: only pass unicode to json.dumps in writediffproperties
Differential Revision: https://phab.mercurial-scm.org/D6109
py3: fix a few "dict keys as str instead of bytes" issues in phabricator.py
Differential Revision: https://phab.mercurial-scm.org/D6108
py3: convert URL to str before passing it to request
Differential Revision: https://phab.mercurial-scm.org/D6106
py3: convert indexes into bytes when enumerating lists in urlencodenested
Otherwise it'll try to insert them them into a %s slot in a b'' later and fail.
Differential Revision: https://phab.mercurial-scm.org/D6105
py3: don't try and format a bare dict into a byte string in callconduit
Differential Revision: https://phab.mercurial-scm.org/D6104
py3: use fsencode for vcr recording paths and strings for custom_patches args
This fixes phabricator.py's vcrcommand under py3
Differential Revision: https://phab.mercurial-scm.org/D6102
phabricator: convert conduit response JSON unicode to bytes inside callconduit
Previously the byte conversion was happening piecemeal in callers, and in the
case of createdifferentialrevision not at all, leading to UnicodeEncodeErrors
when trying to phabsend a commit with a description containing characters not
representable in ascii. (
issue6040)
Remove all the scattered encoding.unitolocal calls and perform it once, inside
callconduit, on the entire response dict recursively before returning it, in
keeping with the strategy of converting at the earliest opportunity. Convert all
keys used on returned object to bytes.
Modify the phabsend tests to test this by adding a € to the commit message of
alpha.
Differential Revision: https://phab.mercurial-scm.org/D6044