[PATCH] setup: explain to distutils how we write rc versions

Gregory Szorc gregory.szorc at gmail.com
Wed Oct 31 16:25:25 EDT 2018


On Wed, Oct 31, 2018 at 1:14 PM Paul Morelle <paul.morelle at octobus.net>
wrote:

> # HG changeset patch
> # User "Paul Morelle <paul.morelle at octobus.net"
> # Date 1541014362 -3600
> #      Wed Oct 31 20:32:42 2018 +0100
> # Node ID 5f86fca43d2ac438aeb3e482fc713906947f2abd
> # Parent  5e5c8f2a1eb5f050a7d13b6f1b6a21fbc2fd1b65
> # EXP-Topic rc-versions
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> 5f86fca43d2a
> setup: explain to distutils how we write rc versions
>

Queued for stable.


>
> When we use a rc version number (e.g. 4.8rc0), bdist_msi is using
> distutils.StrictVersion to parse it into a tuple of numbers.
> By default, StrictVersion.version_re only recognizes [ab] for alpha/beta,
> where mercurial may use '-rc' or 'rc'.
> This change makes StrictVersion parse correctly our version numbers, so
> that
> bdist_msi doesn't fail on rc versions.
>
> diff -r 5e5c8f2a1eb5 -r 5f86fca43d2a setup.py
> --- a/setup.py  Tue Oct 23 21:11:13 2018 +0900
> +++ b/setup.py  Wed Oct 31 20:32:42 2018 +0100
> @@ -168,6 +168,9 @@
>  from distutils.sysconfig import get_python_inc, get_config_var
>  from distutils.version import StrictVersion
>
> +# Explain to distutils.StrictVersion how our release candidates are
> versionned
> +StrictVersion.version_re =
> re.compile(r'^(\d+)\.(\d+)(\.(\d+))?-?(rc(\d+))?$')
> +
>  def write_if_changed(path, content):
>      """Write content to a file iff the content hasn't changed."""
>      if os.path.exists(path):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20181031/a1aa3ab7/attachment.html>


More information about the Mercurial-devel mailing list