Merge "Better handling of duplicate default"

This commit is contained in:
David Pursehouse 2013-10-15 01:40:07 +00:00 committed by Gerrit Code Review
commit 143b4cc992

View File

@ -51,6 +51,12 @@ class _Default(object):
sync_c = False sync_c = False
sync_s = False sync_s = False
def __eq__(self, other):
return self.__dict__ == other.__dict__
def __ne__(self, other):
return self.__dict__ != other.__dict__
class _XmlRemote(object): class _XmlRemote(object):
def __init__(self, def __init__(self,
name, name,
@ -427,11 +433,14 @@ class XmlManifest(object):
for node in itertools.chain(*node_list): for node in itertools.chain(*node_list):
if node.nodeName == 'default': if node.nodeName == 'default':
if self._default is not None: new_default = self._ParseDefault(node)
raise ManifestParseError( if self._default is None:
'duplicate default in %s' % self._default = new_default
(self.manifestFile)) elif new_default != self._default:
self._default = self._ParseDefault(node) raise ManifestParseError(
'duplicate default in %s' %
(self.manifestFile))
if self._default is None: if self._default is None:
self._default = _Default() self._default = _Default()