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