annotate tests/test-mq-caches.t @ 11985:81edef14922e

log: add logging for commands
author Matt Mackall <mpm@selenic.com>
date Thu, 19 Aug 2010 11:14:09 -0500
parents 0e4bbe18ff95
children 4c94b6d0fb1c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
1 $ branches=.hg/branchheads.cache
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
2 $ echo '[extensions]' >> $HGRCPATH
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
3 $ echo 'mq =' >> $HGRCPATH
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
4
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
5 $ show_branch_cache()
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
6 > {
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
7 > # force cache (re)generation
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
8 > hg log -r does-not-exist 2> /dev/null
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
9 > hg log -r tip --template 'tip: {rev}\n'
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
10 > if [ -f $branches ]; then
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
11 > sort $branches
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
12 > else
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
13 > echo No branch cache
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
14 > fi
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
15 > if [ "$1" = 1 ]; then
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
16 > for b in foo bar; do
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
17 > hg log -r $b --template "branch $b: "'{rev}\n'
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
18 > done
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
19 > fi
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
20 > }
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
21
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
22 $ hg init a
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
23 $ cd a
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
24 $ hg qinit -c
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
25
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
26
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
27 mq patch on an empty repo
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
28
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
29 $ hg qnew p1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
30 $ show_branch_cache
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
31 tip: 0
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
32 No branch cache
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
33
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
34 $ echo > pfile
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
35 $ hg add pfile
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
36 $ hg qrefresh -m 'patch 1'
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
37 $ show_branch_cache
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
38 tip: 0
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
39 No branch cache
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
40
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
41 some regular revisions
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
42
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
43 $ hg qpop
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
44 popping p1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
45 patch queue now empty
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
46 $ echo foo > foo
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
47 $ hg add foo
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
48 $ echo foo > .hg/branch
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
49 $ hg ci -m 'branch foo' -d '1000000 0'
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
50
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
51 $ echo bar > bar
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
52 $ hg add bar
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
53 $ echo bar > .hg/branch
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
54 $ hg ci -m 'branch bar' -d '1000000 0'
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
55 $ show_branch_cache
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
56 tip: 1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
57 3f910abad313ff802d3a23a7529433872df9b3ae 1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
58 3f910abad313ff802d3a23a7529433872df9b3ae bar
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
59 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
60
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
61 add some mq patches
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
62
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
63 $ hg qpush
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
64 applying p1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
65 now at: p1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
66 $ show_branch_cache
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
67 tip: 2
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
68 3f910abad313ff802d3a23a7529433872df9b3ae 1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
69 3f910abad313ff802d3a23a7529433872df9b3ae bar
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
70 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
71
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
72 $ hg qnew p2
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
73 $ echo foo > .hg/branch
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
74 $ echo foo2 >> foo
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
75 $ hg qrefresh -m 'patch 2'
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
76 $ show_branch_cache 1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
77 tip: 3
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
78 3f910abad313ff802d3a23a7529433872df9b3ae 1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
79 3f910abad313ff802d3a23a7529433872df9b3ae bar
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
80 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
81 branch foo: 3
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
82 branch bar: 2
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
83
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
84 removing the cache
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
85
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
86 $ rm $branches
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
87 $ show_branch_cache 1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
88 tip: 3
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
89 3f910abad313ff802d3a23a7529433872df9b3ae 1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
90 3f910abad313ff802d3a23a7529433872df9b3ae bar
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
91 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
92 branch foo: 3
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
93 branch bar: 2
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
94
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
95 importing rev 1 (the cache now ends in one of the patches)
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
96
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
97 $ hg qimport -r 1 -n p0
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
98 $ show_branch_cache 1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
99 tip: 3
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
100 3f910abad313ff802d3a23a7529433872df9b3ae 1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
101 3f910abad313ff802d3a23a7529433872df9b3ae bar
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
102 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
103 branch foo: 3
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
104 branch bar: 2
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
105 $ hg log -r qbase --template 'qbase: {rev}\n'
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
106 qbase: 1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
107
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
108 detect an invalid cache
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
109
11897
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
110 $ hg qpop -a
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
111 popping p2
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
112 popping p1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
113 popping p0
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
114 patch queue now empty
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
115 $ hg qpush -a
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
116 applying p0
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
117 applying p1
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
118 applying p2
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
119 now at: p2
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
120 $ show_branch_cache
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
121 tip: 3
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
122 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff 0
0e4bbe18ff95 tests: unify test-mq-caches
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10119
diff changeset
123 9539f35bdc80732cc9a3f84e46508f1ed1ec8cff foo
3492
fbf8320f25c8 make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
124