summaryrefslogtreecommitdiffstats
path: root/manifest_xml.py
diff options
context:
space:
mode:
authorLaMont Jones <lamontjones@google.com>2022-04-05 19:30:46 +0000
committerLaMont Jones <lamontjones@google.com>2022-04-06 16:59:45 +0000
commitd82be3e672986cf1b490248a0ae4e6e42ec6fbd3 (patch)
tree9f33b52802bfa8705d6833851a06a42f2fa26d86 /manifest_xml.py
parent9b03f15e8e870866b26699f696af1884100f51b5 (diff)
downloadgit-repo-d82be3e672986cf1b490248a0ae4e6e42ec6fbd3.tar.gz
Move manifest config logic into ManifestProject
Use ManifestProject properties for config values. Change-Id: Ib4ad90b0d9a089916e35615b8058942e6d01dc04 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334519 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.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index d3e952a5..022cad20 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -372,7 +372,7 @@ class XmlManifest(object):
372 # normal repo settings live in the manifestProject which we just setup 372 # normal repo settings live in the manifestProject which we just setup
373 # above, so we couldn't easily query before that. We assume Project() 373 # above, so we couldn't easily query before that. We assume Project()
374 # init doesn't care if this changes afterwards. 374 # init doesn't care if this changes afterwards.
375 if os.path.exists(mp.gitdir) and mp.config.GetBoolean('repo.worktree'): 375 if os.path.exists(mp.gitdir) and mp.use_worktree:
376 mp.use_git_worktrees = True 376 mp.use_git_worktrees = True
377 377
378 self._Unload() 378 self._Unload()
@@ -487,7 +487,7 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
487 mp = self.manifestProject 487 mp = self.manifestProject
488 488
489 if groups is None: 489 if groups is None:
490 groups = mp.config.GetString('manifest.groups') 490 groups = mp.manifest_groups
491 if groups: 491 if groups:
492 groups = self._ParseList(groups) 492 groups = self._ParseList(groups)
493 493
@@ -861,22 +861,21 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
861 861
862 @property 862 @property
863 def CloneBundle(self): 863 def CloneBundle(self):
864 clone_bundle = self.manifestProject.config.GetBoolean('repo.clonebundle') 864 clone_bundle = self.manifestProject.clone_bundle
865 if clone_bundle is None: 865 if clone_bundle is None:
866 return False if self.manifestProject.config.GetBoolean('repo.partialclone') else True 866 return False if self.manifestProject.partial_clone else True
867 else: 867 else:
868 return clone_bundle 868 return clone_bundle
869 869
870 @property 870 @property
871 def CloneFilter(self): 871 def CloneFilter(self):
872 if self.manifestProject.config.GetBoolean('repo.partialclone'): 872 if self.manifestProject.partial_clone:
873 return self.manifestProject.config.GetString('repo.clonefilter') 873 return self.manifestProject.clone_filter
874 return None 874 return None
875 875
876 @property 876 @property
877 def PartialCloneExclude(self): 877 def PartialCloneExclude(self):
878 exclude = self.manifest.manifestProject.config.GetString( 878 exclude = self.manifest.manifestProject.partial_clone_exclude or ''
879 'repo.partialcloneexclude') or ''
880 return set(x.strip() for x in exclude.split(',')) 879 return set(x.strip() for x in exclude.split(','))
881 880
882 @property 881 @property
@@ -897,23 +896,23 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
897 896
898 @property 897 @property
899 def IsMirror(self): 898 def IsMirror(self):
900 return self.manifestProject.config.GetBoolean('repo.mirror') 899 return self.manifestProject.mirror
901 900
902 @property 901 @property
903 def UseGitWorktrees(self): 902 def UseGitWorktrees(self):
904 return self.manifestProject.config.GetBoolean('repo.worktree') 903 return self.manifestProject.use_worktree
905 904
906 @property 905 @property
907 def IsArchive(self): 906 def IsArchive(self):
908 return self.manifestProject.config.GetBoolean('repo.archive') 907 return self.manifestProject.archive
909 908
910 @property 909 @property
911 def HasSubmodules(self): 910 def HasSubmodules(self):
912 return self.manifestProject.config.GetBoolean('repo.submodules') 911 return self.manifestProject.submodules
913 912
914 @property 913 @property
915 def EnableGitLfs(self): 914 def EnableGitLfs(self):
916 return self.manifestProject.config.GetBoolean('repo.git-lfs') 915 return self.manifestProject.git_lfs
917 916
918 def FindManifestByPath(self, path): 917 def FindManifestByPath(self, path):
919 """Returns the manifest containing path.""" 918 """Returns the manifest containing path."""
@@ -965,7 +964,7 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
965 964
966 def GetGroupsStr(self): 965 def GetGroupsStr(self):
967 """Returns the manifest group string that should be synced.""" 966 """Returns the manifest group string that should be synced."""
968 groups = self.manifestProject.config.GetString('manifest.groups') 967 groups = self.manifestProject.manifest_groups
969 if not groups: 968 if not groups:
970 groups = self.GetDefaultGroupsStr() 969 groups = self.GetDefaultGroupsStr()
971 return groups 970 return groups