diff --git a/manifest_xml.py b/manifest_xml.py index be74bf49..22758cfd 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -625,6 +625,13 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md 'repo.partialcloneexclude') or '' return set(x.strip() for x in exclude.split(',')) + @property + def UseLocalManifests(self): + return self._load_local_manifests + + def SetUseLocalManifests(self, value): + self._load_local_manifests = value + @property def HasLocalManifests(self): return self._load_local_manifests and self.local_manifests diff --git a/subcmds/manifest.py b/subcmds/manifest.py index 00587d8d..0fbdeac0 100644 --- a/subcmds/manifest.py +++ b/subcmds/manifest.py @@ -70,6 +70,8 @@ to indicate the remote ref to push changes to via 'repo upload'. help='output manifest in JSON format (experimental)') p.add_option('--pretty', default=False, action='store_true', help='format output for humans to read') + p.add_option('--no-local-manifests', default=False, action='store_true', + dest='ignore_local_manifests', help='ignore local manifests') p.add_option('-o', '--output-file', dest='output_file', default='-', @@ -85,6 +87,9 @@ to indicate the remote ref to push changes to via 'repo upload'. fd = sys.stdout else: fd = open(opt.output_file, 'w') + + self.manifest.SetUseLocalManifests(not opt.ignore_local_manifests) + if opt.json: print('warning: --json is experimental!', file=sys.stderr) doc = self.manifest.ToDict(peg_rev=opt.peg_rev,