Commit Graph

31114 Commits

Author SHA1 Message Date
Augie Fackler
03a50eb15f revlog: use bytes() to ensure text from _chunks is a reasonable type 2017-03-12 03:32:38 -04:00
Augie Fackler
58dedd9fd0 revlog: extract first byte of revlog with a slice so it's portable 2017-03-12 00:49:49 -05:00
Augie Fackler
9d7c26df45 revsetlang: slice out single bytes instead of indexing
For portability with Python 3.
2017-03-12 00:46:59 -05:00
Augie Fackler
b4f8ffef60 lock: use %d to format integer into a bytestring 2017-03-12 03:29:04 -04:00
Augie Fackler
ef815f4375 parser: use %d instead of %s for interpolating error position
Error position is an int, so we should use %d instead of %s. Fixes
failures on Python 3.
2017-03-12 00:44:59 -05:00
Augie Fackler
949dee72f1 manifest: unbreak pure-python manifest parsing on Python 3 2017-03-12 00:44:21 -05:00
Augie Fackler
d214daa434 context: use portable construction to verify int parsing 2017-03-12 00:43:47 -05:00
Augie Fackler
5e07b24e52 ui: portably bytestring-ify url object 2017-03-12 01:59:23 -05:00
Augie Fackler
edad90c687 scmutil: fix key generation to portably bytestringify integer 2017-03-12 00:47:39 -05:00
Augie Fackler
9c70a09b17 branchmap: stringify int in a portable way
We actually need a bytes in Python 3, and thanks to our nasty source
loader this will portably do the right thing.
2017-03-12 00:42:46 -05:00
Augie Fackler
0c31289213 branchmap: don't use buffer() on Python 3
This is certainly slower than the Python 2 code, but it works, and we
can revisit it later if it's a problem.
2017-03-12 00:49:19 -05:00
Augie Fackler
9a15a28705 py3: use bytearray() instead of array('c', ...) constructions
Portable from 2.6-3.6.
2017-03-12 03:32:21 -04:00
Augie Fackler
b9f0d10d43 summary: don't explicitly str() something we're about to %s
str() is wrong on Python 3 here, and %s implicitly calls str() anyway,
so this was just extra dancing for no reason.
2017-03-11 20:58:26 -05:00
Augie Fackler
d44c41fe19 context: implement both __bytes__ and __str__ for Python 3
They're very similar, for obvious reasons.
2017-03-11 20:57:40 -05:00
Augie Fackler
89600a72c4 context: work around long not existing on Python 3
I can't figure out what this branch is even trying to accomplish, and
it was introduced in 387a3aa50d61 which doesn't really shed any
insight into why longs are treated differently from ints.
2017-03-11 20:57:04 -05:00
Augie Fackler
f080be2c20 phases: explicitly evaluate list returned by map
On Python 3 map() returns a generator, which bool()s to true even if
it had an empty input set. Work around this by using list() on the
map() result.
2017-03-11 20:53:20 -05:00
Augie Fackler
6ba88e41e4 ui: check for --debugger in sys.argv using r-string to avoid bytes on py3
Our source loader was errantly turning this --debugger into a bytes,
which was then causing me to still get a pager when I was using the
debugger on py3. That made life hard.
2017-03-11 20:51:09 -05:00
Pulkit Goyal
f34f53b9de minirst: use bytes.strip instead of str.strip
bytes.strip exists in Python 2.6 and Python 2.7 also.
2017-03-12 22:46:57 +05:30
Pulkit Goyal
48edb15e9c smcposix: pass unicode as first argument to array.array
This is an instance where we can safely convert the first argument, rest are
the cases except one where we are using 'c' which is not there in Python 3. So
that needs to be handled differently. This will help in making `hg help` run on
Python 3.
2017-03-12 22:27:53 +05:30
Pulkit Goyal
7deacd3d03 util: pass encoding.[encoding|encodingmode] as unicodes
We need to pass str to encode() and decode().
2017-03-12 07:35:13 +05:30
Pierre-Yves David
8f0998647c win32text: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:57 -08:00
Pierre-Yves David
9b498a89e0 transplant: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:49 -08:00
Pierre-Yves David
58d5f4561c shelve: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:42 -08:00
Pierre-Yves David
e3931f15fb share: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:30 -08:00
Pierre-Yves David
ec94f0410e mq: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:16 -08:00
Pierre-Yves David
91ebfa657f largefiles: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:52:06 -08:00
Pierre-Yves David
3f8c57e798 keyword: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:57 -08:00
Pierre-Yves David
3cf7472262 journal: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:49 -08:00
Pierre-Yves David
a1d4a95c88 histedit: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:43 -08:00
Pierre-Yves David
d781ee1c04 eol: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:36 -08:00
Pierre-Yves David
db602f5625 convert: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:51:25 -08:00
Pierre-Yves David
dfb3fbad15 test-bundle2-remote-changegroup: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:55 -08:00
Pierre-Yves David
5e62e32b2e subrepo: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:47 -08:00
Pierre-Yves David
197ab7aeb0 repair: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:39 -08:00
Pierre-Yves David
98f81e8c4f merge: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:32 -08:00
Pierre-Yves David
de20776881 hg-mod: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:24 -08:00
Pierre-Yves David
d47e9585d6 commands: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:17 -08:00
Pierre-Yves David
80b1f7c309 cmdutil: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:09 -08:00
Pierre-Yves David
b71c55108c localrepo: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2016-08-05 14:29:22 +02:00
Pulkit Goyal
077cba9952 minirst: make encoding.encoding unicodes to pass into encode() and decode() 2017-03-12 07:09:18 +05:30
Pulkit Goyal
bd7d2c3f64 minirst: make regular expressions bytes 2017-03-12 06:59:37 +05:30
Gregory Szorc
ebff74a01c setup: convert setupversion to unicode
Something deep in the bowels of distutils expects "version" passed to
setup() to be a str/unicode. So, convert the type.

This still works on Python 2 because the string is ascii and an
implicit coercion back to str/bytes should work without issue. If
it does cause problems, we can always make the unicode conversion
dependent on running Python 3.

This change makes `python3.5 setup.py install` work.
2017-03-11 17:14:02 -08:00
Mads Kiilerich
6cbae57046 util: add debugstacktrace depth limit
Useful when you don't care about the start of the stack, but only want to see
the last entries.
2015-01-14 01:15:26 +01:00
Mads Kiilerich
97ac40d793 util: strip trailing newline from debugstacktrace message
This makes the function more convenient to use as drop-in replacement for
ui.write & co.
2015-01-16 04:26:40 +01:00
Mads Kiilerich
e5c197b9ce tests: rework util.debugstacktrace tests
Prepare for adding another test.
2015-01-16 04:26:40 +01:00
Mads Kiilerich
30045d0a29 vfs: use repo.vfs.rename 2017-03-11 11:04:14 -08:00
Mads Kiilerich
975c19c195 vfs: use repo.vfs.unlinkpath 2017-03-11 11:02:25 -08:00
Mads Kiilerich
01ac38526d merge: use repo.wvfs.unlinkpath 2015-01-14 01:15:26 +01:00
Mads Kiilerich
a936a7f3a7 vfs: use repo.wvfs.unlinkpath 2015-01-14 01:15:26 +01:00
Augie Fackler
f3d54c952b policy: try and always have a bytes for module policy
debuginstall now runs cleanly in Python 3.
2017-03-08 18:11:41 -05:00