hg site extension
 
(Arne Babenhauserheide)
2012-10-28: Works on hg 2.4-rc!

Works on hg 2.4-rc!

diff --git a/staticsite.py b/staticsite.py
--- a/staticsite.py
+++ b/staticsite.py
@@ -333,9 +333,14 @@ def getoutgoing(ui, repo, otheruri, othe
     def outgoingchanges(repo, other):
         from mercurial import discovery
         fco = discovery.findcommonoutgoing
-        og = fco(repo, other, force=True)
-        return og.missing
-
+        try:
+            og = fco(repo, other, force=True)
+            return og.missing
+        except AttributeError: # old client
+            common, outheads = og
+            o = repo.changelog.findmissing(common=common, heads=outheads)
+            return o
+            
     other.ui.pushbuffer() # ignore ui events
 
     try:
@@ -901,8 +906,16 @@ def test():
         print args
         sp.call(args)
     os.chdir(os.path.dirname(__file__))
+    # just check if loading the extension works
     showcall(["hg", "--config", "extensions.site="+__file__])
+    # check if I can create a site
     showcall(["hg", "--config", "extensions.site="+__file__, "site", "-B", "-n", "mysite"])
+    # check if uploading works: Only a valid test, if you have a
+    # post-push hook which does the uploading
+    showcall(["hg", "--config", "extensions.site="+__file__, "push"])
+    # check if push directly to ftp works. Requires the path draketo
+    # to be set up in .hg/hgrc as ftp://user:password/path
+    showcall(["hg", "--config", "extensions.site="+__file__, "push", "draketo", "--sitename", "site extension"])
 
 if __name__ == "__main__":
     test()