##// END OF EJS Templates
test-keyword: use inline doctest syntax
Christian Ebert -
r15556:e5804c0f default
parent child Browse files
Show More
@@ -1,1085 +1,1088
1 $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
1 $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
4 > [extensions]
5 > keyword =
5 > keyword =
6 > mq =
6 > mq =
7 > notify =
7 > notify =
8 > record =
8 > record =
9 > transplant =
9 > transplant =
10 > [ui]
10 > [ui]
11 > interactive = true
11 > interactive = true
12 > EOF
12 > EOF
13
13
14 Run kwdemo before [keyword] files are set up
14 Run kwdemo before [keyword] files are set up
15 as it would succeed without uisetup otherwise
15 as it would succeed without uisetup otherwise
16
16
17 $ hg --quiet kwdemo
17 $ hg --quiet kwdemo
18 [extensions]
18 [extensions]
19 keyword =
19 keyword =
20 [keyword]
20 [keyword]
21 demo.txt =
21 demo.txt =
22 [keywordset]
22 [keywordset]
23 svn = False
23 svn = False
24 [keywordmaps]
24 [keywordmaps]
25 Author = {author|user}
25 Author = {author|user}
26 Date = {date|utcdate}
26 Date = {date|utcdate}
27 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
27 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
28 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
28 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
29 RCSFile = {file|basename},v
29 RCSFile = {file|basename},v
30 RCSfile = {file|basename},v
30 RCSfile = {file|basename},v
31 Revision = {node|short}
31 Revision = {node|short}
32 Source = {root}/{file},v
32 Source = {root}/{file},v
33 $Author: test $
33 $Author: test $
34 $Date: ????/??/?? ??:??:?? $ (glob)
34 $Date: ????/??/?? ??:??:?? $ (glob)
35 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
35 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
36 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
36 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 $RCSFile: demo.txt,v $
37 $RCSFile: demo.txt,v $
38 $RCSfile: demo.txt,v $
38 $RCSfile: demo.txt,v $
39 $Revision: ???????????? $ (glob)
39 $Revision: ???????????? $ (glob)
40 $Source: */demo.txt,v $ (glob)
40 $Source: */demo.txt,v $ (glob)
41
41
42 $ hg --quiet kwdemo "Branch = {branches}"
42 $ hg --quiet kwdemo "Branch = {branches}"
43 [extensions]
43 [extensions]
44 keyword =
44 keyword =
45 [keyword]
45 [keyword]
46 demo.txt =
46 demo.txt =
47 [keywordset]
47 [keywordset]
48 svn = False
48 svn = False
49 [keywordmaps]
49 [keywordmaps]
50 Branch = {branches}
50 Branch = {branches}
51 $Branch: demobranch $
51 $Branch: demobranch $
52
52
53 $ cat <<EOF >> $HGRCPATH
53 $ cat <<EOF >> $HGRCPATH
54 > [keyword]
54 > [keyword]
55 > ** =
55 > ** =
56 > b = ignore
56 > b = ignore
57 > i = ignore
57 > i = ignore
58 > [hooks]
58 > [hooks]
59 > EOF
59 > EOF
60 $ cp $HGRCPATH $HGRCPATH.nohooks
60 $ cp $HGRCPATH $HGRCPATH.nohooks
61 > cat <<EOF >> $HGRCPATH
61 > cat <<EOF >> $HGRCPATH
62 > commit=
62 > commit=
63 > commit.test=cp a hooktest
63 > commit.test=cp a hooktest
64 > EOF
64 > EOF
65
65
66 $ hg init Test-bndl
66 $ hg init Test-bndl
67 $ cd Test-bndl
67 $ cd Test-bndl
68
68
69 kwshrink should exit silently in empty/invalid repo
69 kwshrink should exit silently in empty/invalid repo
70
70
71 $ hg kwshrink
71 $ hg kwshrink
72
72
73 Symlinks cannot be created on Windows.
73 Symlinks cannot be created on Windows.
74 A bundle to test this was made with:
74 A bundle to test this was made with:
75 hg init t
75 hg init t
76 cd t
76 cd t
77 echo a > a
77 echo a > a
78 ln -s a sym
78 ln -s a sym
79 hg add sym
79 hg add sym
80 hg ci -m addsym -u mercurial
80 hg ci -m addsym -u mercurial
81 hg bundle --base null ../test-keyword.hg
81 hg bundle --base null ../test-keyword.hg
82
82
83 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
83 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
84 pulling from *test-keyword.hg (glob)
84 pulling from *test-keyword.hg (glob)
85 requesting all changes
85 requesting all changes
86 adding changesets
86 adding changesets
87 adding manifests
87 adding manifests
88 adding file changes
88 adding file changes
89 added 1 changesets with 1 changes to 1 files
89 added 1 changesets with 1 changes to 1 files
90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91
91
92 $ echo 'expand $Id$' > a
92 $ echo 'expand $Id$' > a
93 $ echo 'do not process $Id:' >> a
93 $ echo 'do not process $Id:' >> a
94 $ echo 'xxx $' >> a
94 $ echo 'xxx $' >> a
95 $ echo 'ignore $Id$' > b
95 $ echo 'ignore $Id$' > b
96
96
97 Output files as they were created
97 Output files as they were created
98
98
99 $ cat a b
99 $ cat a b
100 expand $Id$
100 expand $Id$
101 do not process $Id:
101 do not process $Id:
102 xxx $
102 xxx $
103 ignore $Id$
103 ignore $Id$
104
104
105 no kwfiles
105 no kwfiles
106
106
107 $ hg kwfiles
107 $ hg kwfiles
108
108
109 untracked candidates
109 untracked candidates
110
110
111 $ hg -v kwfiles --unknown
111 $ hg -v kwfiles --unknown
112 k a
112 k a
113
113
114 Add files and check status
114 Add files and check status
115
115
116 $ hg addremove
116 $ hg addremove
117 adding a
117 adding a
118 adding b
118 adding b
119 $ hg status
119 $ hg status
120 A a
120 A a
121 A b
121 A b
122
122
123
123
124 Default keyword expansion including commit hook
124 Default keyword expansion including commit hook
125 Interrupted commit should not change state or run commit hook
125 Interrupted commit should not change state or run commit hook
126
126
127 $ hg --debug commit
127 $ hg --debug commit
128 abort: empty commit message
128 abort: empty commit message
129 [255]
129 [255]
130 $ hg status
130 $ hg status
131 A a
131 A a
132 A b
132 A b
133
133
134 Commit with several checks
134 Commit with several checks
135
135
136 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
136 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
137 a
137 a
138 b
138 b
139 overwriting a expanding keywords
139 overwriting a expanding keywords
140 running hook commit.test: cp a hooktest
140 running hook commit.test: cp a hooktest
141 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
141 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
142 $ hg status
142 $ hg status
143 ? hooktest
143 ? hooktest
144 $ hg debugrebuildstate
144 $ hg debugrebuildstate
145 $ hg --quiet identify
145 $ hg --quiet identify
146 ef63ca68695b
146 ef63ca68695b
147
147
148 cat files in working directory with keywords expanded
148 cat files in working directory with keywords expanded
149
149
150 $ cat a b
150 $ cat a b
151 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
151 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
152 do not process $Id:
152 do not process $Id:
153 xxx $
153 xxx $
154 ignore $Id$
154 ignore $Id$
155
155
156 hg cat files and symlink, no expansion
156 hg cat files and symlink, no expansion
157
157
158 $ hg cat sym a b && echo
158 $ hg cat sym a b && echo
159 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
159 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
160 do not process $Id:
160 do not process $Id:
161 xxx $
161 xxx $
162 ignore $Id$
162 ignore $Id$
163 a
163 a
164
164
165 Test hook execution
165 Test hook execution
166
166
167 $ diff a hooktest
167 $ diff a hooktest
168
168
169 $ cp $HGRCPATH.nohooks $HGRCPATH
169 $ cp $HGRCPATH.nohooks $HGRCPATH
170 $ rm hooktest
170 $ rm hooktest
171
171
172 bundle
172 bundle
173
173
174 $ hg bundle --base null ../kw.hg
174 $ hg bundle --base null ../kw.hg
175 2 changesets found
175 2 changesets found
176 $ cd ..
176 $ cd ..
177 $ hg init Test
177 $ hg init Test
178 $ cd Test
178 $ cd Test
179
179
180 Notify on pull to check whether keywords stay as is in email
180 Notify on pull to check whether keywords stay as is in email
181 ie. if patch.diff wrapper acts as it should
181 ie. if patch.diff wrapper acts as it should
182
182
183 $ cat <<EOF >> $HGRCPATH
183 $ cat <<EOF >> $HGRCPATH
184 > [hooks]
184 > [hooks]
185 > incoming.notify = python:hgext.notify.hook
185 > incoming.notify = python:hgext.notify.hook
186 > [notify]
186 > [notify]
187 > sources = pull
187 > sources = pull
188 > diffstat = False
188 > diffstat = False
189 > maxsubject = 15
189 > maxsubject = 15
190 > [reposubs]
190 > [reposubs]
191 > * = Test
191 > * = Test
192 > EOF
192 > EOF
193
193
194 Pull from bundle and trigger notify
194 Pull from bundle and trigger notify
195
195
196 $ hg pull -u ../kw.hg
196 $ hg pull -u ../kw.hg
197 pulling from ../kw.hg
197 pulling from ../kw.hg
198 requesting all changes
198 requesting all changes
199 adding changesets
199 adding changesets
200 adding manifests
200 adding manifests
201 adding file changes
201 adding file changes
202 added 2 changesets with 3 changes to 3 files
202 added 2 changesets with 3 changes to 3 files
203 Content-Type: text/plain; charset="us-ascii"
203 Content-Type: text/plain; charset="us-ascii"
204 MIME-Version: 1.0
204 MIME-Version: 1.0
205 Content-Transfer-Encoding: 7bit
205 Content-Transfer-Encoding: 7bit
206 Date: * (glob)
206 Date: * (glob)
207 Subject: changeset in...
207 Subject: changeset in...
208 From: mercurial
208 From: mercurial
209 X-Hg-Notification: changeset a2392c293916
209 X-Hg-Notification: changeset a2392c293916
210 Message-Id: <hg.a2392c293916*> (glob)
210 Message-Id: <hg.a2392c293916*> (glob)
211 To: Test
211 To: Test
212
212
213 changeset a2392c293916 in $TESTTMP/Test (glob)
213 changeset a2392c293916 in $TESTTMP/Test (glob)
214 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
214 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
215 description:
215 description:
216 addsym
216 addsym
217
217
218 diffs (6 lines):
218 diffs (6 lines):
219
219
220 diff -r 000000000000 -r a2392c293916 sym
220 diff -r 000000000000 -r a2392c293916 sym
221 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
221 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
222 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
222 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
223 @@ -0,0 +1,1 @@
223 @@ -0,0 +1,1 @@
224 +a
224 +a
225 \ No newline at end of file
225 \ No newline at end of file
226 Content-Type: text/plain; charset="us-ascii"
226 Content-Type: text/plain; charset="us-ascii"
227 MIME-Version: 1.0
227 MIME-Version: 1.0
228 Content-Transfer-Encoding: 7bit
228 Content-Transfer-Encoding: 7bit
229 Date:* (glob)
229 Date:* (glob)
230 Subject: changeset in...
230 Subject: changeset in...
231 From: User Name <user@example.com>
231 From: User Name <user@example.com>
232 X-Hg-Notification: changeset ef63ca68695b
232 X-Hg-Notification: changeset ef63ca68695b
233 Message-Id: <hg.ef63ca68695b*> (glob)
233 Message-Id: <hg.ef63ca68695b*> (glob)
234 To: Test
234 To: Test
235
235
236 changeset ef63ca68695b in $TESTTMP/Test (glob)
236 changeset ef63ca68695b in $TESTTMP/Test (glob)
237 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
237 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
238 description:
238 description:
239 absym
239 absym
240
240
241 diffs (12 lines):
241 diffs (12 lines):
242
242
243 diff -r a2392c293916 -r ef63ca68695b a
243 diff -r a2392c293916 -r ef63ca68695b a
244 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
244 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
245 +++ b/a Thu Jan 01 00:00:00 1970 +0000
245 +++ b/a Thu Jan 01 00:00:00 1970 +0000
246 @@ -0,0 +1,3 @@
246 @@ -0,0 +1,3 @@
247 +expand $Id$
247 +expand $Id$
248 +do not process $Id:
248 +do not process $Id:
249 +xxx $
249 +xxx $
250 diff -r a2392c293916 -r ef63ca68695b b
250 diff -r a2392c293916 -r ef63ca68695b b
251 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
251 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
252 +++ b/b Thu Jan 01 00:00:00 1970 +0000
252 +++ b/b Thu Jan 01 00:00:00 1970 +0000
253 @@ -0,0 +1,1 @@
253 @@ -0,0 +1,1 @@
254 +ignore $Id$
254 +ignore $Id$
255 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
256
256
257 $ cp $HGRCPATH.nohooks $HGRCPATH
257 $ cp $HGRCPATH.nohooks $HGRCPATH
258
258
259 Touch files and check with status
259 Touch files and check with status
260
260
261 $ touch a b
261 $ touch a b
262 $ hg status
262 $ hg status
263
263
264 Update and expand
264 Update and expand
265
265
266 $ rm sym a b
266 $ rm sym a b
267 $ hg update -C
267 $ hg update -C
268 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 $ cat a b
269 $ cat a b
270 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
270 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
271 do not process $Id:
271 do not process $Id:
272 xxx $
272 xxx $
273 ignore $Id$
273 ignore $Id$
274
274
275 Check whether expansion is filewise and file mode is preserved
275 Check whether expansion is filewise and file mode is preserved
276
276
277 $ echo '$Id$' > c
277 $ echo '$Id$' > c
278 $ echo 'tests for different changenodes' >> c
278 $ echo 'tests for different changenodes' >> c
279 $ chmod 600 c
279 $ chmod 600 c
280 $ ls -l c | cut -b 1-10
280 $ ls -l c | cut -b 1-10
281 -rw-------
281 -rw-------
282
282
283 commit file c
283 commit file c
284
284
285 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
285 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
286 adding c
286 adding c
287 $ ls -l c | cut -b 1-10
287 $ ls -l c | cut -b 1-10
288 -rw-------
288 -rw-------
289
289
290 force expansion
290 force expansion
291
291
292 $ hg -v kwexpand
292 $ hg -v kwexpand
293 overwriting a expanding keywords
293 overwriting a expanding keywords
294 overwriting c expanding keywords
294 overwriting c expanding keywords
295
295
296 compare changenodes in a and c
296 compare changenodes in a and c
297
297
298 $ cat a c
298 $ cat a c
299 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
299 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
300 do not process $Id:
300 do not process $Id:
301 xxx $
301 xxx $
302 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
302 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
303 tests for different changenodes
303 tests for different changenodes
304
304
305 record
305 record
306
306
307 $ echo '$Id$' > r
307 $ echo '$Id$' > r
308 $ hg add r
308 $ hg add r
309
309
310 record chunk
310 record chunk
311
311
312 $ python -c \
312 >>> lines = open('a').readlines()
313 > 'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
313 >>> lines.insert(1, 'foo\n')
314 >>> lines.append('bar\n')
315 >>> open('a', 'w').writelines(lines)
314 $ hg record -d '1 10' -m rectest a<<EOF
316 $ hg record -d '1 10' -m rectest a<<EOF
315 > y
317 > y
316 > y
318 > y
317 > n
319 > n
318 > EOF
320 > EOF
319 diff --git a/a b/a
321 diff --git a/a b/a
320 2 hunks, 2 lines changed
322 2 hunks, 2 lines changed
321 examine changes to 'a'? [Ynsfdaq?]
323 examine changes to 'a'? [Ynsfdaq?]
322 @@ -1,3 +1,4 @@
324 @@ -1,3 +1,4 @@
323 expand $Id$
325 expand $Id$
324 +foo
326 +foo
325 do not process $Id:
327 do not process $Id:
326 xxx $
328 xxx $
327 record change 1/2 to 'a'? [Ynsfdaq?]
329 record change 1/2 to 'a'? [Ynsfdaq?]
328 @@ -2,2 +3,3 @@
330 @@ -2,2 +3,3 @@
329 do not process $Id:
331 do not process $Id:
330 xxx $
332 xxx $
331 +bar
333 +bar
332 record change 2/2 to 'a'? [Ynsfdaq?]
334 record change 2/2 to 'a'? [Ynsfdaq?]
333
335
334 $ hg identify
336 $ hg identify
335 d17e03c92c97+ tip
337 d17e03c92c97+ tip
336 $ hg status
338 $ hg status
337 M a
339 M a
338 A r
340 A r
339
341
340 Cat modified file a
342 Cat modified file a
341
343
342 $ cat a
344 $ cat a
343 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
345 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
344 foo
346 foo
345 do not process $Id:
347 do not process $Id:
346 xxx $
348 xxx $
347 bar
349 bar
348
350
349 Diff remaining chunk
351 Diff remaining chunk
350
352
351 $ hg diff a
353 $ hg diff a
352 diff -r d17e03c92c97 a
354 diff -r d17e03c92c97 a
353 --- a/a Wed Dec 31 23:59:51 1969 -0000
355 --- a/a Wed Dec 31 23:59:51 1969 -0000
354 +++ b/a * (glob)
356 +++ b/a * (glob)
355 @@ -2,3 +2,4 @@
357 @@ -2,3 +2,4 @@
356 foo
358 foo
357 do not process $Id:
359 do not process $Id:
358 xxx $
360 xxx $
359 +bar
361 +bar
360
362
361 $ hg rollback
363 $ hg rollback
362 repository tip rolled back to revision 2 (undo commit)
364 repository tip rolled back to revision 2 (undo commit)
363 working directory now based on revision 2
365 working directory now based on revision 2
364
366
365 Record all chunks in file a
367 Record all chunks in file a
366
368
367 $ echo foo > msg
369 $ echo foo > msg
368
370
369 - do not use "hg record -m" here!
371 - do not use "hg record -m" here!
370
372
371 $ hg record -l msg -d '1 11' a<<EOF
373 $ hg record -l msg -d '1 11' a<<EOF
372 > y
374 > y
373 > y
375 > y
374 > y
376 > y
375 > EOF
377 > EOF
376 diff --git a/a b/a
378 diff --git a/a b/a
377 2 hunks, 2 lines changed
379 2 hunks, 2 lines changed
378 examine changes to 'a'? [Ynsfdaq?]
380 examine changes to 'a'? [Ynsfdaq?]
379 @@ -1,3 +1,4 @@
381 @@ -1,3 +1,4 @@
380 expand $Id$
382 expand $Id$
381 +foo
383 +foo
382 do not process $Id:
384 do not process $Id:
383 xxx $
385 xxx $
384 record change 1/2 to 'a'? [Ynsfdaq?]
386 record change 1/2 to 'a'? [Ynsfdaq?]
385 @@ -2,2 +3,3 @@
387 @@ -2,2 +3,3 @@
386 do not process $Id:
388 do not process $Id:
387 xxx $
389 xxx $
388 +bar
390 +bar
389 record change 2/2 to 'a'? [Ynsfdaq?]
391 record change 2/2 to 'a'? [Ynsfdaq?]
390
392
391 File a should be clean
393 File a should be clean
392
394
393 $ hg status -A a
395 $ hg status -A a
394 C a
396 C a
395
397
396 rollback and revert expansion
398 rollback and revert expansion
397
399
398 $ cat a
400 $ cat a
399 expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
401 expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
400 foo
402 foo
401 do not process $Id:
403 do not process $Id:
402 xxx $
404 xxx $
403 bar
405 bar
404 $ hg --verbose rollback
406 $ hg --verbose rollback
405 repository tip rolled back to revision 2 (undo commit)
407 repository tip rolled back to revision 2 (undo commit)
406 working directory now based on revision 2
408 working directory now based on revision 2
407 overwriting a expanding keywords
409 overwriting a expanding keywords
408 $ hg status a
410 $ hg status a
409 M a
411 M a
410 $ cat a
412 $ cat a
411 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
413 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
412 foo
414 foo
413 do not process $Id:
415 do not process $Id:
414 xxx $
416 xxx $
415 bar
417 bar
416 $ echo '$Id$' > y
418 $ echo '$Id$' > y
417 $ echo '$Id$' > z
419 $ echo '$Id$' > z
418 $ hg add y
420 $ hg add y
419 $ hg commit -Am "rollback only" z
421 $ hg commit -Am "rollback only" z
420 $ cat z
422 $ cat z
421 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
423 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
422 $ hg --verbose rollback
424 $ hg --verbose rollback
423 repository tip rolled back to revision 2 (undo commit)
425 repository tip rolled back to revision 2 (undo commit)
424 working directory now based on revision 2
426 working directory now based on revision 2
425 overwriting z shrinking keywords
427 overwriting z shrinking keywords
426
428
427 Only z should be overwritten
429 Only z should be overwritten
428
430
429 $ hg status a y z
431 $ hg status a y z
430 M a
432 M a
431 A y
433 A y
432 A z
434 A z
433 $ cat z
435 $ cat z
434 $Id$
436 $Id$
435 $ hg forget y z
437 $ hg forget y z
436 $ rm y z
438 $ rm y z
437
439
438 record added file alone
440 record added file alone
439
441
440 $ hg -v record -l msg -d '1 12' r<<EOF
442 $ hg -v record -l msg -d '1 12' r<<EOF
441 > y
443 > y
442 > EOF
444 > EOF
443 diff --git a/r b/r
445 diff --git a/r b/r
444 new file mode 100644
446 new file mode 100644
445 examine changes to 'r'? [Ynsfdaq?]
447 examine changes to 'r'? [Ynsfdaq?]
446 r
448 r
447 committed changeset 3:899491280810
449 committed changeset 3:899491280810
448 overwriting r expanding keywords
450 overwriting r expanding keywords
449 - status call required for dirstate.normallookup() check
451 - status call required for dirstate.normallookup() check
450 $ hg status r
452 $ hg status r
451 $ hg --verbose rollback
453 $ hg --verbose rollback
452 repository tip rolled back to revision 2 (undo commit)
454 repository tip rolled back to revision 2 (undo commit)
453 working directory now based on revision 2
455 working directory now based on revision 2
454 overwriting r shrinking keywords
456 overwriting r shrinking keywords
455 $ hg forget r
457 $ hg forget r
456 $ rm msg r
458 $ rm msg r
457 $ hg update -C
459 $ hg update -C
458 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
460 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
459
461
460 record added keyword ignored file
462 record added keyword ignored file
461
463
462 $ echo '$Id$' > i
464 $ echo '$Id$' > i
463 $ hg add i
465 $ hg add i
464 $ hg --verbose record -d '1 13' -m recignored<<EOF
466 $ hg --verbose record -d '1 13' -m recignored<<EOF
465 > y
467 > y
466 > EOF
468 > EOF
467 diff --git a/i b/i
469 diff --git a/i b/i
468 new file mode 100644
470 new file mode 100644
469 examine changes to 'i'? [Ynsfdaq?]
471 examine changes to 'i'? [Ynsfdaq?]
470 i
472 i
471 committed changeset 3:5f40fe93bbdc
473 committed changeset 3:5f40fe93bbdc
472 $ cat i
474 $ cat i
473 $Id$
475 $Id$
474 $ hg -q rollback
476 $ hg -q rollback
475 $ hg forget i
477 $ hg forget i
476 $ rm i
478 $ rm i
477
479
478 Test patch queue repo
480 Test patch queue repo
479
481
480 $ hg init --mq
482 $ hg init --mq
481 $ hg qimport -r tip -n mqtest.diff
483 $ hg qimport -r tip -n mqtest.diff
482 $ hg commit --mq -m mqtest
484 $ hg commit --mq -m mqtest
483
485
484 Keywords should not be expanded in patch
486 Keywords should not be expanded in patch
485
487
486 $ cat .hg/patches/mqtest.diff
488 $ cat .hg/patches/mqtest.diff
487 # HG changeset patch
489 # HG changeset patch
488 # User User Name <user@example.com>
490 # User User Name <user@example.com>
489 # Date 1 0
491 # Date 1 0
490 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
492 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
491 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
493 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
492 cndiff
494 cndiff
493
495
494 diff -r ef63ca68695b -r 40a904bbbe4c c
496 diff -r ef63ca68695b -r 40a904bbbe4c c
495 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
497 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
496 +++ b/c Thu Jan 01 00:00:01 1970 +0000
498 +++ b/c Thu Jan 01 00:00:01 1970 +0000
497 @@ -0,0 +1,2 @@
499 @@ -0,0 +1,2 @@
498 +$Id$
500 +$Id$
499 +tests for different changenodes
501 +tests for different changenodes
500
502
501 $ hg qpop
503 $ hg qpop
502 popping mqtest.diff
504 popping mqtest.diff
503 patch queue now empty
505 patch queue now empty
504
506
505 qgoto, implying qpush, should expand
507 qgoto, implying qpush, should expand
506
508
507 $ hg qgoto mqtest.diff
509 $ hg qgoto mqtest.diff
508 applying mqtest.diff
510 applying mqtest.diff
509 now at: mqtest.diff
511 now at: mqtest.diff
510 $ cat c
512 $ cat c
511 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
513 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
512 tests for different changenodes
514 tests for different changenodes
513 $ hg cat c
515 $ hg cat c
514 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
516 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
515 tests for different changenodes
517 tests for different changenodes
516
518
517 Keywords should not be expanded in filelog
519 Keywords should not be expanded in filelog
518
520
519 $ hg --config 'extensions.keyword=!' cat c
521 $ hg --config 'extensions.keyword=!' cat c
520 $Id$
522 $Id$
521 tests for different changenodes
523 tests for different changenodes
522
524
523 qpop and move on
525 qpop and move on
524
526
525 $ hg qpop
527 $ hg qpop
526 popping mqtest.diff
528 popping mqtest.diff
527 patch queue now empty
529 patch queue now empty
528
530
529 Copy and show added kwfiles
531 Copy and show added kwfiles
530
532
531 $ hg cp a c
533 $ hg cp a c
532 $ hg kwfiles
534 $ hg kwfiles
533 a
535 a
534 c
536 c
535
537
536 Commit and show expansion in original and copy
538 Commit and show expansion in original and copy
537
539
538 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
540 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
539 c
541 c
540 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
542 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
541 overwriting c expanding keywords
543 overwriting c expanding keywords
542 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
544 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
543 $ cat a c
545 $ cat a c
544 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
546 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
545 do not process $Id:
547 do not process $Id:
546 xxx $
548 xxx $
547 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
549 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
548 do not process $Id:
550 do not process $Id:
549 xxx $
551 xxx $
550
552
551 Touch copied c and check its status
553 Touch copied c and check its status
552
554
553 $ touch c
555 $ touch c
554 $ hg status
556 $ hg status
555
557
556 Copy kwfile to keyword ignored file unexpanding keywords
558 Copy kwfile to keyword ignored file unexpanding keywords
557
559
558 $ hg --verbose copy a i
560 $ hg --verbose copy a i
559 copying a to i
561 copying a to i
560 overwriting i shrinking keywords
562 overwriting i shrinking keywords
561 $ head -n 1 i
563 $ head -n 1 i
562 expand $Id$
564 expand $Id$
563 $ hg forget i
565 $ hg forget i
564 $ rm i
566 $ rm i
565
567
566 Copy ignored file to ignored file: no overwriting
568 Copy ignored file to ignored file: no overwriting
567
569
568 $ hg --verbose copy b i
570 $ hg --verbose copy b i
569 copying b to i
571 copying b to i
570 $ hg forget i
572 $ hg forget i
571 $ rm i
573 $ rm i
572
574
573 cp symlink file; hg cp -A symlink file (part1)
575 cp symlink file; hg cp -A symlink file (part1)
574 - copied symlink points to kwfile: overwrite
576 - copied symlink points to kwfile: overwrite
575
577
576 $ cp sym i
578 $ cp sym i
577 $ ls -l i
579 $ ls -l i
578 -rw-r--r--* (glob)
580 -rw-r--r--* (glob)
579 $ head -1 i
581 $ head -1 i
580 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
582 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
581 $ hg copy --after --verbose sym i
583 $ hg copy --after --verbose sym i
582 copying sym to i
584 copying sym to i
583 overwriting i shrinking keywords
585 overwriting i shrinking keywords
584 $ head -1 i
586 $ head -1 i
585 expand $Id$
587 expand $Id$
586 $ hg forget i
588 $ hg forget i
587 $ rm i
589 $ rm i
588
590
589 Test different options of hg kwfiles
591 Test different options of hg kwfiles
590
592
591 $ hg kwfiles
593 $ hg kwfiles
592 a
594 a
593 c
595 c
594 $ hg -v kwfiles --ignore
596 $ hg -v kwfiles --ignore
595 I b
597 I b
596 I sym
598 I sym
597 $ hg kwfiles --all
599 $ hg kwfiles --all
598 K a
600 K a
599 K c
601 K c
600 I b
602 I b
601 I sym
603 I sym
602
604
603 Diff specific revision
605 Diff specific revision
604
606
605 $ hg diff --rev 1
607 $ hg diff --rev 1
606 diff -r ef63ca68695b c
608 diff -r ef63ca68695b c
607 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
609 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
608 +++ b/c * (glob)
610 +++ b/c * (glob)
609 @@ -0,0 +1,3 @@
611 @@ -0,0 +1,3 @@
610 +expand $Id$
612 +expand $Id$
611 +do not process $Id:
613 +do not process $Id:
612 +xxx $
614 +xxx $
613
615
614 Status after rollback:
616 Status after rollback:
615
617
616 $ hg rollback
618 $ hg rollback
617 repository tip rolled back to revision 1 (undo commit)
619 repository tip rolled back to revision 1 (undo commit)
618 working directory now based on revision 1
620 working directory now based on revision 1
619 $ hg status
621 $ hg status
620 A c
622 A c
621 $ hg update --clean
623 $ hg update --clean
622 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
624 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
623
625
624 cp symlink file; hg cp -A symlink file (part2)
626 cp symlink file; hg cp -A symlink file (part2)
625 - copied symlink points to kw ignored file: do not overwrite
627 - copied symlink points to kw ignored file: do not overwrite
626
628
627 $ cat a > i
629 $ cat a > i
628 $ ln -s i symignored
630 $ ln -s i symignored
629 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
631 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
630 $ cp symignored x
632 $ cp symignored x
631 $ hg copy --after --verbose symignored x
633 $ hg copy --after --verbose symignored x
632 copying symignored to x
634 copying symignored to x
633 $ head -n 1 x
635 $ head -n 1 x
634 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
636 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
635 $ hg forget x
637 $ hg forget x
636 $ rm x
638 $ rm x
637
639
638 $ hg rollback
640 $ hg rollback
639 repository tip rolled back to revision 1 (undo commit)
641 repository tip rolled back to revision 1 (undo commit)
640 working directory now based on revision 1
642 working directory now based on revision 1
641 $ hg update --clean
643 $ hg update --clean
642 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
644 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
643 $ rm i symignored
645 $ rm i symignored
644
646
645 Custom keywordmaps as argument to kwdemo
647 Custom keywordmaps as argument to kwdemo
646
648
647 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
649 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
648 [extensions]
650 [extensions]
649 keyword =
651 keyword =
650 [keyword]
652 [keyword]
651 ** =
653 ** =
652 b = ignore
654 b = ignore
653 demo.txt =
655 demo.txt =
654 i = ignore
656 i = ignore
655 [keywordset]
657 [keywordset]
656 svn = False
658 svn = False
657 [keywordmaps]
659 [keywordmaps]
658 Xinfo = {author}: {desc}
660 Xinfo = {author}: {desc}
659 $Xinfo: test: hg keyword configuration and expansion example $
661 $Xinfo: test: hg keyword configuration and expansion example $
660
662
661 Configure custom keywordmaps
663 Configure custom keywordmaps
662
664
663 $ cat <<EOF >>$HGRCPATH
665 $ cat <<EOF >>$HGRCPATH
664 > [keywordmaps]
666 > [keywordmaps]
665 > Id = {file} {node|short} {date|rfc822date} {author|user}
667 > Id = {file} {node|short} {date|rfc822date} {author|user}
666 > Xinfo = {author}: {desc}
668 > Xinfo = {author}: {desc}
667 > EOF
669 > EOF
668
670
669 Cat and hg cat files before custom expansion
671 Cat and hg cat files before custom expansion
670
672
671 $ cat a b
673 $ cat a b
672 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
674 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
673 do not process $Id:
675 do not process $Id:
674 xxx $
676 xxx $
675 ignore $Id$
677 ignore $Id$
676 $ hg cat sym a b && echo
678 $ hg cat sym a b && echo
677 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
679 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
678 do not process $Id:
680 do not process $Id:
679 xxx $
681 xxx $
680 ignore $Id$
682 ignore $Id$
681 a
683 a
682
684
683 Write custom keyword and prepare multiline commit message
685 Write custom keyword and prepare multiline commit message
684
686
685 $ echo '$Xinfo$' >> a
687 $ echo '$Xinfo$' >> a
686 $ cat <<EOF >> log
688 $ cat <<EOF >> log
687 > firstline
689 > firstline
688 > secondline
690 > secondline
689 > EOF
691 > EOF
690
692
691 Interrupted commit should not change state
693 Interrupted commit should not change state
692
694
693 $ hg commit
695 $ hg commit
694 abort: empty commit message
696 abort: empty commit message
695 [255]
697 [255]
696 $ hg status
698 $ hg status
697 M a
699 M a
698 ? c
700 ? c
699 ? log
701 ? log
700
702
701 Commit with multiline message and custom expansion
703 Commit with multiline message and custom expansion
702
704
703 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
705 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
704 a
706 a
705 overwriting a expanding keywords
707 overwriting a expanding keywords
706 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
708 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
707 $ rm log
709 $ rm log
708
710
709 Stat, verify and show custom expansion (firstline)
711 Stat, verify and show custom expansion (firstline)
710
712
711 $ hg status
713 $ hg status
712 ? c
714 ? c
713 $ hg verify
715 $ hg verify
714 checking changesets
716 checking changesets
715 checking manifests
717 checking manifests
716 crosschecking files in changesets and manifests
718 crosschecking files in changesets and manifests
717 checking files
719 checking files
718 3 files, 3 changesets, 4 total revisions
720 3 files, 3 changesets, 4 total revisions
719 $ cat a b
721 $ cat a b
720 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
722 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
721 do not process $Id:
723 do not process $Id:
722 xxx $
724 xxx $
723 $Xinfo: User Name <user@example.com>: firstline $
725 $Xinfo: User Name <user@example.com>: firstline $
724 ignore $Id$
726 ignore $Id$
725 $ hg cat sym a b && echo
727 $ hg cat sym a b && echo
726 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
728 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
727 do not process $Id:
729 do not process $Id:
728 xxx $
730 xxx $
729 $Xinfo: User Name <user@example.com>: firstline $
731 $Xinfo: User Name <user@example.com>: firstline $
730 ignore $Id$
732 ignore $Id$
731 a
733 a
732
734
733 annotate
735 annotate
734
736
735 $ hg annotate a
737 $ hg annotate a
736 1: expand $Id$
738 1: expand $Id$
737 1: do not process $Id:
739 1: do not process $Id:
738 1: xxx $
740 1: xxx $
739 2: $Xinfo$
741 2: $Xinfo$
740
742
741 remove with status checks
743 remove with status checks
742
744
743 $ hg debugrebuildstate
745 $ hg debugrebuildstate
744 $ hg remove a
746 $ hg remove a
745 $ hg --debug commit -m rma
747 $ hg --debug commit -m rma
746 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
748 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
747 $ hg status
749 $ hg status
748 ? c
750 ? c
749
751
750 Rollback, revert, and check expansion
752 Rollback, revert, and check expansion
751
753
752 $ hg rollback
754 $ hg rollback
753 repository tip rolled back to revision 2 (undo commit)
755 repository tip rolled back to revision 2 (undo commit)
754 working directory now based on revision 2
756 working directory now based on revision 2
755 $ hg status
757 $ hg status
756 R a
758 R a
757 ? c
759 ? c
758 $ hg revert --no-backup --rev tip a
760 $ hg revert --no-backup --rev tip a
759 $ cat a
761 $ cat a
760 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
762 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
761 do not process $Id:
763 do not process $Id:
762 xxx $
764 xxx $
763 $Xinfo: User Name <user@example.com>: firstline $
765 $Xinfo: User Name <user@example.com>: firstline $
764
766
765 Clone to test global and local configurations
767 Clone to test global and local configurations
766
768
767 $ cd ..
769 $ cd ..
768
770
769 Expansion in destinaton with global configuration
771 Expansion in destinaton with global configuration
770
772
771 $ hg --quiet clone Test globalconf
773 $ hg --quiet clone Test globalconf
772 $ cat globalconf/a
774 $ cat globalconf/a
773 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
775 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
774 do not process $Id:
776 do not process $Id:
775 xxx $
777 xxx $
776 $Xinfo: User Name <user@example.com>: firstline $
778 $Xinfo: User Name <user@example.com>: firstline $
777
779
778 No expansion in destination with local configuration in origin only
780 No expansion in destination with local configuration in origin only
779
781
780 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
782 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
781 $ cat localconf/a
783 $ cat localconf/a
782 expand $Id$
784 expand $Id$
783 do not process $Id:
785 do not process $Id:
784 xxx $
786 xxx $
785 $Xinfo$
787 $Xinfo$
786
788
787 Clone to test incoming
789 Clone to test incoming
788
790
789 $ hg clone -r1 Test Test-a
791 $ hg clone -r1 Test Test-a
790 adding changesets
792 adding changesets
791 adding manifests
793 adding manifests
792 adding file changes
794 adding file changes
793 added 2 changesets with 3 changes to 3 files
795 added 2 changesets with 3 changes to 3 files
794 updating to branch default
796 updating to branch default
795 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
797 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
796 $ cd Test-a
798 $ cd Test-a
797 $ cat <<EOF >> .hg/hgrc
799 $ cat <<EOF >> .hg/hgrc
798 > [paths]
800 > [paths]
799 > default = ../Test
801 > default = ../Test
800 > EOF
802 > EOF
801 $ hg incoming
803 $ hg incoming
802 comparing with $TESTTMP/Test (glob)
804 comparing with $TESTTMP/Test (glob)
803 searching for changes
805 searching for changes
804 changeset: 2:bb948857c743
806 changeset: 2:bb948857c743
805 tag: tip
807 tag: tip
806 user: User Name <user@example.com>
808 user: User Name <user@example.com>
807 date: Thu Jan 01 00:00:02 1970 +0000
809 date: Thu Jan 01 00:00:02 1970 +0000
808 summary: firstline
810 summary: firstline
809
811
810 Imported patch should not be rejected
812 Imported patch should not be rejected
811
813
812 $ python -c \
814 >>> import re
813 > 'import re; s=re.sub("(Id.*)","\\1 rejecttest",open("a").read()); open("a","wb").write(s);'
815 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
816 >>> open('a', 'wb').write(text)
814 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
817 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
815 a
818 a
816 overwriting a expanding keywords
819 overwriting a expanding keywords
817 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
820 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
818 $ hg export -o ../rejecttest.diff tip
821 $ hg export -o ../rejecttest.diff tip
819 $ cd ../Test
822 $ cd ../Test
820 $ hg import ../rejecttest.diff
823 $ hg import ../rejecttest.diff
821 applying ../rejecttest.diff
824 applying ../rejecttest.diff
822 $ cat a b
825 $ cat a b
823 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
826 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
824 do not process $Id: rejecttest
827 do not process $Id: rejecttest
825 xxx $
828 xxx $
826 $Xinfo: User Name <user@example.com>: rejects? $
829 $Xinfo: User Name <user@example.com>: rejects? $
827 ignore $Id$
830 ignore $Id$
828
831
829 $ hg rollback
832 $ hg rollback
830 repository tip rolled back to revision 2 (undo import)
833 repository tip rolled back to revision 2 (undo import)
831 working directory now based on revision 2
834 working directory now based on revision 2
832 $ hg update --clean
835 $ hg update --clean
833 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
836 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
834
837
835 kwexpand/kwshrink on selected files
838 kwexpand/kwshrink on selected files
836
839
837 $ mkdir x
840 $ mkdir x
838 $ hg copy a x/a
841 $ hg copy a x/a
839 $ hg --verbose kwshrink a
842 $ hg --verbose kwshrink a
840 overwriting a shrinking keywords
843 overwriting a shrinking keywords
841 - sleep required for dirstate.normal() check
844 - sleep required for dirstate.normal() check
842 $ sleep 1
845 $ sleep 1
843 $ hg status a
846 $ hg status a
844 $ hg --verbose kwexpand a
847 $ hg --verbose kwexpand a
845 overwriting a expanding keywords
848 overwriting a expanding keywords
846 $ hg status a
849 $ hg status a
847
850
848 kwexpand x/a should abort
851 kwexpand x/a should abort
849
852
850 $ hg --verbose kwexpand x/a
853 $ hg --verbose kwexpand x/a
851 abort: outstanding uncommitted changes
854 abort: outstanding uncommitted changes
852 [255]
855 [255]
853 $ cd x
856 $ cd x
854 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
857 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
855 x/a
858 x/a
856 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
859 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
857 overwriting x/a expanding keywords
860 overwriting x/a expanding keywords
858 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
861 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
859 $ cat a
862 $ cat a
860 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
863 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
861 do not process $Id:
864 do not process $Id:
862 xxx $
865 xxx $
863 $Xinfo: User Name <user@example.com>: xa $
866 $Xinfo: User Name <user@example.com>: xa $
864
867
865 kwshrink a inside directory x
868 kwshrink a inside directory x
866
869
867 $ hg --verbose kwshrink a
870 $ hg --verbose kwshrink a
868 overwriting x/a shrinking keywords
871 overwriting x/a shrinking keywords
869 $ cat a
872 $ cat a
870 expand $Id$
873 expand $Id$
871 do not process $Id:
874 do not process $Id:
872 xxx $
875 xxx $
873 $Xinfo$
876 $Xinfo$
874 $ cd ..
877 $ cd ..
875
878
876 kwexpand nonexistent
879 kwexpand nonexistent
877
880
878 $ hg kwexpand nonexistent
881 $ hg kwexpand nonexistent
879 nonexistent:* (glob)
882 nonexistent:* (glob)
880
883
881
884
882 hg serve
885 hg serve
883 - expand with hgweb file
886 - expand with hgweb file
884 - no expansion with hgweb annotate/changeset/filediff
887 - no expansion with hgweb annotate/changeset/filediff
885 - check errors
888 - check errors
886
889
887 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
890 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
888 $ cat hg.pid >> $DAEMON_PIDS
891 $ cat hg.pid >> $DAEMON_PIDS
889 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/file/tip/a/?style=raw'
892 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/file/tip/a/?style=raw'
890 200 Script output follows
893 200 Script output follows
891
894
892 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
895 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
893 do not process $Id:
896 do not process $Id:
894 xxx $
897 xxx $
895 $Xinfo: User Name <user@example.com>: firstline $
898 $Xinfo: User Name <user@example.com>: firstline $
896 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/annotate/tip/a/?style=raw'
899 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/annotate/tip/a/?style=raw'
897 200 Script output follows
900 200 Script output follows
898
901
899
902
900 user@1: expand $Id$
903 user@1: expand $Id$
901 user@1: do not process $Id:
904 user@1: do not process $Id:
902 user@1: xxx $
905 user@1: xxx $
903 user@2: $Xinfo$
906 user@2: $Xinfo$
904
907
905
908
906
909
907
910
908 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw'
911 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw'
909 200 Script output follows
912 200 Script output follows
910
913
911
914
912 # HG changeset patch
915 # HG changeset patch
913 # User User Name <user@example.com>
916 # User User Name <user@example.com>
914 # Date 3 0
917 # Date 3 0
915 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
918 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
916 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
919 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
917 xa
920 xa
918
921
919 diff -r bb948857c743 -r b4560182a3f9 x/a
922 diff -r bb948857c743 -r b4560182a3f9 x/a
920 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
923 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
921 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
924 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
922 @@ -0,0 +1,4 @@
925 @@ -0,0 +1,4 @@
923 +expand $Id$
926 +expand $Id$
924 +do not process $Id:
927 +do not process $Id:
925 +xxx $
928 +xxx $
926 +$Xinfo$
929 +$Xinfo$
927
930
928 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
931 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
929 200 Script output follows
932 200 Script output follows
930
933
931
934
932 diff -r ef63ca68695b -r bb948857c743 a
935 diff -r ef63ca68695b -r bb948857c743 a
933 --- a/a Thu Jan 01 00:00:00 1970 +0000
936 --- a/a Thu Jan 01 00:00:00 1970 +0000
934 +++ b/a Thu Jan 01 00:00:02 1970 +0000
937 +++ b/a Thu Jan 01 00:00:02 1970 +0000
935 @@ -1,3 +1,4 @@
938 @@ -1,3 +1,4 @@
936 expand $Id$
939 expand $Id$
937 do not process $Id:
940 do not process $Id:
938 xxx $
941 xxx $
939 +$Xinfo$
942 +$Xinfo$
940
943
941
944
942
945
943
946
944 $ cat errors.log
947 $ cat errors.log
945
948
946 Prepare merge and resolve tests
949 Prepare merge and resolve tests
947
950
948 $ echo '$Id$' > m
951 $ echo '$Id$' > m
949 $ hg add m
952 $ hg add m
950 $ hg commit -m 4kw
953 $ hg commit -m 4kw
951 $ echo foo >> m
954 $ echo foo >> m
952 $ hg commit -m 5foo
955 $ hg commit -m 5foo
953
956
954 simplemerge
957 simplemerge
955
958
956 $ hg update 4
959 $ hg update 4
957 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
960 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
958 $ echo foo >> m
961 $ echo foo >> m
959 $ hg commit -m 6foo
962 $ hg commit -m 6foo
960 created new head
963 created new head
961 $ hg merge
964 $ hg merge
962 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
965 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
963 (branch merge, don't forget to commit)
966 (branch merge, don't forget to commit)
964 $ hg commit -m simplemerge
967 $ hg commit -m simplemerge
965 $ cat m
968 $ cat m
966 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
969 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
967 foo
970 foo
968
971
969 conflict: keyword should stay outside conflict zone
972 conflict: keyword should stay outside conflict zone
970
973
971 $ hg update 4
974 $ hg update 4
972 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
975 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
973 $ echo bar >> m
976 $ echo bar >> m
974 $ hg commit -m 8bar
977 $ hg commit -m 8bar
975 created new head
978 created new head
976 $ hg merge
979 $ hg merge
977 merging m
980 merging m
978 warning: conflicts during merge.
981 warning: conflicts during merge.
979 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
982 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
980 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
983 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
981 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
984 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
982 [1]
985 [1]
983 $ cat m
986 $ cat m
984 $Id$
987 $Id$
985 <<<<<<< local
988 <<<<<<< local
986 bar
989 bar
987 =======
990 =======
988 foo
991 foo
989 >>>>>>> other
992 >>>>>>> other
990
993
991 resolve to local
994 resolve to local
992
995
993 $ HGMERGE=internal:local hg resolve -a
996 $ HGMERGE=internal:local hg resolve -a
994 $ hg commit -m localresolve
997 $ hg commit -m localresolve
995 $ cat m
998 $ cat m
996 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
999 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
997 bar
1000 bar
998
1001
999 Test restricted mode with transplant -b
1002 Test restricted mode with transplant -b
1000
1003
1001 $ hg update 6
1004 $ hg update 6
1002 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1005 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1003 $ hg branch foo
1006 $ hg branch foo
1004 marked working directory as branch foo
1007 marked working directory as branch foo
1005 $ mv a a.bak
1008 $ mv a a.bak
1006 $ echo foobranch > a
1009 $ echo foobranch > a
1007 $ cat a.bak >> a
1010 $ cat a.bak >> a
1008 $ rm a.bak
1011 $ rm a.bak
1009 $ hg commit -m 9foobranch
1012 $ hg commit -m 9foobranch
1010 $ hg update default
1013 $ hg update default
1011 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1014 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1012 $ hg -y transplant -b foo tip
1015 $ hg -y transplant -b foo tip
1013 applying 4aa30d025d50
1016 applying 4aa30d025d50
1014 4aa30d025d50 transplanted to e00abbf63521
1017 4aa30d025d50 transplanted to e00abbf63521
1015
1018
1016 Expansion in changeset but not in file
1019 Expansion in changeset but not in file
1017
1020
1018 $ hg tip -p
1021 $ hg tip -p
1019 changeset: 11:e00abbf63521
1022 changeset: 11:e00abbf63521
1020 tag: tip
1023 tag: tip
1021 parent: 9:800511b3a22d
1024 parent: 9:800511b3a22d
1022 user: test
1025 user: test
1023 date: Thu Jan 01 00:00:00 1970 +0000
1026 date: Thu Jan 01 00:00:00 1970 +0000
1024 summary: 9foobranch
1027 summary: 9foobranch
1025
1028
1026 diff -r 800511b3a22d -r e00abbf63521 a
1029 diff -r 800511b3a22d -r e00abbf63521 a
1027 --- a/a Thu Jan 01 00:00:00 1970 +0000
1030 --- a/a Thu Jan 01 00:00:00 1970 +0000
1028 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1031 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1029 @@ -1,3 +1,4 @@
1032 @@ -1,3 +1,4 @@
1030 +foobranch
1033 +foobranch
1031 expand $Id$
1034 expand $Id$
1032 do not process $Id:
1035 do not process $Id:
1033 xxx $
1036 xxx $
1034
1037
1035 $ head -n 2 a
1038 $ head -n 2 a
1036 foobranch
1039 foobranch
1037 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1040 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1038
1041
1039 Turn off expansion
1042 Turn off expansion
1040
1043
1041 $ hg -q rollback
1044 $ hg -q rollback
1042 $ hg -q update -C
1045 $ hg -q update -C
1043
1046
1044 kwshrink with unknown file u
1047 kwshrink with unknown file u
1045
1048
1046 $ cp a u
1049 $ cp a u
1047 $ hg --verbose kwshrink
1050 $ hg --verbose kwshrink
1048 overwriting a shrinking keywords
1051 overwriting a shrinking keywords
1049 overwriting m shrinking keywords
1052 overwriting m shrinking keywords
1050 overwriting x/a shrinking keywords
1053 overwriting x/a shrinking keywords
1051
1054
1052 Keywords shrunk in working directory, but not yet disabled
1055 Keywords shrunk in working directory, but not yet disabled
1053 - cat shows unexpanded keywords
1056 - cat shows unexpanded keywords
1054 - hg cat shows expanded keywords
1057 - hg cat shows expanded keywords
1055
1058
1056 $ cat a b
1059 $ cat a b
1057 expand $Id$
1060 expand $Id$
1058 do not process $Id:
1061 do not process $Id:
1059 xxx $
1062 xxx $
1060 $Xinfo$
1063 $Xinfo$
1061 ignore $Id$
1064 ignore $Id$
1062 $ hg cat sym a b && echo
1065 $ hg cat sym a b && echo
1063 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1066 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1064 do not process $Id:
1067 do not process $Id:
1065 xxx $
1068 xxx $
1066 $Xinfo: User Name <user@example.com>: firstline $
1069 $Xinfo: User Name <user@example.com>: firstline $
1067 ignore $Id$
1070 ignore $Id$
1068 a
1071 a
1069
1072
1070 Now disable keyword expansion
1073 Now disable keyword expansion
1071
1074
1072 $ rm "$HGRCPATH"
1075 $ rm "$HGRCPATH"
1073 $ cat a b
1076 $ cat a b
1074 expand $Id$
1077 expand $Id$
1075 do not process $Id:
1078 do not process $Id:
1076 xxx $
1079 xxx $
1077 $Xinfo$
1080 $Xinfo$
1078 ignore $Id$
1081 ignore $Id$
1079 $ hg cat sym a b && echo
1082 $ hg cat sym a b && echo
1080 expand $Id$
1083 expand $Id$
1081 do not process $Id:
1084 do not process $Id:
1082 xxx $
1085 xxx $
1083 $Xinfo$
1086 $Xinfo$
1084 ignore $Id$
1087 ignore $Id$
1085 a
1088 a
General Comments 0
You need to be logged in to leave comments. Login now