diff --git a/docs/manifest-format.txt b/docs/manifest-format.txt index 409524b..2b49d46 100644 --- a/docs/manifest-format.txt +++ b/docs/manifest-format.txt @@ -23,9 +23,10 @@ following DTD: - - - + + + + @@ -67,6 +68,12 @@ Attribute `review`: Hostname of the Gerrit server where reviews are uploaded to by `repo upload`. This attribute is optional; if not specified then `repo upload` will not function. +Attribute `project-name`: Specifies the name of this project used +by the review server given in the review attribute of this element. +Only permitted when the remote element is nested inside of a project +element (see below). If not given, defaults to the name supplied +in the project's name attribute. + Element default --------------- diff --git a/manifest.py b/manifest.py index ea68b68..6545568 100644 --- a/manifest.py +++ b/manifest.py @@ -206,10 +206,17 @@ class Manifest(object): name = self._reqatt(node, 'name') fetch = self._reqatt(node, 'fetch') review = node.getAttribute('review') + if review == '': + review = None + + projectName = node.getAttribute('project-name') + if projectName == '': + projectName = None r = Remote(name=name, fetch=fetch, - review=review) + review=review, + projectName=projectName) for n in node.childNodes: if n.nodeName == 'require': diff --git a/project.py b/project.py index 2a4adf7..9509cb9 100644 --- a/project.py +++ b/project.py @@ -904,7 +904,9 @@ class Project(object): remote = self.GetRemote(r.name) remote.url = r.fetchUrl remote.review = r.reviewUrl - if remote.projectname is None: + if r.projectName: + remote.projectname = r.projectName + elif remote.projectname is None: remote.projectname = self.name remote.ResetFetch() remote.Save() diff --git a/remote.py b/remote.py index 27a8f7a..3bc30a5 100644 --- a/remote.py +++ b/remote.py @@ -14,8 +14,12 @@ # limitations under the License. class Remote(object): - def __init__(self, name, fetch=None, review=None): + def __init__(self, name, + fetch=None, + review=None, + projectName=None): self.name = name self.fetchUrl = fetch self.reviewUrl = review + self.projectName = projectName self.requiredCommits = []