diff options
author | Andras Becsi <andras.becsi@digia.com> | 2014-07-16 17:11:14 +0200 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2014-07-16 19:50:25 +0200 |
commit | 8a19129da13ac4a0da49fd9e5317631b7f40d896 (patch) | |
tree | d8482bb675d66f167befb668331fa2a938246797 /tools/scripts/git_submodule.py | |
parent | e50e838fd4d3b7592f84ae846a9975ada5fb09c9 (diff) | |
download | qtwebengine-8a19129da13ac4a0da49fd9e5317631b7f40d896.tar.gz |
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.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/scripts/git_submodule.py b/tools/scripts/git_submodule.py index f22f7323c..fa5e9691c 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) |