[PATCH 1 of 2 STABLE] subrepo: warn user if Git is not version 1.6.0 or higher
Augie Fackler
raf at durin42.com
Tue Jun 12 09:57:34 CDT 2012
On Jun 12, 2012, at 10:53 AM, Benjamin Pollack wrote:
> On Tue, 12 Jun 2012 10:39:27 -0400, Augie Fackler <raf at durin42.com> wrote:
>>> + def _ensuregit(self):
>>> + out = self._gitcommand(['--version'])
>>> + m = re.search(r'^git version (\d+)\.(\d+)\.(\d+)', out)
>>> + if not m:
>>> + self._ui.warn(_('cannot retrieve git version'))
>>> + return
>>> + version = (int(m.group(1)), m.group(2), m.group(3))
>>> + if version < (1, 6, 0):
>>> + self._ui.warn(_('git subrepo support requires git 1.6.0 or later'))
>>
>> Should this be an abort rather than a warning? What level of working will this produce?
>
> The restriction comes from the docstring on _gitnodir, which I took at face value. I initially wrote this code as an abort; Kevin suggested changing it to a warning, which I did here, precisely because I wasn't entirely clear what functionality was new in 1.6.0 that subrepo needs. Trying some versions at random, Git 1.4.0 appears somewhat unusable (some commands are missing), while a late 1.5 seems to work okay for a trivial case. I'd need to ask Eric Eisner, who wrote the code, for a precise rundown; Git plumbing isn't my forte.
Fair enough. Maybe abort if it's less than 1.4 now, and leave a comment that we're not sure what the status of 1.5.x is?
>
> --Benjamin
More information about the Mercurial-devel
mailing list