Thu, 10 Oct 2019 03:49:33 +0200 pathcopies: give up any optimization based on `introrev`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 10 Oct 2019 03:49:33 +0200] rev 43198
pathcopies: give up any optimization based on `introrev` Between 8a0136f69027 and d98fb3f42f33, we sped up the search for the introduction revision during path copies. However, further checking show that finding the introduction revision is still expensive and that we are better off without it. So we simply drop it and only rely on the linkrev optimisation. I ran `perfpathcopies` on 6989 pair of revision in the pypy repository (`hg perfhelper-pathcopies`. The result is massively in favor of dropping this condition. The result of the copy tracing are unchanged. Attempt to use a smaller changes preserving linkrev usage were unsuccessful, it can return wrong result. The following changesets broke test-mv-cp-st-diff.t - if not f.isintroducedafter(limit): + if limit >= 0 and f.linkrev() < limit: return None Here are various numbers (before this changeset/after this changesets) source destination before after saved-time ratio worth cases e66f24650daf 695dfb0f493b 1.062843 1.246369 -0.183526 1.172675 c979853a3b6a 8d60fe293e79 1.036985 1.196414 -0.159429 1.153743 22349fa2fc33 fbb1c9fd86c0 0.879926 1.038682 -0.158756 1.180420 682b98f3e672 a4878080a536 0.909952 1.063801 -0.153849 1.169074 5adabc9b9848 920958a93997 0.993622 1.147452 -0.153830 1.154817 worse 1% dbfbfcf077e9 aea8f2fd3593 1.016595 1.082999 -0.066404 1.065320 worse 5% c95f1ced15f2 7d29d5e39734 0.453694 0.471156 -0.017462 1.038488 worse 10% 3e144ed1d5b7 2aef0e942480 0.035140 0.037535 -0.002395 1.068156 worse 25% 321fc60db035 801748ba582a 0.009267 0.009325 -0.000058 1.006259 median 2088ce763fc2 e6991321d78b 0.000665 0.000651 0.000014 0.978947 best 25% 915631a97de6 385b31354be6 0.040743 0.040363 0.000380 0.990673 best 10% ad495c36a765 19c10384d3e7 0.431658 0.411490 0.020168 0.953278 best 5% d13ae7d283ae 813c99f810ac 1.141404 1.075346 0.066058 0.942126 best 1% 81593cb4a496 99ae11866969 1.833297 0.063823 1.769474 0.034813 best cases c3b14617fbd7 743a0fcaa4eb 1101.811740 2.735970 1099.075770 0.002483 c3b14617fbd7 9ba6ab77fd29 1116.753953 2.800729 1113.953224 0.002508 058b99d6e81f 57e249b7a3ea 1246.128485 3.042762 1243.085723 0.002442 9a8c361aab49 0354a250d371 1253.111894 3.085796 1250.026098 0.002463 442dbbc53c68 3ec1002a818c 1261.786294 3.138607 1258.647687 0.002487 As one can see, the average case is not really impacted. However, the worth case we get after this changeset are much better than the one we had before it. We have 30 pairs where improvements are above 10 minutes. This reflect in the combined time for all pairs before: 26256s after: 1300s (-95%) If we remove these pathological 30 cases, we still see a significant improvements: before: 1631s after: 1245s (-24%)
Tue, 08 Oct 2019 04:28:23 -0400 perf: introduce a `--contains` flag to the `perfdirstate` command
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 04:28:23 -0400] rev 43197
perf: introduce a `--contains` flag to the `perfdirstate` command The new flag benchmark a large amount of `filepath in dirstate` call. This will be useful to compare the Python and Rust implementation of the dirstatemap.
Tue, 08 Oct 2019 04:23:04 -0400 perf: introduce a `--iteration` to `perfdirstate`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 04:23:04 -0400] rev 43196
perf: introduce a `--iteration` to `perfdirstate` This flag benchmark an iteration over all the file in the dirstate. This will be useful to compare the Python and the Rust implementation of the dirstate.
Sun, 13 Oct 2019 00:15:36 -0400 tests: open file in binary mode in test-upgrade-repo.t
Matt Harbison <matt_harbison@yahoo.com> [Sun, 13 Oct 2019 00:15:36 -0400] rev 43195
tests: open file in binary mode in test-upgrade-repo.t Otherwise the file sizes printed in the output diverge from other platforms. Differential Revision: https://phab.mercurial-scm.org/D7081
Sat, 12 Oct 2019 22:21:51 -0400 hghave: use a native string to invoke the `black` command
Matt Harbison <matt_harbison@yahoo.com> [Sat, 12 Oct 2019 22:21:51 -0400] rev 43194
hghave: use a native string to invoke the `black` command Windows can't create a process based on bytes. Apparently only the output test in `matchoutput` wants bytes. Differential Revision: https://phab.mercurial-scm.org/D7080
Sat, 12 Oct 2019 22:22:17 -0400 py3: convert cwd to native string when running `fix`
Matt Harbison <matt_harbison@yahoo.com> [Sat, 12 Oct 2019 22:22:17 -0400] rev 43193
py3: convert cwd to native string when running `fix` This prevents a bunch of failures on Windows. Differential Revision: https://phab.mercurial-scm.org/D7079
Fri, 11 Oct 2019 18:56:59 -0700 format: format commands.py, which recently regressed
Martin von Zweigbergk <martinvonz@google.com> [Fri, 11 Oct 2019 18:56:59 -0700] rev 43192
format: format commands.py, which recently regressed # skip-blame just reformatting Differential Revision: https://phab.mercurial-scm.org/D7064
Fri, 04 Oct 2019 19:36:21 +0100 py3: fix test-bad-extension expectations for py35
Ian Moody <moz-ian@perix.co.uk> [Fri, 04 Oct 2019 19:36:21 +0100] rev 43191
py3: fix test-bad-extension expectations for py35 ModuleNotFoundError was introduced in 3.6, so the tests need to expect to see ImportError with 3.5. Differential Revision: https://phab.mercurial-scm.org/D7063
Sun, 06 Oct 2019 16:57:26 +0100 phabricator: add addremoved and addmodified functions
Ian Moody <moz-ian@perix.co.uk> [Sun, 06 Oct 2019 16:57:26 +0100] rev 43190
phabricator: add addremoved and addmodified functions These are relatively simple so add them together. As the name indicates, these add phabchange objects for removed and modified files to the phabdiff. Differential Revision: https://phab.mercurial-scm.org/D7049
Sun, 06 Oct 2019 15:37:13 +0100 phabricator: add makebinary and addoldbinary functions
Ian Moody <moz-ian@perix.co.uk> [Sun, 06 Oct 2019 15:37:13 +0100] rev 43189
phabricator: add makebinary and addoldbinary functions These populate the phabchange with the data for a binary file, much as maketext does for text files. Differential Revision: https://phab.mercurial-scm.org/D7048
Sun, 06 Oct 2019 15:16:47 +0100 phabricator: add the uploadfile function
Ian Moody <moz-ian@perix.co.uk> [Sun, 06 Oct 2019 15:16:47 +0100] rev 43188
phabricator: add the uploadfile function This is needed to be able to submit binary files such as images in commits (and also non-UTF-8 text files). One of the primary disadvantages of the current use of createrawdiff is that Phabricator simply drops any binary diffs included in the patch, but not the files, so if such a diff is then committed it corrupts any binary files in it. Differential Revision: https://phab.mercurial-scm.org/D7047
Sun, 06 Oct 2019 15:04:54 +0100 phabricator: add the uploadchunks function
Ian Moody <moz-ian@perix.co.uk> [Sun, 06 Oct 2019 15:04:54 +0100] rev 43187
phabricator: add the uploadchunks function Differential Revision: https://phab.mercurial-scm.org/D7046
Sun, 06 Oct 2019 14:54:46 +0100 phabricator: add the maketext function
Ian Moody <moz-ian@perix.co.uk> [Sun, 06 Oct 2019 14:54:46 +0100] rev 43186
phabricator: add the maketext function This add the diff data for a text file to a phabchange. Differential Revision: https://phab.mercurial-scm.org/D7045
Sun, 06 Oct 2019 14:53:03 +0100 phabricator: add the phabdiff data structure
Ian Moody <moz-ian@perix.co.uk> [Sun, 06 Oct 2019 14:53:03 +0100] rev 43185
phabricator: add the phabdiff data structure This holds all the data about a commit, and is passed to the differential.creatediff API. Differential Revision: https://phab.mercurial-scm.org/D7044
Sun, 06 Oct 2019 14:08:03 +0100 phabricator: add the phabchange data structure
Ian Moody <moz-ian@perix.co.uk> [Sun, 06 Oct 2019 14:08:03 +0100] rev 43184
phabricator: add the phabchange data structure These store data about individual files in a commit. Differential Revision: https://phab.mercurial-scm.org/D7043
Sun, 06 Oct 2019 13:55:04 +0100 phabricator: add the phabhunk data structure
Ian Moody <moz-ian@perix.co.uk> [Sun, 06 Oct 2019 13:55:04 +0100] rev 43183
phabricator: add the phabhunk data structure These store the actual diff data (for UTF-8 text files anyway) and are equivalent to hunks in a patch file. Differential Revision: https://phab.mercurial-scm.org/D7042
Sun, 06 Oct 2019 13:50:32 +0100 phabricator: add the DiffChangeType and DiffFileType constants
Ian Moody <moz-ian@perix.co.uk> [Sun, 06 Oct 2019 13:50:32 +0100] rev 43182
phabricator: add the DiffChangeType and DiffFileType constants These are used in Phabricator change objects. There are more values but so far as I can tell we don't need them. Differential Revision: https://phab.mercurial-scm.org/D7041
Sun, 06 Oct 2019 03:30:00 -0400 help: adding a help category to narrow and remotefilelog commands
Rodrigo Damazio <rdamazio@google.com> [Sun, 06 Oct 2019 03:30:00 -0400] rev 43181
help: adding a help category to narrow and remotefilelog commands Differential Revision: https://phab.mercurial-scm.org/D6998
Sun, 15 Sep 2019 17:02:31 +0900 rust-cpython: drop self.borrow_mut() in favor of PySharedRef wrapper
Yuya Nishihara <yuya@tcha.org> [Sun, 15 Sep 2019 17:02:31 +0900] rev 43180
rust-cpython: drop self.borrow_mut() in favor of PySharedRef wrapper
Sun, 15 Sep 2019 16:59:50 +0900 rust-cpython: drop self.leak_immutable() in favor of PySharedRef wrapper
Yuya Nishihara <yuya@tcha.org> [Sun, 15 Sep 2019 16:59:50 +0900] rev 43179
rust-cpython: drop self.leak_immutable() in favor of PySharedRef wrapper
Sun, 15 Sep 2019 16:50:48 +0900 rust-cpython: add safe wrapper representing shared data borrowed from PyObject
Yuya Nishihara <yuya@tcha.org> [Sun, 15 Sep 2019 16:50:48 +0900] rev 43178
rust-cpython: add safe wrapper representing shared data borrowed from PyObject PySharedRef is a tempoary wrapper around PySharedRefCell. It provides safe functions for each shared data. $shared_accessor implements a safe method to construct PySharedRefCell. This allows us to add more than once PySharedRefCell to a Python object.
Sun, 08 Sep 2019 20:26:55 +0900 rust-cpython: move $leaked struct out of macro
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Sep 2019 20:26:55 +0900] rev 43177
rust-cpython: move $leaked struct out of macro It wasn't easy to hack the $leaked struct since errors in macro would generate lots of compile errors. Let's make it a plain struct so we can easily extend it. PyLeakedRef keeps a more generic PyObject instead of the $name struct since it no longer has to call any specific methods implemented by the $name class. $leaked parameter in py_shared_iterator!() is kept for future change.
Sun, 15 Sep 2019 16:04:45 +0900 rust-cpython: store leaked reference to PySharedState in $leaked struct
Yuya Nishihara <yuya@tcha.org> [Sun, 15 Sep 2019 16:04:45 +0900] rev 43176
rust-cpython: store leaked reference to PySharedState in $leaked struct I want to move it out of the macro, and allow multiple sharable objects per PyObject.
Tue, 17 Sep 2019 07:59:25 +0900 rust-cpython: mark PySharedState as Sync so &'PySharedState can be Send
Yuya Nishihara <yuya@tcha.org> [Tue, 17 Sep 2019 07:59:25 +0900] rev 43175
rust-cpython: mark PySharedState as Sync so &'PySharedState can be Send The goal is to store &'static PySharedState in $leaked struct, which allows us to move the $leaked struct out of the macro. Currently, it depends on inner.$data_member(py), which can't be generalized. PySharedState is Sync because any mutation or read operation is synchronized by the Python GIL, py: Python<'a>, which should guarantee that &'PySharedState can be sent to another thread.
Sat, 14 Sep 2019 23:17:19 +0900 rust-cpython: move borrow_mut() to PySharedRefCell
Yuya Nishihara <yuya@tcha.org> [Sat, 14 Sep 2019 23:17:19 +0900] rev 43174
rust-cpython: move borrow_mut() to PySharedRefCell PySharedRefCell() will host almost all py_shared public functions. This change is the first step. borrow_mut() can be safely implemented since PySharedRefCell knows its inner object is managed by its own py_shared_state.
Sat, 14 Sep 2019 23:01:51 +0900 rust-cpython: move py_shared_state to PySharedRefCell object
Yuya Nishihara <yuya@tcha.org> [Sat, 14 Sep 2019 23:01:51 +0900] rev 43173
rust-cpython: move py_shared_state to PySharedRefCell object The goal of this series is to encapsulate more "py_shared" thingy and reduce the size of the macro, which is hard to debug. Since py_shared_state manages the borrowing state of the object owned by PySharedRefCell, this change makes more sense. If a PyObject has more than one data to be leaked into Python world, each PySharedState should incref the parent PyObject, and keep track of the corresponding borrowing state.
Thu, 10 Oct 2019 21:37:12 +0200 py3: decode username and password before SMTP login
Denis Laxalde <denis@laxalde.org> [Thu, 10 Oct 2019 21:37:12 +0200] rev 43172
py3: decode username and password before SMTP login smtplib.SMTP.login() requires str on Python 3. For 'password', we only need to decode when value comes from config as getpass() returns the correct type already.
Thu, 10 Oct 2019 21:30:44 +0200 py3: use socket.makefile() instead of dropped smtplib.SSLFakeFile
Denis Laxalde <denis@laxalde.org> [Thu, 10 Oct 2019 21:30:44 +0200] rev 43171
py3: use socket.makefile() instead of dropped smtplib.SSLFakeFile The latter (undocumented internal) class got removed in Python 3.3. Use socket.makefile() as suggested: https://docs.python.org/3/whatsnew/3.3.html#porting-python-code
Thu, 10 Oct 2019 21:05:34 +0200 py3: call SMTP.docmd() with an str
Denis Laxalde <denis@laxalde.org> [Thu, 10 Oct 2019 21:05:34 +0200] rev 43170
py3: call SMTP.docmd() with an str Otherwise, this always returns (502, '5.5.2 Error: command not recognized').
Thu, 10 Oct 2019 21:00:13 +0200 py3: call SMTP.has_extn() with an str
Denis Laxalde <denis@laxalde.org> [Thu, 10 Oct 2019 21:00:13 +0200] rev 43169
py3: call SMTP.has_extn() with an str Passing a bytes on Python 3 always returns False, thus starttls is not properly detected.
Thu, 10 Oct 2019 20:27:34 +0200 py3: fix sorting of obsolete markers when building bundle
Denis Laxalde <denis@laxalde.org> [Thu, 10 Oct 2019 20:27:34 +0200] rev 43168
py3: fix sorting of obsolete markers when building bundle Last item of marker tuple (parents) is either None or tuple. Comparison thus fails on Python 3 with: TypeError: '<' not supported between instances of 'tuple' and 'NoneType' Fixing this by coercing None to the empty tuple when sorting markers in exchange._getbundleobsmarkerpart().
Thu, 10 Oct 2019 04:34:58 +0200 sidedata: rename the configuration option to `exp-use-side-data`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 10 Oct 2019 04:34:58 +0200] rev 43167
sidedata: rename the configuration option to `exp-use-side-data` We don't want setup configured to use the final version that would end using the experimental one while using and older version. Differential Revision: https://phab.mercurial-scm.org/D7040
Thu, 10 Oct 2019 16:02:47 +0200 py3: drop ui.flush() during interactive patch filtering
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 16:02:47 +0200] rev 43166
py3: drop ui.flush() during interactive patch filtering With previous changeset fixing line buffering on stdout, this is no longer needed.
Thu, 10 Oct 2019 16:00:02 +0200 py3: keep stdout as defined by pycompat in procutil
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 16:00:02 +0200] rev 43165
py3: keep stdout as defined by pycompat in procutil According to https://docs.python.org/3/library/functions.html#open, it's not possible to use 1 as buffering argument value in binary mode. This is probably why line buffering does not work well in python3. On the other hand, sys.stdout.buffer appears to be line-buffered already on python3. So by not replacing it, there should be no behavior change. This fixes buffering issue in "hg email" (confirmation prompt shown before information to be confirmed).
Mon, 07 Oct 2019 21:21:16 -0400 notify: cast hash to bytes
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 07 Oct 2019 21:21:16 -0400] rev 43164
notify: cast hash to bytes This is needed to avoid a str/bytes mismatch when interpolating a line or 2 later. Differential Revision: https://phab.mercurial-scm.org/D7021
Sat, 05 Oct 2019 13:39:35 -0700 push: support config option to require revs be specified when running push
Kyle Lippincott <spectral@google.com> [Sat, 05 Oct 2019 13:39:35 -0700] rev 43163
push: support config option to require revs be specified when running push Differential Revision: https://phab.mercurial-scm.org/D6989
Thu, 10 Oct 2019 11:33:33 +0200 py3-discovery: using plain str in stats dict
Georges Racinet <georges.racinet@octobus.net> [Thu, 10 Oct 2019 11:33:33 +0200] rev 43162
py3-discovery: using plain str in stats dict rust-cpython converts automatically from Rust strings to the appropriate `str` for the target Python version. Insisting on discovery stats dict keys to be bytes hence breaks the process (this is spotted by test-setdiscovery.t). Now that byteify-strings has been run on the entire codebase, and the import transformer is not there any more, the simplest fix is to make the keys plain str again. Another possible fix would be to forcefully convert to bytes in rust-cpython code, but that feels less natural, and would probably have to be reverted down the road. Differential Revision: https://phab.mercurial-scm.org/D7039
Thu, 10 Oct 2019 04:48:31 +0200 perf: fix `perfhelper-mergecopies` report of #changesets
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 10 Oct 2019 04:48:31 +0200] rev 43161
perf: fix `perfhelper-mergecopies` report of #changesets Same as `perfhelper-pathcopies`. The previous computation `<base>::<target>` was wrong, what we actually need is `::<target> - ::<base>`. This is now fixed.
Wed, 02 Oct 2019 18:39:20 -0400 perf: fix `perfhelper-pathcopies` report of #changesets
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 02 Oct 2019 18:39:20 -0400] rev 43160
perf: fix `perfhelper-pathcopies` report of #changesets The previous computation `<base>::<target>` was wrong, what we actually need is `::<target> - ::<base>`. This is now fixed
Thu, 10 Oct 2019 12:22:15 +0200 py3: use integer division in curseschunkselector.printstring()
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 12:22:15 +0200] rev 43159
py3: use integer division in curseschunkselector.printstring() This fixes a crash when scrolling in curses UI when refresh() is called when a float value (namely 'self.firstlineofpadtoprint', taking its value indirectly from 'self.linesprintedtopadsofar').
Thu, 10 Oct 2019 12:20:23 +0200 crecord: drop duplicated set of firstlineofpadtoprint attribute
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 12:20:23 +0200] rev 43158
crecord: drop duplicated set of firstlineofpadtoprint attribute The attribute is already set a couple of lines above, in curseschunkselector.__init__().
Thu, 10 Oct 2019 10:53:13 +0200 patchbomb: use mail.Generator alias for py2/py3 compat
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 10:53:13 +0200] rev 43157
patchbomb: use mail.Generator alias for py2/py3 compat
Thu, 10 Oct 2019 10:48:57 +0200 py3: use email.generator.BytesGenerator in patch.split()
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 10:48:57 +0200] rev 43156
py3: use email.generator.BytesGenerator in patch.split() This fixes test-import.t on python3. We add Generator alias in mail module to handle python2/python3 compatibility.
Thu, 10 Oct 2019 10:03:01 +0200 py3: only flush before prompting during interactive patch filtering
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 10:03:01 +0200] rev 43155
py3: only flush before prompting during interactive patch filtering Follows up on c9093ae8d6c4. It's enough to flush just before each prompt.
Wed, 28 Aug 2019 17:45:18 -0700 py3: add a missing b'' prefix in test extension for chg
Martin von Zweigbergk <martinvonz@google.com> [Wed, 28 Aug 2019 17:45:18 -0700] rev 43154
py3: add a missing b'' prefix in test extension for chg Differential Revision: https://phab.mercurial-scm.org/D7038
Wed, 09 Oct 2019 20:49:58 -0700 fuzz: new target to fuzz jsonescapeu8fast
Augie Fackler <augie@google.com> [Wed, 09 Oct 2019 20:49:58 -0700] rev 43153
fuzz: new target to fuzz jsonescapeu8fast This code just feels complicated enough we should go ahead and give it a dedicated fuzzer: we've found bugs in similar things before. Differential Revision: https://phab.mercurial-scm.org/D7034
Wed, 09 Oct 2019 20:49:39 -0700 fuzz: new fuzzer for fncache-related functions
Augie Fackler <augie@google.com> [Wed, 09 Oct 2019 20:49:39 -0700] rev 43152
fuzz: new fuzzer for fncache-related functions Not all of these are strictly fncache-related, but they all have th same signature and similar-enough behavior that we may as well fuzz them together. No obvious bugs for once, but these felt like they were just complicated enough to cover. Differential Revision: https://phab.mercurial-scm.org/D7033
Wed, 09 Oct 2019 20:49:23 -0700 fuzz: exercise a little more revlog code
Augie Fackler <augie@google.com> [Wed, 09 Oct 2019 20:49:23 -0700] rev 43151
fuzz: exercise a little more revlog code Differential Revision: https://phab.mercurial-scm.org/D7032
Wed, 09 Oct 2019 20:48:12 -0700 fuzz: new fuzzer for dirs.c
Augie Fackler <augie@google.com> [Wed, 09 Oct 2019 20:48:12 -0700] rev 43150
fuzz: new fuzzer for dirs.c This found a six-year-old bug immediately, and then I put it through a few CPU-days of time before sending it. Differential Revision: https://phab.mercurial-scm.org/D7031
Tue, 08 Oct 2019 16:18:15 -0400 dirs: fix trivial over-read of input data
Augie Fackler <augie@google.com> [Tue, 08 Oct 2019 16:18:15 -0400] rev 43149
dirs: fix trivial over-read of input data This code, introduced in 8c0a7eeda06d, was intentionally over-reading an input string to avoid getting a shared string object for a one-byte input. Unfortunately with an empty input (like in the case of a fuzzer getting started) this was a trivial over-read and triggered an AddressSanitizer failure. I went out of my way to make sure the code still does the copy-avoidance tricks. I don't think this change will cost us much performance since the one-character strings should be cached aggressively anyway. Differential Revision: https://phab.mercurial-scm.org/D7030
Sun, 06 Oct 2019 23:36:52 -0400 sidedatacopies: deal with upgrading and downgrading to that format
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:52 -0400] rev 43148
sidedatacopies: deal with upgrading and downgrading to that format This is quite useful to test this on real life data. Differential Revision: https://phab.mercurial-scm.org/D6955
Sun, 06 Oct 2019 23:36:51 -0400 sidedatacopies: move various copies related function to the copies modules
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43147
sidedatacopies: move various copies related function to the copies modules We will need to access these logic form the copies module. So we move them from their higher level module to the lower level `copies` module. We cannot use them from their top level module as it would create cycles. Differential Revision: https://phab.mercurial-scm.org/D6954
Wed, 09 Oct 2019 22:59:38 +0200 sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 09 Oct 2019 22:59:38 +0200] rev 43146
sidedatacopies: read rename information from sidedata Repository using the new format now use changeset centric algorithm and read the copies information from the changelog sidedata. Differential Revision: https://phab.mercurial-scm.org/D6953
Thu, 10 Oct 2019 00:06:41 +0200 changelog: make copies related function return None or a valid value
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 10 Oct 2019 00:06:41 +0200] rev 43145
changelog: make copies related function return None or a valid value With the previous code, existing but empty value were not "decoded", leading to the method returning one of `None`, some valid value (`list` or `dict`) or `b''`. On a general basis, not explicitly checking for None is a source of bugs. Having a clean return types will help the side-data copies code in future changesets. Differential Revision: https://phab.mercurial-scm.org/D7037
Thu, 10 Oct 2019 00:01:40 +0200 test: fix zstd related output in pure tests
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 10 Oct 2019 00:01:40 +0200] rev 43144
test: fix zstd related output in pure tests Differential Revision: https://phab.mercurial-scm.org/D7036
Sun, 06 Oct 2019 23:36:51 -0400 sidedatacopies: get and store sidedata in the changelogrevision object
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43143
sidedatacopies: get and store sidedata in the changelogrevision object The object provide a simple way to access changelog entry, we need it to also bear the sidedata value. Since the sidedata are retrieved at the same time as the revision, we can do that without extra cost. Differential Revision: https://phab.mercurial-scm.org/D6951
Sun, 06 Oct 2019 23:36:51 -0400 sidedatacopies: write copies information in sidedata when applicable
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43142
sidedatacopies: write copies information in sidedata when applicable If the format of the repository indicate it stores copies information into changeset's sidedata, then we actually write that information into sidedata at commit time. It will be put to use in later changesets. Currently, we store all field unconditionally, but that is likely to change in the future for the sake of efficiency. Differential Revision: https://phab.mercurial-scm.org/D6950
Sun, 06 Oct 2019 23:36:51 -0400 sidedatacopies: introduce a sidedata testcase for test-copies-in-changeset.t
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43141
sidedatacopies: introduce a sidedata testcase for test-copies-in-changeset.t For now it is equivalent to the filelog case, but introducing this early helps make the comings changesets clearer. Differential Revision: https://phab.mercurial-scm.org/D6949
Sun, 06 Oct 2019 23:36:51 -0400 sidedatacopies: introduce a sidedata testcase for test-copies-unrelated.t
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43140
sidedatacopies: introduce a sidedata testcase for test-copies-unrelated.t For now it is equivalent to the filelog case, but introducing this early helps make the comings changesets clearer. Differential Revision: https://phab.mercurial-scm.org/D6948
Sun, 06 Oct 2019 23:36:51 -0400 sidedatacopies: introduce a sidedata testcase for test-copies.t
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43139
sidedatacopies: introduce a sidedata testcase for test-copies.t For now it is equivalent to the filelog case, but introducing this early helps make the comings changesets clearer. Differential Revision: https://phab.mercurial-scm.org/D6947
Sun, 06 Oct 2019 23:36:51 -0400 sidedatacopies: teach upgrade about the new requirement
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43138
sidedatacopies: teach upgrade about the new requirement The `debugformat` and `debugupgraderepo` command now detect the requirement. (upgrade to and from are not currently possible). Differential Revision: https://phab.mercurial-scm.org/D6946
Sun, 06 Oct 2019 23:36:51 -0400 sidedatacopies: add a new requirement for storing copies into sidedata
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43137
sidedatacopies: add a new requirement for storing copies into sidedata The end goal is to have changesets centric sidedata information stored into changelog sidedata. This make it possible to use the changeset based copy tracing algorithm on any repository without affecting hashes. The actual implementation is coming. The feature is marked as experimental (do not use in production) until we stabilise details about the format. Differential Revision: https://phab.mercurial-scm.org/D6945
Sun, 06 Oct 2019 23:36:51 -0400 debugsidedata: small doc improvement
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43136
debugsidedata: small doc improvement The command has a mode to actually show the sidedata, but it wasn't documented. Differential Revision: https://phab.mercurial-scm.org/D6944
Sun, 06 Oct 2019 23:36:51 -0400 upgrade: allow for `sidedata` removal
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43135
upgrade: allow for `sidedata` removal If the side-date feature is removed, we need to drop them. Differential Revision: https://phab.mercurial-scm.org/D6943
Sun, 06 Oct 2019 23:36:51 -0400 upgrade: allow upgrade to repository using sidedata
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43134
upgrade: allow upgrade to repository using sidedata Repository can now be migrated to support sidedata. More requirements and migration will be needed to actual side-data usage. This is a step in that direction. To test the feature, we leverage the test extension. It make sure the `update` part of the side-data migration actually works. Differential Revision: https://phab.mercurial-scm.org/D6942
Sun, 06 Oct 2019 23:36:51 -0400 revlog: add a way to control sidedata changes during revlog.clone
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43133
revlog: add a way to control sidedata changes during revlog.clone We introduce a new argument to pass a callable dealing with the side data logic. Since the side data are usually associated to higher level logic, the revlog code itself is unlikely to know that to do itself. As a result the higher level upgrade code will be responsible to decide what needs to changes. The lower level revlog.clone just get simple instructions to apply. Differential Revision: https://phab.mercurial-scm.org/D6941
Sun, 06 Oct 2019 23:36:51 -0400 sidedata: use only changegroup3 if sidedata is in use
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43132
sidedata: use only changegroup3 if sidedata is in use This is necessary to exchange the flags over the wire (and within bundles). Differential Revision: https://phab.mercurial-scm.org/D6940
Sun, 06 Oct 2019 23:36:51 -0400 sidedata: apply basic but tight security around exchange
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43131
sidedata: apply basic but tight security around exchange We don't currently have code to deal with exchange between repository using sidedata and repository not using sidedata. Until we implement such code (eg: dropping side data when pushing to a non-sidedata repo) we prevent the two kind of repo to speak to each other. This is somewhere similar to what 'treemanifest' does. Note that sidedata exchange is broken unless one use changegroup v3 anyway. See next changeset for details. Differential Revision: https://phab.mercurial-scm.org/D6939
Tue, 08 Oct 2019 02:19:04 -0400 perf: use `setup` function in `perfdirstatewrite`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 02:19:04 -0400] rev 43130
perf: use `setup` function in `perfdirstatewrite` The command seems to pre-date the introduction of the `setup` support in timer. We move the line that is obviously about benchmark setup in such `setup` function.
Tue, 08 Oct 2019 01:49:34 -0400 perf: document `perfdirstatewrite`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 01:49:34 -0400] rev 43129
perf: document `perfdirstatewrite`
Tue, 08 Oct 2019 02:12:15 -0400 perf: use `setup` function in `perfdirfoldmap`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 02:12:15 -0400] rev 43128
perf: use `setup` function in `perfdirfoldmap` The command seems to pre-date the introduction of the `setup` support in timer. We move the line that is obviously about benchmark setup in such `setup` function.
Tue, 08 Oct 2019 01:49:18 -0400 perf: document `perfdirfoldmap`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 01:49:18 -0400] rev 43127
perf: document `perfdirfoldmap`
Tue, 08 Oct 2019 02:16:15 -0400 perf: use `setup` function in `perfdirstatefoldmap`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 02:16:15 -0400] rev 43126
perf: use `setup` function in `perfdirstatefoldmap` The command seems to pre-date the introduction of the `setup` support in timer. We move the line that is obviously about benchmark setup in such `setup` function.
Tue, 08 Oct 2019 01:48:10 -0400 perf: document `perfdirstatefoldmap`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 01:48:10 -0400] rev 43125
perf: document `perfdirstatefoldmap`
Tue, 08 Oct 2019 02:08:41 -0400 perf: use `setup` function in `perfdirstatedirs`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 02:08:41 -0400] rev 43124
perf: use `setup` function in `perfdirstatedirs` The command seems to pre-date the introduction of the `setup` support in timer. We move the line that is obviously about benchmark setup in such `setup` function.
Tue, 08 Oct 2019 01:47:35 -0400 perf: document `perfdirstatedirs`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 01:47:35 -0400] rev 43123
perf: document `perfdirstatedirs`
Tue, 08 Oct 2019 01:57:10 -0400 perf: use `setup` function in `perfdirstate`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 01:57:10 -0400] rev 43122
perf: use `setup` function in `perfdirstate` The command seems to pre-date the introduction of the `setup` support in timer. We move the line that is obviously about benchmark setup in such `setup` function.
Tue, 08 Oct 2019 01:46:57 -0400 perf: document `perfdirstate`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 01:46:57 -0400] rev 43121
perf: document `perfdirstate`
Tue, 08 Oct 2019 01:15:28 -0400 perf: document `perfstatus`
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 08 Oct 2019 01:15:28 -0400] rev 43120
perf: document `perfstatus`
Wed, 09 Oct 2019 15:24:14 +0200 py3: flush ui after each message in interactive patch filtering
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 09 Oct 2019 15:24:14 +0200] rev 43119
py3: flush ui after each message in interactive patch filtering Otherwise, actions from ui.write() are buffered and displayed at end of interactive session.
Wed, 09 Oct 2019 15:28:16 +0200 py3: decode prompt string before calling rawinput
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 09 Oct 2019 15:28:16 +0200] rev 43118
py3: decode prompt string before calling rawinput Calling input() (aka pycompat.rawinput() on python3) with a byte string displays a byte string in the console. E.g. in interactive commit, we get: b"examine changes to '<file>'?\n(enter ? for help) [Ynesfdaq?]". Similarly, "hg email" prompts are messed up. We thus decode the prompt string before running rawinput().
Tue, 08 Oct 2019 15:06:18 -0700 cleanup: join string literals that are already on one line
Martin von Zweigbergk <martinvonz@google.com> [Tue, 08 Oct 2019 15:06:18 -0700] rev 43117
cleanup: join string literals that are already on one line Thanks to Kyle for noticing this and for providing the regular expression to run on the codebase. This patch has been reviewed by the test suite and they approved of it. # skip-blame: fallout from mass reformatting Differential Revision: https://phab.mercurial-scm.org/D7028
Tue, 08 Oct 2019 15:15:37 -0700 debugcommands: add a few more writenoi18n()
Martin von Zweigbergk <martinvonz@google.com> [Tue, 08 Oct 2019 15:15:37 -0700] rev 43116
debugcommands: add a few more writenoi18n() Differential Revision: https://phab.mercurial-scm.org/D7027
Sun, 06 Oct 2019 20:17:41 -0700 py3: delete b'' prefix from safehasattr arguments
Martin von Zweigbergk <martinvonz@google.com> [Sun, 06 Oct 2019 20:17:41 -0700] rev 43115
py3: delete b'' prefix from safehasattr arguments Differential Revision: https://phab.mercurial-scm.org/D7029
Tue, 08 Oct 2019 19:35:30 -0700 destutil: provide hint on rebase+merge for how to specify destination/rev
Kyle Lippincott <spectral@google.com> [Tue, 08 Oct 2019 19:35:30 -0700] rev 43114
destutil: provide hint on rebase+merge for how to specify destination/rev Without a destination specified, rebase and merge attempt to identify a good candidate; this fails if there's too many heads, the heads have a bookmark, or other reasons. Complicating the issue, users may have specified -t, thinking it means target, and are confused when the error message says that they need to specify an explicit rev or explicit destination - they feel like they already have. Differential Revision: https://phab.mercurial-scm.org/D7024
Tue, 08 Oct 2019 10:40:36 -0700 hghave: document format for version feature checks as <name><vers>, no dots
Kyle Lippincott <spectral@google.com> [Tue, 08 Oct 2019 10:40:36 -0700] rev 43113
hghave: document format for version feature checks as <name><vers>, no dots I had a bit of a difficult time when attempting to fix a use of `py-38` when trying to figure out what the correct way of specifying the feature was. By having the strings 'py-3*' and 'py3.8' in the hghave.checkvers docstring, I would have had a much easier time of it instead of having to trace exactly what was happening here. Differential Revision: https://phab.mercurial-scm.org/D7023
Fri, 02 Feb 2018 10:13:42 -0800 check-commit: allow foo_bar naming in functions
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 02 Feb 2018 10:13:42 -0800] rev 43112
check-commit: allow foo_bar naming in functions nameswithallthewordssmashedtogetherarehardtoread. especiallyifenglishisnotyourprimarylanguage. Let's align with the rest of the programming universe and allow_the_use_of_underscores_in_names. We took a hand poll at the 5.2 sprint regarding this change and all but 1 person supported it. The person who didn't expressed concerns around excessive API breakage if we mass renamed things. But we're not planning to mass rename things for the sake of renaming, so all should be well. Differential Revision: https://phab.mercurial-scm.org/D2010
Tue, 08 Oct 2019 13:38:02 -0400 infinitepush: mark extension as likely to be deleted
Augie Fackler <augie@google.com> [Tue, 08 Oct 2019 13:38:02 -0400] rev 43111
infinitepush: mark extension as likely to be deleted .. bc:: The infinitepush extension is believed to be unused, and will be deleted at the end of 2020 unless users contact mercurial-devel@mercurial-scm.org. Differential Revision: https://phab.mercurial-scm.org/D7022
Mon, 07 Oct 2019 10:34:21 -0400 tests: use range() in generate-churning-module.py
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 07 Oct 2019 10:34:21 -0400] rev 43110
tests: use range() in generate-churning-module.py This is a test-only script. Performance on Python 2 for creating a full list instead of a generator doesn't matter. With this change, test-check-pyflakes.t passes on Python 3! Differential Revision: https://phab.mercurial-scm.org/D7019
Mon, 07 Oct 2019 10:31:11 -0400 tests: allow warning about file
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 07 Oct 2019 10:31:11 -0400] rev 43109
tests: allow warning about file The code is protected by a block that makes it Python 2 only, so use of file is acceptable. Differential Revision: https://phab.mercurial-scm.org/D7018
Mon, 07 Oct 2019 10:28:32 -0400 lsprof: remove __main__ functionality
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 07 Oct 2019 10:28:32 -0400] rev 43108
lsprof: remove __main__ functionality I'm pretty sure nobody uses this. I noticed it because Python 3 linting is complaining about execfile. Differential Revision: https://phab.mercurial-scm.org/D7017
Mon, 07 Oct 2019 10:26:46 -0400 tests: use proper Python 3.8 feature
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 07 Oct 2019 10:26:46 -0400] rev 43107
tests: use proper Python 3.8 feature Fix typo introduced in 830eacef67f8. Differential Revision: https://phab.mercurial-scm.org/D7016
Mon, 07 Oct 2019 00:04:04 -0400 py3: finish porting iteritems() to pycompat and remove source transformer
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 07 Oct 2019 00:04:04 -0400] rev 43106
py3: finish porting iteritems() to pycompat and remove source transformer This commit finishes porting .iteritems() to pycompat.iteritems() for the mercurial package. The translation of .iteritems() to .items() was the last conversion performed by the source transformer. With the porting to pycompat complete, we no longer have a need for the source transformer. So the source transformer has been removed. Good riddance! The code base is now compatible with Python 2 and Python 3. For the record, as the person who introduced the source transformer, it brings me joy to delete it. It accomplished its goal to facilitate a port to Python 3 without overly burdening people on some painful low-level differences between Python 2 and 3. It is unfortunate we still have to wallpaper over many differences with the pycompat shim. But it is what it is. Differential Revision: https://phab.mercurial-scm.org/D7015
Sun, 06 Oct 2019 19:25:18 -0400 py3: define and use pycompat.iteritems() for hgext/
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 19:25:18 -0400] rev 43105
py3: define and use pycompat.iteritems() for hgext/ .iteritems() -> .items() is the last source transform being performed. But it is also the most widely used. This commit adds a pycompat.iteritems symbol and imports it in place of .iteritems() for usage in hgext/. I chose to stop at just hgext/ because the patch will be large and it is an easy boundary to stop at since we can disable source transformation on a per-package basis. There are places where the type does implement items() and we could call items() directly. However, this would require critical thought and I thought it would be easier to just blindly change the code. We know which call sites need to be audited in the future because they have "pycompat.iteritems." With this change, we no longer perform source transformation on hgext! Differential Revision: https://phab.mercurial-scm.org/D7014
Sun, 06 Oct 2019 17:59:15 -0400 py3: define and use pycompat.itervalues()
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 17:59:15 -0400] rev 43104
py3: define and use pycompat.itervalues() .itervalues() only exists on Python 2. Python 3's equivalent is .values(). But we don't want to blindly use .values() everywhere because on Python 2, it will create a list, which will have performance implications. This commit introduces pycompat.itervalues() which will call the appropriate method on the passed object. We update all callers of obj.itervalues() to pycompat.itervalues(obj) instead. With this commit, the only source tranforming remaining is for iteritems(). Victory is near... Differential Revision: https://phab.mercurial-scm.org/D7013
Sun, 06 Oct 2019 17:45:05 -0400 py3: stop normalizing 2nd argument of *attr() to unicode
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 17:45:05 -0400] rev 43103
py3: stop normalizing 2nd argument of *attr() to unicode Now that we don't byteify strings, we can stop normalizing the 2nd string argument to getattr() and remove explicit overrides we were using in the code base. We no longer use some helper functions in the source transformer, so we remove those as well. Differential Revision: https://phab.mercurial-scm.org/D7012
Sun, 06 Oct 2019 14:58:41 -0400 log: populate keywords if specified in custom -Tjson(...) or -Tcbor(...)
Yuya Nishihara <yuya@tcha.org> [Sun, 06 Oct 2019 14:58:41 -0400] rev 43102
log: populate keywords if specified in custom -Tjson(...) or -Tcbor(...) To make things simple, early return for ui.quiet is disabled if the formatter is templated and provides some datahint().
Sat, 05 Oct 2019 23:30:09 -0400 formatter: map -Tjson(...) and -Tcbor(...) to templater
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 23:30:09 -0400] rev 43101
formatter: map -Tjson(...) and -Tcbor(...) to templater Even though custom JSON output could be generated by using --config template.json="{dict(...)|json}" ..., doing that is tedious because of the trailing comma handling. This patch introduces special syntax for JSON/CBOR formats. -Tjson(...) is translated to template as if function-style template definition were supported: [templates] json(...) = "{dict(...)|json}" json(...):docheader = "[\n " json(...):docfooter = "\n]\n" json(...):separator = ",\n "
Sat, 05 Oct 2019 23:20:35 -0400 formatter: parse name of built-in formatter templates in standard way
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 23:20:35 -0400] rev 43100
formatter: parse name of built-in formatter templates in standard way This slightly makes it easier to add "-Tjson(...)" handling, which should be enabled only if the template specifier doesn't look like a literal template. In other words, it should be handled after "if '{' in tmpl". This makes "log -Tpickle" and "log -Tdebug" abort, which I think is better than just printing "picklepicklepickle...".
Sat, 05 Oct 2019 23:04:45 -0400 formatter: pass in template spec to templateformatter as argument
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 23:04:45 -0400] rev 43099
formatter: pass in template spec to templateformatter as argument Prepare for the next patch, which will unify handling of the formatter names and the template names.
Sat, 05 Oct 2019 15:47:38 -0400 templater: add public parseexpr() function to parse "-Tjson(...)"
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 15:47:38 -0400] rev 43098
templater: add public parseexpr() function to parse "-Tjson(...)" Extracted _addparseerrorhint() to show nicer hint on error.
Sun, 06 Oct 2019 13:06:19 +0200 import: read X-Mercurial-Node email header to determine nodeid
Denis Laxalde <denis@laxalde.org> [Sun, 06 Oct 2019 13:06:19 +0200] rev 43097
import: read X-Mercurial-Node email header to determine nodeid This would be useful to import and obsolete patches sent using 'hg email --plain', using evolve's --obsolete option of 'hg import'. If email body contains Mercurial patch header ('# HG changeset patch' block), nodeid parsed from X-Mercurial-Node header will still be overridden by respective value found in body.
Wed, 02 Oct 2019 07:35:22 +0900 patchbomb: use procutil.shellquote() instead of shlex to escape email address
Yuya Nishihara <yuya@tcha.org> [Wed, 02 Oct 2019 07:35:22 +0900] rev 43096
patchbomb: use procutil.shellquote() instead of shlex to escape email address This basically backs out 2cc453284d5c, and inserts procutil.shellquote() instead. I don't care about Windows compatibility here, but shlex.quote() can't handle byte strings on Python 3.
Mon, 07 Oct 2019 11:52:58 -0400 formatting: introduce a `test-check-format-black.t` that enforce formatting
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 07 Oct 2019 11:52:58 -0400] rev 43095
formatting: introduce a `test-check-format-black.t` that enforce formatting This should prevent use to drift away from the expect format.
Mon, 07 Oct 2019 10:58:51 -0400 formatting: run black on all file again
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 07 Oct 2019 10:58:51 -0400] rev 43094
formatting: run black on all file again Apparently, since the blackgnarok, we divergence from the expected formatting. Formatted using:: grey.py -S $(hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/** - contrib/grey.py') # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions
Mon, 07 Oct 2019 11:51:34 -0400 formatting: make black --quiet in the example `hg fix` config
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 07 Oct 2019 11:51:34 -0400] rev 43093
formatting: make black --quiet in the example `hg fix` config I do like cake, but I cannot have so many of them.
Mon, 07 Oct 2019 11:48:34 -0400 formatting: remove the data-ogre from the config example
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 07 Oct 2019 11:48:34 -0400] rev 43092
formatting: remove the data-ogre from the config example Without he final `-`, black ignore the stdin and just looks at file provided as command line argument. Since `hg fix` feeds the file content through stdin and does not pass file argument, this meant black happily exited successful (all files passed as argument were formatted) without any output. Fix picked this "no output" as the new file content, deleting all previous content. I appreciate the fact this effectively removed all buggy code in any files processing that way, but this also ate all my data. The example config is now fixed in that regards.
Sun, 06 Oct 2019 17:27:51 -0400 py3: stop normalizing .encode()/.decode() arguments to unicode
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 17:27:51 -0400] rev 43091
py3: stop normalizing .encode()/.decode() arguments to unicode Now that we don't byte transform string literals, we no longer need this transform. While we're here, we also drop some superfluous u'' prefix in existing callers. Differential Revision: https://phab.mercurial-scm.org/D7011
Sun, 06 Oct 2019 16:58:55 -0400 py3: manually import pycompat.delattr where it is needed
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 16:58:55 -0400] rev 43090
py3: manually import pycompat.delattr where it is needed And with this change, we no longer need the auto-inserted import statement in the source transformer, so it has been removed! Differential Revision: https://phab.mercurial-scm.org/D7010
Sun, 06 Oct 2019 16:55:18 -0400 py3: manually import getattr where it is needed
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 16:55:18 -0400] rev 43089
py3: manually import getattr where it is needed The march continues. Differential Revision: https://phab.mercurial-scm.org/D7009
Sun, 06 Oct 2019 16:39:13 -0400 py3: stop injecting pycompat.hasattr into modules
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 16:39:13 -0400] rev 43088
py3: stop injecting pycompat.hasattr into modules I only found a single user of this pattern, probably because we use util.hasattr everywhere. Differential Revision: https://phab.mercurial-scm.org/D7008
Sun, 06 Oct 2019 14:58:42 -0400 py3: manually import pycompat.setattr where it is needed
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 14:58:42 -0400] rev 43087
py3: manually import pycompat.setattr where it is needed Continuing to eliminate the implicit import of symbols in the Python 3 source transformer so we can eliminate it. Differential Revision: https://phab.mercurial-scm.org/D7007
Sun, 06 Oct 2019 14:51:45 -0400 py3: stop implicitly importing unicode
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 14:51:45 -0400] rev 43086
py3: stop implicitly importing unicode We should be pycompat.unicode everywhere. It turns out we were doing this everywhere except for one place in templatefilters! Differential Revision: https://phab.mercurial-scm.org/D7006
Sun, 06 Oct 2019 13:28:56 -0400 py3: manually import pycompat.open into files that need it
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 13:28:56 -0400] rev 43085
py3: manually import pycompat.open into files that need it We want to eliminate the source transformer. Currently it inserts a `from mercurial.pycompat import ...` at the top of files to alias some builtins. This commit replaces the implicit import of `open` with an explicit import on files that need it and changes the source transformer to no longer import `open`. As part of this, we needed to store an explicit local for `open` in the Python 2 code path in `pycompat` so the import works. (Builtins that are automatically in scope cannot be imported.) Differential Revision: https://phab.mercurial-scm.org/D7005
Sun, 06 Oct 2019 13:17:19 -0400 import-checker: allow symbol imports from mercurial.pycompat
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 13:17:19 -0400] rev 43084
import-checker: allow symbol imports from mercurial.pycompat Currently, the source transformer inserts `from mercurial.pycompat import delattr, getattr, hasattr, setattr, open, unicode` to the top of every file. As part of getting rid of the source transformer, we'll need to have source code call these wrappers directly. Rather than rewrite all call sites to call pycompat.*, I think it makes sense to import needed symbols via explicit imports. That requires loosening the import checker to allow this. Differential Revision: https://phab.mercurial-scm.org/D7004
Sun, 06 Oct 2019 14:13:03 -0700 contrib: add a fork of black (as "grey") that includes my changes
Augie Fackler <augie@google.com> [Sun, 06 Oct 2019 14:13:03 -0700] rev 43083
contrib: add a fork of black (as "grey") that includes my changes This is black with https://github.com/psf/black/pull/826 applied as of today. The current git hash of black master is d9e71a75ccfefa3d9156a64c03313a0d4ad981e5, and the hash of my commit is dc1add6e94e212eff37bb3619e1422fb3c6d8dc8. In order to use this, you need to install `black` (from github master) and `typed-ast` using pip, preferably into python3, and then you can run `grey.py` with that Python and you'll have my patched version of black, which is how we've been formatting the codebase. Once my PR is merged, I'll follow up by removing this fork and updating instructions in the example config. # no-check-commit bad style Differential Revision: https://phab.mercurial-scm.org/D7002
Sat, 05 Oct 2019 09:58:21 -0400 rust-cpython: change license of ref_sharing.rs to MIT
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 09:58:21 -0400] rev 43082
rust-cpython: change license of ref_sharing.rs to MIT Since we plan to upstream this feature, it's better to continue further refactoring under the same license as rust-cpython crate. According to the file history, copyright holders are: - Raphaël Gomès <rgomes@octobus.net> - Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> - Yuya Nishihara <yuya@tcha.org>
Sun, 06 Oct 2019 10:20:17 -0400 contrib: fix check-code to be able to detect missing _() with bytestrings
Augie Fackler <augie@google.com> [Sun, 06 Oct 2019 10:20:17 -0400] rev 43081
contrib: fix check-code to be able to detect missing _() with bytestrings Differential Revision: https://phab.mercurial-scm.org/D6997
Sun, 06 Oct 2019 10:51:16 -0400 cleanup: mark some ui.(status|note|warn|write) calls as not needing i18n
Augie Fackler <augie@google.com> [Sun, 06 Oct 2019 10:51:16 -0400] rev 43080
cleanup: mark some ui.(status|note|warn|write) calls as not needing i18n These used to be marked with no-op parens, but black removes those now and this is more explicit. # skip-blame: fallout from mass reformatting Differential Revision: https://phab.mercurial-scm.org/D6996
Sun, 06 Oct 2019 10:10:14 -0400 ui: define (write|status|warn|note)noi18n aliases
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Oct 2019 10:10:14 -0400] rev 43079
ui: define (write|status|warn|note)noi18n aliases We currently use `write(('...'))` to suppress check-code warnings about not using translated strings. However, when we run black, it will strip the `((...))`. In order to placate black, we'll need to use a different mechanism to pass untranslatable strings. This commit introduces a `writenoi18n` alias (and friends) to `write` for that purpose. Differential Revision: https://phab.mercurial-scm.org/D6994
(0) -30000 -10000 -3000 -1000 -120 +120 +1000 +3000 tip