Sun, 29 Mar 2020 13:06:59 -0700 dispatch: force \n for newlines on sys.std* streams (BC)
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 29 Mar 2020 13:06:59 -0700] rev 44653
dispatch: force \n for newlines on sys.std* streams (BC) The sys.std* streams behave differently on Python 3. On Python 3, these streams are an io.TextIOWrapper that wraps a binary buffer stored on a .buffer attribute. These TextIOWrapper instances normalize \n to os.linesep by default. On Windows, this means that \n is normalized to \r\n. So functions like print() which have an implicit end='\n' will actually emit \r\n for line endings. While most parts of Mercurial go through the ui.write() layer to print output, some code - notably in extensions and hooks - can use print(). If this code was using print() or otherwise writing to sys.std* on Windows, Mercurial would emit \r\n. In reality, pretty much everything on Windows reacts to \n just fine. Mercurial itself doesn't emit \r\n when going through the ui layer. Changing the sys.std* streams to not normalize line endings sounds like a scary change. But I think it is safe. It also makes Mercurial on Python 3 behave similarly to Python 2, which did not perform \r\n normalization in print() by default. .. bc:: sys.{stdout, stderr, stdin} now use \n line endings on Python 3 Differential Revision: https://phab.mercurial-scm.org/D8339
Sun, 29 Mar 2020 11:58:50 -0700 hook: move stdio redirection to context manager
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 29 Mar 2020 11:58:50 -0700] rev 44652
hook: move stdio redirection to context manager The old code was checking stdio redirection in a loop. This didn't make sense. The pattern is better expressed as a context manager IMO, so this commit refactors it to be one. Differential Revision: https://phab.mercurial-scm.org/D8338
Sat, 28 Mar 2020 12:18:58 -0700 pycompat: change argv conversion semantics
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 28 Mar 2020 12:18:58 -0700] rev 44651
pycompat: change argv conversion semantics Use of os.fsencode() to convert Python's sys.argv back to bytes was not correct because it isn't the logically inverse operation from what CPython was doing under the hood. This commit changes the logic for doing the str -> bytes conversion. This required a separate implementation for POSIX and Windows. The Windows behavior is arguably not ideal. The previous behavior on Windows was leading to failing tests, such as test-http-branchmap.t, which defines a utf-8 branch name via a command argument. Previously, Mercurial's argument parser looked to be receiving wchar_t bytes in some cases. After this commit, behavior on Windows is compatible with Python 2, where CPython did not implement `int wmain()` and Windows was performing a Unicode to ANSI conversion on the wchar_t native command line. Arguably better behavior on Windows would be for Mercurial to preserve the original Unicode sequence coming from Python and to wrap this in a bytes-like type so we can round trip safely. But, this would be new, backwards incompatible behavior. My goal for this commit was to converge Mercurial behavior on Python 3 on Windows to fix busted tests. And I believe I was successful, as this commit fixes 9 tests on my Windows machine and 14 tests in the AWS CI environment! Differential Revision: https://phab.mercurial-scm.org/D8337
Thu, 02 Apr 2020 12:05:41 -0400 Added signature for changeset 8fca7e8449a8 stable
Augie Fackler <raf@durin42.com> [Thu, 02 Apr 2020 12:05:41 -0400] rev 44650
Added signature for changeset 8fca7e8449a8
Thu, 02 Apr 2020 12:05:40 -0400 Added tag 5.3.2 for changeset 8fca7e8449a8 stable
Augie Fackler <raf@durin42.com> [Thu, 02 Apr 2020 12:05:40 -0400] rev 44649
Added tag 5.3.2 for changeset 8fca7e8449a8
Wed, 18 Mar 2020 14:53:53 -0400 phabricator: extract logic to print the status when posting a commit
Matt Harbison <matt_harbison@yahoo.com> [Wed, 18 Mar 2020 14:53:53 -0400] rev 44648
phabricator: extract logic to print the status when posting a commit This will make it easier to list each commit when folding. That makes the output less confusing because it matches the output of `--confirm` and the revisions listed on the command line. Differential Revision: https://phab.mercurial-scm.org/D8313
Mon, 16 Mar 2020 14:33:35 -0400 phabricator: extract the logic to amend diff properties to a function
Matt Harbison <matt_harbison@yahoo.com> [Mon, 16 Mar 2020 14:33:35 -0400] rev 44647
phabricator: extract the logic to amend diff properties to a function This will be needed on a separate code path when dealing with folding revisions. And since we know that will involve adding multiple local commmits to the diff properties instead of just one, restructure the logic slightly to allow it. Differential Revision: https://phab.mercurial-scm.org/D8312
Mon, 16 Mar 2020 13:36:12 -0400 phabricator: teach `getoldnodedrevmap()` to handle folded reviews
Matt Harbison <matt_harbison@yahoo.com> [Mon, 16 Mar 2020 13:36:12 -0400] rev 44646
phabricator: teach `getoldnodedrevmap()` to handle folded reviews The tricky part here is reasoning through all of the possible predecessor scenarios. In the typical case of submitting a folded range and then resubmitting it (also folded), filtering the list of commits for the diff stored on Phabricator through the local predecessor list for each single node will result in the typical 1:1 mapping to the old node. There are edge cases like using `hg fold` within the range prior to resubmitting, that will result in mapping to multiple old nodes. In that case, the first direct predecessor is needed for the base of the diff, and the last direct predecessor is needed for the head of the diff in order to make sure that the entire range is included in the diff content. And none of this matters for commits in the middle of the range, as they are never used. Fortunately the only crucial thing here is the `drev` number for each node. For these complicated cases where there are multiple old nodes, simply ignore them all. This will cause `createdifferentialrevision()` to generate a new diff (within the same Differential), and avoids complicating the code. Differential Revision: https://phab.mercurial-scm.org/D8311
Mon, 09 Mar 2020 12:07:28 -0400 phabricator: teach createdifferentialrevision() to allow a folded commit range
Matt Harbison <matt_harbison@yahoo.com> [Mon, 09 Mar 2020 12:07:28 -0400] rev 44645
phabricator: teach createdifferentialrevision() to allow a folded commit range No visible changes here, until an option to enable it is added to `phabsend`. Differential Revision: https://phab.mercurial-scm.org/D8310
Fri, 06 Mar 2020 17:03:04 -0500 phabricator: combine commit messages into the review when folding commits
Matt Harbison <matt_harbison@yahoo.com> [Fri, 06 Mar 2020 17:03:04 -0500] rev 44644
phabricator: combine commit messages into the review when folding commits No visible changes here, until an option to enable it is added to `phabsend`. This combines the Differential fields like Arcanist does, rather than simply concatenating the text blocks. Aside from populating everything properly in the web interface, Phabricator fails the review create/update if repeated fields are seen as would happen with simple concatenation. On the flip side, now that the Summary and Test Plan fields can contain data from multiple commits, we can't just join these fields together to determine if an amend is needed. If that were to happen, every single commit in the folded range would get amended with the combined commit message, which seems clearly wrong. Aside from making a minor assumption about the content of the Differential Revision field (it seems they allow some minor variances with spacing), this means that for folded reviews, you can't post it, go to the web page add a missing Test Plan, and then get it added to the commit message by re-posting it. I don't think that's a big deal. Differential Revision: https://phab.mercurial-scm.org/D8309
Wed, 26 Feb 2020 13:13:49 -0500 phabricator: record all local commits used to create a Differential revision
Matt Harbison <matt_harbison@yahoo.com> [Wed, 26 Feb 2020 13:13:49 -0500] rev 44643
phabricator: record all local commits used to create a Differential revision Arcanist records all of the commits that it squashes into a single review, and that info will be helpful when adding similar functionality. This info is used when submitting an updated review, so that the extension can recalculate the old diff and see if a new one is necessary, or if it is just a property update. It also shows on the `commits` tab in the `Revision Contents` section. When submitting in the usual 1:1 commit to review mode, the wire protocol is unchanged. The content of `hg:meta` is a bit odd, but such is the problem when folding several commits. The choice for the parent node is obvious, but the `node` value uses the tip commit because that seems more natural, and is used elsewhere to look up the previous diff when updating. The rest of the attributes follow from there. Differential Revision: https://phab.mercurial-scm.org/D8308
Sat, 28 Mar 2020 13:29:25 -0700 tests: use `f --hexdump` to print file content
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 28 Mar 2020 13:29:25 -0700] rev 44642
tests: use `f --hexdump` to print file content The inline print.py in this test wasn't fully compatible with Python 3 because it was reading from sys.stdin, which already normalized line endings since it operates in the realm of str on Python 3. To do this correctly, we'd need to read from sys.stdin.buffer on Python 3. This would entail conditional code. I felt this was too much effort. So I just replaced the custom script with `f`, which already knows how to do the right thing. test-mactext.t now passes on Python 3 on Windows. Differential Revision: https://phab.mercurial-scm.org/D8336
Sat, 28 Mar 2020 13:12:43 -0700 url: pass str to pathname2url
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 28 Mar 2020 13:12:43 -0700] rev 44641
url: pass str to pathname2url This is needed to appease Python 3. This fixes test-extdata.t and test-url-download.t on Python 3 on Windows. Differential Revision: https://phab.mercurial-scm.org/D8335
Sat, 28 Mar 2020 09:21:46 -0700 tests: pass str to matchoutput()
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 28 Mar 2020 09:21:46 -0700] rev 44640
tests: pass str to matchoutput() It accepts a str, not bytes. This fixes a failure in test-hghave.t on Windows. Why it wasn't failing on Linux, I don't know. I suspect the Windows process code in Python doesn't accept bytes and the POSIX code does? Differential Revision: https://phab.mercurial-scm.org/D8334
Tue, 31 Mar 2020 19:44:28 -0700 hgcli: customize for Mercurial
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 31 Mar 2020 19:44:28 -0700] rev 44639
hgcli: customize for Mercurial Now that we have a shiny new PyOxidizer-based hgcli project, let's customize it for Mercurial! This commit replaces the auto-generated pyoxidizer.bzl with one that installs Mercurial from the local source repository. A README.md with build instructions has been added. The Cargo.toml file has been updated to reflect the proper license and reference the added README.md. In my Linux environment, running the test suite yields 27 failures. It's worth noting the run time of the test harness on Linux on my Ryzen 3950X: before: 378s wall; 9982s user; 1195s sys after: 353s wall; 8996s user; 958s sys % orig: 93.4 wall; 90.1 user; 80.2 sys While I haven't measured explicitly, I suspect the performance win is due to in-memory resource loading (which is known to be faster than Python's filesystem importer). Differential Revision: https://phab.mercurial-scm.org/D8351
Tue, 31 Mar 2020 19:07:36 -0700 hgcli: add stub PyOxidizer project
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 31 Mar 2020 19:07:36 -0700] rev 44638
hgcli: add stub PyOxidizer project Using commit c772a1379c3026314eda1c8ea244b86c0658951d of PyOxidizer, I ran `pyoxidizer init-rust-project hgcli` to create a stub Rust project. The only modifications I made from what that command produced are: * Update location of pyembed crate to PyOxidizer's Git repository. * Removed some trailing whitespace from pyoxidizer.bzl * Added auto-generated Cargo.lock file Subsequent commits will modify the stub project to Mercurial's needs. Differential Revision: https://phab.mercurial-scm.org/D8350
Tue, 31 Mar 2020 18:56:41 -0700 hgcli: remove legacy project
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 31 Mar 2020 18:56:41 -0700] rev 44637
hgcli: remove legacy project This code is a logical precursor to PyOxidizer. It is now defunct. Differential Revision: https://phab.mercurial-scm.org/D8349
Thu, 26 Mar 2020 11:55:06 +0100 nodemap: automatically "vacuum" the persistent nodemap when too sparse
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 26 Mar 2020 11:55:06 +0100] rev 44636
nodemap: automatically "vacuum" the persistent nodemap when too sparse We arbitrarily pick "10%" as the threshold. Differential Revision: https://phab.mercurial-scm.org/D8193
Fri, 28 Feb 2020 03:18:57 +0100 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 28 Feb 2020 03:18:57 +0100] rev 44635
nodemap: display percentage of unused in `hg debugnodemap` This is useful to assess the density of the cache. Differential Revision: https://phab.mercurial-scm.org/D8192
Fri, 28 Feb 2020 03:05:52 +0100 nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 28 Feb 2020 03:05:52 +0100] rev 44634
nodemap: make sure on disk change get rolled back with the transaction In case of errors, we need to rollback the change made to the persistent nodemap. Differential Revision: https://phab.mercurial-scm.org/D8191
Fri, 28 Feb 2020 02:23:38 +0100 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 28 Feb 2020 02:23:38 +0100] rev 44633
nodemap: test that concurrent process don't see the pending transaction We don't want other client to read uncommitted data, until the transaction is really committed. Differential Revision: https://phab.mercurial-scm.org/D8190
Fri, 20 Mar 2020 23:41:35 +0100 testlib: adjust wait-on-file timeout according to the global test timeout
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 20 Mar 2020 23:41:35 +0100] rev 44632
testlib: adjust wait-on-file timeout according to the global test timeout Lets assume that if test timeout have been set to be twice as long, it means local timeout should be twice as long too. I am not aware of any case were extending timeout for file based synchronisation was necessary, but the safety seems simple to implements. Differential Revision: https://phab.mercurial-scm.org/D8316
Fri, 28 Feb 2020 02:23:28 +0100 testlib: add a small scrip to help process to synchronise using file
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 28 Feb 2020 02:23:28 +0100] rev 44631
testlib: add a small scrip to help process to synchronise using file Creating and waiting for files is a robust way to synchronise two processes running concurrently. We already use this approach in various tests. I am adding a official script to do so before adding more usage of this. Differential Revision: https://phab.mercurial-scm.org/D8189
Tue, 31 Mar 2020 16:14:10 -0400 setup: work around old versions of distutils breaking setup.py
Augie Fackler <augie@google.com> [Tue, 31 Mar 2020 16:14:10 -0400] rev 44630
setup: work around old versions of distutils breaking setup.py I'm not really sure how to trigger this, but we saw it in our build environment for Windows at Google. This fixed it. Sigh.
Tue, 31 Mar 2020 15:11:33 +0530 chgserver: update the umask cache before each run
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 31 Mar 2020 15:11:33 +0530] rev 44629
chgserver: update the umask cache before each run posix.py uses a global variable to store the umask value resulting in caching of it when using chg. We need to update it before each command run as the umask can change between commands. This fixes test-inherit-mode.t with chg.
Thu, 26 Mar 2020 10:09:17 -0400 tests: handle new error string from FreeBSD for dns entry not resolving
Augie Fackler <augie@google.com> [Thu, 26 Mar 2020 10:09:17 -0400] rev 44628
tests: handle new error string from FreeBSD for dns entry not resolving Differential Revision: https://phab.mercurial-scm.org/D8333
Wed, 26 Feb 2020 22:35:39 +0100 notify: optional mail threading based on obsmarker
Joerg Sonnenberger <joerg@bec.de> [Wed, 26 Feb 2020 22:35:39 +0100] rev 44627
notify: optional mail threading based on obsmarker When notify.reply is set and a changeset has a predecessor in the repository, include In-Reply-To pointing to the message-id that would have been generated for the oldest predecessor. This allows mail threading like Phabricator for common cases like rebasing changes, but will be optimal for cases like folding. Differential Revision: https://phab.mercurial-scm.org/D8172
Fri, 27 Mar 2020 10:39:59 -0400 pathutil: document that dirs map type implies manifest/dirstate processing
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Fri, 27 Mar 2020 10:39:59 -0400] rev 44626
pathutil: document that dirs map type implies manifest/dirstate processing
Fri, 27 Mar 2020 10:38:40 -0400 git: pass a list to pathutil.dirs to indicate that it is a manifest
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Fri, 27 Mar 2020 10:38:40 -0400] rev 44625
git: pass a list to pathutil.dirs to indicate that it is a manifest The python implementation of pathutil.dirs just uses a for loop which happens to work the same on both dicts and lists. The rust implementation actually figures out which of the two types it is, and directs the execution to either dirstate or manifest processing.
Thu, 26 Mar 2020 17:49:30 -0400 git: implement basic bookmark activation
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Thu, 26 Mar 2020 17:49:30 -0400] rev 44624
git: implement basic bookmark activation This is very limited, but it allows 'hg update foo' when already on foo. The caching is based on bmstore's caching.
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 tip