summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean McAllister <smcallis@google.com>2020-02-20 13:49:01 -0700
committerSean McAllister <smcallis@google.com>2020-02-22 19:17:40 +0000
commitd38300c7565461d4e0b9d7bedf88552e9fd6bf3b (patch)
tree209e2dfb74027133769f6d9cc207f7a53c456c64
parentdcbfadf814aeb31bb66a265c74ef681d9dcb4875 (diff)
downloadgit-repo-d38300c7565461d4e0b9d7bedf88552e9fd6bf3b.tar.gz
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 <vapier@google.com> Tested-by: Sean McAllister <smcallis@google.com>
-rw-r--r--subcmds/manifest.py8
1 files changed, 7 insertions, 1 deletions
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):
25 common = False 25 common = False
26 helpSummary = "Manifest inspection utility" 26 helpSummary = "Manifest inspection utility"
27 helpUsage = """ 27 helpUsage = """
28%prog [-o {-|NAME.xml} [-r]] 28%prog [-o {-|NAME.xml}] [-m MANIFEST.xml] [-r]
29""" 29"""
30 _helpDescription = """ 30 _helpDescription = """
31 31
@@ -50,6 +50,8 @@ in a Git repository for use during future 'repo init' invocations.
50 p.add_option('-r', '--revision-as-HEAD', 50 p.add_option('-r', '--revision-as-HEAD',
51 dest='peg_rev', action='store_true', 51 dest='peg_rev', action='store_true',
52 help='Save revisions as current HEAD') 52 help='Save revisions as current HEAD')
53 p.add_option('-m', '--manifest-name',
54 help='temporary manifest to use for this sync', metavar='NAME.xml')
53 p.add_option('--suppress-upstream-revision', dest='peg_rev_upstream', 55 p.add_option('--suppress-upstream-revision', dest='peg_rev_upstream',
54 default=True, action='store_false', 56 default=True, action='store_false',
55 help='If in -r mode, do not write the upstream field. ' 57 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.
62 metavar='-|NAME.xml') 64 metavar='-|NAME.xml')
63 65
64 def _Output(self, opt): 66 def _Output(self, opt):
67 # If alternate manifest is specified, override the manifest file that we're using.
68 if opt.manifest_name:
69 self.manifest.Override(opt.manifest_name, False)
70
65 if opt.output_file == '-': 71 if opt.output_file == '-':
66 fd = sys.stdout 72 fd = sys.stdout
67 else: 73 else: