diff options
Diffstat (limited to 'subcmds/manifest.py')
| -rw-r--r-- | subcmds/manifest.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/subcmds/manifest.py b/subcmds/manifest.py index e33e683c..0fbdeac0 100644 --- a/subcmds/manifest.py +++ b/subcmds/manifest.py | |||
| @@ -20,7 +20,7 @@ from command import PagedCommand | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | class Manifest(PagedCommand): | 22 | class Manifest(PagedCommand): |
| 23 | common = False | 23 | COMMON = False |
| 24 | helpSummary = "Manifest inspection utility" | 24 | helpSummary = "Manifest inspection utility" |
| 25 | helpUsage = """ | 25 | helpUsage = """ |
| 26 | %prog [-o {-|NAME.xml}] [-m MANIFEST.xml] [-r] | 26 | %prog [-o {-|NAME.xml}] [-m MANIFEST.xml] [-r] |
| @@ -53,27 +53,29 @@ to indicate the remote ref to push changes to via 'repo upload'. | |||
| 53 | def _Options(self, p): | 53 | def _Options(self, p): |
| 54 | p.add_option('-r', '--revision-as-HEAD', | 54 | p.add_option('-r', '--revision-as-HEAD', |
| 55 | dest='peg_rev', action='store_true', | 55 | dest='peg_rev', action='store_true', |
| 56 | help='Save revisions as current HEAD') | 56 | help='save revisions as current HEAD') |
| 57 | p.add_option('-m', '--manifest-name', | 57 | p.add_option('-m', '--manifest-name', |
| 58 | help='temporary manifest to use for this sync', metavar='NAME.xml') | 58 | help='temporary manifest to use for this sync', metavar='NAME.xml') |
| 59 | p.add_option('--suppress-upstream-revision', dest='peg_rev_upstream', | 59 | p.add_option('--suppress-upstream-revision', dest='peg_rev_upstream', |
| 60 | default=True, action='store_false', | 60 | default=True, action='store_false', |
| 61 | help='If in -r mode, do not write the upstream field. ' | 61 | help='if in -r mode, do not write the upstream field ' |
| 62 | 'Only of use if the branch names for a sha1 manifest are ' | 62 | '(only of use if the branch names for a sha1 manifest are ' |
| 63 | 'sensitive.') | 63 | 'sensitive)') |
| 64 | p.add_option('--suppress-dest-branch', dest='peg_rev_dest_branch', | 64 | p.add_option('--suppress-dest-branch', dest='peg_rev_dest_branch', |
| 65 | default=True, action='store_false', | 65 | default=True, action='store_false', |
| 66 | help='If in -r mode, do not write the dest-branch field. ' | 66 | help='if in -r mode, do not write the dest-branch field ' |
| 67 | 'Only of use if the branch names for a sha1 manifest are ' | 67 | '(only of use if the branch names for a sha1 manifest are ' |
| 68 | 'sensitive.') | 68 | 'sensitive)') |
| 69 | p.add_option('--json', default=False, action='store_true', | 69 | p.add_option('--json', default=False, action='store_true', |
| 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='-', |
| 76 | help='File to save the manifest to', | 78 | help='file to save the manifest to', |
| 77 | metavar='-|NAME.xml') | 79 | metavar='-|NAME.xml') |
| 78 | 80 | ||
| 79 | def _Output(self, opt): | 81 | def _Output(self, opt): |
| @@ -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, |
