changeset 3797:54fd4d3b4fce

Generate docs for help topics
author Matt Mackall <mpm@selenic.com>
date Tue, 05 Dec 2006 16:28:59 -0600
parents 58133ba5847d
children 6f0c42d50394
files doc/gendoc.py doc/hg.1.txt
diffstat 2 files changed, 12 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/doc/gendoc.py	Tue Dec 05 16:28:56 2006 -0600
+++ b/doc/gendoc.py	Tue Dec 05 16:28:59 2006 -0600
@@ -3,6 +3,7 @@
 sys.path.insert(0, "..")
 from mercurial.commands import table, globalopts
 from mercurial.i18n import gettext as _
+from mercurial.help import helptable
 
 def get_desc(docstr):
     if not docstr:
@@ -88,5 +89,16 @@
             if d['aliases']:
                 ui.write(_("    aliases: %s\n\n") % " ".join(d['aliases']))
 
+    # print topics
+    for t in helptable:
+        l = t.split("|")
+        section = l[-1]
+        underlined(_(section).upper())
+        doc = helptable[t]
+        if callable(doc):
+            doc = doc()
+        ui.write(_(doc))
+        ui.write("\n")
+
 if __name__ == "__main__":
     show_doc(sys.stdout)
--- a/doc/hg.1.txt	Tue Dec 05 16:28:56 2006 -0600
+++ b/doc/hg.1.txt	Tue Dec 05 16:28:59 2006 -0600
@@ -127,42 +127,6 @@
     A range acts as a closed interval.  This means that a range of 3:5
     gives 3, 4 and 5.  Similarly, a range of 4:2 gives 4, 3, and 2.
 
-DATE FORMATS
-------------
-
-    Some commands (backout, commit, tag) allow the user to specify a date.
-    Possible formats for dates are:
-
-YYYY-mm-dd \HH:MM[:SS] [(+|-)NNNN]::
-    This is a subset of ISO 8601, allowing just the recommended notations
-    for date and time. The last part represents the timezone; if omitted,
-    local time is assumed. Examples:
-
-    "2005-08-22 03:27 -0700"
-
-    "2006-04-19 21:39:51"
-
-aaa bbb dd HH:MM:SS YYYY [(+|-)NNNN]::
-    This is the date format used by the C library. Here, aaa stands for
-    abbreviated weekday name and bbb for abbreviated month name. The last
-    part represents the timezone; if omitted, local time is assumed.
-    Examples:
-
-    "Mon Aug 22 03:27:00 2005 -0700"
-
-    "Wed Apr 19 21:39:51 2006"
-
-unixtime offset::
-    This is the internal representation format for dates. unixtime is
-    the number of seconds since the epoch (1970-01-01 00:00 UTC). offset
-    is the offset of the local timezone, in seconds west of UTC (negative
-    if the timezone is east of UTC).
-    Examples:
-
-    "1124706420 25200" (2005-08-22 03:27:00 -0700)
-
-    "1145475591 -7200" (2006-04-19 21:39:51 +0200)
-
 ENVIRONMENT VARIABLES
 ---------------------