annotate tests/test-push-http @ 10397:8cb81d75730c

mq: add parent node IDs to MQ patches on qrefresh/qnew The goal of this patch is to add the IDs of the parents of applied MQ patches into the patch file headers whenever qnew or qrefresh are run. This will serve as a reminder of when the patches last applied cleanly and will let us do more intelligent things in the future, such as: * Resolve conflicts found when qpushing to a new location by merging instead of simply showing rejects. * Display better diffs of versioned MQ patches because we can tell how the patched files have changed in the meantime. Here are the new rules this patch introduces. They are checked in this order: * If a patch currently has old, plain-style patch headers ("From:" and "Date:") do not change the style or add any new headers. * If the 'mq.plain' configuration setting is true, only plain-style headers will be used for all MQ patches. * qnew will initialize new patches with HG-style headers and fill in the "# Parent" header with the appropriate parent node. * qrefresh will refresh the "# Parent" header with the current parent of the current patch.
author Steve Losh <steve@stevelosh.com>
date Sun, 07 Feb 2010 10:47:54 -0500
parents 6c82beaaa11a
children ace3cf2bc991
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
1 #!/bin/sh
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
2
4288
8a3e12426c03 test-push-http: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2673
diff changeset
3 cp "$TESTDIR"/printenv.py .
8a3e12426c03 test-push-http: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2673
diff changeset
4
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
5 hg init test
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
6 cd test
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
7 echo a > a
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 6167
diff changeset
8 hg ci -Ama
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
9
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
10 cd ..
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
11 hg clone test test2
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
12 cd test2
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
13 echo a >> a
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 6167
diff changeset
14 hg ci -mb
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
15
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
16 req() {
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
17 hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
18 cat hg.pid >> $DAEMON_PIDS
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
19 hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
20 kill `cat hg.pid`
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
21 echo % serve errors
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
22 cat errors.log
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
23 }
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
24
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
25 cd ../test
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
26
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
27 echo % expect ssl error
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
28 req
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
29
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
30 echo % expect authorization error
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
31 echo '[web]' > .hg/hgrc
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
32 echo 'push_ssl = false' >> .hg/hgrc
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
33 req
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
34
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
35 echo % expect authorization error: must have authorized user
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
36 echo 'allow_push = unperson' >> .hg/hgrc
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
37 req
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
38
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
39 echo % expect success
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
40 echo 'allow_push = *' >> .hg/hgrc
2673
109a22f5434a hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2571
diff changeset
41 echo '[hooks]' >> .hg/hgrc
4288
8a3e12426c03 test-push-http: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2673
diff changeset
42 echo 'changegroup = python ../printenv.py changegroup 0 ../urls' >> .hg/hgrc
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
43 req
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
44
4288
8a3e12426c03 test-push-http: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2673
diff changeset
45 cat ../urls
2673
109a22f5434a hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2571
diff changeset
46
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
47 hg rollback
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
48 echo % expect authorization error: all users denied
2673
109a22f5434a hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2571
diff changeset
49 echo '[web]' > .hg/hgrc
109a22f5434a hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2571
diff changeset
50 echo 'push_ssl = false' >> .hg/hgrc
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
51 echo 'deny_push = *' >> .hg/hgrc
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
52 req
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
53
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
54 echo % expect authorization error: some users denied, users must be authenticated
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
55 echo 'deny_push = unperson' >> .hg/hgrc
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
56 req