From d38300c7565461d4e0b9d7bedf88552e9fd6bf3b Mon Sep 17 00:00:00 2001 From: Sean McAllister Date: Thu, 20 Feb 2020 13:49:01 -0700 Subject: [PATCH] manifest: support optional --manifest-name Still use the repo manifest by default as before, but gives us the option of overriding it to support e.g.: using a subset of the full manifest. Change-Id: Ia42cd1cb3a0a58929d31bb01c9724e9d31f68730 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256372 Reviewed-by: Mike Frysinger Tested-by: Sean McAllister --- subcmds/manifest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/subcmds/manifest.py b/subcmds/manifest.py index 072c9ff7..d9f242ee 100644 --- a/subcmds/manifest.py +++ b/subcmds/manifest.py @@ -25,7 +25,7 @@ class Manifest(PagedCommand): common = False helpSummary = "Manifest inspection utility" helpUsage = """ -%prog [-o {-|NAME.xml} [-r]] +%prog [-o {-|NAME.xml}] [-m MANIFEST.xml] [-r] """ _helpDescription = """ @@ -50,6 +50,8 @@ in a Git repository for use during future 'repo init' invocations. p.add_option('-r', '--revision-as-HEAD', dest='peg_rev', action='store_true', help='Save revisions as current HEAD') + p.add_option('-m', '--manifest-name', + help='temporary manifest to use for this sync', metavar='NAME.xml') p.add_option('--suppress-upstream-revision', dest='peg_rev_upstream', default=True, action='store_false', help='If in -r mode, do not write the upstream field. ' @@ -62,6 +64,10 @@ in a Git repository for use during future 'repo init' invocations. metavar='-|NAME.xml') def _Output(self, opt): + # If alternate manifest is specified, override the manifest file that we're using. + if opt.manifest_name: + self.manifest.Override(opt.manifest_name, False) + if opt.output_file == '-': fd = sys.stdout else: