annotate tests/test-push-http.t @ 36241:fefd57bd9573 stable

tests: port value-less unbundle capability test to test-push-http.t This test is present in test-push-http-bundle1.t. Let's add it to test-push-http.t to further unify the tests.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 18 Feb 2018 08:52:57 -0800
parents aa05b95949fe
children 477280637646
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 20966
diff changeset
1 #require killdaemons
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
2
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
3 $ hg init test
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
4 $ cd test
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
5 $ echo a > a
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
6 $ hg ci -Ama
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
7 adding a
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
8 $ cd ..
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
9 $ hg clone test test2
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
10 updating to branch default
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
12 $ cd test2
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
13 $ echo a >> a
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
14 $ hg ci -mb
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
15 $ req() {
12743
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
16 > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
17 > cat hg.pid >> $DAEMON_PIDS
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
18 > hg --cwd ../test2 push http://localhost:$HGPORT/
17455
2212af23c9de test-push-http: include exit status of hg push
Yuya Nishihara <yuya@tcha.org>
parents: 17018
diff changeset
19 > exitstatus=$?
25474
8c14f87bd0ae tests: drop DAEMON_PIDS from killdaemons calls
Matt Mackall <mpm@selenic.com>
parents: 25472
diff changeset
20 > killdaemons.py
12743
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
21 > echo % serve errors
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
22 > cat errors.log
17455
2212af23c9de test-push-http: include exit status of hg push
Yuya Nishihara <yuya@tcha.org>
parents: 17018
diff changeset
23 > return $exitstatus
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
24 > }
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
25 $ cd ../test
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
26
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
27 expect ssl error
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
28
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
29 $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
30 pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
31 searching for changes
17456
59a168019255 hgweb: respond 403 forbidden for ssl required error
Yuya Nishihara <yuya@tcha.org>
parents: 17455
diff changeset
32 abort: HTTP Error 403: ssl required
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
33 % serve errors
17456
59a168019255 hgweb: respond 403 forbidden for ssl required error
Yuya Nishihara <yuya@tcha.org>
parents: 17455
diff changeset
34 [255]
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
35
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
36 expect authorization error
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
37
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
38 $ echo '[web]' > .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
39 $ echo 'push_ssl = false' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
40 $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
41 pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
42 searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
43 abort: authorization failed
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
44 % serve errors
17455
2212af23c9de test-push-http: include exit status of hg push
Yuya Nishihara <yuya@tcha.org>
parents: 17018
diff changeset
45 [255]
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
46
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
47 expect authorization error: must have authorized user
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
48
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
49 $ echo 'allow_push = unperson' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
50 $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
51 pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
52 searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
53 abort: authorization failed
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
54 % serve errors
17455
2212af23c9de test-push-http: include exit status of hg push
Yuya Nishihara <yuya@tcha.org>
parents: 17018
diff changeset
55 [255]
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
56
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
57 expect success
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
58
34938
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34876
diff changeset
59 $ cat > $TESTTMP/hook.sh <<'EOF'
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34876
diff changeset
60 > echo "phase-move: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE"
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34876
diff changeset
61 > EOF
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34876
diff changeset
62
30234
34a5f6c66bc5 tests: invoke printenv.py via sh -c for test portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27739
diff changeset
63 $ cat >> .hg/hgrc <<EOF
34a5f6c66bc5 tests: invoke printenv.py via sh -c for test portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27739
diff changeset
64 > allow_push = *
34a5f6c66bc5 tests: invoke printenv.py via sh -c for test portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27739
diff changeset
65 > [hooks]
34a5f6c66bc5 tests: invoke printenv.py via sh -c for test portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27739
diff changeset
66 > changegroup = sh -c "printenv.py changegroup 0"
34a5f6c66bc5 tests: invoke printenv.py via sh -c for test portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27739
diff changeset
67 > pushkey = sh -c "printenv.py pushkey 0"
34938
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34876
diff changeset
68 > txnclose-phase.test = sh $TESTTMP/hook.sh
30234
34a5f6c66bc5 tests: invoke printenv.py via sh -c for test portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27739
diff changeset
69 > EOF
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
70 $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
71 pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
72 searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
73 remote: adding changesets
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
74 remote: adding manifests
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
75 remote: adding file changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
76 remote: added 1 changesets with 1 changes to 1 files
34876
eb1b964b354b phases: pass phase names to hooks instead of internal values
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 34836
diff changeset
77 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
eb1b964b354b phases: pass phase names to hooks instead of internal values
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 34836
diff changeset
78 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
31815
7937dabb5447 tests: fix missing (glob) annotations in test-push-http.t
Augie Fackler <augie@google.com>
parents: 31747
diff changeset
79 remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
80 % serve errors
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
81 $ hg rollback
13446
1e497df514e2 rollback: clarifies the message about the reverted state (issue2628)
Gilles Moris <gilles.moris@free.fr>
parents: 13405
diff changeset
82 repository tip rolled back to revision 0 (undo serve)
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
83
14093
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
84 expect success, server lacks the httpheader capability
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
85
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
86 $ CAP=httpheader
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
87 $ . "$TESTDIR/notcapable"
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
88 $ req
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
89 pushing to http://localhost:$HGPORT/
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
90 searching for changes
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
91 remote: adding changesets
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
92 remote: adding manifests
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
93 remote: adding file changes
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
94 remote: added 1 changesets with 1 changes to 1 files
34876
eb1b964b354b phases: pass phase names to hooks instead of internal values
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 34836
diff changeset
95 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
eb1b964b354b phases: pass phase names to hooks instead of internal values
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 34836
diff changeset
96 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
31815
7937dabb5447 tests: fix missing (glob) annotations in test-push-http.t
Augie Fackler <augie@google.com>
parents: 31747
diff changeset
97 remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
14093
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
98 % serve errors
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
99 $ hg rollback
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
100 repository tip rolled back to revision 0 (undo serve)
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
101
13946
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
102 expect success, server lacks the unbundlehash capability
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
103
14011
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13946
diff changeset
104 $ CAP=unbundlehash
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13946
diff changeset
105 $ . "$TESTDIR/notcapable"
13946
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
106 $ req
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
107 pushing to http://localhost:$HGPORT/
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
108 searching for changes
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
109 remote: adding changesets
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
110 remote: adding manifests
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
111 remote: adding file changes
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
112 remote: added 1 changesets with 1 changes to 1 files
34876
eb1b964b354b phases: pass phase names to hooks instead of internal values
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 34836
diff changeset
113 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
eb1b964b354b phases: pass phase names to hooks instead of internal values
Kevin Bullock <kbullock+mercurial@ringworld.org>
parents: 34836
diff changeset
114 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
31815
7937dabb5447 tests: fix missing (glob) annotations in test-push-http.t
Augie Fackler <augie@google.com>
parents: 31747
diff changeset
115 remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
13946
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
116 % serve errors
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
117 $ hg rollback
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
118 repository tip rolled back to revision 0 (undo serve)
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
119
36241
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
120 expect success, pre-d1b16a746db6 server supports the unbundle capability, but
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
121 has no parameter
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
122
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
123 $ cat <<EOF > notcapable-unbundleparam.py
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
124 > from mercurial import extensions, httppeer
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
125 > def capable(orig, self, name):
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
126 > if name == 'unbundle':
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
127 > return True
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
128 > return orig(self, name)
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
129 > def uisetup(ui):
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
130 > extensions.wrapfunction(httppeer.httppeer, 'capable', capable)
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
131 > EOF
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
132 $ cp $HGRCPATH $HGRCPATH.orig
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
133 $ cat <<EOF >> $HGRCPATH
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
134 > [extensions]
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
135 > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
136 > EOF
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
137 $ req
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
138 pushing to http://localhost:$HGPORT/
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
139 searching for changes
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
140 remote: adding changesets
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
141 remote: adding manifests
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
142 remote: adding file changes
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
143 remote: added 1 changesets with 1 changes to 1 files
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
144 remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
145 remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
146 remote: changegroup hook: * (glob)
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
147 % serve errors
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
148 $ hg rollback
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
149 repository tip rolled back to revision 0 (undo serve)
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
150 $ mv $HGRCPATH.orig $HGRCPATH
fefd57bd9573 tests: port value-less unbundle capability test to test-push-http.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34938
diff changeset
151
17793
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
152 expect push success, phase change failure
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
153
17842
a029dac38942 test-push-http: fix failing test on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17793
diff changeset
154 $ cat > .hg/hgrc <<EOF
a029dac38942 test-push-http: fix failing test on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17793
diff changeset
155 > [web]
a029dac38942 test-push-http: fix failing test on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17793
diff changeset
156 > push_ssl = false
a029dac38942 test-push-http: fix failing test on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17793
diff changeset
157 > allow_push = *
a029dac38942 test-push-http: fix failing test on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17793
diff changeset
158 > [hooks]
30234
34a5f6c66bc5 tests: invoke printenv.py via sh -c for test portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27739
diff changeset
159 > prepushkey = sh -c "printenv.py prepushkey 1"
34836
537de0b14030 phase: use a binary phase part to push through bundle2 (BC)
Boris Feld <boris.feld@octobus.net>
parents: 34710
diff changeset
160 > [devel]
537de0b14030 phase: use a binary phase part to push through bundle2 (BC)
Boris Feld <boris.feld@octobus.net>
parents: 34710
diff changeset
161 > legacy.exchange=phases
17842
a029dac38942 test-push-http: fix failing test on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17793
diff changeset
162 > EOF
17793
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
163 $ req
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
164 pushing to http://localhost:$HGPORT/
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
165 searching for changes
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
166 remote: adding changesets
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
167 remote: adding manifests
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
168 remote: adding file changes
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
169 remote: added 1 changesets with 1 changes to 1 files
31815
7937dabb5447 tests: fix missing (glob) annotations in test-push-http.t
Augie Fackler <augie@google.com>
parents: 31747
diff changeset
170 remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
25390
14c6b4c6e3f9 test: use bundle2 in test-push-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24740
diff changeset
171 remote: pushkey-abort: prepushkey hook exited with status 1
25502
bd41c19383db phases: abort the whole push if phases fail to update (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25478
diff changeset
172 remote: transaction abort!
bd41c19383db phases: abort the whole push if phases fail to update (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25478
diff changeset
173 remote: rollback completed
bd41c19383db phases: abort the whole push if phases fail to update (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25478
diff changeset
174 abort: updating ba677d0156c1 to public failed
17793
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
175 % serve errors
25502
bd41c19383db phases: abort the whole push if phases fail to update (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25478
diff changeset
176 [255]
17793
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
177
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
178 expect phase change success
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
179
30234
34a5f6c66bc5 tests: invoke printenv.py via sh -c for test portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27739
diff changeset
180 $ cat >> .hg/hgrc <<EOF
34a5f6c66bc5 tests: invoke printenv.py via sh -c for test portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27739
diff changeset
181 > prepushkey = sh -c "printenv.py prepushkey 0"
34836
537de0b14030 phase: use a binary phase part to push through bundle2 (BC)
Boris Feld <boris.feld@octobus.net>
parents: 34710
diff changeset
182 > [devel]
537de0b14030 phase: use a binary phase part to push through bundle2 (BC)
Boris Feld <boris.feld@octobus.net>
parents: 34710
diff changeset
183 > legacy.exchange=
30234
34a5f6c66bc5 tests: invoke printenv.py via sh -c for test portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 27739
diff changeset
184 > EOF
17793
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
185 $ req
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
186 pushing to http://localhost:$HGPORT/
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
187 searching for changes
25502
bd41c19383db phases: abort the whole push if phases fail to update (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25478
diff changeset
188 remote: adding changesets
bd41c19383db phases: abort the whole push if phases fail to update (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25478
diff changeset
189 remote: adding manifests
bd41c19383db phases: abort the whole push if phases fail to update (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25478
diff changeset
190 remote: adding file changes
bd41c19383db phases: abort the whole push if phases fail to update (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25478
diff changeset
191 remote: added 1 changesets with 1 changes to 1 files
17793
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
192 % serve errors
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
193 $ hg rollback
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
194 repository tip rolled back to revision 0 (undo serve)
8474be4412ca wireproto: fix pushkey hook failure and output on remote http repo
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 17565
diff changeset
195
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
196 expect authorization error: all users denied
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
197
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
198 $ echo '[web]' > .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
199 $ echo 'push_ssl = false' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
200 $ echo 'deny_push = *' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
201 $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
202 pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
203 searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
204 abort: authorization failed
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
205 % serve errors
17455
2212af23c9de test-push-http: include exit status of hg push
Yuya Nishihara <yuya@tcha.org>
parents: 17018
diff changeset
206 [255]
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
207
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
208 expect authorization error: some users denied, users must be authenticated
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
209
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
210 $ echo 'deny_push = unperson' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
211 $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
212 pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
213 searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
214 abort: authorization failed
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
215 % serve errors
17455
2212af23c9de test-push-http: include exit status of hg push
Yuya Nishihara <yuya@tcha.org>
parents: 17018
diff changeset
216 [255]
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15933
diff changeset
217
33700
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
218 $ cat > .hg/hgrc <<EOF
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
219 > [web]
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
220 > push_ssl = false
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
221 > allow_push = *
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
222 > [experimental]
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
223 > httppostargs=true
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
224 > EOF
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
225 $ req
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
226 pushing to http://localhost:$HGPORT/
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
227 searching for changes
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
228 remote: adding changesets
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
229 remote: adding manifests
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
230 remote: adding file changes
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
231 remote: added 1 changesets with 1 changes to 1 files
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
232 % serve errors
970967e0a917 http: add a test of actually pushing with httppostargs
Augie Fackler <augie@google.com>
parents: 31815
diff changeset
233
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15933
diff changeset
234 $ cd ..