Michael Tharp avatar Michael Tharp committed b3aa740

Fix fclone on 1.7 servers.

Comments (0)

Files changed (1)

 sshserver.sshserver.do_hello = _sshserver_do_hello
 
 
+try:
+    from mercurial import wireproto
+except KeyError:
+    pass
+else:
+    # hg >= 1.7
+    _old_caps = wireproto.capabilities
+    def _forest_caps(*args, **kwargs):
+        caps = _old_caps(*args, **kwargs)
+        caps += ' forests'
+        return caps
+    wireproto.capabilities = _forest_caps
+
+    def do_forests(repo, proto, walkhg):
+        forests = repo.forests(bool(walkhg))
+        return "\n".join(forests)
+    wireproto.commands['forests'] = (do_forests, 'walkhg')
+
+
+
 def _sshserver_do_forests(self):
     """Shim this function into the sshserver so that it responds to
     the forests command.  It gives a list of roots relative to the
     self.repo repository, sorted lexigraphically.
     """
-    
+    # hg < 1.7
     key, walkhg = self.getarg()
     forests = self.repo.forests(bool(walkhg))
     self.respond("\n".join(forests))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.