mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Move local-manifest check to manifest_xml.py
This removes the need for git_superproject to include manifest_xml, and puts the logic for local_manifest detection in one place. Change-Id: I4d33ded0542ceea4606a1ea24304f678de20c59e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/330499 Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com>
This commit is contained in:
parent
adaa1d8734
commit
87cce68b28
@ -32,7 +32,6 @@ from typing import NamedTuple
|
|||||||
from git_command import git_require, GitCommand
|
from git_command import git_require, GitCommand
|
||||||
from git_config import RepoConfig
|
from git_config import RepoConfig
|
||||||
from git_refs import R_HEADS
|
from git_refs import R_HEADS
|
||||||
from manifest_xml import LOCAL_MANIFEST_GROUP_PREFIX
|
|
||||||
|
|
||||||
_SUPERPROJECT_GIT_NAME = 'superproject.git'
|
_SUPERPROJECT_GIT_NAME = 'superproject.git'
|
||||||
_SUPERPROJECT_MANIFEST_NAME = 'superproject_override.xml'
|
_SUPERPROJECT_MANIFEST_NAME = 'superproject_override.xml'
|
||||||
@ -311,7 +310,7 @@ class Superproject(object):
|
|||||||
if project.revisionId:
|
if project.revisionId:
|
||||||
return True
|
return True
|
||||||
# Skip the project if it comes from the local manifest.
|
# Skip the project if it comes from the local manifest.
|
||||||
return any(s.startswith(LOCAL_MANIFEST_GROUP_PREFIX) for s in project.groups)
|
return project.manifest.IsFromLocalManifest(project)
|
||||||
|
|
||||||
def UpdateProjectsRevisionId(self, projects):
|
def UpdateProjectsRevisionId(self, projects):
|
||||||
"""Update revisionId of every project in projects with the commit id.
|
"""Update revisionId of every project in projects with the commit id.
|
||||||
|
@ -650,6 +650,12 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
|
|||||||
def HasLocalManifests(self):
|
def HasLocalManifests(self):
|
||||||
return self._load_local_manifests and self.local_manifests
|
return self._load_local_manifests and self.local_manifests
|
||||||
|
|
||||||
|
def IsFromLocalManifest(self, project):
|
||||||
|
"""Is the project from a local manifest?
|
||||||
|
"""
|
||||||
|
return any(x.startswith(LOCAL_MANIFEST_GROUP_PREFIX)
|
||||||
|
for x in project.groups)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def IsMirror(self):
|
def IsMirror(self):
|
||||||
return self.manifestProject.config.GetBoolean('repo.mirror')
|
return self.manifestProject.config.GetBoolean('repo.mirror')
|
||||||
|
Loading…
Reference in New Issue
Block a user