summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorVictor Boivie <victor.boivie@sonymobile.com>2012-10-05 12:37:58 +0200
committerChirayu Desai <cdesai@cyanogenmod.org>2013-05-12 17:49:28 +0530
commit2b30e3aabafa43c224cb6d57dc232d78b28a4901 (patch)
treeba6fe5ee439091371977cd3db36b32b41c6b4e9d /project.py
parent793f90cdc0cffc3ade6acdc544e315fbd54cbb0b (diff)
downloadgit-repo-2b30e3aabafa43c224cb6d57dc232d78b28a4901.tar.gz
Use reference also for manifest git
When running 'repo init --reference=<mirror>', the mirror will be used for all projects except the manifest project. This is because the _InitGitDir function uses the 'repo.reference' git config value specified in the manifest git, which has no effect when creating the manifest git as that value will be set after the git has been successfully cloned. Information about where the manifest git is located on the server is only known when performing the 'repo init', so that information has to be provided when cloning the git in order for it to set up a proper mapping. Change-Id: I47a2c8b3267a4065965058718ce1def4ecb34d5a Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
Diffstat (limited to 'project.py')
-rw-r--r--project.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/project.py b/project.py
index 516d3b6c..effe75c4 100644
--- a/project.py
+++ b/project.py
@@ -1854,16 +1854,17 @@ class Project(object):
1854 if GitCommand(self, cmd).Wait() != 0: 1854 if GitCommand(self, cmd).Wait() != 0:
1855 raise GitError('%s merge %s ' % (self.name, head)) 1855 raise GitError('%s merge %s ' % (self.name, head))
1856 1856
1857 def _InitGitDir(self): 1857 def _InitGitDir(self, mirror_git=None):
1858 if not os.path.exists(self.gitdir): 1858 if not os.path.exists(self.gitdir):
1859 os.makedirs(self.gitdir) 1859 os.makedirs(self.gitdir)
1860 self.bare_git.init() 1860 self.bare_git.init()
1861 1861
1862 mp = self.manifest.manifestProject 1862 mp = self.manifest.manifestProject
1863 ref_dir = mp.config.GetString('repo.reference') 1863 ref_dir = mp.config.GetString('repo.reference') or ''
1864 1864
1865 if ref_dir: 1865 if ref_dir or mirror_git:
1866 mirror_git = os.path.join(ref_dir, self.name + '.git') 1866 if not mirror_git:
1867 mirror_git = os.path.join(ref_dir, self.name + '.git')
1867 repo_git = os.path.join(ref_dir, '.repo', 'projects', 1868 repo_git = os.path.join(ref_dir, '.repo', 'projects',
1868 self.relpath + '.git') 1869 self.relpath + '.git')
1869 1870