##// END OF EJS Templates
subrepo: move git version check into a separate method...
Mathias De Maré -
r23521:f5de2a82 default
parent child Browse files
Show More
@@ -1135,6 +1135,14 b' class gitsubrepo(abstractsubrepo):'
1135 1135 self._ui.warn(_('git subrepo requires at least 1.6.0 or later\n'))
1136 1136
1137 1137 @staticmethod
1138 def _gitversion(out):
1139 m = re.search(r'^git version (\d+)\.(\d+)', out)
1140 if m:
1141 return (int(m.group(1)), int(m.group(2)))
1142
1143 return -1
1144
1145 @staticmethod
1138 1146 def _checkversion(out):
1139 1147 '''ensure git version is new enough
1140 1148
@@ -1158,13 +1166,12 b' class gitsubrepo(abstractsubrepo):'
1158 1166 >>> _checkversion('no')
1159 1167 'unknown'
1160 1168 '''
1161 m = re.search(r'^git version (\d+)\.(\d+)', out)
1162 if not m:
1163 return 'unknown'
1164 version = (int(m.group(1)), int(m.group(2)))
1169 version = gitsubrepo._gitversion(out)
1165 1170 # git 1.4.0 can't work at all, but 1.5.X can in at least some cases,
1166 1171 # despite the docstring comment. For now, error on 1.4.0, warn on
1167 1172 # 1.5.0 but attempt to continue.
1173 if version == -1:
1174 return 'unknown'
1168 1175 if version < (1, 5):
1169 1176 return 'abort'
1170 1177 elif version < (1, 6):
General Comments 0
You need to be logged in to leave comments. Login now