# HG changeset patch # User Mathias De Maré # Date 1418197281 -3600 # Node ID 49a58b33d1ced975fee1e3fd7bb8fca0084017c0 # Parent f5de2a82b77ef9d5209b78546404795c204f0a72 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 -r f5de2a82b77e -r 49a58b33d1ce mercurial/subrepo.py --- a/mercurial/subrepo.py Wed Dec 10 08:33:03 2014 +0100 +++ b/mercurial/subrepo.py Wed Dec 10 08:41:21 2014 +0100 @@ -1136,9 +1136,13 @@ @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))) + 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) return -1 @@ -1172,9 +1176,9 @@ # 1.5.0 but attempt to continue. if version == -1: return 'unknown' - if version < (1, 5): + if version < (1, 5, 0): return 'abort' - elif version < (1, 6): + elif version < (1, 6, 0): return 'warning' return 'ok'