--- a/doc/Makefile Mon Sep 14 17:29:47 2009 -0500
+++ b/doc/Makefile Mon Sep 14 17:32:55 2009 -0500
@@ -17,13 +17,15 @@
touch hg.1.txt
hg.1.gendoc.txt: gendoc.py ../mercurial/commands.py ../mercurial/help.py
- ${PYTHON} gendoc.py > $@
+ ${PYTHON} gendoc.py > $@.tmp
+ mv $@.tmp $@
%: %.txt common.txt
- $(PYTHON) rst2man.py --strip-elements-with-class htmlonly $*.txt > $*
+ $(PYTHON) rst2man.py --halt warning \
+ --strip-elements-with-class htmlonly $*.txt $*
%.html: %.txt common.txt
- $(RST2HTML) $*.txt > $*.html
+ $(RST2HTML) --halt warning $*.txt $*.html
MANIFEST: man html
# tracked files are already in the main MANIFEST
--- a/hgext/win32mbcs.py Mon Sep 14 17:29:47 2009 -0500
+++ b/hgext/win32mbcs.py Mon Sep 14 17:32:55 2009 -0500
@@ -123,7 +123,7 @@
funcs = '''os.path.join os.path.split os.path.splitext
os.path.splitunc os.path.normpath os.path.normcase os.makedirs
mercurial.util.endswithsep mercurial.util.splitpath mercurial.util.checkcase
- mercurial.util.fspath mercurial.windows.pconvert'''
+ mercurial.util.fspath mercurial.util.pconvert'''
# codec and alias names of sjis and big5 to be faked.
problematic_encodings = '''big5 big5-tw csbig5 big5hkscs big5-hkscs
--- a/hgext/zeroconf/__init__.py Mon Sep 14 17:29:47 2009 -0500
+++ b/hgext/zeroconf/__init__.py Mon Sep 14 17:32:55 2009 -0500
@@ -101,17 +101,20 @@
def __init__(self, repo, name=None):
super(hgwebzc, self).__init__(repo, name)
name = self.reponame or os.path.basename(repo.root)
+ path = self.repo.ui.config("web", "prefix", "").strip('/')
desc = self.repo.ui.config("web", "description", name)
- publish(name, desc, name, int(repo.ui.config("web", "port", 8000)))
+ publish(name, desc, path, int(repo.ui.config("web", "port", 8000)))
class hgwebdirzc(hgwebdir_mod.hgwebdir):
- def run(self):
+ def __init__(self, conf, baseui=None):
+ super(hgwebdirzc, self).__init__(conf, baseui)
+ prefix = self.ui.config("web", "prefix", "").strip('/') + '/'
for r, p in self.repos:
u = self.ui.copy()
u.readconfig(os.path.join(p, '.hg', 'hgrc'))
n = os.path.basename(r)
- publish(n, "hgweb", p, int(u.config("web", "port", 8000)))
- return super(hgwebdirzc, self).run()
+ path = (prefix + r).strip('/')
+ publish(n, "hgweb", path, int(u.config("web", "port", 8000)))
# listen
--- a/tests/hghave Mon Sep 14 17:29:47 2009 -0500
+++ b/tests/hghave Mon Sep 14 17:32:55 2009 -0500
@@ -123,6 +123,10 @@
def has_git():
return matchoutput('git --version 2>&1', r'^git version')
+def has_rst2html():
+ return matchoutput('rst2html --version', r'^rst2html \(Docutils') or \
+ matchoutput('rst2html.py --version', r'^rst2html.py \(Docutils')
+
def has_svn():
return matchoutput('svn --version 2>&1', r'^svn, version') and \
matchoutput('svnadmin --version 2>&1', r'^svnadmin, version')
@@ -195,6 +199,7 @@
"outer-repo": (has_outer_repo, "outer repo"),
"p4": (has_p4, "Perforce server and client"),
"pygments": (has_pygments, "Pygments source highlighting library"),
+ "rst2html": (has_rst2html, "Docutils rst2html tool"),
"svn": (has_svn, "subversion client and admin tools"),
"svn-bindings": (has_svn_bindings, "subversion python bindings"),
"symlink": (has_symlink, "symbolic links"),
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-gendoc Mon Sep 14 17:32:55 2009 -0500
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+"$TESTDIR/hghave" rst2html || exit 80
+RST2HTML=$(which rst2html 2> /dev/null || which rst2html.py)
+
+echo "checking for syntax errors in gendoc.py"
+python $TESTDIR/../doc/gendoc.py > gendoc.txt || exit
+
+# We run rst2html over the file without adding "--halt warning" to
+# make it report all errors instead of stopping on the first one.
+echo "checking for parse errors with rst2html"
+$RST2HTML gendoc.txt /dev/null
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-gendoc.out Mon Sep 14 17:32:55 2009 -0500
@@ -0,0 +1,2 @@
+checking for syntax errors in gendoc.py
+checking for parse errors with rst2html