[cig-commits] commit: Final cleanups of documentation and other functions.
Mercurial
hg at geodynamics.org
Mon Nov 24 11:27:05 PST 2008
changeset: 50:904f45baaf83
user: Simon Law <simon at akoha.org>
date: Mon Jul 09 18:24:55 2007 -0400
files: forest.py
description:
Final cleanups of documentation and other functions.
diff -r 728167aff824 -r 904f45baaf83 forest.py
--- a/forest.py Mon Jul 09 18:04:44 2007 -0400
+++ b/forest.py Mon Jul 09 18:24:55 2007 -0400
@@ -81,19 +81,12 @@ def walkhgenabled(ui, walkhg):
return res
-def enumerate_repos(ui, top, walkhg):
- """Generate a lexicographically sorted list of repository roots.
-
- Return a list of roots in filesystem representation.
- """
- return top.forests(walkhg)
-
def _localrepo_forests(self, walkhg):
"""Shim this function into mercurial.localrepo.localrepository so
that it gives you the list of subforests.
Return a list of roots in filesystem representation relative to
- the self repository.
+ the self repository. This list is lexigraphically sorted.
"""
def errhandler(err):
@@ -136,6 +129,7 @@ def _sshrepo_forests(self, walkhg):
Return a list of roots as ssh:// URLs.
"""
+
if 'forests' not in self.capabilities:
raise util.Abort(_("Remote forests cannot be cloned because the other repository doesn't support the forest extension."))
data = self.call("forests", walkhg=("", "True")[walkhg])
@@ -162,6 +156,11 @@ sshserver.sshserver.do_hello = _sshserve
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.
+ """
+
key, walkhg = self.getarg()
f = self.repo.forests(bool(walkhg))
self.respond("\n".join(f))
@@ -176,6 +175,7 @@ def _httprepo_forests(self, walkhg):
Return a list of roots as http:// URLs.
"""
+
if 'forests' not in self.capabilities:
raise util.Abort(_("Remote forests cannot be cloned because the other repository doesn't support the forest extension."))
data = self.do_read("forests", walkhg=("", "True")[walkhg])
@@ -200,6 +200,11 @@ hgweb_mod.hgweb.do_capabilities = _https
def _httpserver_do_forests(self, req):
+ """Shim this function into the httpserver so that it responds to
+ the forests command. It gives a list of roots relative to the
+ self.repo repository, sorted lexigraphically.
+ """
+
resp = ""
if req.form.has_key('walkhg'):
f = self.repo.forests(bool(req.form['walkhg'][0]))
@@ -502,11 +507,11 @@ def trees(ui, repo, convert=False, walkh
if convert:
pfxlen = len(repo.root + os.sep)
l = [util.pconvert(p[pfxlen:])
- for p in enumerate_repos(ui, repo.root, walkhg)]
+ for p in repo.forests(walkhg)]
l.remove('')
l.insert(0, '.')
else:
- l = enumerate_repos(ui, repo.root, walkhg)
+ l = repo.forests(walkhg)
for t in l:
ui.write(t + '\n')
More information about the CIG-COMMITS
mailing list