Commit fcffd481 authored by bashi@chromium.org's avatar bashi@chromium.org

Fix compatibility with Xcode4.3 git

Xcode 4.3 git returns the version like below:

git version 1.7.7.5 (Apple Git-26)

Modify GIT.AssertVersion to accept such input.

Also modify tests/gclient_scm_test.py to pass tests, but not sure
the fix is collect.

BUG=chromium:115576
TEST=ran tests/gclient_scm_test.py

Review URL: http://codereview.chromium.org/9443047

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@123399 0039d316-1c4b-4281-b951-d872f2087c98
parent 33167331
......@@ -415,7 +415,9 @@ class GIT(object):
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(r'version ([0-9\.]+)', current_version)
cls.current_version = matched.group(1)
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)
......
......@@ -948,7 +948,7 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase):
"\n_____ foo at refs/heads/master\n\n"
"________ running 'git clone --progress -b master --verbose %s %s'"
" in '%s'\n"
"Cloning into %s...\ndone.\n") % (
"Cloning into '%s'...\ndone.\n") % (
join(self.root_dir, '.', '.git'),
join(root_dir, 'foo'),
root_dir,
......@@ -1263,7 +1263,7 @@ class UnmanagedGitWrapperTestCase(BaseGitWrapperTestCase):
"\n_____ foo at refs/heads/master\n\n"
"________ running 'git clone --progress -b master --verbose %s %s'"
" in '%s'\n"
"Cloning into %s...\ndone.\n") % (
"Cloning into '%s'...\ndone.\n") % (
join(self.root_dir, '.', '.git'),
join(root_dir, 'foo'),
root_dir,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment