[PATCH 1 of 2 STABLE] httprepo: normalize output from unbundle with ssh
Sune Foldager
cryo at cyanite.org
Mon Feb 22 09:34:00 CST 2010
# HG changeset patch
# User Sune Foldager <cryo at cyanite.org>
# Date 1266852543 -3600
# Branch stable
# Node ID 63a858b81dd2c5fc7d5f60ac16349f7e1d2ad3aa
# Parent 6f61c480f51c970d3e0cb0d6862e5e3c3784303c
httprepo: normalize output from unbundle with ssh
Lines from the remote are prefixed with 'remote: ' and written
locally using ui.status, similar to what sshrepo does.
diff --git a/mercurial/hgweb/protocol.py b/mercurial/hgweb/protocol.py
--- a/mercurial/hgweb/protocol.py
+++ b/mercurial/hgweb/protocol.py
@@ -158,7 +158,6 @@
gen = changegroupmod.unbundle(header, fp)
# send addchangegroup output to client
-
oldio = sys.stdout, sys.stderr
sys.stderr = sys.stdout = cStringIO.StringIO()
diff --git a/mercurial/httprepo.py b/mercurial/httprepo.py
--- a/mercurial/httprepo.py
+++ b/mercurial/httprepo.py
@@ -239,7 +239,8 @@
except ValueError, err:
raise error.ResponseError(
_('push failed (unexpected response):'), resp)
- self.ui.write(output)
+ for l in output.splitlines(True):
+ self.ui.status(_('remote: '), l)
return ret
except socket.error, err:
if err[0] in (errno.ECONNRESET, errno.EPIPE):
diff --git a/tests/test-push-http.out b/tests/test-push-http.out
--- a/tests/test-push-http.out
+++ b/tests/test-push-http.out
@@ -4,7 +4,7 @@
% expect ssl error
pushing to http://localhost:$HGPORT/
searching for changes
-ssl required
+remote: ssl required
% serve errors
% expect authorization error
abort: authorization failed
@@ -19,10 +19,10 @@
% expect success
pushing to http://localhost:$HGPORT/
searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
+remote: adding changesets
+remote: adding manifests
+remote: adding file changes
+remote: added 1 changesets with 1 changes to 1 files
% serve errors
changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http
rolling back last transaction
More information about the Mercurial-devel
mailing list