diff i18n/hggettext @ 9539:c904e76e3834

help: move help topics from mercurial/help.py to help/*.txt The help topics are loaded on demand so we wont hit the disk unless we really have to.
author Martin Geisler <mg@lazybytes.net>
date Sun, 04 Oct 2009 09:59:13 +0200
parents 1fc1c77d4863
children 25e572394f5c
line wrap: on
line diff
--- a/i18n/hggettext	Sat Oct 03 18:58:25 2009 +0200
+++ b/i18n/hggettext	Sun Oct 04 09:59:13 2009 +0200
@@ -112,6 +112,11 @@
             print poentry(path, lineno, func.__doc__)
 
 
+def rawtext(path):
+    src = open(path).read()
+    print poentry(path, 1, src)
+
+
 if __name__ == "__main__":
     # It is very important that we import the Mercurial modules from
     # the source tree where hggettext is executed. Otherwise we might
@@ -120,4 +125,7 @@
     sys.path.insert(0, os.getcwd())
     from mercurial import demandimport; demandimport.enable()
     for path in sys.argv[1:]:
-        docstrings(path)
+        if path.endswith('.txt'):
+            rawtext(path)
+        else:
+            docstrings(path)