diff --git a/docs/manifest-format.txt b/docs/manifest-format.txt index f4629a55..59f6a2fd 100644 --- a/docs/manifest-format.txt +++ b/docs/manifest-format.txt @@ -57,6 +57,7 @@ following DTD: + @@ -227,6 +228,12 @@ Attribute `clone-depth`: Set the depth to use when fetching this project. If specified, this value will override any value given to repo init with the --depth option on the command line. +Attribute `force-path`: Set to true to force this project to create the +local mirror repository according to its `path` attribute (if supplied) +rather than the `name` attribute. This attribute only applies to the +local mirrors syncing, it will be ignored when syncing the projects in a +client working directory. + Element annotation ------------------ 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),