From db83b1b5abcc2df1b5c7a76ca74ff60e88fe956e Mon Sep 17 00:00:00 2001 From: Scott Fan Date: Thu, 28 Feb 2013 09:34:14 +0800 Subject: Allow mirror to be created in directories specified by 'path' attribute In some cases, especially when local manifest files exist, users may want to force the mirrored repositories to be created in folders according to their 'path' attribute in the manifest, rather than according to the name of the repositories. To enable this functionality for specified mirror, add a new attribute 'force-path' for that project in the manifest, set its value to 'true'. Change-Id: I61df8c987a23d84309b113e7d886ec90c838a6cc Signed-off-by: Scott Fan --- manifest_xml.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'manifest_xml.py') diff --git a/manifest_xml.py b/manifest_xml.py index 4eef748f..51d51b95 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -690,6 +690,10 @@ class XmlManifest(object): default_groups = ['all', 'name:%s' % name, 'path:%s' % relpath] groups.extend(set(default_groups).difference(groups)) + if self.IsMirror and node.hasAttribute('force-path'): + if node.getAttribute('force-path').lower() in ("yes", "true", "1"): + gitdir = os.path.join(self.topdir, '%s.git' % path) + project = Project(manifest = self, name = name, remote = remote.ToRemoteSpec(name), -- cgit v1.2.3-54-g00ecf