implement optional 'pushurl' in the manifest file
Allow the 'remote' element in the manifest file to define an optional
'pushurl' attribute which is passed into the .git/config file.
Change-Id: If342d299d371374aedc4440645798888869c9714
Signed-off-by: Steve Rae <steve.rae@raedomain.com>
diff --git a/git_config.py b/git_config.py
index f76cd04..f474a1c 100644
--- a/git_config.py
+++ b/git_config.py
@@ -572,6 +572,7 @@
self._config = config
self.name = name
self.url = self._Get('url')
+ self.pushUrl = self._Get('pushurl')
self.review = self._Get('review')
self.projectname = self._Get('projectname')
self.fetch = list(map(RefSpec.FromString,
@@ -701,6 +702,10 @@
"""Save this remote to the configuration.
"""
self._Set('url', self.url)
+ if self.pushUrl is not None:
+ self._Set('pushurl', self.pushUrl + '/' + self.projectname)
+ else:
+ self._Set('pushurl', self.pushUrl)
self._Set('review', self.review)
self._Set('projectname', self.projectname)
self._Set('fetch', list(map(str, self.fetch)))