[PATCH 2 of 3] subrepo: extend git version check to 3 digits
Matt Mackall
mpm at selenic.com
Wed Dec 10 15:31:16 CST 2014
On Wed, 2014-12-10 at 13:07 -0800, Siddharth Agarwal wrote:
> On 12/10/2014 01:48 AM, Mathias De Maré wrote:
> > # HG changeset patch
> > # User Mathias De Maré <mathias.demare at gmail.com>
> > # Date 1418197281 -3600
> > # Mit Dez 10 08:41:21 2014 +0100
> > # Node ID 239ccaaed78095a128fde4b1421de3d997068c6f
> > # Parent 5a05303a5e4753fb21e99c08635284c25dc8569f
> > subrepo: extend git version check to 3 digits
> >
> > This allows more flexibility when a version check is required.
> > Some git features are introduced in a version where only
> > the 3rd digit changes.
> >
> > diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
> > --- a/mercurial/subrepo.py
> > +++ b/mercurial/subrepo.py
> > @@ -1131,19 +1131,23 @@ class gitsubrepo(abstractsubrepo):
> > self._ui.warn(_('cannot retrieve git version\n'))
> > elif versionstatus == 'abort':
> > raise util.Abort(_('git subrepo requires at least 1.6.0 or later'))
> > elif versionstatus == 'warning':
> > self._ui.warn(_('git subrepo requires at least 1.6.0 or later\n'))
> >
> > @staticmethod
> > def _gitversion(out):
> > + m = re.search(r'^git version (\d+)\.(\d+)\.(\d+)', out)
> > + if m:
> > + return (int(m.group(1)), int(m.group(2)), int(m.group(3)))
>
> I actually changed this to be two digits instead of three because this
> doesn't work with rc versions of Git. The doctests cover this.
>
> > +
> > m = re.search(r'^git version (\d+)\.(\d+)', out)
> > if m:
> > - return (int(m.group(1)), int(m.group(2)))
> > + return (int(m.group(1)), int(m.group(2)), 0)
It falls through to here? So it becomes a question of whether we need to
distinguish between x.y-rc (and friends) and x.y.0, right?
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list