Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/hgweb/protocol.py Mon Oct 11 12:44:33 2010 -0500 +++ b/mercurial/hgweb/protocol.py Mon Oct 11 12:45:36 2010 -0500 @@ -66,3 +66,8 @@ sys.stdout, sys.stderr = p.oldio req.respond(HTTP_OK, HGTYPE) return ['%d\n%s' % (rsp.res, val)] + elif isinstance(rsp, wireproto.pusherr): + sys.stdout, sys.stderr = p.oldio + rsp = '0\n%s\n' % rsp.res + req.respond(HTTP_OK, HGTYPE, length=len(rsp)) + return [rsp]