Mercurial > hg > hgforest
changeset 50:904f45baaf83
Final cleanups of documentation and other functions.
author | Simon Law <simon@akoha.org> |
---|---|
date | Mon, 09 Jul 2007 18:24:55 -0400 |
parents | 728167aff824 |
children | d3d1b4a1a90d |
files | forest.py |
diffstat | 1 files changed, 15 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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')