(Arne Babenhauserheide)
2012-06-26: had to fix some more stuff to make it work with ftp repos in had to fix some more stuff to make it work with ftp repos in .hg/hgrc
diff --git a/staticsite.py b/staticsite.py
--- a/staticsite.py
+++ b/staticsite.py
@@ -258,6 +258,13 @@ def writelog(ui, repo, target, name):
f.write(data)
def getincoming(ui, repo, otheruri, other=None):
+ # cannot do that for ftp repos, yet
+ if otheruri.startswith("ftp://"):
+ chlist = []
+ def cleanupfn():
+ pass
+ return chlist, cleanupfn
+
if not other:
other = hg.peer(repo, {}, otheruri)
ui.pushbuffer() # ignore ui events
@@ -276,6 +283,12 @@ def getincoming(ui, repo, otheruri, othe
return chlist, cleanupfn
def getoutgoing(ui, repo, otheruri, other=None):
+ # cannot do that for ftp repos, yet
+ if otheruri.startswith("ftp://"):
+ chlist = []
+ def cleanupfn():
+ pass
+ return chlist, cleanupfn
if not other:
other = hg.peer(repo, {}, otheruri)
other.ui.pushbuffer() # ignore ui events
@@ -730,6 +743,7 @@ extensions.wrapfunction(discovery, 'find
def ftppush(orig, *args, **opts):
try:
ui, repo, path = args
+ path = ui.expandpath(path)
except ValueError: # no ftp string
ui, repo = args
path = ui.expandpath('default-push', 'default')
@@ -743,6 +757,7 @@ def ftppush(orig, *args, **opts):
opts["name"] = opts["sitetitle"]
opts["upload"] = ftpstring
staticsite(ui, repo, target, **opts)
+ return 0
# really wrap the command
siteopts = [('', 'sitetitle', "", 'staticsite: the title of the site. Default: folder or last segment of the repo-path.'),
@@ -790,8 +805,7 @@ class FTPRepository(repo.repository):
Whenever this function is hit, we abort. The traceback is useful for
figuring out where to intercept the functionality.
"""
- return []
- #raise util.Abort('command heads unavailable for FTP repositories')
+ raise util.Abort('command heads unavailable for FTP repositories')
def pushkey(self, namespace, key, old, new):
return False