annotate tests/test-http-branchmap.t @ 15446:c5c9ca3719f9

tests: use 'hghave serve' to guard tests that requires serve daemon management
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 07 Nov 2011 03:24:53 +0100
parents 2e9f379de0ac
children fc8c7a5ccc4a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15446
c5c9ca3719f9 tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents: 14647
diff changeset
1 $ "$TESTDIR/hghave" serve || exit 80
9879
7bb004fc14ec Extend test-branchmap to test c51494c53841
Thomas Arendsen Hein <thomas@intevation.de>
parents: 9789
diff changeset
2
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
3 $ hgserve() {
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
4 > hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
5 > cat hg.pid >> "$DAEMON_PIDS"
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
6 > }
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
7 $ hg init a
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
8 $ hg --encoding utf-8 -R a branch æ
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12700
diff changeset
9 marked working directory as branch \xc3\xa6 (esc)
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
10 $ echo foo > a/foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
11 $ hg -R a ci -Am foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
12 adding foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
13 $ hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1
12700
17aa0f1ed89d tests: use a glob for all of the host, might not be localhost
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 12643
diff changeset
14 listening at http://*:$HGPORT1/ (bound to 127.0.0.1:$HGPORT1) (glob)
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
15 $ hg --encoding utf-8 clone http://localhost:$HGPORT1 b
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
16 requesting all changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
17 adding changesets
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
18 adding manifests
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
19 adding file changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
20 added 1 changesets with 1 changes to 1 files
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12700
diff changeset
21 updating to branch \xc3\xa6 (esc)
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
23 $ hg --encoding utf-8 -R b log
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
24 changeset: 0:867c11ce77b8
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12700
diff changeset
25 branch: \xc3\xa6 (esc)
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
26 tag: tip
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
27 user: test
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
28 date: Thu Jan 01 00:00:00 1970 +0000
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
29 summary: foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
30
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
31 $ echo bar >> b/foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
32 $ hg -R b ci -m bar
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
33 $ hg --encoding utf-8 -R b push
13815
d066d8d652c8 url: add trailing slashes to URLs with hostnames that don't have one
Brodie Rao <brodie@bitheap.org>
parents: 12942
diff changeset
34 pushing to http://localhost:$HGPORT1/
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
35 searching for changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
36 remote: adding changesets
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
37 remote: adding manifests
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
38 remote: adding file changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
39 remote: added 1 changesets with 1 changes to 1 files
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
40 $ hg -R a --encoding utf-8 log
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
41 changeset: 1:58e7c90d67cb
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12700
diff changeset
42 branch: \xc3\xa6 (esc)
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
43 tag: tip
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
44 user: test
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
45 date: Thu Jan 01 00:00:00 1970 +0000
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
46 summary: bar
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
47
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
48 changeset: 0:867c11ce77b8
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12700
diff changeset
49 branch: \xc3\xa6 (esc)
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
50 user: test
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
51 date: Thu Jan 01 00:00:00 1970 +0000
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
52 summary: foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
53
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
54 $ kill `cat hg.pid`
9879
7bb004fc14ec Extend test-branchmap to test c51494c53841
Thomas Arendsen Hein <thomas@intevation.de>
parents: 9789
diff changeset
55
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
56 verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
9879
7bb004fc14ec Extend test-branchmap to test c51494c53841
Thomas Arendsen Hein <thomas@intevation.de>
parents: 9789
diff changeset
57
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
58 $ cat <<EOF > oldhg
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
59 > import sys
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
60 > from mercurial import ui, hg, commands
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
61 >
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
62 > class StdoutWrapper(object):
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
63 > def __init__(self, stdout):
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
64 > self._file = stdout
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
65 >
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
66 > def write(self, data):
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
67 > if data == '47\n':
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
68 > # latin1 encoding is one %xx (3 bytes) shorter
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
69 > data = '44\n'
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
70 > elif data.startswith('%C3%A6 '):
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
71 > # translate to latin1 encoding
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
72 > data = '%%E6 %s' % data[7:]
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
73 > self._file.write(data)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
74 >
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
75 > def __getattr__(self, name):
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
76 > return getattr(self._file, name)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
77 >
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
78 > sys.stdout = StdoutWrapper(sys.stdout)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
79 > sys.stderr = StdoutWrapper(sys.stderr)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
80 >
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
81 > myui = ui.ui()
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
82 > repo = hg.repository(myui, 'a')
14647
2e9f379de0ac serve: add --cmdserver option to communicate with hg over a pipe
Idan Kamara <idankk86@gmail.com>
parents: 13815
diff changeset
83 > commands.serve(myui, repo, stdio=True, cmdserver=False)
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
84 > EOF
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
85 $ echo baz >> b/foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
86 $ hg -R b ci -m baz
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
87 $ hg push -R b -e 'python oldhg' ssh://dummy/ --encoding latin1
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
88 pushing to ssh://dummy/
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
89 searching for changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
90 remote: adding changesets
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
91 remote: adding manifests
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
92 remote: adding file changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
93 remote: added 1 changesets with 1 changes to 1 files