mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Merge "Better handling of duplicate remotes"
This commit is contained in:
commit
2fa715f8b5
@ -54,6 +54,12 @@ class _XmlRemote(object):
|
||||
self.reviewUrl = review
|
||||
self.resolvedFetchUrl = self._resolveFetchUrl()
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
return self.__dict__ != other.__dict__
|
||||
|
||||
def _resolveFetchUrl(self):
|
||||
url = self.fetchUrl.rstrip('/')
|
||||
manifestUrl = self.manifestUrl.rstrip('/')
|
||||
@ -365,10 +371,13 @@ class XmlManifest(object):
|
||||
for node in itertools.chain(*node_list):
|
||||
if node.nodeName == 'remote':
|
||||
remote = self._ParseRemote(node)
|
||||
if self._remotes.get(remote.name):
|
||||
if remote:
|
||||
if remote.name in self._remotes:
|
||||
if remote != self._remotes[remote.name]:
|
||||
raise ManifestParseError(
|
||||
'duplicate remote %s in %s' %
|
||||
(remote.name, self.manifestFile))
|
||||
'remote %s already exists with different attributes' %
|
||||
(remote.name))
|
||||
else:
|
||||
self._remotes[remote.name] = remote
|
||||
|
||||
for node in itertools.chain(*node_list):
|
||||
|
Loading…
Reference in New Issue
Block a user