summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-06-03 14:16:14 -0700
committerShawn O. Pearce <sop@google.com>2009-07-03 11:00:16 -0700
commit050e4fd591537811e6e62b2e9ba1ce83e520e550 (patch)
tree05ca13bcc8713675eba7c896f7e75e1cb76e1bbb
parent60e679209a5495393ef584efaaad287fc8b77c51 (diff)
downloadgit-repo-050e4fd591537811e6e62b2e9ba1ce83e520e550.tar.gz
manifest: Only display XML help on XML manifest
Some of the help text is only related to the XML formatted manifest, so only display that text if that is the current format. Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r--docs/manifest_xml.txt (renamed from docs/manifest-format.txt)0
-rw-r--r--subcmds/manifest.py21
2 files changed, 13 insertions, 8 deletions
diff --git a/docs/manifest-format.txt b/docs/manifest_xml.txt
index da0e69ff..da0e69ff 100644
--- a/docs/manifest-format.txt
+++ b/docs/manifest_xml.txt
diff --git a/subcmds/manifest.py b/subcmds/manifest.py
index 4374a9d0..4415b99e 100644
--- a/subcmds/manifest.py
+++ b/subcmds/manifest.py
@@ -18,13 +18,22 @@ import sys
18 18
19from command import PagedCommand 19from command import PagedCommand
20 20
21def _doc(name):
22 r = os.path.dirname(__file__)
23 r = os.path.dirname(r)
24 fd = open(os.path.join(r, 'docs', 'manifest_xml.txt'))
25 try:
26 return fd.read()
27 finally:
28 fd.close()
29
21class Manifest(PagedCommand): 30class Manifest(PagedCommand):
22 common = False 31 common = False
23 helpSummary = "Manifest inspection utility" 32 helpSummary = "Manifest inspection utility"
24 helpUsage = """ 33 helpUsage = """
25%prog [-o {-|NAME.xml} [-r]] 34%prog [-o {-|NAME.xml} [-r]]
26""" 35"""
27 _helpDescription = """ 36 _xmlHelp = """
28 37
29With the -o option, exports the current manifest for inspection. 38With the -o option, exports the current manifest for inspection.
30The manifest and (if present) local_manifest.xml are combined 39The manifest and (if present) local_manifest.xml are combined
@@ -35,13 +44,9 @@ in a Git repository for use during future 'repo init' invocations.
35 44
36 @property 45 @property
37 def helpDescription(self): 46 def helpDescription(self):
38 help = self._helpDescription + '\n' 47 help = ''
39 r = os.path.dirname(__file__) 48 if isinstance(self.manifest, XmlManifest):
40 r = os.path.dirname(r) 49 help += self._xmlHelp + '\n' + _doc('manifest_xml.txt')
41 fd = open(os.path.join(r, 'docs', 'manifest-format.txt'))
42 for line in fd:
43 help += line
44 fd.close()
45 return help 50 return help
46 51
47 def _Options(self, p): 52 def _Options(self, p):