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