Mercurial > hg
comparison mercurial/hgweb/protocol.py @ 10531:e3eff76552f1 stable
hgweb: use string join instead of slower cStringIO
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Tue, 23 Feb 2010 11:37:40 -0500 |
parents | ed87b6c60e0b |
children | 5dc09507b90e |
comparison
equal
deleted
inserted
replaced
10530:ed87b6c60e0b | 10531:e3eff76552f1 |
---|---|
62 yield resp | 62 yield resp |
63 | 63 |
64 def between(repo, req): | 64 def between(repo, req): |
65 pairs = [map(bin, p.split("-")) | 65 pairs = [map(bin, p.split("-")) |
66 for p in req.form['pairs'][0].split(" ")] | 66 for p in req.form['pairs'][0].split(" ")] |
67 resp = cStringIO.StringIO() | 67 resp = ''.join(" ".join(map(hex, b)) + "\n" for b in repo.between(pairs)) |
68 for b in repo.between(pairs): | |
69 resp.write(" ".join(map(hex, b)) + "\n") | |
70 resp = resp.getvalue() | |
71 req.respond(HTTP_OK, HGTYPE, length=len(resp)) | 68 req.respond(HTTP_OK, HGTYPE, length=len(resp)) |
72 yield resp | 69 yield resp |
73 | 70 |
74 def changegroup(repo, req): | 71 def changegroup(repo, req): |
75 req.respond(HTTP_OK, HGTYPE) | 72 req.respond(HTTP_OK, HGTYPE) |