Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/protocol.py @ 12703:40bb5853fc4b
wireproto: introduce pusherr() to deal with "unsynced changes" error
The behaviour between http and ssh still differ:
- the "unsynced changes" is seen as a remote output in the http cases
- but it is correctly seen as a push error for ssh
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Mon, 11 Oct 2010 12:45:36 -0500 |
parents | 2f8adc60e013 |
children | ca6e2adc3e4d |
comparison
equal
deleted
inserted
replaced
12702:f747c085b789 | 12703:40bb5853fc4b |
---|---|
64 elif isinstance(rsp, wireproto.pushres): | 64 elif isinstance(rsp, wireproto.pushres): |
65 val = sys.stdout.getvalue() | 65 val = sys.stdout.getvalue() |
66 sys.stdout, sys.stderr = p.oldio | 66 sys.stdout, sys.stderr = p.oldio |
67 req.respond(HTTP_OK, HGTYPE) | 67 req.respond(HTTP_OK, HGTYPE) |
68 return ['%d\n%s' % (rsp.res, val)] | 68 return ['%d\n%s' % (rsp.res, val)] |
69 elif isinstance(rsp, wireproto.pusherr): | |
70 sys.stdout, sys.stderr = p.oldio | |
71 rsp = '0\n%s\n' % rsp.res | |
72 req.respond(HTTP_OK, HGTYPE, length=len(rsp)) | |
73 return [rsp] |