annotate tests/test-http-branchmap.t @ 12447:f5f90d3808e2

tests: unify test-http-branchmap
author Matt Mackall <mpm@selenic.com>
date Sun, 26 Sep 2010 13:43:08 -0500
parents tests/test-http-branchmap@9f10adb70a04
children d08bb64888bc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9879
7bb004fc14ec Extend test-branchmap to test c51494c53841
Thomas Arendsen Hein <thomas@intevation.de>
parents: 9789
diff changeset
1
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
2 $ hgserve() {
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
3 > 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
4 > cat hg.pid >> "$DAEMON_PIDS"
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
5 > }
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
6 $ hg init a
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
7 $ hg --encoding utf-8 -R a branch æ
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
8 marked working directory as branch æ
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
9 $ echo foo > a/foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
10 $ hg -R a ci -Am foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
11 adding foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
12 $ hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
13 listening at http://localhost*/ (bound to 127.0.0.1:*) (glob)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
14 $ hg --encoding utf-8 clone http://localhost:$HGPORT1 b
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
15 requesting all changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
16 adding changesets
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
17 adding manifests
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
18 adding file changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
19 added 1 changesets with 1 changes to 1 files
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
20 updating to branch æ
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
21 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
22 $ hg --encoding utf-8 -R b log
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
23 changeset: 0:867c11ce77b8
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
24 branch: æ
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
25 tag: tip
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
26 user: test
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
27 date: Thu Jan 01 00:00:00 1970 +0000
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
28 summary: foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
29
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
30 $ echo bar >> b/foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
31 $ hg -R b ci -m bar
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
32 $ hg --encoding utf-8 -R b push
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
33 pushing to http://localhost:* (glob)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
34 searching for changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
35 remote: adding changesets
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
36 remote: adding manifests
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
37 remote: adding file changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
38 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
39 $ hg -R a --encoding utf-8 log
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
40 changeset: 1:58e7c90d67cb
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
41 branch: æ
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
42 tag: tip
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
43 user: test
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
44 date: Thu Jan 01 00:00:00 1970 +0000
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
45 summary: bar
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
46
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
47 changeset: 0:867c11ce77b8
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
48 branch: æ
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
49 user: test
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
50 date: Thu Jan 01 00:00:00 1970 +0000
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
51 summary: foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
52
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
53 $ kill `cat hg.pid`
9879
7bb004fc14ec Extend test-branchmap to test c51494c53841
Thomas Arendsen Hein <thomas@intevation.de>
parents: 9789
diff changeset
54
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
55 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
56
12447
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
57 $ cat <<EOF > oldhg
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
58 > import sys
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
59 > from mercurial import ui, hg, commands
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
60 >
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
61 > class StdoutWrapper(object):
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
62 > def __init__(self, stdout):
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
63 > self._file = stdout
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
64 >
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
65 > def write(self, data):
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
66 > if data == '47\n':
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
67 > # latin1 encoding is one %xx (3 bytes) shorter
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
68 > data = '44\n'
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
69 > elif data.startswith('%C3%A6 '):
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
70 > # translate to latin1 encoding
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
71 > data = '%%E6 %s' % data[7:]
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
72 > self._file.write(data)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
73 >
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
74 > def __getattr__(self, name):
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
75 > return getattr(self._file, name)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
76 >
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
77 > sys.stdout = StdoutWrapper(sys.stdout)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
78 > sys.stderr = StdoutWrapper(sys.stderr)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
79 >
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
80 > myui = ui.ui()
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
81 > repo = hg.repository(myui, 'a')
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
82 > commands.serve(myui, repo, stdio=True)
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
83 > EOF
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
84 $ echo baz >> b/foo
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
85 $ hg -R b ci -m baz
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
86 $ 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
87 pushing to ssh://dummy/
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
88 searching for changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
89 remote: adding changesets
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
90 remote: adding manifests
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
91 remote: adding file changes
f5f90d3808e2 tests: unify test-http-branchmap
Matt Mackall <mpm@selenic.com>
parents: 11617
diff changeset
92 remote: added 1 changesets with 1 changes to 1 files