Mercurial > hg-stable
comparison tests/test-push-http.t @ 17793:8474be4412ca
wireproto: fix pushkey hook failure and output on remote http repo
Over http, a failed pushkey hook simply crashed the server, and
successful hook output was never sent to the client.
author | Wagner Bruna <wbruna@softwareexpress.com.br> |
---|---|
date | Mon, 15 Oct 2012 18:37:34 -0300 |
parents | f62ed3d90377 |
children | a029dac38942 |
comparison
equal
deleted
inserted
replaced
17792:a1c4b21fc1b2 | 17793:8474be4412ca |
---|---|
57 expect success | 57 expect success |
58 | 58 |
59 $ echo 'allow_push = *' >> .hg/hgrc | 59 $ echo 'allow_push = *' >> .hg/hgrc |
60 $ echo '[hooks]' >> .hg/hgrc | 60 $ echo '[hooks]' >> .hg/hgrc |
61 $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup 0" >> .hg/hgrc | 61 $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup 0" >> .hg/hgrc |
62 $ echo "pushkey = python \"$TESTDIR/printenv.py\" pushkey 0" >> .hg/hgrc | |
62 $ req | 63 $ req |
63 pushing to http://localhost:$HGPORT/ | 64 pushing to http://localhost:$HGPORT/ |
64 searching for changes | 65 searching for changes |
65 remote: adding changesets | 66 remote: adding changesets |
66 remote: adding manifests | 67 remote: adding manifests |
67 remote: adding file changes | 68 remote: adding file changes |
68 remote: added 1 changesets with 1 changes to 1 files | 69 remote: added 1 changesets with 1 changes to 1 files |
69 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) | 70 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) |
71 remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 | |
70 % serve errors | 72 % serve errors |
71 $ hg rollback | 73 $ hg rollback |
72 repository tip rolled back to revision 0 (undo serve) | 74 repository tip rolled back to revision 0 (undo serve) |
73 | 75 |
74 expect success, server lacks the httpheader capability | 76 expect success, server lacks the httpheader capability |
81 remote: adding changesets | 83 remote: adding changesets |
82 remote: adding manifests | 84 remote: adding manifests |
83 remote: adding file changes | 85 remote: adding file changes |
84 remote: added 1 changesets with 1 changes to 1 files | 86 remote: added 1 changesets with 1 changes to 1 files |
85 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) | 87 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) |
88 remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 | |
86 % serve errors | 89 % serve errors |
87 $ hg rollback | 90 $ hg rollback |
88 repository tip rolled back to revision 0 (undo serve) | 91 repository tip rolled back to revision 0 (undo serve) |
89 | 92 |
90 expect success, server lacks the unbundlehash capability | 93 expect success, server lacks the unbundlehash capability |
97 remote: adding changesets | 100 remote: adding changesets |
98 remote: adding manifests | 101 remote: adding manifests |
99 remote: adding file changes | 102 remote: adding file changes |
100 remote: added 1 changesets with 1 changes to 1 files | 103 remote: added 1 changesets with 1 changes to 1 files |
101 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) | 104 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) |
105 remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1 | |
102 % serve errors | 106 % serve errors |
107 $ hg rollback | |
108 repository tip rolled back to revision 0 (undo serve) | |
109 | |
110 expect push success, phase change failure | |
111 | |
112 $ echo '[web]' > .hg/hgrc | |
113 $ echo 'push_ssl = false' >> .hg/hgrc | |
114 $ echo 'allow_push = *' >> .hg/hgrc | |
115 $ echo '[hooks]' >> .hg/hgrc | |
116 $ echo 'prepushkey = python "$TESTDIR/printenv.py" prepushkey 1' >> .hg/hgrc | |
117 $ req | |
118 pushing to http://localhost:$HGPORT/ | |
119 searching for changes | |
120 remote: adding changesets | |
121 remote: adding manifests | |
122 remote: adding file changes | |
123 remote: added 1 changesets with 1 changes to 1 files | |
124 remote: prepushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 | |
125 updating ba677d0156c1 to public failed! | |
126 % serve errors | |
127 | |
128 expect phase change success | |
129 | |
130 $ echo 'prepushkey = python "$TESTDIR/printenv.py" prepushkey 0' >> .hg/hgrc | |
131 $ req | |
132 pushing to http://localhost:$HGPORT/ | |
133 searching for changes | |
134 no changes found | |
135 remote: prepushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 | |
136 % serve errors | |
137 [1] | |
103 $ hg rollback | 138 $ hg rollback |
104 repository tip rolled back to revision 0 (undo serve) | 139 repository tip rolled back to revision 0 (undo serve) |
105 | 140 |
106 expect authorization error: all users denied | 141 expect authorization error: all users denied |
107 | 142 |