diff options
author | LaMont Jones <lamontjones@google.com> | 2022-03-29 21:54:22 +0000 |
---|---|---|
committer | LaMont Jones <lamontjones@google.com> | 2022-03-31 21:02:52 +0000 |
commit | 9b72cf2ba5c00bee726aa4bddbb84be554294284 (patch) | |
tree | 9b9e34554a46c2af45a02f8f56366c50d7390efd /manifest_xml.py | |
parent | 5d3291d818ba479afc112370e3c5fc2dc0587d6e (diff) | |
download | git-repo-9b72cf2ba5c00bee726aa4bddbb84be554294284.tar.gz |
project: Isolate ManifestProject from RepoProject
Create RepoProject and ManifestProject, inheriting from MetaProject,
with methods separated for isolation and clarity.
Change-Id: Ic1d6efc65c99470290fea612e2abaf8670d199f4
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334139
Tested-by: LaMont Jones <lamontjones@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'manifest_xml.py')
-rw-r--r-- | manifest_xml.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index a14cc526..d3e952a5 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -25,7 +25,8 @@ import gitc_utils | |||
25 | from git_config import GitConfig, IsId | 25 | from git_config import GitConfig, IsId |
26 | from git_refs import R_HEADS, HEAD | 26 | from git_refs import R_HEADS, HEAD |
27 | import platform_utils | 27 | import platform_utils |
28 | from project import Annotation, RemoteSpec, Project, MetaProject | 28 | from project import (Annotation, RemoteSpec, Project, RepoProject, |
29 | ManifestProject) | ||
29 | from error import (ManifestParseError, ManifestInvalidPathError, | 30 | from error import (ManifestParseError, ManifestInvalidPathError, |
30 | ManifestInvalidRevisionError) | 31 | ManifestInvalidRevisionError) |
31 | from wrapper import Wrapper | 32 | from wrapper import Wrapper |
@@ -360,7 +361,7 @@ class XmlManifest(object): | |||
360 | # multi-tree. | 361 | # multi-tree. |
361 | self._outer_client = outer_client or self | 362 | self._outer_client = outer_client or self |
362 | 363 | ||
363 | self.repoProject = MetaProject(self, 'repo', | 364 | self.repoProject = RepoProject(self, 'repo', |
364 | gitdir=os.path.join(repodir, 'repo/.git'), | 365 | gitdir=os.path.join(repodir, 'repo/.git'), |
365 | worktree=os.path.join(repodir, 'repo')) | 366 | worktree=os.path.join(repodir, 'repo')) |
366 | 367 | ||
@@ -953,9 +954,9 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
953 | def SubmanifestProject(self, submanifest_path): | 954 | def SubmanifestProject(self, submanifest_path): |
954 | """Return a manifestProject for a submanifest.""" | 955 | """Return a manifestProject for a submanifest.""" |
955 | subdir = self.SubmanifestInfoDir(submanifest_path) | 956 | subdir = self.SubmanifestInfoDir(submanifest_path) |
956 | mp = MetaProject(self, 'manifests', | 957 | mp = ManifestProject(self, 'manifests', |
957 | gitdir=os.path.join(subdir, 'manifests.git'), | 958 | gitdir=os.path.join(subdir, 'manifests.git'), |
958 | worktree=os.path.join(subdir, 'manifests')) | 959 | worktree=os.path.join(subdir, 'manifests')) |
959 | return mp | 960 | return mp |
960 | 961 | ||
961 | def GetDefaultGroupsStr(self): | 962 | def GetDefaultGroupsStr(self): |