annotate tests/test-mq @ 2993:985594e891b8

Support foo@bar notation as demandload module spec.
author Shun-ichi GOTO <shunichi.goto@gmail.com>
date Tue, 22 Aug 2006 14:31:56 +0900
parents 1c66aad252f9
children 61fcd9fac434
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2729
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
1 #!/bin/sh
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
2
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
3 HGRCPATH=$HGTMP/.hgrc; export HGRCPATH
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
4 echo "[extensions]" >> $HGTMP/.hgrc
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
5 echo "mq=" >> $HGTMP/.hgrc
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
6
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
7 echo % help
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
8 hg help mq
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
9
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
10 hg init a
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
11 cd a
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
12 echo a > a
2848
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
13 hg ci -Ama
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
14
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
15 hg clone . ../k
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
16
2729
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
17 mkdir b
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
18 echo z > b/z
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
19 hg ci -Ama
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
20
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
21 echo % qinit
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
22
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
23 hg qinit
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
24
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
25 cd ..
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
26 hg init b
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
27
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
28 echo % -R qinit
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
29
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
30 hg -R b qinit
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
31
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
32 hg init c
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
33
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
34 echo % qinit -c
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
35
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
36 hg --cwd c qinit -c
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
37 hg -R c/.hg/patches st
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
38
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
39 echo % qnew implies add
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
40
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
41 hg -R c qnew test.patch
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
42 hg -R c/.hg/patches st
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
43
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
44 cd a
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
45
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
46 echo % qnew -m
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
47
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
48 hg qnew -m 'foo bar' test.patch
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
49 cat .hg/patches/test.patch
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
50
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
51 echo % qrefresh
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
52
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
53 echo a >> a
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
54 hg qrefresh
2843
0b9ac7dfcf56 Fix some tests for portability.
Danek Duvall <danek.duvall@sun.com>
parents: 2729
diff changeset
55 sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \
2729
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
56 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
57 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
58
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
59 echo % qpop
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
60
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
61 hg qpop
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
62
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
63 echo % qpush
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
64
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
65 hg qpush
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
66
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
67 cd ..
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
68
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
69 echo % pop/push outside repo
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
70
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
71 hg -R a qpop
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
72 hg -R a qpush
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
73
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
74 cd a
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
75 hg qnew test2.patch
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
76
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
77 echo % qrefresh in subdir
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
78
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
79 cd b
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
80 echo a > a
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
81 hg add a
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
82 hg qrefresh
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
83
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
84 echo % pop/push -a in subdir
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
85
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
86 hg qpop -a
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
87 hg --traceback qpush -a
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
88
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
89 echo % qseries
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
90 hg qseries
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
91
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
92 echo % qapplied
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
93 hg qapplied
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
94
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
95 echo % qtop
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
96 hg qtop
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
97
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
98 echo % qprev
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
99 hg qprev
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
100
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
101 echo % qnext
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
102 hg qnext
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
103
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
104 echo % pop, qnext, qprev, qapplied
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
105 hg qpop
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
106 hg qnext
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
107 hg qprev
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
108 hg qapplied
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
109
2846
b8d587cfa3bb mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2843
diff changeset
110 echo % commit should fail
b8d587cfa3bb mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2843
diff changeset
111 hg commit
b8d587cfa3bb mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2843
diff changeset
112
2848
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
113 echo % push should fail
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
114 hg push ../../k
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
115
2729
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
116 echo % qunapplied
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
117 hg qunapplied
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
118
2848
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
119 echo % push should succeed
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
120 hg qpop -a
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
121 hg push ../../k
307439d6fede mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2846
diff changeset
122
2729
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
123 echo % strip
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
124 cd ../../b
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
125 echo x>x
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
126 hg ci -Ama
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
127 hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
8ce86d2c9737 mq: add basic tests
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
128 hg unbundle .hg/strip-backup/*
2934
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
129
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
130 cat >>$HGTMP/.hgrc <<EOF
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
131 [diff]
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
132 git = True
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
133 EOF
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
134 cd ..
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
135 hg init git
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
136 cd git
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
137 hg qinit
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
138
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
139 hg qnew -m'new file' new
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
140 echo foo > new
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
141 chmod +x new
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
142 hg add new
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
143 hg qrefresh
2935
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2934
diff changeset
144 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2934
diff changeset
145 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new
2934
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
146
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
147 hg qnew -m'copy file' copy
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
148 hg cp new copy
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
149 hg qrefresh
2935
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2934
diff changeset
150 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2934
diff changeset
151 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy
2934
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
152
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
153 hg qpop
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
154 hg qpush
2f190e998eb3 Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents: 2848
diff changeset
155 hg qdiff