mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-30 20:17:08 +00:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
5cc6679fb8 |
16
manifest.py
16
manifest.py
@ -26,6 +26,7 @@ from remote import Remote
|
|||||||
from error import ManifestParseError
|
from error import ManifestParseError
|
||||||
|
|
||||||
MANIFEST_FILE_NAME = 'manifest.xml'
|
MANIFEST_FILE_NAME = 'manifest.xml'
|
||||||
|
LOCAL_MANIFEST_NAME = 'local_manifest.xml'
|
||||||
|
|
||||||
class _Default(object):
|
class _Default(object):
|
||||||
"""Project defaults within the manifest."""
|
"""Project defaults within the manifest."""
|
||||||
@ -108,10 +109,20 @@ class Manifest(object):
|
|||||||
|
|
||||||
def _Load(self):
|
def _Load(self):
|
||||||
if not self._loaded:
|
if not self._loaded:
|
||||||
self._ParseManifest()
|
self._ParseManifest(True)
|
||||||
|
|
||||||
|
local = os.path.join(self.repodir, LOCAL_MANIFEST_NAME)
|
||||||
|
if os.path.exists(local):
|
||||||
|
try:
|
||||||
|
real = self.manifestFile
|
||||||
|
self.manifestFile = local
|
||||||
|
self._ParseManifest(False)
|
||||||
|
finally:
|
||||||
|
self.manifestFile = real
|
||||||
|
|
||||||
self._loaded = True
|
self._loaded = True
|
||||||
|
|
||||||
def _ParseManifest(self):
|
def _ParseManifest(self, is_root_file):
|
||||||
root = xml.dom.minidom.parse(self.manifestFile)
|
root = xml.dom.minidom.parse(self.manifestFile)
|
||||||
if not root or not root.childNodes:
|
if not root or not root.childNodes:
|
||||||
raise ManifestParseError, \
|
raise ManifestParseError, \
|
||||||
@ -124,6 +135,7 @@ class Manifest(object):
|
|||||||
"no <manifest> in %s" % \
|
"no <manifest> in %s" % \
|
||||||
self.manifestFile
|
self.manifestFile
|
||||||
|
|
||||||
|
if is_root_file:
|
||||||
self.branch = config.getAttribute('branch')
|
self.branch = config.getAttribute('branch')
|
||||||
if not self.branch:
|
if not self.branch:
|
||||||
self.branch = 'default'
|
self.branch = 'default'
|
||||||
|
Reference in New Issue
Block a user