Wed, 08 Mar 2017 22:48:26 +0900 pycompat: add bytestr wrapper which mostly acts as a Python 2 str
Yuya Nishihara <yuya@tcha.org> [Wed, 08 Mar 2017 22:48:26 +0900] rev 31448
pycompat: add bytestr wrapper which mostly acts as a Python 2 str This allows us to handle bytes in mostly the same manner as Python 2 str, so we can get rid of ugly s[i:i + 1] hacks: s = bytestr(s) while i < len(s): c = s[i] ... This is the simpler version of the previous RFC patch which tried to preserve the bytestr type if possible. New version simply drops the bytestr wrapping so we aren't likely to pass a bytestr to a function that expects Python 3 bytes.
Wed, 08 Mar 2017 22:13:32 +0900 tests: allow running doctests selectively on Python 3
Yuya Nishihara <yuya@tcha.org> [Wed, 08 Mar 2017 22:13:32 +0900] rev 31447
tests: allow running doctests selectively on Python 3 Currently most doctests fail on Python 3, but I want to add some.
Wed, 15 Mar 2017 15:33:24 -0700 context: explicitly tests for None
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 15:33:24 -0700] rev 31446
context: explicitly tests for None Changeset 9e57033fec0c removed the mutable default value, but did not explicitly tested for None. Such implicit testing can introduce semantic and performance issue. We move to an explicit testing for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations
Wed, 15 Mar 2017 15:11:52 -0700 filemerge: explicitly tests for None
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 15:11:52 -0700] rev 31445
filemerge: explicitly tests for None Changeset 758526333dec removed the mutable default value, but did not explicitly tested for None. Such implicit testing can introduce semantic and performance issue. We move to an explicit testing for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations
Wed, 15 Mar 2017 15:11:04 -0700 hgweb: explicitly tests for None
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 15:11:04 -0700] rev 31444
hgweb: explicitly tests for None Changeset 7dafa8d0e006 removed the mutable default value, but did not explicitly tested for None. Such implicit testing can introduce semantic and performance issue. We move to an explicit testing for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations
Wed, 15 Mar 2017 15:10:09 -0700 hgweb: explicitly tests for None in webutil
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 15:10:09 -0700] rev 31443
hgweb: explicitly tests for None in webutil Changeset d2878bec55bd removed the mutable default value, but did not explicitly tested for None. Such implicit testing can introduce semantic and performance issue. We move to an explicit testing for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations
Wed, 15 Mar 2017 15:08:45 -0700 match: explicitly tests for None
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 15:08:45 -0700] rev 31442
match: explicitly tests for None Changeset 6168d4b93634 removed the mutable default value, but did not explicitly tested for None. Such implicit testing can introduce semantic and performance issue. We move to an explicit testing for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations
Wed, 15 Mar 2017 15:05:54 -0700 mq: explicitly tests for None
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 15:05:54 -0700] rev 31441
mq: explicitly tests for None Changeset fd3d8eb7f545 removed the mutable default value, but did not explicitly tested for None. Such implicit testing can introduce semantic and performance issue. We move to an explicit testing for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations
Wed, 15 Mar 2017 15:03:43 -0700 rebase: explicitly tests for None
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Wed, 15 Mar 2017 15:03:43 -0700] rev 31440
rebase: explicitly tests for None Changeset 361bccce566a removed the mutable default value, but did not explicitly tested for None. Such implicit checking can introduce semantic and performance issue. We move to an explicit check for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations
Thu, 16 Mar 2017 04:53:23 +0530 py3: use iter() instead of iterkeys()
Rishabh Madan <rishabhmadan96@gmail.com> [Thu, 16 Mar 2017 04:53:23 +0530] rev 31439
py3: use iter() instead of iterkeys()
Fri, 05 Aug 2016 14:15:45 +0200 localrepo: deprecated '_link'
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 05 Aug 2016 14:15:45 +0200] rev 31438
localrepo: deprecated '_link' That method had a total on 1 internal user... G: changed mercurial/localrepo.py
Fri, 05 Aug 2016 14:19:31 +0200 localrepo: use self.wvfs.islink directly
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 05 Aug 2016 14:19:31 +0200] rev 31437
localrepo: use self.wvfs.islink directly We are about to deprecate the helper function.
Thu, 16 Mar 2017 10:10:00 +0530 py3: convert opts back to bytes for status
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 16 Mar 2017 10:10:00 +0530] rev 31436
py3: convert opts back to bytes for status
Mon, 13 Mar 2017 17:49:13 -0700 parsers: handle refcounting of "parents" consistently
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Mar 2017 17:49:13 -0700] rev 31435
parsers: handle refcounting of "parents" consistently Py_None can be refcounted like any other Python object. So do that.
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 31434
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 31433
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 31432
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 31431
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 31430
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 31429
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 31428
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 31427
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 31426
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 31425
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 31424
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 31423
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 31422
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 31421
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 31420
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 31419
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 31418
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 31417
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 31416
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 31415
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 31414
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 31413
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 31412
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 31411
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 31410
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 31409
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 31408
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 31407
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 31406
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 31405
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 31404
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 31403
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 31402
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 31401
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.
(0) -30000 -10000 -3000 -1000 -300 -100 -48 +48 +100 +300 +1000 +3000 +10000 tip