Mercurial > hg
annotate tests/test-keyword.out @ 6056:0ad2ffbf6b38
Print less scary warning when invalidating the branch cache.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sat, 09 Feb 2008 18:58:31 +0100 |
parents | 1038b1458d7a |
children | de08788511d7 |
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 | |
5884
a139f141dcae
keyword: support mq; handle (q)record more gracefully
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
39 Also, when committing with the record extension or using mq's qrecord, be aware |
a139f141dcae
keyword: support mq; handle (q)record more gracefully
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
40 that keywords cannot be updated. Again, run "hg kwexpand" on the files in |
a139f141dcae
keyword: support mq; handle (q)record more gracefully
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
41 question to update keyword expansions after all changes have been checked in. |
a139f141dcae
keyword: support mq; handle (q)record more gracefully
Christian Ebert <blacktrash@gmx.net>
parents:
5856
diff
changeset
|
42 |
5816 | 43 Expansions spanning more than one line and incremental expansions, |
44 like CVS' $Log$, are not supported. A keyword template map | |
45 "Log = {desc}" expands to the first line of the changeset description. | |
46 | |
47 list of commands: | |
48 | |
49 kwdemo print [keywordmaps] configuration and an expansion example | |
50 kwexpand expand keywords in working directory | |
51 kwfiles print files currently configured for keyword expansion | |
52 kwshrink revert expanded keywords in working directory | |
53 | |
54 use "hg -v help keyword" to show aliases and global options | |
55 % hg kwdemo | |
56 [extensions] | |
57 hgext.keyword = | |
58 [keyword] | |
59 * = | |
60 b = ignore | |
61 demo.txt = | |
62 [keywordmaps] | |
63 RCSFile = {file|basename},v | |
64 Author = {author|user} | |
65 Header = {root}/{file},v {node|short} {date|utcdate} {author|user} | |
66 Source = {root}/{file},v | |
67 Date = {date|utcdate} | |
68 Id = {file|basename},v {node|short} {date|utcdate} {author|user} | |
69 Revision = {node|short} | |
70 $RCSFile: demo.txt,v $ | |
71 $Author: test $ | |
72 $Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ | |
73 $Source: /TMP/demo.txt,v $ | |
74 $Date: 2000/00/00 00:00:00 $ | |
75 $Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ | |
76 $Revision: xxxxxxxxxxxx $ | |
77 [extensions] | |
78 hgext.keyword = | |
79 [keyword] | |
80 * = | |
81 b = ignore | |
82 demo.txt = | |
83 [keywordmaps] | |
84 Branch = {branches} | |
85 $Branch: demobranch $ | |
86 % kwshrink should exit silently in empty/invalid repo | |
87 % cat | |
88 expand $Id$ | |
89 do not process $Id: | |
90 xxx $ | |
91 expand $Id$ | |
92 do not process $Id: | |
93 xxx $ | |
94 ignore $Id$ | |
95 % addremove | |
96 adding a | |
97 adding b | |
98 adding sym | |
99 % status | |
100 A a | |
101 A b | |
102 A sym | |
103 % default keyword expansion including commit hook | |
104 % interrupted commit should not change state or run commit hook | |
105 a | |
106 b | |
107 sym | |
108 transaction abort! | |
109 rollback completed | |
5855
a6ccb957fd07
Solaris compatibility fixes for test-keyword:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
5816
diff
changeset
|
110 abort: empty commit message |
5816 | 111 % status |
112 A a | |
113 A b | |
114 A sym | |
115 % commit | |
116 a | |
117 b | |
118 sym | |
119 overwriting a expanding keywords | |
120 running hook commit.test: cp a hooktest | |
121 % status | |
122 ? hooktest | |
123 % identify | |
124 f782df5f9602 | |
125 % cat | |
126 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
127 do not process $Id: | |
128 xxx $ | |
129 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
130 do not process $Id: | |
131 xxx $ | |
132 ignore $Id$ | |
133 % hg cat | |
134 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
135 do not process $Id: | |
136 xxx $ | |
137 ignore $Id$ | |
138 a | |
139 % diff a hooktest | |
140 % removing commit hook from config | |
6051
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
141 % bundle |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
142 1 changesets found |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
143 % pull from bundle |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
144 pulling from ../kw.hg |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
145 requesting all changes |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
146 adding changesets |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
147 adding manifests |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
148 adding file changes |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
149 added 1 changesets with 3 changes to 3 files |
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
150 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
5816 | 151 % touch |
152 % status | |
153 % update | |
154 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
155 % cat | |
156 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
157 do not process $Id: | |
158 xxx $ | |
159 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
160 do not process $Id: | |
161 xxx $ | |
162 ignore $Id$ | |
5856
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
163 % check whether expansion is filewise |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
164 % commit c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
165 adding c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
166 % force expansion |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
167 overwriting a expanding keywords |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
168 overwriting c expanding keywords |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
169 % compare changenodes in a c |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
170 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
|
171 do not process $Id: |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
172 xxx $ |
85888efbdfff
keyword: test that expansion is done filewise
Christian Ebert <blacktrash@gmx.net>
parents:
5855
diff
changeset
|
173 $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
|
174 tests for different changenodes |
6051
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
175 % qinit -c |
5894
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
176 % qimport |
6051
1038b1458d7a
keyword: safeguards against erroneous behaviour or aborts
Christian Ebert <blacktrash@gmx.net>
parents:
5943
diff
changeset
|
177 % qcommit |
5894
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
178 % keywords should not be expanded in patch |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
179 # HG changeset patch |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
180 # User User Name <user@example.com> |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
181 # Date 1 0 |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
182 # Node ID ba4426d1938ec9673e03ab274d88c44e24618f7f |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
183 # Parent f782df5f9602483b4e51c31a12315f353bba380c |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
184 cndiff |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
185 |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
186 diff -r f782df5f9602 -r ba4426d1938e c |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
187 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
188 +++ b/c Thu Jan 01 00:00:01 1970 +0000 |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
189 @@ -0,0 +1,2 @@ |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
190 +$Id$ |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
191 +tests for different changenodes |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
192 % qpop |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
193 Patch queue now empty |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
194 % qgoto - should imply qpush |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
195 applying mqtest.diff |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
196 Now at: mqtest.diff |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
197 % cat |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
198 $Id: c,v ba4426d1938e 1970/01/01 00:00:01 user $ |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
199 tests for different changenodes |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
200 % qpop and move on |
e181665c1c79
keyword: add very simple mq test
Christian Ebert <blacktrash@gmx.net>
parents:
5885
diff
changeset
|
201 Patch queue now empty |
5816 | 202 % copy |
203 % kwfiles added | |
204 a | |
205 c | |
206 % commit | |
207 c | |
208 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 | |
209 overwriting c expanding keywords | |
210 % cat a c | |
211 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
212 do not process $Id: | |
213 xxx $ | |
214 expand $Id: c,v 0ba462c0f077 1970/01/01 00:00:01 user $ | |
215 do not process $Id: | |
216 xxx $ | |
217 % touch copied c after 1 second | |
218 % status | |
219 % kwfiles | |
220 a | |
221 c | |
222 % diff --rev | |
223 diff -r f782df5f9602 c | |
224 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
225 @@ -0,0 +1,3 @@ | |
5885
53be157543d4
keyword: avoid extra diffs when not comparing against working dir
Christian Ebert <blacktrash@gmx.net>
parents:
5884
diff
changeset
|
226 +expand $Id$ |
5816 | 227 +do not process $Id: |
228 +xxx $ | |
229 % rollback | |
230 rolling back last transaction | |
231 % status | |
232 A c | |
233 % update -C | |
234 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
235 % custom keyword expansion | |
236 % try with kwdemo | |
237 [extensions] | |
238 hgext.keyword = | |
239 [keyword] | |
240 * = | |
241 b = ignore | |
242 demo.txt = | |
243 [keywordmaps] | |
244 Xinfo = {author}: {desc} | |
245 $Xinfo: test: hg keyword config and expansion example $ | |
246 % cat | |
247 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
248 do not process $Id: | |
249 xxx $ | |
250 expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
251 do not process $Id: | |
252 xxx $ | |
253 ignore $Id$ | |
254 % hg cat | |
255 expand $Id: a f782df5f9602 Thu, 01 Jan 1970 00:00:00 +0000 user $ | |
256 do not process $Id: | |
257 xxx $ | |
258 ignore $Id$ | |
259 a | |
260 % interrupted commit should not change state | |
261 transaction abort! | |
262 rollback completed | |
5855
a6ccb957fd07
Solaris compatibility fixes for test-keyword:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
5816
diff
changeset
|
263 abort: empty commit message |
5816 | 264 % status |
265 M a | |
266 ? log | |
267 % commit | |
268 a | |
269 overwriting a expanding keywords | |
270 % status | |
271 % cat | |
272 expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
273 do not process $Id: | |
274 xxx $ | |
275 $Xinfo: User Name <user@example.com>: firstline $ | |
276 expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
277 do not process $Id: | |
278 xxx $ | |
279 $Xinfo: User Name <user@example.com>: firstline $ | |
280 ignore $Id$ | |
281 % hg cat | |
282 expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
283 do not process $Id: | |
284 xxx $ | |
285 $Xinfo: User Name <user@example.com>: firstline $ | |
286 ignore $Id$ | |
287 a | |
288 % remove | |
289 % status | |
290 % rollback | |
291 rolling back last transaction | |
292 % status | |
293 R a | |
294 % revert a | |
295 % cat a | |
296 expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
297 do not process $Id: | |
298 xxx $ | |
299 $Xinfo: User Name <user@example.com>: firstline $ | |
300 % clone to test incoming | |
301 requesting all changes | |
302 adding changesets | |
303 adding manifests | |
304 adding file changes | |
305 added 1 changesets with 3 changes to 3 files | |
306 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
307 % incoming | |
5943
ffaf2419de44
Ensure that absolutized paths from hgrc do not contain ../ segments.
Jesse Glick <jesse.glick@sun.com>
parents:
5894
diff
changeset
|
308 comparing with test-keyword/Test |
5816 | 309 searching for changes |
310 changeset: 1:0729690beff6 | |
311 tag: tip | |
312 user: User Name <user@example.com> | |
313 date: Thu Jan 01 00:00:02 1970 +0000 | |
314 summary: firstline | |
315 | |
316 % commit rejecttest | |
317 a | |
318 overwriting a expanding keywords | |
319 % export | |
320 % import | |
321 applying ../rejecttest.diff | |
322 % cat | |
323 expand $Id: a 82983f13f138 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest | |
324 do not process $Id: rejecttest | |
325 xxx $ | |
326 $Xinfo: User Name <user@example.com>: rejects? $ | |
327 expand $Id: a 82983f13f138 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest | |
328 do not process $Id: rejecttest | |
329 xxx $ | |
330 $Xinfo: User Name <user@example.com>: rejects? $ | |
331 ignore $Id$ | |
332 | |
333 % rollback | |
334 rolling back last transaction | |
335 % clean update | |
336 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
337 % kwexpand/kwshrink on selected files | |
338 % copy a x/a | |
339 % kwexpand a | |
340 overwriting a expanding keywords | |
341 % kwexpand x/a should abort | |
342 abort: outstanding uncommitted changes in given files | |
343 x/a | |
344 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e | |
345 overwriting x/a expanding keywords | |
346 % cat a | |
347 expand $Id: x/a f27c134d2d9b Thu, 01 Jan 1970 00:00:03 +0000 user $ | |
348 do not process $Id: | |
349 xxx $ | |
350 $Xinfo: User Name <user@example.com>: xa $ | |
351 % kwshrink a inside directory x | |
352 overwriting x/a shrinking keywords | |
353 % cat a | |
354 expand $Id$ | |
355 do not process $Id: | |
356 xxx $ | |
357 $Xinfo$ | |
358 % kwexpand nonexistent | |
359 nonexistent: No such file or directory | |
360 % switch off expansion | |
361 % kwshrink with unknown file u | |
362 overwriting a shrinking keywords | |
363 overwriting x/a shrinking keywords | |
364 % cat | |
365 expand $Id$ | |
366 do not process $Id: | |
367 xxx $ | |
368 $Xinfo$ | |
369 expand $Id$ | |
370 do not process $Id: | |
371 xxx $ | |
372 $Xinfo$ | |
373 ignore $Id$ | |
374 % hg cat | |
375 expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
376 do not process $Id: | |
377 xxx $ | |
378 $Xinfo: User Name <user@example.com>: firstline $ | |
379 ignore $Id$ | |
380 a | |
381 % cat | |
382 expand $Id$ | |
383 do not process $Id: | |
384 xxx $ | |
385 $Xinfo$ | |
386 expand $Id$ | |
387 do not process $Id: | |
388 xxx $ | |
389 $Xinfo$ | |
390 ignore $Id$ | |
391 % hg cat | |
392 expand $Id$ | |
393 do not process $Id: | |
394 xxx $ | |
395 $Xinfo$ | |
396 ignore $Id$ | |
397 a |