author | Christian Ebert <blacktrash@gmx.net> |
Wed, 06 Feb 2008 23:14:33 +0100 | |
changeset 6051 | 1038b1458d7a |
parent 5894 | e181665c1c79 |
child 6061 | de08788511d7 |
permissions | -rwxr-xr-x |
5816 | 1 |
#!/bin/sh |
2 |
||
3 |
cat <<EOF >> $HGRCPATH |
|
4 |
[extensions] |
|
5 |
hgext.keyword = |
|
5894
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
6 |
hgext.mq = |
5816 | 7 |
[keyword] |
8 |
* = |
|
9 |
b = ignore |
|
10 |
[hooks] |
|
11 |
commit= |
|
12 |
commit.test=cp a hooktest |
|
13 |
EOF |
|
14 |
||
15 |
echo % help |
|
16 |
hg help keyword |
|
17 |
||
18 |
echo % hg kwdemo |
|
19 |
hg --quiet kwdemo --default \ |
|
20 |
| sed -e 's![^ ][^ ]*demo.txt,v!/TMP/demo.txt,v!' \ |
|
21 |
-e 's/,v [a-z0-9][a-z0-9]* /,v xxxxxxxxxxxx /' \ |
|
22 |
-e '/[$]Revision/ s/: [a-z0-9][a-z0-9]* /: xxxxxxxxxxxx /' \ |
|
23 |
-e 's! 20[0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]! 2000/00/00 00:00:00!' |
|
24 |
||
25 |
hg --quiet kwdemo "Branch = {branches}" |
|
26 |
||
6051
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
27 |
hg init Test-bndl |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
28 |
cd Test-bndl |
5816 | 29 |
|
30 |
echo % kwshrink should exit silently in empty/invalid repo |
|
31 |
hg kwshrink |
|
32 |
||
33 |
echo 'expand $Id$' > a |
|
34 |
echo 'do not process $Id:' >> a |
|
35 |
echo 'xxx $' >> a |
|
36 |
echo 'ignore $Id$' > b |
|
37 |
ln -s a sym |
|
38 |
echo % cat |
|
39 |
cat sym a b |
|
40 |
||
41 |
echo % addremove |
|
42 |
hg addremove |
|
43 |
echo % status |
|
44 |
hg status |
|
45 |
||
46 |
echo % default keyword expansion including commit hook |
|
47 |
echo % interrupted commit should not change state or run commit hook |
|
5855
a6ccb957fd07
Solaris compatibility fixes for test-keyword:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
5839
diff
changeset
|
48 |
hg --debug commit |
5816 | 49 |
echo % status |
50 |
hg status |
|
51 |
||
52 |
echo % commit |
|
53 |
hg --debug commit -mabsym -d '0 0' -u 'User Name <user@example.com>' |
|
54 |
echo % status |
|
55 |
hg status |
|
56 |
echo % identify |
|
57 |
hg --quiet identify |
|
58 |
echo % cat |
|
59 |
cat sym a b |
|
60 |
echo % hg cat |
|
61 |
hg cat sym a b |
|
62 |
||
63 |
echo |
|
64 |
echo % diff a hooktest |
|
65 |
diff a hooktest |
|
66 |
||
67 |
echo % removing commit hook from config |
|
68 |
sed -e '/\[hooks\]/,$ d' $HGRCPATH > $HGRCPATH.nohook |
|
69 |
mv $HGRCPATH.nohook $HGRCPATH |
|
70 |
rm hooktest |
|
71 |
||
6051
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
72 |
echo % bundle |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
73 |
hg bundle --base null ../kw.hg |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
74 |
|
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
75 |
cd .. |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
76 |
hg init Test |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
77 |
cd Test |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
78 |
|
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
79 |
echo % pull from bundle |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
80 |
hg pull -u ../kw.hg |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
81 |
|
5816 | 82 |
echo % touch |
83 |
touch a b |
|
84 |
echo % status |
|
85 |
hg status |
|
86 |
||
87 |
rm sym a b |
|
88 |
echo % update |
|
89 |
hg update |
|
90 |
echo % cat |
|
91 |
cat sym a b |
|
92 |
||
5856
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
93 |
echo % check whether expansion is filewise |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
94 |
echo '$Id$' > c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
95 |
echo 'tests for different changenodes' >> c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
96 |
echo % commit c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
97 |
hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>' |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
98 |
echo % force expansion |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
99 |
hg -v kwexpand |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
100 |
echo % compare changenodes in a c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
101 |
cat a c |
5894
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
102 |
|
6051
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
103 |
echo % qinit -c |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
104 |
hg qinit -c |
5894
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
105 |
echo % qimport |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
106 |
hg qimport -r tip -n mqtest.diff |
6051
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
107 |
echo % qcommit |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5894
diff
changeset
|
108 |
hg qcommit -mqtest |
5894
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
109 |
echo % keywords should not be expanded in patch |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
110 |
cat .hg/patches/mqtest.diff |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
111 |
echo % qpop |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
112 |
hg qpop |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
113 |
echo % qgoto - should imply qpush |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
114 |
hg qgoto mqtest.diff |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
115 |
echo % cat |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
116 |
cat c |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
117 |
echo % qpop and move on |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
118 |
hg qpop |
5856
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
119 |
|
5816 | 120 |
echo % copy |
121 |
hg cp a c |
|
122 |
||
123 |
echo % kwfiles added |
|
124 |
hg kwfiles |
|
125 |
||
126 |
echo % commit |
|
127 |
hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>' |
|
128 |
echo % cat a c |
|
129 |
cat a c |
|
130 |
echo % touch copied c after 1 second |
|
131 |
sleep 1 |
|
132 |
touch c |
|
133 |
echo % status |
|
134 |
hg status |
|
135 |
||
136 |
echo % kwfiles |
|
137 |
hg kwfiles |
|
138 |
||
139 |
echo % diff --rev |
|
140 |
hg diff --rev 0 | grep -v 'b/c' |
|
141 |
||
142 |
echo % rollback |
|
143 |
hg rollback |
|
144 |
echo % status |
|
145 |
hg status |
|
146 |
echo % update -C |
|
147 |
hg update --clean |
|
148 |
||
149 |
echo % custom keyword expansion |
|
150 |
echo % try with kwdemo |
|
151 |
hg --quiet kwdemo "Xinfo = {author}: {desc}" |
|
152 |
||
153 |
cat <<EOF >>$HGRCPATH |
|
154 |
[keywordmaps] |
|
155 |
Id = {file} {node|short} {date|rfc822date} {author|user} |
|
156 |
Xinfo = {author}: {desc} |
|
157 |
EOF |
|
158 |
||
159 |
echo % cat |
|
160 |
cat sym a b |
|
161 |
echo % hg cat |
|
162 |
hg cat sym a b |
|
163 |
||
164 |
echo |
|
165 |
echo '$Xinfo$' >> a |
|
166 |
cat <<EOF >> log |
|
167 |
firstline |
|
168 |
secondline |
|
169 |
EOF |
|
170 |
||
171 |
echo % interrupted commit should not change state |
|
5855
a6ccb957fd07
Solaris compatibility fixes for test-keyword:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
5839
diff
changeset
|
172 |
hg commit |
5816 | 173 |
echo % status |
174 |
hg status |
|
175 |
||
176 |
echo % commit |
|
177 |
hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>' |
|
178 |
rm log |
|
179 |
echo % status |
|
180 |
hg status |
|
181 |
||
182 |
echo % cat |
|
183 |
cat sym a b |
|
184 |
echo % hg cat |
|
185 |
hg cat sym a b |
|
186 |
echo |
|
187 |
||
188 |
echo % remove |
|
189 |
hg remove a |
|
190 |
hg --debug commit -m rma |
|
191 |
echo % status |
|
192 |
hg status |
|
193 |
echo % rollback |
|
194 |
hg rollback |
|
195 |
echo % status |
|
196 |
hg status |
|
197 |
echo % revert a |
|
198 |
hg revert --no-backup --rev tip a |
|
199 |
echo % cat a |
|
200 |
cat a |
|
201 |
||
202 |
echo % clone to test incoming |
|
203 |
cd .. |
|
204 |
hg clone -r0 Test Test-a |
|
205 |
cd Test-a |
|
206 |
cat <<EOF >> .hg/hgrc |
|
207 |
[paths] |
|
208 |
default = ../Test |
|
209 |
EOF |
|
210 |
echo % incoming |
|
211 |
# remove path to temp dir |
|
212 |
hg incoming | sed -e 's/^\(comparing with \).*\(test-keyword.*\)/\1\2/' |
|
213 |
||
5839
59fba5caa94b
Don't use the -i option with sed
Will Maier <willmaier@ml1.net>
parents:
5816
diff
changeset
|
214 |
sed -e 's/Id.*/& rejecttest/' a > a.new |
59fba5caa94b
Don't use the -i option with sed
Will Maier <willmaier@ml1.net>
parents:
5816
diff
changeset
|
215 |
mv a.new a |
5816 | 216 |
echo % commit rejecttest |
217 |
hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>' |
|
218 |
echo % export |
|
219 |
hg export -o ../rejecttest.diff tip |
|
220 |
||
221 |
cd ../Test |
|
222 |
echo % import |
|
223 |
hg import ../rejecttest.diff |
|
224 |
echo % cat |
|
225 |
cat sym a b |
|
226 |
echo |
|
227 |
echo % rollback |
|
228 |
hg rollback |
|
229 |
echo % clean update |
|
230 |
hg update --clean |
|
231 |
||
232 |
echo % kwexpand/kwshrink on selected files |
|
233 |
mkdir x |
|
234 |
echo % copy a x/a |
|
235 |
hg copy a x/a |
|
236 |
echo % kwexpand a |
|
237 |
hg --verbose kwexpand a |
|
238 |
echo % kwexpand x/a should abort |
|
239 |
hg --verbose kwexpand x/a |
|
240 |
cd x |
|
241 |
hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>' |
|
242 |
echo % cat a |
|
243 |
cat a |
|
244 |
echo % kwshrink a inside directory x |
|
245 |
hg --verbose kwshrink a |
|
246 |
echo % cat a |
|
247 |
cat a |
|
5855
a6ccb957fd07
Solaris compatibility fixes for test-keyword:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
5839
diff
changeset
|
248 |
cd .. |
5816 | 249 |
|
250 |
echo % kwexpand nonexistent |
|
251 |
hg kwexpand nonexistent |
|
252 |
||
253 |
echo % switch off expansion |
|
254 |
echo % kwshrink with unknown file u |
|
255 |
cp a u |
|
256 |
hg --verbose kwshrink |
|
257 |
echo % cat |
|
258 |
cat sym a b |
|
259 |
echo % hg cat |
|
260 |
hg cat sym a b |
|
261 |
echo |
|
262 |
rm $HGRCPATH |
|
263 |
echo % cat |
|
264 |
cat sym a b |
|
265 |
echo % hg cat |
|
266 |
hg cat sym a b |
|
267 |
echo |