Mercurial > hg
annotate tests/test-keyword.out @ 5856:85888efbdfff
keyword: test that expansion is done filewise
Checks issue fixed in 2a66138c5e7e.
author | Christian Ebert <blacktrash@gmx.net> |
---|---|
date | Fri, 11 Jan 2008 23:36:56 +0100 |
parents | a6ccb957fd07 |
children | a139f141dcae |
rev | line source |
---|---|
5816 | 1 % help |
2 keyword extension - keyword expansion in local repositories | |
3 | |
4 This extension expands RCS/CVS-like or self-customized $Keywords$ | |
5 in tracked text files selected by your configuration. | |
6 | |
7 Keywords are only expanded in local repositories and not stored in | |
8 the change history. The mechanism can be regarded as a convenience | |
9 for the current user or for archive distribution. | |
10 | |
11 Configuration is done in the [keyword] and [keywordmaps] sections | |
12 of hgrc files. | |
13 | |
14 Example: | |
15 | |
16 [keyword] | |
17 # expand keywords in every python file except those matching "x*" | |
18 **.py = | |
19 x* = ignore | |
20 | |
21 Note: the more specific you are in your filename patterns | |
22 the less you lose speed in huge repos. | |
23 | |
24 For [keywordmaps] template mapping and expansion demonstration and | |
25 control run "hg kwdemo". | |
26 | |
27 An additional date template filter {date|utcdate} is provided. | |
28 | |
29 The default template mappings (view with "hg kwdemo -d") can be replaced | |
30 with customized keywords and templates. | |
31 Again, run "hg kwdemo" to control the results of your config changes. | |
32 | |
33 Before changing/disabling active keywords, run "hg kwshrink" to avoid | |
34 the risk of inadvertedly storing expanded keywords in the change history. | |
35 | |
36 To force expansion after enabling it, or a configuration change, run | |
37 "hg kwexpand". | |
38 | |
39 Expansions spanning more than one line and incremental expansions, | |
40 like CVS' $Log$, are not supported. A keyword template map | |
41 "Log = {desc}" expands to the first line of the changeset description. | |
42 | |
43 list of commands: | |
44 | |
45 kwdemo print [keywordmaps] configuration and an expansion example | |
46 kwexpand expand keywords in working directory | |
47 kwfiles print files currently configured for keyword expansion | |
48 kwshrink revert expanded keywords in working directory | |
49 | |
50 use "hg -v help keyword" to show aliases and global options | |
51 % hg kwdemo | |
52 [extensions] | |
53 hgext.keyword = | |
54 [keyword] | |
55 * = | |
56 b = ignore | |
57 demo.txt = | |
58 [keywordmaps] | |
59 RCSFile = {file|basename},v | |
60 Author = {author|user} | |
61 Header = {root}/{file},v {node|short} {date|utcdate} {author|user} | |
62 Source = {root}/{file},v | |
63 Date = {date|utcdate} | |
64 Id = {file|basename},v {node|short} {date|utcdate} {author|user} | |
65 Revision = {node|short} | |
66 $RCSFile: demo.txt,v $ | |
67 $Author: test $ | |
68 $Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ | |
69 $Source: /TMP/demo.txt,v $ | |
70 $Date: 2000/00/00 00:00:00 $ | |
71 $Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ | |
72 $Revision: xxxxxxxxxxxx $ | |
73 [extensions] | |
74 hgext.keyword = | |
75 [keyword] | |
76 * = | |
77 b = ignore | |
78 demo.txt = | |
79 [keywordmaps] | |
80 Branch = {branches} | |
81 $Branch: demobranch $ | |
82 % kwshrink should exit silently in empty/invalid repo | |
83 % cat | |
84 expand $Id$ | |
85 do not process $Id: | |
86 xxx $ | |
87 expand $Id$ | |
88 do not process $Id: | |
89 xxx $ | |
90 ignore $Id$ | |
91 % addremove | |
92 adding a | |
93 adding b | |
94 adding sym | |
95 % status | |
96 A a | |
97 A b | |
98 A sym | |
99 % default keyword expansion including commit hook | |
100 % interrupted commit should not change state or run commit hook | |
101 a | |
102 b | |
103 sym | |
104 transaction abort! | |
105 rollback completed | |
5855
a6ccb957fd07
Solaris compatibility fixes for test-keyword:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
5816
diff
changeset
|
106 abort: empty commit message |
5816 | 107 % status |
108 A a | |
109 A b | |
110 A sym | |
111 % commit | |
112 a | |
113 b | |
114 sym | |
115 overwriting a expanding keywords | |
116 running hook commit.test: cp a hooktest | |
117 % status | |
118 ? hooktest | |
119 % identify | |
120 f782df5f9602 | |
121 % cat | |
122 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
123 do not process $Id: | |
124 xxx $ | |
125 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
126 do not process $Id: | |
127 xxx $ | |
128 ignore $Id$ | |
129 % hg cat | |
130 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
131 do not process $Id: | |
132 xxx $ | |
133 ignore $Id$ | |
134 a | |
135 % diff a hooktest | |
136 % removing commit hook from config | |
137 % touch | |
138 % status | |
139 % update | |
140 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
141 % cat | |
142 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
143 do not process $Id: | |
144 xxx $ | |
145 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
146 do not process $Id: | |
147 xxx $ | |
148 ignore $Id$ | |
5856
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
149 % check whether expansion is filewise |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
150 % commit c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
151 adding c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
152 % force expansion |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
153 overwriting a expanding keywords |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
154 overwriting c expanding keywords |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
155 % compare changenodes in a c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
156 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
157 do not process $Id: |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
158 xxx $ |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
159 $Id: c,v ba4426d1938e 1970/01/01 00:00:01 user $ |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
160 tests for different changenodes |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
161 % rollback and remove c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
162 rolling back last transaction |
5816 | 163 % copy |
164 % kwfiles added | |
165 a | |
166 c | |
167 % commit | |
168 c | |
169 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 | |
170 overwriting c expanding keywords | |
171 % cat a c | |
172 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
173 do not process $Id: | |
174 xxx $ | |
175 expand $Id: c,v 0ba462c0f077 1970/01/01 00:00:01 user $ | |
176 do not process $Id: | |
177 xxx $ | |
178 % touch copied c after 1 second | |
179 % status | |
180 % kwfiles | |
181 a | |
182 c | |
183 % diff --rev | |
184 diff -r f782df5f9602 c | |
185 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
186 @@ -0,0 +1,3 @@ | |
187 +expand $Id: c,v 0ba462c0f077 1970/01/01 00:00:01 user $ | |
188 +do not process $Id: | |
189 +xxx $ | |
190 % rollback | |
191 rolling back last transaction | |
192 % status | |
193 A c | |
194 % update -C | |
195 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
196 % custom keyword expansion | |
197 % try with kwdemo | |
198 [extensions] | |
199 hgext.keyword = | |
200 [keyword] | |
201 * = | |
202 b = ignore | |
203 demo.txt = | |
204 [keywordmaps] | |
205 Xinfo = {author}: {desc} | |
206 $Xinfo: test: hg keyword config and expansion example $ | |
207 % cat | |
208 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
209 do not process $Id: | |
210 xxx $ | |
211 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
212 do not process $Id: | |
213 xxx $ | |
214 ignore $Id$ | |
215 % hg cat | |
216 expand $Id: a f782df5f9602 Thu, 01 Jan 1970 00:00:00 +0000 user $ | |
217 do not process $Id: | |
218 xxx $ | |
219 ignore $Id$ | |
220 a | |
221 % interrupted commit should not change state | |
222 transaction abort! | |
223 rollback completed | |
5855
a6ccb957fd07
Solaris compatibility fixes for test-keyword:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
5816
diff
changeset
|
224 abort: empty commit message |
5816 | 225 % status |
226 M a | |
227 ? log | |
228 % commit | |
229 a | |
230 overwriting a expanding keywords | |
231 % status | |
232 % cat | |
233 expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
234 do not process $Id: | |
235 xxx $ | |
236 $Xinfo: User Name <user@example.com>: firstline $ | |
237 expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
238 do not process $Id: | |
239 xxx $ | |
240 $Xinfo: User Name <user@example.com>: firstline $ | |
241 ignore $Id$ | |
242 % hg cat | |
243 expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
244 do not process $Id: | |
245 xxx $ | |
246 $Xinfo: User Name <user@example.com>: firstline $ | |
247 ignore $Id$ | |
248 a | |
249 % remove | |
250 % status | |
251 % rollback | |
252 rolling back last transaction | |
253 % status | |
254 R a | |
255 % revert a | |
256 % cat a | |
257 expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
258 do not process $Id: | |
259 xxx $ | |
260 $Xinfo: User Name <user@example.com>: firstline $ | |
261 % clone to test incoming | |
262 requesting all changes | |
263 adding changesets | |
264 adding manifests | |
265 adding file changes | |
266 added 1 changesets with 3 changes to 3 files | |
267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
268 % incoming | |
269 comparing with test-keyword/Test-a/../Test | |
270 searching for changes | |
271 changeset: 1:0729690beff6 | |
272 tag: tip | |
273 user: User Name <user@example.com> | |
274 date: Thu Jan 01 00:00:02 1970 +0000 | |
275 summary: firstline | |
276 | |
277 % commit rejecttest | |
278 a | |
279 overwriting a expanding keywords | |
280 % export | |
281 % import | |
282 applying ../rejecttest.diff | |
283 % cat | |
284 expand $Id: a 82983f13f138 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest | |
285 do not process $Id: rejecttest | |
286 xxx $ | |
287 $Xinfo: User Name <user@example.com>: rejects? $ | |
288 expand $Id: a 82983f13f138 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest | |
289 do not process $Id: rejecttest | |
290 xxx $ | |
291 $Xinfo: User Name <user@example.com>: rejects? $ | |
292 ignore $Id$ | |
293 | |
294 % rollback | |
295 rolling back last transaction | |
296 % clean update | |
297 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
298 % kwexpand/kwshrink on selected files | |
299 % copy a x/a | |
300 % kwexpand a | |
301 overwriting a expanding keywords | |
302 % kwexpand x/a should abort | |
303 abort: outstanding uncommitted changes in given files | |
304 x/a | |
305 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e | |
306 overwriting x/a expanding keywords | |
307 % cat a | |
308 expand $Id: x/a f27c134d2d9b Thu, 01 Jan 1970 00:00:03 +0000 user $ | |
309 do not process $Id: | |
310 xxx $ | |
311 $Xinfo: User Name <user@example.com>: xa $ | |
312 % kwshrink a inside directory x | |
313 overwriting x/a shrinking keywords | |
314 % cat a | |
315 expand $Id$ | |
316 do not process $Id: | |
317 xxx $ | |
318 $Xinfo$ | |
319 % kwexpand nonexistent | |
320 nonexistent: No such file or directory | |
321 % switch off expansion | |
322 % kwshrink with unknown file u | |
323 overwriting a shrinking keywords | |
324 overwriting x/a shrinking keywords | |
325 % cat | |
326 expand $Id$ | |
327 do not process $Id: | |
328 xxx $ | |
329 $Xinfo$ | |
330 expand $Id$ | |
331 do not process $Id: | |
332 xxx $ | |
333 $Xinfo$ | |
334 ignore $Id$ | |
335 % hg cat | |
336 expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
337 do not process $Id: | |
338 xxx $ | |
339 $Xinfo: User Name <user@example.com>: firstline $ | |
340 ignore $Id$ | |
341 a | |
342 % cat | |
343 expand $Id$ | |
344 do not process $Id: | |
345 xxx $ | |
346 $Xinfo$ | |
347 expand $Id$ | |
348 do not process $Id: | |
349 xxx $ | |
350 $Xinfo$ | |
351 ignore $Id$ | |
352 % hg cat | |
353 expand $Id$ | |
354 do not process $Id: | |
355 xxx $ | |
356 $Xinfo$ | |
357 ignore $Id$ | |
358 a |