summaryrefslogtreecommitdiffstats
path: root/tools/scripts/git_submodule.py
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-07-16 17:11:14 +0200
committerAndras Becsi <andras.becsi@digia.com>2014-07-16 19:50:25 +0200
commit8a19129da13ac4a0da49fd9e5317631b7f40d896 (patch)
treed8482bb675d66f167befb668331fa2a938246797 /tools/scripts/git_submodule.py
parente50e838fd4d3b7592f84ae846a9975ada5fb09c9 (diff)
init-repository: fix checkout of pure git repositories
Since some projects are maintained in git repositories only even the 'svn' DEPS file has some git shasums instead of svn revisions. Check the current shasum and tag outside of the ref block so we actually end up checking out the parsed shasum for non-git-svn repositories. Change-Id: Iabc4a5b15e50a0f0df84179a65929352ee2addb7 Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Diffstat (limited to 'tools/scripts/git_submodule.py')
-rw-r--r--tools/scripts/git_submodule.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/scripts/git_submodule.py b/tools/scripts/git_submodule.py
index f22f7323..fa5e9691 100644
--- a/tools/scripts/git_submodule.py
+++ b/tools/scripts/git_submodule.py
@@ -161,7 +161,6 @@ class Submodule:
oldCwd = os.getcwd()
os.chdir(self.path)
error = 0
- current_shasum = ''
if self.ref:
# Fetch the ref we parsed from the DEPS file.
error = subprocessCall(['git', 'fetch', 'origin', self.ref])
@@ -170,18 +169,20 @@ class Submodule:
return error
error = subprocessCall(['git', 'checkout', 'FETCH_HEAD']);
- current_shasum = subprocessCheckOutput(['git', 'rev-parse', 'HEAD']).strip()
- current_tag = subprocessCheckOutput(['git', 'name-rev', '--tags', '--name-only', current_shasum]).strip()
- if current_tag == resolver.currentVersion():
- # We checked out a tagged version of chromium.
- self.shasum = current_shasum
- elif self.revision:
+ if self.revision:
search_string = '\"git-svn-id: .*@' + str(self.revision) + '\"'
line = subprocessCheckOutput(['git', 'log', '-n1', '--pretty=oneline', '--grep=' + search_string])
if line:
self.shasum = line.split()[0]
+ current_shasum = subprocessCheckOutput(['git', 'rev-parse', 'HEAD']).strip()
+ current_tag = subprocessCheckOutput(['git', 'name-rev', '--tags', '--name-only', current_shasum]).strip()
+
+ if current_tag == resolver.currentVersion():
+ # We checked out a tagged version of chromium.
+ self.shasum = current_shasum
+
if not self.shasum:
# No shasum could be deduced, use the submodule shasum.
os.chdir(oldCwd)