Chromium Code Reviews| Index: scm.py |
| =================================================================== |
| --- scm.py (revision 123366) |
| +++ scm.py (working copy) |
| @@ -415,7 +415,9 @@ |
| def AssertVersion(cls, min_version): |
| """Asserts git's version is at least min_version.""" |
| if cls.current_version is None: |
| - cls.current_version = cls.Capture(['--version'], '.').split()[-1] |
| + current_version = cls.Capture(['--version'], '.') |
| + matched = re.search('version (?P<version>[0-9.]+)', current_version) |
|
M-A Ruel
2012/02/24 01:33:27
using a named variable is a bit over IMHO, this wo
bashi
2012/02/24 01:39:58
Done.
|
| + cls.current_version = matched.group('version') |
| current_version_list = map(only_int, cls.current_version.split('.')) |
| for min_ver in map(int, min_version.split('.')): |
| ver = current_version_list.pop(0) |