Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 13 Nov 2019 16:46:28 +0100] rev 43628
mail: move strtolocal call in _addressencode()
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 13 Nov 2019 15:23:04 +0100] rev 43627
mail: use a native string for "subtype" value
This is somehow similar to previous changeset and avoids one str
conversion.
Denis Laxalde <denis@laxalde.org> [Tue, 12 Nov 2019 22:52:30 +0100] rev 43626
mail: let all charset values be native strings
Charset values will typically be used to build email.header.Header
instances, which takes str (though it tolerates bytes) or passed to
decode()/encode() methods of string values (which want str). It seems
that using native str involves less conversions than before and this
also helps type hinting (as illustrates removal of pytype disabling
instructions).
Denis Laxalde <denis@laxalde.org> [Wed, 13 Nov 2019 22:20:44 +0100] rev 43625
mail: add type hints for pytype
We essentially annotate functions in which handling of bytes/str is not
obvious in order to hopefully clear things out. See also changeset
2ade00f3b03b introducing typing hints in Mercurial.
Most types are straightforward but a few is wrong, and we need to
either disable pytype on respective instructions or use wrong
annotations. These will be fixed in next changesets. Notice the type
Union[bytes, str] of "s" parameter of headencode(), this reflects how
email.header.Header.append() behaves.
Denis Laxalde <denis.laxalde@logilab.fr> [Tue, 12 Nov 2019 17:12:16 +0100] rev 43624
mail: fix a bad return type in _encode()
This particular instruction returned only a string and omitted the
charset value.
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 11 Nov 2019 18:55:42 -0800] rev 43623
packaging: stage files and dynamically generate WiX installer
Like we did for Inno, we want to make the WiX installer
"dumb" and simply consume source files from a directory
tree rather than have to define every single file in
installer files. This will greatly decrease the amount of
effort required to maintain the WiX installer since we don't
have to think that much about keeping files in sync.
This commit changes the WiX packager to populate a staging
directory as part of packaging. After it does so, it scans
that directory and dynamically generates WiX XML defining the
content within.
The IDs and GUIDs being generated are deterministic. So,
upgrades should work as expected in Windows Installer land.
(WiX has a "heat" tool that can generate XML by walking the
filesystem but it doesn't have this deterministic property,
sadly.)
As part of this change, GUIDs are now effectively reset.
So the next upgrade should be a complete wipe and replace.
This could potentially cause issues. But in my local testing,
I was able to upgrade an existing 5.1.2 install without
issue.
Compared to the previous commit, the installed files differ
in the following:
* A ReleaseNotes.txt file is now included
* A hgrc.d/editor.rc file is now generated (mercurial.rc has been
updated to reflect this logical change to the content source)
* All files are marked as read-only. Previously, only a subset
of files were. This should help prevent unwanted tampering.
Although we may want to consider use cases like modifying
template files...
This change also means that Inno and WiX are now using very
similar code for managing the install layout. This means
that on disk both packages are nearly identical. The
differences in install layout are as follows:
* Inno has a Copying.txt vs a COPYING.rtf for WiX.
(The WiX installer wants to use RTF.)
* Inno has a Mercurial.url file that is an internet shortcut
to www.mercurial-scm.org. (This could potentially be
removed.)
* Inno includes msvc[mpr]90.dll files and WiX does not.
(WiX installs the MSVC runtime via merge modules.)
* Inno includes unins000.{dat,exe} files. (WiX's state is
managed by Windows Installer, which places things elsewhere.)
Because file lists are dynamically generated now, the test
ensuring things remain in sync has been deleted. Good riddance.
While this is a huge step towards unifying the Windows installers,
there's still some improvements that can be made. But I think
it is worth celebrating the milestone of getting both Inno
and WiX to essentially share core packaging code and workflows.
That should make it much easier to change the installers going
forward. This will aid support of Python 3.
Differential Revision: https://phab.mercurial-scm.org/D7173
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 11 Nov 2019 19:04:49 -0800] rev 43622
tests: add optional output when wheel is missing
If the `wheel` package isn't installed, pip will emit a warning
on stderr complaining about that. Alternatively, we could
redirect stderr to stdout and swallow the warning. But I like
tests having visibility of warnings, as it helps keep us honest
regarding edge cases.
Differential Revision: https://phab.mercurial-scm.org/D7371
Martin von Zweigbergk <martinvonz@google.com> [Wed, 28 Aug 2019 17:43:56 -0700] rev 43621
py3: replace "%r" by"'%s'% for py3-compatible (and clearer) quoting in chg
Differential Revision: https://phab.mercurial-scm.org/D7375