summaryrefslogtreecommitdiffstats
path: root/tools/scripts/git_submodule.py
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-09-09 15:55:59 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-09-10 13:02:06 +0200
commita4eb4ab50eab0ab91e6c4cacfc23232d6a0a2081 (patch)
treeaa45474284ddd770f84a79044e68ee47167c4267 /tools/scripts/git_submodule.py
parent65d149352d4062356c15dc496f738fe51f257557 (diff)
Prepare scripts for the .103 snapshot
Chromium is now relying on git for its releases and isn't creating release DEPS files anymore. This patch makes sure that we ignore any deps not starting with src/ to exclude the script repositories outside of the Chromium sources and it removes all the svn-related logic. Change-Id: I24b1839f919821382b8c5993c71251dbd6108d4f Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'tools/scripts/git_submodule.py')
-rw-r--r--tools/scripts/git_submodule.py20
1 files changed, 4 insertions, 16 deletions
diff --git a/tools/scripts/git_submodule.py b/tools/scripts/git_submodule.py
index a9002ffe8..f3508eac9 100644
--- a/tools/scripts/git_submodule.py
+++ b/tools/scripts/git_submodule.py
@@ -77,8 +77,9 @@ class DEPSParser:
subdir = dep
if subdir.startswith('src/'):
subdir = subdir[4:]
- if subdir.startswith('src'):
- # Ignore the information about chromium since we get that from git.
+ else:
+ # Ignore the information about chromium itself since we get that from git,
+ # also ignore anything outside src/ (e.g. depot_tools)
continue
submodule = Submodule(subdir, repo)
@@ -91,14 +92,10 @@ class DEPSParser:
if len(rev) == 40: # Length of a git shasum
submodule.shasum = rev
else:
- # Try to find out the git branch using the svn path.
+ # Try to find out the git branch.
branchMatch = re.search('/branches/((chromium/)?[^/]+)', repo)
- trunkMatch = re.search('/(trunk|svn)/', repo)
if branchMatch:
submodule.ref = 'refs/branch-heads/' + branchMatch.group(1)
- elif trunkMatch:
- submodule.ref = 'refs/heads/master'
- submodule.revision = int(rev)
submodules.append(submodule)
return submodules
@@ -118,7 +115,6 @@ class Submodule:
self.shasum = shasum
self.os = os
self.ref = ''
- self.revision = None
def matchesOS(self):
if not self.os:
@@ -153,12 +149,6 @@ class Submodule:
error = subprocessCall(['git', 'checkout', 'FETCH_HEAD']);
- if self.revision:
- search_string = 'git-svn-id:.*@%d' % self.revision
- line = subprocessCheckOutput(['git', 'log', '-n1', '--pretty=oneline', r'--grep=%s' % 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()
@@ -249,8 +239,6 @@ class Submodule:
print 'DEPS file provides the following submodules:'
for submodule in submodules:
submodule_ref = submodule.shasum
- if submodule.revision:
- submodule_ref = submodule.ref + '@' + str(submodule.revision)
print '{:<80}'.format(submodule.path) + '{:<120}'.format(submodule.url) + submodule_ref
else: # Try .gitmodules since no ref has been specified
if not os.path.isfile('.gitmodules'):