Mercurial > hg > mercurial-crew-with-dirclash
annotate tests/test-mq @ 3064:fbd3f9fd645d
hgk.py: use mercurial.patch functions when possible
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Thu, 07 Sep 2006 14:13:01 +0200 |
parents | a4374f7331e4 |
children | 760414dc7ac6 |
rev | line source |
---|---|
2729 | 1 #!/bin/sh |
2 | |
2976
61fcd9fac434
Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2935
diff
changeset
|
3 echo "[extensions]" >> $HGRCPATH |
61fcd9fac434
Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2935
diff
changeset
|
4 echo "mq=" >> $HGRCPATH |
2729 | 5 |
6 echo % help | |
7 hg help mq | |
8 | |
9 hg init a | |
10 cd a | |
11 echo a > a | |
2836
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
12 hg ci -Ama |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
13 |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
14 hg clone . ../k |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
15 |
2729 | 16 mkdir b |
17 echo z > b/z | |
18 hg ci -Ama | |
19 | |
20 echo % qinit | |
21 | |
22 hg qinit | |
23 | |
24 cd .. | |
25 hg init b | |
26 | |
27 echo % -R qinit | |
28 | |
29 hg -R b qinit | |
30 | |
31 hg init c | |
32 | |
33 echo % qinit -c | |
34 | |
35 hg --cwd c qinit -c | |
36 hg -R c/.hg/patches st | |
37 | |
38 echo % qnew implies add | |
39 | |
40 hg -R c qnew test.patch | |
41 hg -R c/.hg/patches st | |
42 | |
43 cd a | |
44 | |
45 echo % qnew -m | |
46 | |
47 hg qnew -m 'foo bar' test.patch | |
48 cat .hg/patches/test.patch | |
49 | |
50 echo % qrefresh | |
51 | |
52 echo a >> a | |
53 hg qrefresh | |
2831
0b9ac7dfcf56
Fix some tests for portability.
Danek Duvall <danek.duvall@sun.com>
parents:
2729
diff
changeset
|
54 sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \ |
2729 | 55 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
56 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch | |
57 | |
58 echo % qpop | |
59 | |
60 hg qpop | |
61 | |
62 echo % qpush | |
63 | |
64 hg qpush | |
65 | |
66 cd .. | |
67 | |
68 echo % pop/push outside repo | |
69 | |
70 hg -R a qpop | |
71 hg -R a qpush | |
72 | |
73 cd a | |
74 hg qnew test2.patch | |
75 | |
76 echo % qrefresh in subdir | |
77 | |
78 cd b | |
79 echo a > a | |
80 hg add a | |
81 hg qrefresh | |
82 | |
83 echo % pop/push -a in subdir | |
84 | |
85 hg qpop -a | |
86 hg --traceback qpush -a | |
87 | |
88 echo % qseries | |
89 hg qseries | |
90 | |
91 echo % qapplied | |
92 hg qapplied | |
93 | |
94 echo % qtop | |
95 hg qtop | |
96 | |
97 echo % qprev | |
98 hg qprev | |
99 | |
100 echo % qnext | |
101 hg qnext | |
102 | |
103 echo % pop, qnext, qprev, qapplied | |
104 hg qpop | |
105 hg qnext | |
106 hg qprev | |
107 hg qapplied | |
108 | |
2834
b8d587cfa3bb
mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2831
diff
changeset
|
109 echo % commit should fail |
b8d587cfa3bb
mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2831
diff
changeset
|
110 hg commit |
b8d587cfa3bb
mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2831
diff
changeset
|
111 |
2836
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
112 echo % push should fail |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
113 hg push ../../k |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
114 |
2729 | 115 echo % qunapplied |
116 hg qunapplied | |
117 | |
2836
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
118 echo % push should succeed |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
119 hg qpop -a |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
120 hg push ../../k |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2834
diff
changeset
|
121 |
2729 | 122 echo % strip |
123 cd ../../b | |
124 echo x>x | |
125 hg ci -Ama | |
126 hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
127 hg unbundle .hg/strip-backup/* | |
2934
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
128 |
3024
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
129 echo '% cd b; hg qrefresh' |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
130 hg init refresh |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
131 cd refresh |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
132 echo a > a |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
133 hg ci -Ama -d'0 0' |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
134 hg qnew -mfoo foo |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
135 echo a >> a |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
136 hg qrefresh |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
137 mkdir b |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
138 cd b |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
139 echo f > f |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
140 hg add f |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
141 hg qrefresh |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
142 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
143 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
144 echo % hg qrefresh . |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
145 hg qrefresh . |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
146 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
147 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
148 hg status |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2976
diff
changeset
|
149 |
2976
61fcd9fac434
Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2935
diff
changeset
|
150 cat >>$HGRCPATH <<EOF |
2934
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
151 [diff] |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
152 git = True |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
153 EOF |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
154 cd .. |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
155 hg init git |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
156 cd git |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
157 hg qinit |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
158 |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
159 hg qnew -m'new file' new |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
160 echo foo > new |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
161 chmod +x new |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
162 hg add new |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
163 hg qrefresh |
2935 | 164 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
165 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new | |
2934
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
166 |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
167 hg qnew -m'copy file' copy |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
168 hg cp new copy |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
169 hg qrefresh |
2935 | 170 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
171 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy | |
2934
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
172 |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
173 hg qpop |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
174 hg qpush |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2836
diff
changeset
|
175 hg qdiff |