summaryrefslogtreecommitdiffstats
path: root/subcmds/manifest.py
diff options
context:
space:
mode:
authorMichael Kelly <mkelly@arista.com>2021-07-02 09:25:48 -0700
committerMichael Kelly <mkelly@arista.com>2021-07-20 04:56:12 +0000
commitc34b91c9d80d6d6510c500cb8a8a9ee448963f09 (patch)
tree6e9010879d883384caa50faa1b3adb60f8d59fe8 /subcmds/manifest.py
parent0a1f533e2835c856473e3e4046341a4d2f66764b (diff)
downloadgit-repo-c34b91c9d80d6d6510c500cb8a8a9ee448963f09.tar.gz
manifest: Support ignoring local manifests with 'repo manifest'
Currently users need to look up the baseline manifest by loading the specific manifest file. This exposes them to the internals of how the manifest is stored which may potentially be fragile (eg: It was switched from a symlink pointing at the file in the report to an actual file with an 'include' tag). Instead of doing this, we can provide an option to the 'repo manifest' command which will emit the baseline manifest and decouple users from the internal manifest details. Change-Id: I12ee9160feaa591484ae71f404bc529be500ae4e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/311202 Tested-by: Michael Kelly <mkelly@arista.com> Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/manifest.py')
-rw-r--r--subcmds/manifest.py5
1 files changed, 5 insertions, 0 deletions
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'.
70 help='output manifest in JSON format (experimental)') 70 help='output manifest in JSON format (experimental)')
71 p.add_option('--pretty', default=False, action='store_true', 71 p.add_option('--pretty', default=False, action='store_true',
72 help='format output for humans to read') 72 help='format output for humans to read')
73 p.add_option('--no-local-manifests', default=False, action='store_true',
74 dest='ignore_local_manifests', help='ignore local manifests')
73 p.add_option('-o', '--output-file', 75 p.add_option('-o', '--output-file',
74 dest='output_file', 76 dest='output_file',
75 default='-', 77 default='-',
@@ -85,6 +87,9 @@ to indicate the remote ref to push changes to via 'repo upload'.
85 fd = sys.stdout 87 fd = sys.stdout
86 else: 88 else:
87 fd = open(opt.output_file, 'w') 89 fd = open(opt.output_file, 'w')
90
91 self.manifest.SetUseLocalManifests(not opt.ignore_local_manifests)
92
88 if opt.json: 93 if opt.json:
89 print('warning: --json is experimental!', file=sys.stderr) 94 print('warning: --json is experimental!', file=sys.stderr)
90 doc = self.manifest.ToDict(peg_rev=opt.peg_rev, 95 doc = self.manifest.ToDict(peg_rev=opt.peg_rev,