Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/protocol.py @ 10530:ed87b6c60e0b stable
hgweb: fix handling of arguments in the between command
The 'pairs' argument was coded to be optional, but the code would
crash if it was not provided.
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Tue, 23 Feb 2010 11:34:08 -0500 |
parents | 04e1e6743809 |
children | e3eff76552f1 |
comparison
equal
deleted
inserted
replaced
10529:076e8a8000a3 | 10530:ed87b6c60e0b |
---|---|
60 resp = resp.getvalue() | 60 resp = resp.getvalue() |
61 req.respond(HTTP_OK, HGTYPE, length=len(resp)) | 61 req.respond(HTTP_OK, HGTYPE, length=len(resp)) |
62 yield resp | 62 yield resp |
63 | 63 |
64 def between(repo, req): | 64 def between(repo, req): |
65 if 'pairs' in req.form: | 65 pairs = [map(bin, p.split("-")) |
66 pairs = [map(bin, p.split("-")) | 66 for p in req.form['pairs'][0].split(" ")] |
67 for p in req.form['pairs'][0].split(" ")] | |
68 resp = cStringIO.StringIO() | 67 resp = cStringIO.StringIO() |
69 for b in repo.between(pairs): | 68 for b in repo.between(pairs): |
70 resp.write(" ".join(map(hex, b)) + "\n") | 69 resp.write(" ".join(map(hex, b)) + "\n") |
71 resp = resp.getvalue() | 70 resp = resp.getvalue() |
72 req.respond(HTTP_OK, HGTYPE, length=len(resp)) | 71 req.respond(HTTP_OK, HGTYPE, length=len(resp)) |