summaryrefslogtreecommitdiffstats
path: root/init-repository.py
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@digia.com>2013-06-26 19:28:49 +0200
committerAndras Becsi <andras.becsi@digia.com>2013-06-27 13:53:45 +0200
commit54a034ea11f511ee20712b0255f7e909e7e2384d (patch)
tree8575bc314b989c5bdb0d2487fb78623a91f0d149 /init-repository.py
parent7327bbfc93e1e2dda2436814e66e2e237b66b997 (diff)
Improve init-repository.py script.
The script now also installs a gerrit git remote and the Change-Id git hook. Further it also resets the chromium repository and applies the patches on top. Change-Id: Ic0cb0195678e457a9316454d75132798bc5b9de2 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'init-repository.py')
-rwxr-xr-xinit-repository.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/init-repository.py b/init-repository.py
index 97ad31047..ae7679da5 100755
--- a/init-repository.py
+++ b/init-repository.py
@@ -84,7 +84,7 @@ class Submodule:
return False
def findSha(self):
- line = subprocess.check_output(['git', 'submodule', 'status', self.path]);
+ line = subprocess.check_output(['git', 'submodule', 'status', self.path])
line = line.lstrip(' -')
self.shasum = line.split(' ')[0]
@@ -96,8 +96,9 @@ class Submodule:
self.findSha()
currentDir = os.getcwd()
os.chdir(self.path)
- #subprocess.call(['git', 'fetch'])
- #subprocess.call(['git', 'checkout', self.shasum, '-q']) # -q is to silence detached head warnings.
+ # Make sure we have checked out the right shasum.
+ # In case there were other patches applied before.
+ subprocess.call(['git', 'checkout', self.shasum])
initSubmodules()
os.chdir(currentDir)
else:
@@ -159,9 +160,25 @@ def buildNinja():
subprocess.call(['python', 'bootstrap.py'])
os.chdir(currentDir)
+def addGerritRemote():
+ os.chdir(qtwebengine_src)
+ remotes = subprocess.check_output(['git', 'remote'])
+ if not 'gerrit' in remotes:
+ subprocess.call(['git', 'remote', 'add', 'gerrit', 'ssh://codereview.qt-project.org:29418/qt-labs/qtwebengine.git'])
+
+def installGitHooks():
+ os.chdir(qtwebengine_src)
+ subprocess.call(['scp', '-p', 'codereview.qt-project.org:hooks/commit-msg', '.git/hooks'])
+
+def applyPatches():
+ os.chdir(qtwebengine_src)
+ subprocess.call(['sh', './patches/patch-chromium.sh'])
+
os.chdir(qtwebengine_src)
+addGerritRemote()
+installGitHooks()
initSubmodules()
-#initSubmodules('HEAD')
+applyPatches()
updateLastChange()
buildNinja()