diff options
Diffstat (limited to 'manifest_xml.py')
| -rw-r--r-- | manifest_xml.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index 02f09db9..8718dc54 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -376,7 +376,7 @@ class XmlManifest(object): | |||
| 376 | if os.path.exists(mp.gitdir) and mp.use_worktree: | 376 | if os.path.exists(mp.gitdir) and mp.use_worktree: |
| 377 | mp.use_git_worktrees = True | 377 | mp.use_git_worktrees = True |
| 378 | 378 | ||
| 379 | self._Unload() | 379 | self.Unload() |
| 380 | 380 | ||
| 381 | def Override(self, name, load_local_manifests=True): | 381 | def Override(self, name, load_local_manifests=True): |
| 382 | """Use a different manifest, just for the current instantiation. | 382 | """Use a different manifest, just for the current instantiation. |
| @@ -399,7 +399,7 @@ class XmlManifest(object): | |||
| 399 | try: | 399 | try: |
| 400 | self._load_local_manifests = load_local_manifests | 400 | self._load_local_manifests = load_local_manifests |
| 401 | self.manifestFile = path | 401 | self.manifestFile = path |
| 402 | self._Unload() | 402 | self.Unload() |
| 403 | self._Load() | 403 | self._Load() |
| 404 | finally: | 404 | finally: |
| 405 | self.manifestFile = old | 405 | self.manifestFile = old |
| @@ -970,7 +970,13 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
| 970 | groups = self.GetDefaultGroupsStr() | 970 | groups = self.GetDefaultGroupsStr() |
| 971 | return groups | 971 | return groups |
| 972 | 972 | ||
| 973 | def _Unload(self): | 973 | def Unload(self): |
| 974 | """Unload the manifest. | ||
| 975 | |||
| 976 | If the manifest files have been changed since Load() was called, this will | ||
| 977 | cause the new/updated manifest to be used. | ||
| 978 | |||
| 979 | """ | ||
| 974 | self._loaded = False | 980 | self._loaded = False |
| 975 | self._projects = {} | 981 | self._projects = {} |
| 976 | self._paths = {} | 982 | self._paths = {} |
| @@ -984,6 +990,11 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
| 984 | self.branch = None | 990 | self.branch = None |
| 985 | self._manifest_server = None | 991 | self._manifest_server = None |
| 986 | 992 | ||
| 993 | def Load(self): | ||
| 994 | """Read the manifest into memory.""" | ||
| 995 | # Do not expose internal arguments. | ||
| 996 | self._Load() | ||
| 997 | |||
| 987 | def _Load(self, initial_client=None, submanifest_depth=0): | 998 | def _Load(self, initial_client=None, submanifest_depth=0): |
| 988 | if submanifest_depth > MAX_SUBMANIFEST_DEPTH: | 999 | if submanifest_depth > MAX_SUBMANIFEST_DEPTH: |
| 989 | raise ManifestParseError('maximum submanifest depth %d exceeded.' % | 1000 | raise ManifestParseError('maximum submanifest depth %d exceeded.' % |
| @@ -1030,7 +1041,7 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
| 1030 | except ManifestParseError as e: | 1041 | except ManifestParseError as e: |
| 1031 | # There was a problem parsing, unload ourselves in case they catch | 1042 | # There was a problem parsing, unload ourselves in case they catch |
| 1032 | # this error and try again later, we will show the correct error | 1043 | # this error and try again later, we will show the correct error |
| 1033 | self._Unload() | 1044 | self.Unload() |
| 1034 | raise e | 1045 | raise e |
| 1035 | 1046 | ||
| 1036 | if self.IsMirror: | 1047 | if self.IsMirror: |
