diff --git a/gclient_scm.py b/gclient_scm.py index e0b7b259d..18811c453 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -628,8 +628,6 @@ class GitWrapper(SCMWrapper): raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args)) - self._CheckMinVersion("1.6.6") - url, deps_revision = gclient_utils.SplitUrlRevision(self.url) revision = deps_revision managed = True @@ -1385,13 +1383,6 @@ class GitWrapper(SCMWrapper): # whitespace between projects when syncing. self.Print('') - @staticmethod - def _CheckMinVersion(min_version): - (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 _EnsureValidHeadObjectOrCheckout(self, revision, options, url): # Special case handling if all 3 conditions are met: # * the mirros have recently changed, but deps destination remains same, diff --git a/scm.py b/scm.py index 2c98290c5..5dc9583ad 100644 --- a/scm.py +++ b/scm.py @@ -3,7 +3,6 @@ # found in the LICENSE file. """SCM-specific utility classes.""" -import distutils.version import glob import io import os @@ -489,14 +488,3 @@ class GIT(object): if sha_only: return sha == rev.lower() return True - - @classmethod - def AssertVersion(cls, min_version): - """Asserts git's version is at least min_version.""" - if cls.current_version is None: - current_version = cls.Capture(['--version'], '.') - matched = re.search(r'git version (.+)', current_version) - cls.current_version = distutils.version.LooseVersion( - matched.group(1)) - min_version = distutils.version.LooseVersion(min_version) - return (min_version <= cls.current_version, cls.current_version) diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py index 3b3c8794c..5f1adf14b 100755 --- a/tests/gclient_scm_test.py +++ b/tests/gclient_scm_test.py @@ -635,7 +635,6 @@ class ManagedGitWrapperTestCaseMock(unittest.TestCase): self.backup_base_path = os.path.join(self.root_dir, 'old_%s.git' % self.relpath) mock.patch('gclient_scm.scm.GIT.ApplyEnvVars').start() - mock.patch('gclient_scm.GitWrapper._CheckMinVersion').start() mock.patch('gclient_scm.GitWrapper._Fetch').start() mock.patch('gclient_scm.GitWrapper._DeleteOrMove').start() mock.patch('sys.stdout', StringIO()).start() diff --git a/tests/scm_unittest.py b/tests/scm_unittest.py index 8e4a3f4c2..e0b1a6d61 100755 --- a/tests/scm_unittest.py +++ b/tests/scm_unittest.py @@ -34,25 +34,6 @@ class GitWrapperTestCase(unittest.TestCase): mockCapture.assert_called_with(['config', 'user.email'], cwd=self.root_dir) - @mock.patch('scm.GIT.Capture') - def testAssertVersion(self, mockCapture): - cases = [ - ('1.7', True), - ('1.7.9', True), - ('1.7.9.foo-bar-baz', True), - ('1.8', True), - ('1.6.9', False), - ] - for expected_version, expected_ok in cases: - - class GIT(scm.GIT): - pass - - mockCapture.return_value = 'git version ' + expected_version - ok, version = GIT.AssertVersion('1.7') - self.assertEqual(expected_ok, ok) - self.assertEqual(expected_version, version) - def testRefToRemoteRef(self): remote = 'origin' refs = {