repo: Fix 'remove-project' regression with multiple projects.

In CL:50715, I updated repo to handle multiple projects, but the
remove-projects code path was not updated accordingly. Update it.

Change-Id: Icd681d45ce857467b584bca0d2fdcbf24ec6e8db
This commit is contained in:
David James 2014-01-30 10:11:17 -08:00
parent f2fe2d9b86
commit b8433dfd2f

View File

@ -519,12 +519,15 @@ class XmlManifest(object):
self._repo_hooks_project.enabled_repo_hooks = enabled_repo_hooks self._repo_hooks_project.enabled_repo_hooks = enabled_repo_hooks
if node.nodeName == 'remove-project': if node.nodeName == 'remove-project':
name = self._reqatt(node, 'name') name = self._reqatt(node, 'name')
try:
del self._projects[name] if name not in self._projects:
except KeyError:
raise ManifestParseError('remove-project element specifies non-existent ' raise ManifestParseError('remove-project element specifies non-existent '
'project: %s' % name) 'project: %s' % name)
for p in self._projects[name]:
del self._paths[p.relpath]
del self._projects[name]
# If the manifest removes the hooks project, treat it as if it deleted # If the manifest removes the hooks project, treat it as if it deleted
# the repo-hooks element too. # the repo-hooks element too.
if self._repo_hooks_project and (self._repo_hooks_project.name == name): if self._repo_hooks_project and (self._repo_hooks_project.name == name):