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