hg site extension
 
(Arne Babenhauserheide)
2012-10-27: more testing added.

more testing added.

diff --git a/staticsite.py b/staticsite.py
--- a/staticsite.py
+++ b/staticsite.py
@@ -813,7 +813,11 @@ entry[1].extend(siteopts)
 # Starting an FTP repo. Not yet used, except for throwing errors for missing commands and faking the lock.
 
 # TODO: repo -> peer
-from mercurial import peer, util
+from mercurial import util
+try:
+    from mercurial import peer
+except ImportError:
+    from mercurial import repo as peer
 try:
     from mercurial.error import RepoError
 except ImportError:
@@ -884,8 +888,13 @@ class RepoContainer(object):
 hg.schemes["ftp"] = RepoContainer()
 
 def test():
-    from subprocess import call
-    call(["hg", "--config", "extensions.site="+__file__, "help"])
+    import subprocess as sp
+    def showcall(args):
+        print args
+        sp.call(args)
+    os.chdir(os.path.dirname(__file__))
+    showcall(["hg", "--config", "extensions.site="+__file__])
+    showcall(["hg", "--config", "extensions.site="+__file__, "site", "-B", "-n", "mysite"])
 
 if __name__ == "__main__":
     test()