diff options
-rw-r--r-- | manifest.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/manifest.py b/manifest.py index 45b0f9a5..89dd5bed 100644 --- a/manifest.py +++ b/manifest.py | |||
@@ -26,6 +26,7 @@ from remote import Remote | |||
26 | from error import ManifestParseError | 26 | from error import ManifestParseError |
27 | 27 | ||
28 | MANIFEST_FILE_NAME = 'manifest.xml' | 28 | MANIFEST_FILE_NAME = 'manifest.xml' |
29 | LOCAL_MANIFEST_NAME = 'local_manifest.xml' | ||
29 | 30 | ||
30 | class _Default(object): | 31 | class _Default(object): |
31 | """Project defaults within the manifest.""" | 32 | """Project defaults within the manifest.""" |
@@ -108,10 +109,20 @@ class Manifest(object): | |||
108 | 109 | ||
109 | def _Load(self): | 110 | def _Load(self): |
110 | if not self._loaded: | 111 | if not self._loaded: |
111 | self._ParseManifest() | 112 | self._ParseManifest(True) |
113 | |||
114 | local = os.path.join(self.repodir, LOCAL_MANIFEST_NAME) | ||
115 | if os.path.exists(local): | ||
116 | try: | ||
117 | real = self.manifestFile | ||
118 | self.manifestFile = local | ||
119 | self._ParseManifest(False) | ||
120 | finally: | ||
121 | self.manifestFile = real | ||
122 | |||
112 | self._loaded = True | 123 | self._loaded = True |
113 | 124 | ||
114 | def _ParseManifest(self): | 125 | def _ParseManifest(self, is_root_file): |
115 | root = xml.dom.minidom.parse(self.manifestFile) | 126 | root = xml.dom.minidom.parse(self.manifestFile) |
116 | if not root or not root.childNodes: | 127 | if not root or not root.childNodes: |
117 | raise ManifestParseError, \ | 128 | raise ManifestParseError, \ |
@@ -124,9 +135,10 @@ class Manifest(object): | |||
124 | "no <manifest> in %s" % \ | 135 | "no <manifest> in %s" % \ |
125 | self.manifestFile | 136 | self.manifestFile |
126 | 137 | ||
127 | self.branch = config.getAttribute('branch') | 138 | if is_root_file: |
128 | if not self.branch: | 139 | self.branch = config.getAttribute('branch') |
129 | self.branch = 'default' | 140 | if not self.branch: |
141 | self.branch = 'default' | ||
130 | 142 | ||
131 | for node in config.childNodes: | 143 | for node in config.childNodes: |
132 | if node.nodeName == 'remote': | 144 | if node.nodeName == 'remote': |