From b8433dfd2f078617b724e4dc4f709330cc90f1e7 Mon Sep 17 00:00:00 2001 From: David James Date: Thu, 30 Jan 2014 10:11:17 -0800 Subject: 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 --- manifest_xml.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manifest_xml.py b/manifest_xml.py index c5f3bcc9..f2ac77a5 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -519,12 +519,15 @@ class XmlManifest(object): self._repo_hooks_project.enabled_repo_hooks = enabled_repo_hooks if node.nodeName == 'remove-project': name = self._reqatt(node, 'name') - try: - del self._projects[name] - except KeyError: + + if name not in self._projects: raise ManifestParseError('remove-project element specifies non-existent ' '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 # the repo-hooks element too. if self._repo_hooks_project and (self._repo_hooks_project.name == name): -- cgit v1.2.3-54-g00ecf