Summary: The "function name" is unicode in Python 3. Put unicode as the dict keys.
Reviewed By: farnz
Differential Revision: D19615814
fbshipit-source-id: 3508f59d11e4f8ab6345c80c6bdfaff150a63d76
Summary: Some assertions were added to make sure paths are unicode.
Reviewed By: farnz
Differential Revision: D19615813
fbshipit-source-id: 7d2135c0ac424fc46edd9d660b072a2a95be7f82
Summary:
Changegroup should be using bytes mostly except when it tries to access
files via `repo.file(path)`. The `path` should be unicode on Python 3.
Make it happen. Some assertions are added to help capture issues.
Reviewed By: farnz
Differential Revision: D19615835
fbshipit-source-id: b35d13152ecb835092c7870e88383f484dc5f868
Summary:
The bundle2 layer uses bytes since it's part of the wireprotocol.
Some assertions were added to help detecting issues.
Reviewed By: farnz
Differential Revision: D19615832
fbshipit-source-id: 73ea657b501c7539b17862165c7a5781884013a2
Summary: The layer interacting with raw manifest text should use bytes.
Reviewed By: farnz
Differential Revision: D19613694
fbshipit-source-id: c5a12235eb50acd90e409c1059a3f9f11665f9f3
Summary: Use native unicode hostname without converting it to bytes.
Reviewed By: farnz
Differential Revision: D19613692
fbshipit-source-id: 0bd7e37890b96566143fb0501c3fa310270844d3
Summary:
Like revlog, the changelog layer should use bytes for parsing its raw content.
`str` is still used for users, messages, etc.
Reviewed By: markbt
Differential Revision: D19613695
fbshipit-source-id: 4f6758f9fca0788bc89ad5c14d9103f66d19b7f2
Summary:
Bookmarks use unicode by default. Only need to use bytes when interacting with
vfs.
Reviewed By: farnz
Differential Revision: D19613689
fbshipit-source-id: bbe80e552cf17a023e5905f849a273b4b4299dc5
Summary: The patchtext is about a binary patch. It should use bytes.
Reviewed By: farnz
Differential Revision: D19613688
fbshipit-source-id: 20bddeb17f520f625396b23b5dcead7c7bbd3ede
Summary:
Make sure file content and wireproto buffers are using bytes.
Added a utf8 helper function.
Reviewed By: farnz
Differential Revision: D19613686
fbshipit-source-id: 5d67ce48246dc8c3cc47041f461e454c46bc67f9
Summary:
We want to assume almost all paths are unicode and drop support for non-unicode
paths. `os.fsencode` returns bytes that breaks the assumption.
Change fsencode and fsdecode to do nothing so path types remain unicode.
Most use-cases are related to `__file__`, which is already unicode on Python 3.
`posix._checklink` uses it. But it seems making it no-op is okay.
Reviewed By: farnz
Differential Revision: D19613693
fbshipit-source-id: 587dbeef68b23beeaf6bc8861c71ea27b3c512d7
Summary: Those will simplify some use-cases.
Reviewed By: farnz
Differential Revision: D19613121
fbshipit-source-id: 85ac4fa0c86afb84e0c9fb78950d3da2c93aa967
Summary: The raw blobs are in bytes, while paths and other things are in native string.
Reviewed By: markbt
Differential Revision: D19613122
fbshipit-source-id: e865168b5bc839e85ef843d771d8a6044e35a03a
Summary:
The commit message should be in native string. The raw file content is bytes.
Add translation for that.
Reviewed By: xavierd
Differential Revision: D19613117
fbshipit-source-id: 1b4145f0de75e48df3416cd7c52c09df1e6c4a07
Summary: Like filelog, the remotefilelog layer should use bytes.
Reviewed By: xavierd
Differential Revision: D19613119
fbshipit-source-id: c8221ac21dc255ad0a837b2bb30fa9966df95390
Summary: Like revlog, the filelog layer should use bytes.
Reviewed By: sfilipco
Differential Revision: D19613116
fbshipit-source-id: 6b07d05a6960c2d1c8b4ebe3001632fd8024c5af
Summary: The revlog layer should use bytes.
Reviewed By: sfilipco
Differential Revision: D19613120
fbshipit-source-id: 09f0028cbf810b52694643c79c91997d434cdaf5
Summary:
On Python 2 we want bytes.encode("utf-8") to be no-op, while on Python 3 we
want it to return a real `str`. This helper function does that.
Reviewed By: sfilipco
Differential Revision: D19613118
fbshipit-source-id: 1f0fc31bf8aee28cc20694da52b10b12dbdd9000
Summary:
Set up the `cpython-ext` and `hgcommands` libraries so that they can compile
against py2 and py3 versions of rust-cpython. Make py2 the default so
that cargo test still works.
Reviewed By: singhsrb
Differential Revision: D19615656
fbshipit-source-id: 3403e7077deb3c0a9dfe0e3b7d4f4ad1da73bba3
Summary: In both py2 and py3 stdout is text mode.
Reviewed By: simpkins
Differential Revision: D19613397
fbshipit-source-id: fe01363836cb5956c7e6d83a0f81488649c262a9
Summary:
The config functions takes Str (ie: bytes in Python2, Unicode in Python3), the
b is uncessary.
Reviewed By: sfilipco
Differential Revision: D19611274
fbshipit-source-id: 0807bd6aed1b5bd0baa0b78d3dfcbb9c46aeff35
Summary: All of these should just plain strings.
Reviewed By: sfilipco
Differential Revision: D19611275
fbshipit-source-id: 1d16c10df6f67cee9dadd7480c40950c0abae926
Summary:
Most of these tests use `file` instead of `open` for opening files, which is removed in Python 3. And when we open files in byte mode, Python disallows writing `str` into such files, so we add `b` prefix to write actual bytes instead.
There are some other minor problems like reading from `sys.stdin` gives you `str` while expecting `bytes`. The solution is to use `sys.stdin.buffer` instead. However, Python 2 does not have `sys.stdin.buffer` so we have to do a version check to provide compatibility.
Reviewed By: quark-zju
Differential Revision: D19606357
fbshipit-source-id: e9177134294f03af8b581230a57902c3435b319a
Summary:
We want all config values to always be `str` types, so remove this explicit
`encode()` call that was trying to convert the value to `bytes`.
Reviewed By: sfilipco
Differential Revision: D19610590
fbshipit-source-id: a72f0755cdb12cae13fb9d58f529433d508d46e9
Summary:
For empty repos, some versions of dulwich return a non-`None` `FetchPackResult`
where `bool(result)` throws an exception. Handle this by explicitly checking
for `result.refs` being `None`, too.
Reviewed By: sfilipco
Differential Revision: D19611221
fbshipit-source-id: 094e3ec667a484a150eb75596684a120528159e9
Summary: this pyre-ignore got lost in translation and caused pyre eden to fail
Reviewed By: sfilipco, mitrandir77, xavierd
Differential Revision: D19610997
fbshipit-source-id: b21faa36ee6b45585a774402d081bb7a3b8731b4
Summary:
Update the Rust hgcommands code to pass the command line arguments into the
Python logic as `Str` types, so that this will be Unicode `str` objects when
using Python 3.
Reviewed By: xavierd
Differential Revision: D19596739
fbshipit-source-id: 7cdfd44a1c4ce8b0f86d20b634d9b27eab822b2d
Summary:
Several of the debug commands explicitly defined their command names as bytes.
Remove the leading `b` prefix so that all command names are uniformly `str`
data types.
Reviewed By: DurhamG, sfilipco
Differential Revision: D19596738
fbshipit-source-id: 3851a32c38009968dfa338877b9ae03015dfca61
Summary: Use pycompat unicode instead of python 2 built in unicode to check type.
Reviewed By: mitrandir77
Differential Revision: D19589969
fbshipit-source-id: 3e3cf2c5cb6fd90cca9c8f803e7bd45f262f96e5
Summary: The input of minirst will be unicode, therefore, remove the b prefix.
Reviewed By: sfilipco
Differential Revision: D19610028
fbshipit-source-id: d3b1ebfeb1ba5a30afe250ce5713857dd9ebc359
Summary: The later is deprecated since python 2.6, and the former works in python3
Reviewed By: simpkins
Differential Revision: D19608560
fbshipit-source-id: c9e45bbc51f0e20416c2640dfc25e4cac4934152
Summary: The fallback filename handling can be utf8 under py3
Reviewed By: sfilipco
Differential Revision: D19610624
fbshipit-source-id: a86ed958edca70597ff5a7c67cbc746c1e325518