Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Apr 2020 17:33:41 -0700] rev 44764
packaging: isolate invocation of WiX to own function
Like we did for Inno, we want to split out the building
of Mercurial from invoking the packaging tool so that we
can introduce an alternate build mechanism.
As part of this refactor, there are inconsequential changes
to file layouts. Before, some shared files such as the
WiX binaries and merge modules would be installed under
build/. Now, they are installed under build/wix-*. This
is to keep implementation simpler. But it also helps keep
build state more isolated.
Differential Revision: https://phab.mercurial-scm.org/D8474
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 23 Apr 2020 18:06:02 -0700] rev 44763
packaging: support building Inno installer with PyOxidizer
We want to start distributing Mercurial on Python 3 on
Windows. PyOxidizer will be our vehicle for achieving that.
This commit implements basic support for producing Inno
installers using PyOxidizer.
While it is an eventual goal of PyOxidizer to produce
installers, those features aren't yet implemented. So our
strategy for producing Mercurial installers is similar to
what we've been doing with py2exe: invoke a build system to
produce files then stage those files into a directory so they
can be turned into an installer.
We had to make significant alterations to the pyoxidizer.bzl
config file to get it to produce the files that we desire for
a Windows install. This meant differentiating the build targets
so we can target Windows specifically.
We've added a new module to hgpackaging to deal with interacting
with PyOxidizer. It is similar to pyexe: we invoke a build process
then copy files to a staging directory. Ideally these extra
files would be defined in pyoxidizer.bzl. But I don't think it
is worth doing at this time, as PyOxidizer's config files are
lacking some features to make this turnkey.
The rest of the change is introducing a variant of the
Inno installer code that invokes PyOxidizer instead of
py2exe.
Comparing the Python 2.7 based Inno installers with this
one, the following changes were observed:
* No lib/*.{pyd, dll} files
* No Microsoft.VC90.CRT.manifest
* No msvc{m,p,r}90.dll files
* python27.dll replaced with python37.dll
* Add vcruntime140.dll file
The disappearance of the .pyd and .dll files is acceptable, as
PyOxidizer has embedded these in hg.exe and loads them from
memory.
The disappearance of the *90* files is acceptable because those
provide the Visual C++ 9 runtime, as required by Python 2.7.
Similarly, the appearance of vcruntime140.dll is a requirement
of Python 3.7.
Differential Revision: https://phab.mercurial-scm.org/D8473
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 19 Apr 2020 15:35:21 -0700] rev 44762
packaging: split Inno installer building from Mercurial building
We want to make the logic for producing the installer agnostic about
how Mercurial is built to allow for alternate build methods (like
PyOxidizer).
Differential Revision: https://phab.mercurial-scm.org/D8472
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 19 Apr 2020 14:25:27 -0700] rev 44761
packaging: remove pyoxidizer.bzl from packaging directory
We have another version in rust/hgcli that is more modern
and is already associated with our Rust CLI project.
Differential Revision: https://phab.mercurial-scm.org/D8471
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 19 Apr 2020 14:16:24 -0700] rev 44760
contrib: install PyOxidizer in Linux and Windows environments
For Linux, this was trivial.
For Windows, we need to teach the powershell script to install
Rust as well. This was also pretty straightforward.
Differential Revision: https://phab.mercurial-scm.org/D8468
Elmar Bartel <elb_hg@leo.org> [Thu, 30 Apr 2020 15:10:05 +0200] rev 44759
diff: re-establish linear runtime performance
The previous method with sum() and list() creates a new list object
for every hunk. Then sum() is used to flatten out this sequence of
lists. The sum() function is not "lazy", but creates a new list object
for every "+" operation and so this code had quadratic runtime behaviour.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 05 Mar 2020 17:55:05 +0100] rev 44758
copies: fix the changeset based algorithm regarding merge
In
99ebde4fec99, we changed the list of files stored into the `files` field.
This lead to the changeset centric copy algorithm to break in various merge
situation involving merge. Older information could reach the merge through
`p1`, and while information from `p2` was strictly fresher, it would get
overwritten anyway.
We update the situation with more details about which revision introduces rename
information. This help use making the right decision in case of merge.
We are now running a more comprehensive suite of test with include this kind of
situation. The behavior differ slightly from the filelog based in a couple of
instance. There is mostly two distinct cases:
1) there are conflicting rename information in a merge (different rename history
on each side). In this case the filelog based implementation arbitrarily pick a
side based on the file-revision-number. So it depends on a local factor. The
changeset centric algorithm will use a deterministic approach, by picking the
information coming from the first parent of the merge. This is stable across
different clone.
2) rename information related to file that exist in both source and destination.
The filelog based implementation do not even try to detect these, however the
changeset centric one get them for "free" (it is simpler to detect them than
not).
The new implementation focus on correctness. Performance improvement will come
later.
Differential Revision: https://phab.mercurial-scm.org/D8244
Augie Fackler <augie@google.com> [Fri, 24 Apr 2020 15:06:42 -0400] rev 44757
merge with stable
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Apr 2020 17:43:29 +0900] rev 44756
rust-chg: clean up excessive indents
Differential Revision: https://phab.mercurial-scm.org/D8450
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Apr 2020 02:51:03 +0900] rev 44755
rust-chg: do not terminate tokio runtime until pager exits
We no longer need to spawn a task just to keep the pager handle. The pager
handle can be held by ChgUiHandler since the handler itself is not consumed
and recreated across async calls.
Differential Revision: https://phab.mercurial-scm.org/D8449
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Apr 2020 02:21:06 +0900] rev 44754
rust-chg: modernize entry function
Finally the entire build passes.
There's a bug that run() no longer waits for the spawned pager, which will
be fixed by the next patch.
Differential Revision: https://phab.mercurial-scm.org/D8448
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Apr 2020 00:47:32 +0900] rev 44753
rust-chg: reimplement locator by using async/await and tokio-0.2
connect_spawned() is rewritten from scratch by using std::process. Before,
it would select completion of either connection or server process. New code
could be implemented as such, but it's much simpler to occasionally run
try_wait() to detect server death.
Differential Revision: https://phab.mercurial-scm.org/D8447
Yuya Nishihara <yuya@tcha.org> [Fri, 10 Apr 2020 23:26:36 +0900] rev 44752
rust-chg: reimplement ChgClientExt as ChgClient wrapper
ChgClient is no longer an extension trait because:
a. Client object is not consumed and recreated in future-0.3 world, which
unblocks writing a simple wrapper struct.
b. async fn isn't allowed in trait.
Overall, the API should become simpler.
Differential Revision: https://phab.mercurial-scm.org/D8446
Yuya Nishihara <yuya@tcha.org> [Fri, 10 Apr 2020 22:44:51 +0900] rev 44751
rust-chg: reimplement run_command operation as async function
The crafted state machine is no longer needed thanks to async/await.
The state machine is basically rewritten as follows:
- Ready(..) -> return ..
- PollAgain(..) -> run .. and await
- Err(..) -> return Err(..)
Differential Revision: https://phab.mercurial-scm.org/D8445
Yuya Nishihara <yuya@tcha.org> [Fri, 10 Apr 2020 22:23:10 +0900] rev 44750
rust-chg: reimplement uihandler by using async-trait and tokio-0.2
We no longer have to consume self and arguments.
Differential Revision: https://phab.mercurial-scm.org/D8444
Yuya Nishihara <yuya@tcha.org> [Fri, 10 Apr 2020 23:08:57 +0900] rev 44749
rust-chg: have attach_io() simply take reference of AsRawFd object
We no longer have to deal with the restriction of the Future type.
Before, these file objects couldn't be references and that's the only
reason why we had to make stderr an Option<T>.
This fixes future type deduction issue of stderr = None, where rustc would
complain that T of Option<T> couldn't be deduced.
Differential Revision: https://phab.mercurial-scm.org/D8443
Raphaël Gomès <rgomes@octobus.net> [Thu, 23 Apr 2020 09:59:38 +0200] rev 44748
rust-status: check for '.hg' regardless of file type (
issue6300)
'.hg' would show up in `hg status` if were a symlink.
Differential Revision: https://phab.mercurial-scm.org/D8461
Raphaël Gomès <rgomes@octobus.net> [Mon, 20 Apr 2020 11:03:31 +0200] rev 44747
rust: remove extra empty line
This is a gratuitous cleanup.
Differential Revision: https://phab.mercurial-scm.org/D8460
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 15 Apr 2020 18:10:19 +0200] rev 44746
upgrade: properly filter action depending on planned work
The `determineactions` function filters out deficiency that are not scheduled to
be fixed by the target repository configuration. However it only did so for
requirement we currently support, letting other actions for unsupported
requirement through even if the target repo configuration did not request it.
As a result the output of the command was easily polluted by experimental
feature with no upgrade support.
We rework the code to still filter out requirement based action without the
faulty filtering.
Differential Revision: https://phab.mercurial-scm.org/D8427
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 13 Apr 2020 18:04:55 +0200] rev 44745
nodemap: skip persistent nodemap warming for revlog not using it
Before this patch, the usual checking (especially, inline-ess) were not
performed when warming the cache through `hg debugupdatecache`.
This is now fixed.
Differential Revision: https://phab.mercurial-scm.org/D8408
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 16 Apr 2020 22:56:03 +0200] rev 44744
wait-on-file: adjust the timer counter
The wait performed in increment of 0.01 second, but the timer was expressed in
second. So we did not wait 20s, we waited 0.2 second. Internally we adjust the
counter to be expressed in centisecond. This prevent some flackyness in the
test.
Differential Revision: https://phab.mercurial-scm.org/D8453
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 19 Apr 2020 17:33:08 -0700] rev 44743
packaging: add docutils as dependency
The previous commit revealed that attempting to run
`python setup.py build_doc` from the packaging virtualenv
failed due to missing docutils package. We didn't notice
this before because py2exe Windows packaging appears to
use a Python from another virtualenv (which does include
docutils) to invoke setup.py. I discovered this as part
of implementing packaging outside of that virtualenv
environment.
Differential Revision: https://phab.mercurial-scm.org/D8470
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 19 Apr 2020 17:26:52 -0700] rev 44742
setup: use sysstr() on process output
Otherwise we get a str-bytes mismatch on Python 3 if
an error occurs.
Differential Revision: https://phab.mercurial-scm.org/D8469
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 28 Mar 2020 08:18:11 -0700] rev 44741
automation: install latest Python versions in Linux
Staying up to date. Keeping parity with the Windows environment.
Differential Revision: https://phab.mercurial-scm.org/D8467
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 21 Apr 2020 19:33:57 -0700] rev 44740
contrib: update to latest Python 2.7, 3.7, and 3.8
We would ideally update the 3.5 and 3.6 versions as well. But Python
didn't generate exe installers for newer versions for some reason.
Differential Revision: https://phab.mercurial-scm.org/D8466
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 19 Apr 2020 13:29:50 -0700] rev 44739
automation: always use latest Windows AMI
The old AMI isn't available any more.
We seem to run into this problem every few months. Amazon (or
Microsoft) appears to be removing the old AMIs when they are
superseded or something. Let's give up on tracking known images
and switch the image selection logic to use the latest published
image.
Differential Revision: https://phab.mercurial-scm.org/D8465
Yuya Nishihara <yuya@tcha.org> [Fri, 10 Apr 2020 22:07:11 +0900] rev 44738
rust-chg: reimplement attach_io operation as async function
In short, MessageLoop<Connection> was redesigned as Protocol<Connection>,
and the protocol methods no longer consume self.
API changes are briefly documented in the following page:
https://docs.rs/tokio-hglib/0.3.0/tokio_hglib/struct.Protocol.html
Differential Revision: https://phab.mercurial-scm.org/D8442
Yuya Nishihara <yuya@tcha.org> [Fri, 10 Apr 2020 21:54:03 +0900] rev 44737
rust-chg: upgrade to futures-0.3 based libraries
And do some trivial fixes:
- BytesMut::put_u32_be() -> put_u32()
- tokio_process -> tokio::process, CommandExt -> Command,
spawn_async() -> spawn(), stdin() -> stdin
- tokio_timer::sleep() -> tokio::time::delay_for()
Differential Revision: https://phab.mercurial-scm.org/D8441
Yuya Nishihara <yuya@tcha.org> [Fri, 10 Apr 2020 21:44:46 +0900] rev 44736
rust-chg: exclude futures-dependent modules from build and break things
It's impractical to upgrade the codebase incrementally since futures 0.1
and 0.3 APIs are fundamentally different. So this patch temporarily excludes
futures-dependent modules from the build. These modules will be upgraded
and re-enabled one by one.
Differential Revision: https://phab.mercurial-scm.org/D8440
Matt Harbison <matt_harbison@yahoo.com> [Fri, 17 Apr 2020 21:00:18 -0400] rev 44735
tests: stabilize test-log.t on Windows
I think this is because Windows doesn't recognize single quote. Other ssh based
clones use this clunky style too.
Differential Revision: https://phab.mercurial-scm.org/D8459