Wed, 15 Mar 2017 09:32:18 -0700 py3: make py3 compat.iterbytestr simpler and faster
Martin von Zweigbergk <martinvonz@google.com> [Wed, 15 Mar 2017 09:32:18 -0700] rev 31425
py3: make py3 compat.iterbytestr simpler and faster With Python 3.4.3, timit says 11.9 usec-> 6.44 usec. With Python 3.6.0, timeit says 14.1 usec -> 9.55 usec.
Wed, 15 Mar 2017 09:30:50 -0700 py3: optimize py3 compat.bytechr using Struct.pack
Martin von Zweigbergk <martinvonz@google.com> [Wed, 15 Mar 2017 09:30:50 -0700] rev 31424
py3: optimize py3 compat.bytechr using Struct.pack With Python 3.4.3, timeit says 0.437 usec -> 0.0685 usec. With Python 3.6, timeit says 0.157 usec -> 0.0907 usec. So it's faster on both versions, but the speedup varies a lot. Thanks to Gregory Szorc for the suggestion.
Wed, 15 Mar 2017 19:26:20 -0700 tests: properly drop back to root dir in test-status.t
Ryan McElroy <rmcelroy@fb.com> [Wed, 15 Mar 2017 19:26:20 -0700] rev 31423
tests: properly drop back to root dir in test-status.t
Thu, 16 Mar 2017 09:00:27 +0530 dirstate: use list comprehension to get a list of keys
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 16 Mar 2017 09:00:27 +0530] rev 31422
dirstate: use list comprehension to get a list of keys We have used dict.keys() which returns a dict_keys() object instead of list on Python 3. So this patch replaces that with list comprehension which works both on Python 2 and 3.
Thu, 16 Mar 2017 08:03:51 +0530 match: slice over bytes to get the byteschr instead of ascii value
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 16 Mar 2017 08:03:51 +0530] rev 31421
match: slice over bytes to get the byteschr instead of ascii value
Thu, 16 Mar 2017 07:52:47 +0530 match: make regular expression bytes to prevent TypeError
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 16 Mar 2017 07:52:47 +0530] rev 31420
match: make regular expression bytes to prevent TypeError
Thu, 16 Mar 2017 06:32:33 +0530 scmutil: make function name bytes in class filecache
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 16 Mar 2017 06:32:33 +0530] rev 31419
scmutil: make function name bytes in class filecache func.__name__ returns unicodes and this leads to keyerror when we try to do filecache[''] by passing bytes.
Wed, 15 Mar 2017 00:27:17 -0700 localrepo: deprecate 'wfile'
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 00:27:17 -0700] rev 31418
localrepo: deprecate 'wfile' The method had very few users and the modern form is shorter. So let us deprecates another method of the localrepo class.
Wed, 15 Mar 2017 00:31:59 -0700 eol: use 'wvfs' instead of 'wfile'
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 00:31:59 -0700] rev 31417
eol: use 'wvfs' instead of 'wfile' Method is about to be deprecated and the modern form is shorter.
Wed, 15 Mar 2017 00:29:09 -0700 localrepo: use 'wvfs' instead of 'wfile'
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 00:29:09 -0700] rev 31416
localrepo: use 'wvfs' instead of 'wfile' Method is about to be deprecated and the modern form is shorter.
Wed, 15 Mar 2017 00:28:58 -0700 tagmerge: use 'wvfs' instead of 'wfile'
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 00:28:58 -0700] rev 31415
tagmerge: use 'wvfs' instead of 'wfile' Method is about to be deprecated and the modern form is shorter.
Wed, 15 Mar 2017 00:28:21 -0700 gpg: use 'wvfs' instead of 'wfile'
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 00:28:21 -0700] rev 31414
gpg: use 'wvfs' instead of 'wfile' Method is about to be deprecated and the modern form is shorter.
Wed, 28 Dec 2016 23:42:50 +0100 test: add a basic 'test-check-pylint.t'
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 28 Dec 2016 23:42:50 +0100] rev 31413
test: add a basic 'test-check-pylint.t' We add a minimal check using pylint for one case we knows we care about: "mutable default" argument. We'll likely extend this over time to cover other useful checks but this is a good starting point.
Tue, 14 Mar 2017 23:50:07 -0700 localrepo: don't use mutable default argument value
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 14 Mar 2017 23:50:07 -0700] rev 31412
localrepo: don't use mutable default argument value Caught by pylint.
Tue, 14 Mar 2017 23:49:25 -0700 httpclient: don't use mutable default argument value
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 14 Mar 2017 23:49:25 -0700] rev 31411
httpclient: don't use mutable default argument value Caught by pylint.
Tue, 14 Mar 2017 23:49:10 -0700 largefiles: don't use mutable default argument value
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 14 Mar 2017 23:49:10 -0700] rev 31410
largefiles: don't use mutable default argument value Caught by pylint.
Tue, 14 Mar 2017 23:48:25 -0700 hgk: don't use mutable default argument value
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 14 Mar 2017 23:48:25 -0700] rev 31409
hgk: don't use mutable default argument value Caught by pylint.
Tue, 14 Mar 2017 23:48:08 -0700 convert: don't use mutable default argument value
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 14 Mar 2017 23:48:08 -0700] rev 31408
convert: don't use mutable default argument value Caught by pylint.
Tue, 14 Mar 2017 23:46:48 -0700 mq: don't use mutable default argument value
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 14 Mar 2017 23:46:48 -0700] rev 31407
mq: don't use mutable default argument value Caught by pylint.
Mon, 13 Mar 2017 21:43:17 -0700 pager: if old pager extensions is enabled, respect pager.attend
Martin von Zweigbergk <martinvonz@google.com> [Mon, 13 Mar 2017 21:43:17 -0700] rev 31406
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.
Mon, 13 Mar 2017 21:42:59 -0700 tests: duplicate test for pager for old extension and for in-core pager
Martin von Zweigbergk <martinvonz@google.com> [Mon, 13 Mar 2017 21:42:59 -0700] rev 31405
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.
Tue, 14 Mar 2017 08:51:35 -0700 util: make strdate's defaults default value a dict
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 14 Mar 2017 08:51:35 -0700] rev 31404
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.
Wed, 15 Mar 2017 14:51:18 +0530 py3: open file in rb mode
Rishabh Madan <rishabhmadan96@gmail.com> [Wed, 15 Mar 2017 14:51:18 +0530] rev 31403
py3: open file in rb mode
Tue, 14 Mar 2017 13:10:30 -0700 debuglabelcomplete: fix to call debugnamecomplete in new location
Kyle Lippincott <spectral@google.com> [Tue, 14 Mar 2017 13:10:30 -0700] rev 31402
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.
Mon, 13 Mar 2017 13:06:37 -0700 tests: prove that `hg init` works with Python 3
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Mar 2017 13:06:37 -0700] rev 31401
tests: prove that `hg init` works with Python 3 The previous patch made `hg init` work!
Mon, 13 Mar 2017 12:16:47 -0700 pycompat: custom implementation of urllib.parse.quote()
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Mar 2017 12:16:47 -0700] rev 31400
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.
Mon, 13 Mar 2017 12:14:17 -0700 pycompat: alias urllib symbols directly
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Mar 2017 12:14:17 -0700] rev 31399
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.
Mon, 13 Mar 2017 13:08:11 -0700 tests: clean up bad extension
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Mar 2017 13:08:11 -0700] rev 31398
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.
Mon, 13 Mar 2017 18:16:42 -0700 perf: perform a garbage collection before each iteration
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Mar 2017 18:16:42 -0700] rev 31397
perf: perform a garbage collection before each iteration Currently, no explicit garbage collection is performed when running the microbenchmarks in `hg perf`. I think this is wrong because garbage collection can have a significant impact on execution times. And, if gc is triggered via the default heuristics, it will fire effectively randomly during subsequent benchmark iterations due to variable amount of garbage left over from previous runs. Running a gc before invoking the measured function will help ensure state is more consistent across all iterations.
Mon, 13 Mar 2017 18:31:29 -0700 formatter: support json formatting of long type
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Mar 2017 18:31:29 -0700] rev 31396
formatter: support json formatting of long type By luck, we appear to not pass any long instances into the JSON formatter. I suspect this will change with all the Python 3 porting work. Plus I have another series that will convert some ints to longs that triggers this.
Sun, 12 Mar 2017 21:56:39 -0700 rebase: don't use mutable default argument value
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 12 Mar 2017 21:56:39 -0700] rev 31395
rebase: don't use mutable default argument value
Sun, 12 Mar 2017 21:55:46 -0700 mq: don't use mutable default argument value
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 12 Mar 2017 21:55:46 -0700] rev 31394
mq: don't use mutable default argument value
Sun, 12 Mar 2017 21:54:32 -0700 util: don't use mutable default argument value
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 12 Mar 2017 21:54:32 -0700] rev 31393
util: don't use mutable default argument value I don't think this is any tight loops and we'd need to worry about PyObject creation overhead. Also, I'm pretty sure strptime() will be much slower than PyObject creation (date parsing is surprisingly slow).
Sun, 12 Mar 2017 21:53:03 -0700 match: don't use mutable default argument value
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 12 Mar 2017 21:53:03 -0700] rev 31392
match: don't use mutable default argument value There shouldn't be a big perf hit creating a new object because this function is complicated and does things that dwarf the cost of creating a new PyObject.
Sun, 12 Mar 2017 21:52:17 -0700 hgweb: don't use mutable default argument value
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 12 Mar 2017 21:52:17 -0700] rev 31391
hgweb: don't use mutable default argument value
Mon, 26 Dec 2016 16:55:47 -0700 hgweb: don't use mutable default argument value
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Dec 2016 16:55:47 -0700] rev 31390
hgweb: don't use mutable default argument value
Mon, 26 Dec 2016 16:54:33 -0700 filemerge: don't use mutable default argument value
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Dec 2016 16:54:33 -0700] rev 31389
filemerge: don't use mutable default argument value
Sun, 12 Mar 2017 21:50:42 -0700 context: don't use mutable default argument value
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 12 Mar 2017 21:50:42 -0700] rev 31388
context: don't use mutable default argument value Mutable default argument values are a Python gotcha and can represent subtle, hard-to-find bugs. Lets rid our code base of them.
Mon, 13 Mar 2017 11:19:24 -0700 heads: enable pager
Martin von Zweigbergk <martinvonz@google.com> [Mon, 13 Mar 2017 11:19:24 -0700] rev 31387
heads: enable pager
Mon, 13 Mar 2017 11:03:59 -0700 branches: enable pager
Martin von Zweigbergk <martinvonz@google.com> [Mon, 13 Mar 2017 11:03:59 -0700] rev 31386
branches: enable pager
Sun, 12 Mar 2017 17:16:43 -0700 py3: fix slicing of bytes in revset.formatspec()
Yuya Nishihara <yuya@tcha.org> [Sun, 12 Mar 2017 17:16:43 -0700] rev 31385
py3: fix slicing of bytes in revset.formatspec()
Sun, 12 Mar 2017 17:13:54 -0700 py3: make set of revset operators and quotes in bytes
Yuya Nishihara <yuya@tcha.org> [Sun, 12 Mar 2017 17:13:54 -0700] rev 31384
py3: make set of revset operators and quotes in bytes
Sun, 12 Mar 2017 17:10:14 -0700 py3: convert set of revset initial symbols back to bytes
Yuya Nishihara <yuya@tcha.org> [Sun, 12 Mar 2017 17:10:14 -0700] rev 31383
py3: convert set of revset initial symbols back to bytes Otherwise tokenize() would fail due to comparison between unicode and bytes.
Sun, 12 Mar 2017 17:04:45 -0700 pycompat: add helper to iterate each char in bytes
Yuya Nishihara <yuya@tcha.org> [Sun, 12 Mar 2017 17:04:45 -0700] rev 31382
pycompat: add helper to iterate each char in bytes
Sun, 12 Mar 2017 19:47:51 -0400 branchmap: fix python 2.6 by using util.buffer() instead of passing bytearray
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 19:47:51 -0400] rev 31381
branchmap: fix python 2.6 by using util.buffer() instead of passing bytearray
Sun, 12 Mar 2017 16:44:01 -0700 rebase: allow rebasing children of wd to wd if a new branch has been set (BC)
Mads Kiilerich <mads@kiilerich.com> [Sun, 12 Mar 2017 16:44:01 -0700] rev 31380
rebase: allow rebasing children of wd to wd if a new branch has been set (BC) The named branch of the leaf changeset can be changed by updating to it, setting the branch, and amending. But previously, there was no good way to *just* change the branch of several linear changes. If rebasing changes with another parent to '.', it would pick up a pending branch change up. But when rebasing changes that have the same parent, it would fail with 'nothing to rebase', even when the branch name was set differently. To fix this, allow rebasing to same parent when a branch has been set.
Sun, 12 Mar 2017 16:41:46 -0700 merge: check current wc branch for 'nothing to merge', not its p1
Mads Kiilerich <mads@kiilerich.com> [Sun, 12 Mar 2017 16:41:46 -0700] rev 31379
merge: check current wc branch for 'nothing to merge', not its p1 The working directory will usually be clean or very clean, and wc will usually have the same branch as its parent. This change will thus usually not make any difference and is done as a separate change to show that. It will be used in a later change.
Sun, 12 Mar 2017 16:26:34 -0700 lock: do not encode result of gethostname on Python 2
Yuya Nishihara <yuya@tcha.org> [Sun, 12 Mar 2017 16:26:34 -0700] rev 31378
lock: do not encode result of gethostname on Python 2 If a hostname contained non-ascii character, str.encode() would first try to decode it to a unicode and raise UnicodeDecodeError.
Sun, 12 Mar 2017 03:33:38 -0400 py3: prove `hg files --rev` works
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 03:33:38 -0400] rev 31377
py3: prove `hg files --rev` works
Sun, 12 Mar 2017 03:37:45 -0400 tests: make a variable for hg binary location in test-check-py3-commands
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 03:37:45 -0400] rev 31376
tests: make a variable for hg binary location in test-check-py3-commands The number of which calls in here is starting to get silly.
Sun, 12 Mar 2017 03:28:50 -0400 lock: encode result of gethostname into a bytestring
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 03:28:50 -0400] rev 31375
lock: encode result of gethostname into a bytestring
Sun, 12 Mar 2017 12:56:12 -0700 config: avoid using a mutable default
Martijn Pieters <mjpieters@fb.com> [Sun, 12 Mar 2017 12:56:12 -0700] rev 31374
config: avoid using a mutable default Nothing *currently* mutates this list, but the moment something does it'll be shared between all config instances. Avoid this eventuality.
Fri, 05 Aug 2016 14:09:04 +0200 localrepo: deprecate 'repo.join' in favor of 'repo.vfs.join'
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 05 Aug 2016 14:09:04 +0200] rev 31373
localrepo: deprecate 'repo.join' in favor of 'repo.vfs.join' localrepo have an insane amount of method. Accessing the feature through the vfs is not really harder and allow us to schedule that method for removal.
Sun, 12 Mar 2017 12:54:11 -0700 pycompat: move imports of cStringIO/io to where they are used
Yuya Nishihara <yuya@tcha.org> [Sun, 12 Mar 2017 12:54:11 -0700] rev 31372
pycompat: move imports of cStringIO/io to where they are used There's no point to import cStringIO as io since we have to select StringIO or BytesIO conditionally.
Sun, 12 Mar 2017 12:17:30 -0700 rbc: empty (and invalid) rbc-names file should give an empty name list
Mads Kiilerich <mads@kiilerich.com> [Sun, 12 Mar 2017 12:17:30 -0700] rev 31371
rbc: empty (and invalid) rbc-names file should give an empty name list An empty file (if it somehow should exist) used to give a list with an empty name. That didn't do any harm, but it was "wrong". Fix that.
Wed, 19 Oct 2016 02:46:35 +0200 rbc: use struct unpack_from and pack_into instead of unpack and pack
Mads Kiilerich <madski@unity3d.com> [Wed, 19 Oct 2016 02:46:35 +0200] rev 31370
rbc: use struct unpack_from and pack_into instead of unpack and pack These functions were introduced in Python 2.5 and are faster and simpler than the old ones ... mainly because we can avoid intermediate buffers: $ python -m timeit -s "_rbcrecfmt='>4sI'" -s 's = "x"*10000' -s 'from struct import unpack' 'unpack(_rbcrecfmt, buffer(s, 16, 8))' 1000000 loops, best of 3: 0.543 usec per loop $ python -m timeit -s "_rbcrecfmt='>4sI'" -s 's = "x"*10000' -s 'from struct import unpack_from' 'unpack_from(_rbcrecfmt, s, 16)' 1000000 loops, best of 3: 0.323 usec per loop $ python -m timeit -s "from array import array" -s "_rbcrecfmt='>4sI'" -s "s = array('c')" -s 's.fromstring("x"*10000)' -s 'from struct import pack' -s "rec = array('c')" 'rec.fromstring(pack(_rbcrecfmt, "asdf", 7))' 1000000 loops, best of 3: 0.364 usec per loop $ python -m timeit -s "from array import array" -s "_rbcrecfmt='>4sI'" -s "s = array('c')" -s 's.fromstring("x"*10000)' -s 'from struct import pack_into' -s "rec = array('c')" -s 'rec.fromstring("x"*100)' 'pack_into(_rbcrecfmt, rec, 0, "asdf", 7)' 1000000 loops, best of 3: 0.229 usec per loop
Sun, 12 Mar 2017 15:27:02 -0400 revlog: use bytes() instead of str() to get data from memoryview
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 15:27:02 -0400] rev 31369
revlog: use bytes() instead of str() to get data from memoryview Fixes `files -v` on Python 3.
Sun, 12 Mar 2017 03:33:22 -0400 util: teach url object about __bytes__
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 03:33:22 -0400] rev 31368
util: teach url object about __bytes__ __str__ tries to do something reasonable, but someone else more familiar with encoding bugs should check my work.
Sun, 12 Mar 2017 03:31:54 -0400 manifest: ensure paths are bytes (not str) in pure parser
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 03:31:54 -0400] rev 31367
manifest: ensure paths are bytes (not str) in pure parser
Sun, 12 Mar 2017 03:30:15 -0400 manifest: now that node.bin is available, use it directly
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 03:30:15 -0400] rev 31366
manifest: now that node.bin is available, use it directly Previously we were getting it through revlog, which is a little unusual.
Sun, 12 Mar 2017 03:29:48 -0400 manifest: use node.bin instead of .decode('hex')
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 03:29:48 -0400] rev 31365
manifest: use node.bin instead of .decode('hex') The latter doesn't work in Python 3.
Sun, 12 Mar 2017 00:43:20 -0500 manifest: add __next__ methods for Python 3
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:43:20 -0500] rev 31364
manifest: add __next__ methods for Python 3 Python 3 renamed .next() in the iterator protocol to __next__().
Sun, 12 Mar 2017 00:51:00 -0500 files: use native string type to load rev opt from dict
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:51:00 -0500] rev 31363
files: use native string type to load rev opt from dict
Sun, 12 Mar 2017 00:50:44 -0500 store: fix many single-byte ops to use slicing in _auxencode
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:50:44 -0500] rev 31362
store: fix many single-byte ops to use slicing in _auxencode
Mon, 13 Mar 2017 04:06:36 +0900 py3: add "b" prefix to string literals related to module policy
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 13 Mar 2017 04:06:36 +0900] rev 31361
py3: add "b" prefix to string literals related to module policy String literals without explicit prefix in __init__.py and policy.py are treated as unicode object on Python3, because these modules are loaded before setup of our specific code transformation (the later module is imported at the beginning of __init__.py). BTW, "modulepolicy" in __init__.py is initialized by "policy.policy". This causes issues below; - checking "policy" value in other modules causes unintentional result For example, "b'py' not in (u'c', u'py')" returns True unintentionally on Python3. - writing "policy" out fails at conversion from unicode to bytes 62939e0148f1 fixed this issue for default code path, but "policy" can be overridden by HGMODULEPOLICY environment variable (it should be rare case for developer using Python3, though). This patch does: - add "b" prefix to all string literals, which are related to module policy, in modules above. - check existence of HGMODULEPOLICY, and overwrite "policy" only if it exists For simplicity, this patch omits checking "supports_bytes_environ", switching os.environ/os.environb, and so on (Yuya agreed this in personal talking)
Sun, 12 Mar 2017 11:47:02 -0700 py3: drop unused aliases to array.array which are replaced with bytearray
Yuya Nishihara <yuya@tcha.org> [Sun, 12 Mar 2017 11:47:02 -0700] rev 31360
py3: drop unused aliases to array.array which are replaced with bytearray
Mon, 13 Mar 2017 00:55:14 +0530 pycompat: default to BytesIO instead of StringIO
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 13 Mar 2017 00:55:14 +0530] rev 31359
pycompat: default to BytesIO instead of StringIO
Sun, 12 Mar 2017 00:48:06 -0500 repoview: specify setattr values as native strings
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:48:06 -0500] rev 31358
repoview: specify setattr values as native strings
Sun, 12 Mar 2017 03:32:38 -0400 revlog: use bytes() to ensure text from _chunks is a reasonable type
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 03:32:38 -0400] rev 31357
revlog: use bytes() to ensure text from _chunks is a reasonable type
Sun, 12 Mar 2017 00:49:49 -0500 revlog: extract first byte of revlog with a slice so it's portable
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:49:49 -0500] rev 31356
revlog: extract first byte of revlog with a slice so it's portable
Sun, 12 Mar 2017 00:46:59 -0500 revsetlang: slice out single bytes instead of indexing
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:46:59 -0500] rev 31355
revsetlang: slice out single bytes instead of indexing For portability with Python 3.
Sun, 12 Mar 2017 03:29:04 -0400 lock: use %d to format integer into a bytestring
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 03:29:04 -0400] rev 31354
lock: use %d to format integer into a bytestring
Sun, 12 Mar 2017 00:44:59 -0500 parser: use %d instead of %s for interpolating error position
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:44:59 -0500] rev 31353
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.
Sun, 12 Mar 2017 00:44:21 -0500 manifest: unbreak pure-python manifest parsing on Python 3
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:44:21 -0500] rev 31352
manifest: unbreak pure-python manifest parsing on Python 3
Sun, 12 Mar 2017 00:43:47 -0500 context: use portable construction to verify int parsing
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:43:47 -0500] rev 31351
context: use portable construction to verify int parsing
Sun, 12 Mar 2017 01:59:23 -0500 ui: portably bytestring-ify url object
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 01:59:23 -0500] rev 31350
ui: portably bytestring-ify url object
Sun, 12 Mar 2017 00:47:39 -0500 scmutil: fix key generation to portably bytestringify integer
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:47:39 -0500] rev 31349
scmutil: fix key generation to portably bytestringify integer
Sun, 12 Mar 2017 00:42:46 -0500 branchmap: stringify int in a portable way
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:42:46 -0500] rev 31348
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.
Sun, 12 Mar 2017 00:49:19 -0500 branchmap: don't use buffer() on Python 3
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 00:49:19 -0500] rev 31347
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.
Sun, 12 Mar 2017 03:32:21 -0400 py3: use bytearray() instead of array('c', ...) constructions
Augie Fackler <augie@google.com> [Sun, 12 Mar 2017 03:32:21 -0400] rev 31346
py3: use bytearray() instead of array('c', ...) constructions Portable from 2.6-3.6.
Sat, 11 Mar 2017 20:58:26 -0500 summary: don't explicitly str() something we're about to %s
Augie Fackler <augie@google.com> [Sat, 11 Mar 2017 20:58:26 -0500] rev 31345
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.
Sat, 11 Mar 2017 20:57:40 -0500 context: implement both __bytes__ and __str__ for Python 3
Augie Fackler <augie@google.com> [Sat, 11 Mar 2017 20:57:40 -0500] rev 31344
context: implement both __bytes__ and __str__ for Python 3 They're very similar, for obvious reasons.
Sat, 11 Mar 2017 20:57:04 -0500 context: work around `long` not existing on Python 3
Augie Fackler <augie@google.com> [Sat, 11 Mar 2017 20:57:04 -0500] rev 31343
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 ac89a23ca814 which doesn't really shed any insight into why longs are treated differently from ints.
Sat, 11 Mar 2017 20:53:20 -0500 phases: explicitly evaluate list returned by map
Augie Fackler <augie@google.com> [Sat, 11 Mar 2017 20:53:20 -0500] rev 31342
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.
Sat, 11 Mar 2017 20:51:09 -0500 ui: check for --debugger in sys.argv using r-string to avoid bytes on py3
Augie Fackler <augie@google.com> [Sat, 11 Mar 2017 20:51:09 -0500] rev 31341
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.
Sun, 12 Mar 2017 22:46:57 +0530 minirst: use bytes.strip instead of str.strip
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 12 Mar 2017 22:46:57 +0530] rev 31340
minirst: use bytes.strip instead of str.strip bytes.strip exists in Python 2.6 and Python 2.7 also.
Sun, 12 Mar 2017 22:27:53 +0530 smcposix: pass unicode as first argument to array.array
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 12 Mar 2017 22:27:53 +0530] rev 31339
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.
Sun, 12 Mar 2017 07:35:13 +0530 util: pass encoding.[encoding|encodingmode] as unicodes
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 12 Mar 2017 07:35:13 +0530] rev 31338
util: pass encoding.[encoding|encodingmode] as unicodes We need to pass str to encode() and decode().
Wed, 08 Mar 2017 16:52:57 -0800 win32text: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:52:57 -0800] rev 31337
win32text: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:52:49 -0800 transplant: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:52:49 -0800] rev 31336
transplant: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:52:42 -0800 shelve: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:52:42 -0800] rev 31335
shelve: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:52:30 -0800 share: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:52:30 -0800] rev 31334
share: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:52:16 -0800 mq: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:52:16 -0800] rev 31333
mq: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:52:06 -0800 largefiles: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:52:06 -0800] rev 31332
largefiles: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:51:57 -0800 keyword: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:51:57 -0800] rev 31331
keyword: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:51:49 -0800 journal: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:51:49 -0800] rev 31330
journal: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:51:43 -0800 histedit: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:51:43 -0800] rev 31329
histedit: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:51:36 -0800 eol: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:51:36 -0800] rev 31328
eol: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:51:25 -0800 convert: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:51:25 -0800] rev 31327
convert: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:53:55 -0800 test-bundle2-remote-changegroup: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:53:55 -0800] rev 31326
test-bundle2-remote-changegroup: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:53:47 -0800 subrepo: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:53:47 -0800] rev 31325
subrepo: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:53:39 -0800 repair: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:53:39 -0800] rev 31324
repair: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:53:32 -0800 merge: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:53:32 -0800] rev 31323
merge: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:53:24 -0800 hg-mod: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:53:24 -0800] rev 31322
hg-mod: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:53:17 -0800 commands: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:53:17 -0800] rev 31321
commands: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Wed, 08 Mar 2017 16:53:09 -0800 cmdutil: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 08 Mar 2017 16:53:09 -0800] rev 31320
cmdutil: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Fri, 05 Aug 2016 14:29:22 +0200 localrepo: directly use repo.vfs.join
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 05 Aug 2016 14:29:22 +0200] rev 31319
localrepo: directly use repo.vfs.join The 'repo.join' method is about to be deprecated.
Sun, 12 Mar 2017 07:09:18 +0530 minirst: make encoding.encoding unicodes to pass into encode() and decode()
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 12 Mar 2017 07:09:18 +0530] rev 31318
minirst: make encoding.encoding unicodes to pass into encode() and decode()
Sun, 12 Mar 2017 06:59:37 +0530 minirst: make regular expressions bytes
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 12 Mar 2017 06:59:37 +0530] rev 31317
minirst: make regular expressions bytes
Sat, 11 Mar 2017 17:14:02 -0800 setup: convert setupversion to unicode
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Mar 2017 17:14:02 -0800] rev 31316
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.
Wed, 14 Jan 2015 01:15:26 +0100 util: add debugstacktrace depth limit
Mads Kiilerich <madski@unity3d.com> [Wed, 14 Jan 2015 01:15:26 +0100] rev 31315
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.
Fri, 16 Jan 2015 04:26:40 +0100 util: strip trailing newline from debugstacktrace message
Mads Kiilerich <madski@unity3d.com> [Fri, 16 Jan 2015 04:26:40 +0100] rev 31314
util: strip trailing newline from debugstacktrace message This makes the function more convenient to use as drop-in replacement for ui.write & co.
Fri, 16 Jan 2015 04:26:40 +0100 tests: rework util.debugstacktrace tests
Mads Kiilerich <madski@unity3d.com> [Fri, 16 Jan 2015 04:26:40 +0100] rev 31313
tests: rework util.debugstacktrace tests Prepare for adding another test.
Sat, 11 Mar 2017 11:04:14 -0800 vfs: use repo.vfs.rename
Mads Kiilerich <mads@kiilerich.com> [Sat, 11 Mar 2017 11:04:14 -0800] rev 31312
vfs: use repo.vfs.rename
Sat, 11 Mar 2017 11:02:25 -0800 vfs: use repo.vfs.unlinkpath
Mads Kiilerich <mads@kiilerich.com> [Sat, 11 Mar 2017 11:02:25 -0800] rev 31311
vfs: use repo.vfs.unlinkpath
Wed, 14 Jan 2015 01:15:26 +0100 merge: use repo.wvfs.unlinkpath
Mads Kiilerich <madski@unity3d.com> [Wed, 14 Jan 2015 01:15:26 +0100] rev 31310
merge: use repo.wvfs.unlinkpath
Wed, 14 Jan 2015 01:15:26 +0100 vfs: use repo.wvfs.unlinkpath
Mads Kiilerich <madski@unity3d.com> [Wed, 14 Jan 2015 01:15:26 +0100] rev 31309
vfs: use repo.wvfs.unlinkpath
Wed, 08 Mar 2017 18:11:41 -0500 policy: try and always have a bytes for module policy
Augie Fackler <raf@durin42.com> [Wed, 08 Mar 2017 18:11:41 -0500] rev 31308
policy: try and always have a bytes for module policy debuginstall now runs cleanly in Python 3.
Wed, 08 Mar 2017 18:11:19 -0500 init: zstd is already python3-ready, so don't run it through our importer
Augie Fackler <raf@durin42.com> [Wed, 08 Mar 2017 18:11:19 -0500] rev 31307
init: zstd is already python3-ready, so don't run it through our importer
Fri, 03 Mar 2017 14:42:56 -0500 config: guard against setconfig specifying unicode values on py3
Augie Fackler <raf@durin42.com> [Fri, 03 Mar 2017 14:42:56 -0500] rev 31306
config: guard against setconfig specifying unicode values on py3 This was leading to some difficult to trace problems because the values were set in one place, but then blew up much later in the program. Exploding violently with an assertion seems reasonable here.
(0) -30000 -10000 -3000 -1000 -120 +120 +1000 +3000 +10000 tip