Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: gclient_scm.py

Issue 878001: Extract git version check code from gclient_scm.py into scm.py where it belongs. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scm.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index a9984e857029680af5dbb7598f276810f7bd3917..1afd3f4ffa4382373e07b650fa9c8d287eb6e44a 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -555,21 +555,10 @@ class GitWrapper(SCMWrapper, scm.GIT):
print ""
def _CheckMinVersion(self, min_version):
- def only_int(val):
- if val.isdigit():
- return int(val)
- else:
- return 0
- version = self._Run(['--version'], cwd='.').split()[-1]
- version_list = map(only_int, version.split('.'))
- min_version_list = map(int, min_version.split('.'))
- for min_ver in min_version_list:
- ver = version_list.pop(0)
- if min_ver > ver:
- raise gclient_utils.Error('git version %s < minimum required %s' %
- (version, min_version))
- elif min_ver < ver:
- return
+ (ok, current_version) = scm.GIT.AssertVersion(min_version)
+ if not ok:
+ raise gclient_utils.Error('git version %s < minimum required %s' %
+ (current_version, min_version))
def _GetCurrentBranch(self):
# Returns name of current branch
« no previous file with comments | « no previous file | scm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698