##// END OF EJS Templates
tests: move test bundles in a bundles/ subdirectory
Nicolas Dumazet -
r14116:cd303243 default
parent child Browse files
Show More
1 NO CONTENT: file renamed from tests/darcs1.hg to tests/bundles/darcs1.hg
1 NO CONTENT: file renamed from tests/legacy-encoding.hg to tests/bundles/legacy-encoding.hg
1 NO CONTENT: file renamed from tests/tampered.hg to tests/bundles/tampered.hg
1 NO CONTENT: file renamed from tests/test-keyword.hg to tests/bundles/test-keyword.hg
1 NO CONTENT: file renamed from tests/test-manifest.hg to tests/bundles/test-manifest.hg
1 NO CONTENT: file renamed from tests/test-merge-symlinks.hg to tests/bundles/test-merge-symlinks.hg
1 NO CONTENT: file renamed from tests/test-no-symlinks.hg to tests/bundles/test-no-symlinks.hg
@@ -1,82 +1,82 b''
1 1 $ hg init
2 2
3 3 should fail
4 4
5 5 $ hg add .hg/00changelog.i
6 6 abort: path contains illegal component: .hg/00changelog.i
7 7 [255]
8 8
9 9 $ mkdir a
10 10 $ echo a > a/a
11 11 $ hg ci -Ama
12 12 adding a/a
13 13 $ ln -s a b
14 14 $ echo b > a/b
15 15
16 16 should fail
17 17
18 18 $ hg add b/b
19 19 abort: path 'b/b' traverses symbolic link 'b'
20 20 [255]
21 21
22 22 should succeed
23 23
24 24 $ hg add b
25 25
26 26 should still fail - maybe
27 27
28 28 $ hg add b/b
29 29 abort: path 'b/b' traverses symbolic link 'b'
30 30 [255]
31 31
32 32 unbundle tampered bundle
33 33
34 34 $ hg init target
35 35 $ cd target
36 $ hg unbundle $TESTDIR/tampered.hg
36 $ hg unbundle $TESTDIR/bundles/tampered.hg
37 37 adding changesets
38 38 adding manifests
39 39 adding file changes
40 40 added 5 changesets with 6 changes to 6 files (+4 heads)
41 41 (run 'hg heads' to see heads, 'hg merge' to merge)
42 42
43 43 attack .hg/test
44 44
45 45 $ hg manifest -r0
46 46 .hg/test
47 47 $ hg update -Cr0
48 48 abort: path contains illegal component: .hg/test
49 49 [255]
50 50
51 51 attack foo/.hg/test
52 52
53 53 $ hg manifest -r1
54 54 foo/.hg/test
55 55 $ hg update -Cr1
56 56 abort: path 'foo/.hg/test' is inside nested repo 'foo'
57 57 [255]
58 58
59 59 attack back/test where back symlinks to ..
60 60
61 61 $ hg manifest -r2
62 62 back
63 63 back/test
64 64 $ hg update -Cr2
65 65 abort: path 'back/test' traverses symbolic link 'back'
66 66 [255]
67 67
68 68 attack ../test
69 69
70 70 $ hg manifest -r3
71 71 ../test
72 72 $ hg update -Cr3
73 73 abort: path contains illegal component: ../test
74 74 [255]
75 75
76 76 attack /tmp/test
77 77
78 78 $ hg manifest -r4
79 79 /tmp/test
80 80 $ hg update -Cr4
81 81 abort: No such file or directory: $TESTTMP/target//tmp/test
82 82 [255]
@@ -1,143 +1,143 b''
1 1
2 2 $ "$TESTDIR/hghave" darcs || exit 80
3 3 $ echo "[extensions]" >> $HGRCPATH
4 4 $ echo "convert=" >> $HGRCPATH
5 5 $ echo 'graphlog =' >> $HGRCPATH
6 6 $ DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
7 7
8 8 skip if we can't import elementtree
9 9
10 10 $ mkdir dummy
11 11 $ mkdir dummy/_darcs
12 12 $ if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
13 13 > echo 'skipped: missing feature: elementtree module'
14 14 > exit 80
15 15 > fi
16 16
17 17 try converting darcs1 repository
18 18
19 $ hg clone -q "$TESTDIR/darcs1.hg" darcs
19 $ hg clone -q "$TESTDIR/bundles/darcs1.hg" darcs
20 20 $ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0
21 21 darcs-1.0 repository format is unsupported, please upgrade
22 22
23 23 initialize darcs repo
24 24
25 25 $ mkdir darcs-repo
26 26 $ cd darcs-repo
27 27 $ darcs init
28 28 $ echo a > a
29 29 $ darcs record -a -l -m p0
30 30 Finished recording patch 'p0'
31 31 $ cd ..
32 32
33 33 branch and update
34 34
35 35 $ darcs get darcs-repo darcs-clone >/dev/null
36 36 $ cd darcs-clone
37 37 $ echo c >> a
38 38 $ echo c > c
39 39 $ darcs record -a -l -m p1.1
40 40 Finished recording patch 'p1.1'
41 41 $ cd ..
42 42
43 43 update source
44 44
45 45 $ cd darcs-repo
46 46 $ echo b >> a
47 47 $ echo b > b
48 48 $ darcs record -a -l -m p1.2
49 49 Finished recording patch 'p1.2'
50 50
51 51 $ darcs pull -a ../darcs-clone
52 52 Backing up ./a(-darcs-backup0)
53 53 We have conflicts in the following files:
54 54 ./a
55 55 Finished pulling and applying.
56 56 $ sleep 1
57 57 $ echo e > a
58 58 $ echo f > f
59 59 $ mkdir dir
60 60 $ echo d > dir/d
61 61 $ echo d > dir/d2
62 62 $ darcs record -a -l -m p2
63 63 Finished recording patch 'p2'
64 64
65 65 test file and directory move
66 66
67 67 $ darcs mv f ff
68 68
69 69 Test remove + move
70 70
71 71 $ darcs remove dir/d2
72 72 $ rm dir/d2
73 73 $ darcs mv dir dir2
74 74 $ darcs record -a -l -m p3
75 75 Finished recording patch 'p3'
76 76
77 77 test utf-8 commit message and author
78 78
79 79 $ echo g > g
80 80
81 81 darcs is encoding agnostic, so it takes whatever bytes it's given
82 82
83 83 $ darcs record -a -l -m 'p4: desc Γ±' -A 'author Γ±'
84 84 Finished recording patch 'p4: desc \xc3\xb1' (esc)
85 85
86 86 Test latin-1 commit message
87 87
88 88 $ echo h > h
89 89 $ printf "p5: desc " > ../p5
90 90 $ python -c 'print "".join([chr(i) for i in range(128, 256)])' >> ../p5
91 91 $ darcs record -a -l --logfile ../p5
92 92 Finished recording patch 'p5: desc \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff' (esc)
93 93
94 94 $ glog()
95 95 > {
96 96 > HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@"
97 97 > }
98 98 $ cd ..
99 99 $ hg convert darcs-repo darcs-repo-hg
100 100 initializing destination darcs-repo-hg repository
101 101 scanning source...
102 102 sorting...
103 103 converting...
104 104 6 p0
105 105 5 p1.2
106 106 4 p1.1
107 107 3 p2
108 108 2 p3
109 109 1 p4: desc ?
110 110 0 p5: desc ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
111 111
112 112 The converter does not currently handle patch conflicts very well.
113 113 When they occur, it reverts *all* changes and moves forward,
114 114 letting the conflict resolving patch fix collisions.
115 115 Unfortunately, non-conflicting changes, like the addition of the
116 116 "c" file in p1.1 patch are reverted too.
117 117 Just to say that manifest not listing "c" here is a bug.
118 118
119 119 $ HGENCODING=latin-1 glog -R darcs-repo-hg -r 6
120 120 o 6 "p5: desc \xc2\x80\xc2\x81\xc2\x82\xc2\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3\xbe\xc3\xbf" (test@example.org) files: h (esc)
121 121 |
122 122 $ HGENCODING=utf-8 glog -R darcs-repo-hg -r 0:5
123 123 o 5 "p4: desc \xc3\xb1" (author \xc3\xb1) files: g (esc)
124 124 |
125 125 o 4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
126 126 |
127 127 o 3 "p2" (test@example.org) files: a dir/d dir/d2 f
128 128 |
129 129 o 2 "p1.1" (test@example.org) files:
130 130 |
131 131 o 1 "p1.2" (test@example.org) files: a b
132 132 |
133 133 o 0 "p0" (test@example.org) files: a
134 134
135 135
136 136 $ hg up -q -R darcs-repo-hg
137 137 $ hg -R darcs-repo-hg manifest --debug
138 138 7225b30cdf38257d5cc7780772c051b6f33e6d6b 644 a
139 139 1e88685f5ddec574a34c70af492f95b6debc8741 644 b
140 140 37406831adc447ec2385014019599dfec953c806 644 dir2/d
141 141 b783a337463792a5c7d548ad85a7d3253c16ba8c 644 ff
142 142 0973eb1b2ecc4de7fafe7447ce1b7462108b4848 644 g
143 143 fe6f8b4f507fe3eb524c527192a84920a4288dac 644 h
@@ -1,249 +1,249 b''
1 1 Test character encoding
2 2
3 3 $ hg init t
4 4 $ cd t
5 5
6 6 we need a repo with some legacy latin-1 changesets
7 7
8 $ hg unbundle $TESTDIR/legacy-encoding.hg
8 $ hg unbundle $TESTDIR/bundles/legacy-encoding.hg
9 9 adding changesets
10 10 adding manifests
11 11 adding file changes
12 12 added 2 changesets with 2 changes to 1 files
13 13 (run 'hg update' to get a working copy)
14 14 $ hg co
15 15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 16 $ python << EOF
17 17 > f = file('latin-1', 'w'); f.write("latin-1 e' encoded: \xe9"); f.close()
18 18 > f = file('utf-8', 'w'); f.write("utf-8 e' encoded: \xc3\xa9"); f.close()
19 19 > f = file('latin-1-tag', 'w'); f.write("\xe9"); f.close()
20 20 > EOF
21 21
22 22 should fail with encoding error
23 23
24 24 $ echo "plain old ascii" > a
25 25 $ hg st
26 26 M a
27 27 ? latin-1
28 28 ? latin-1-tag
29 29 ? utf-8
30 30 $ HGENCODING=ascii hg ci -l latin-1
31 31 transaction abort!
32 32 rollback completed
33 33 abort: decoding near ' encoded: \xe9': 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)! (esc)
34 34 [255]
35 35
36 36 these should work
37 37
38 38 $ echo "latin-1" > a
39 39 $ HGENCODING=latin-1 hg ci -l latin-1
40 40 $ echo "utf-8" > a
41 41 $ HGENCODING=utf-8 hg ci -l utf-8
42 42 $ HGENCODING=latin-1 hg tag `cat latin-1-tag`
43 43 $ HGENCODING=latin-1 hg branch `cat latin-1-tag`
44 44 marked working directory as branch \xe9 (esc)
45 45 $ HGENCODING=latin-1 hg ci -m 'latin1 branch'
46 46 $ rm .hg/branch
47 47
48 48 hg log (ascii)
49 49
50 50 $ hg --encoding ascii log
51 51 changeset: 5:093c6077d1c8
52 52 branch: ?
53 53 tag: tip
54 54 user: test
55 55 date: Thu Jan 01 00:00:00 1970 +0000
56 56 summary: latin1 branch
57 57
58 58 changeset: 4:94db611b4196
59 59 user: test
60 60 date: Thu Jan 01 00:00:00 1970 +0000
61 61 summary: Added tag ? for changeset ca661e7520de
62 62
63 63 changeset: 3:ca661e7520de
64 64 tag: ?
65 65 user: test
66 66 date: Thu Jan 01 00:00:00 1970 +0000
67 67 summary: utf-8 e' encoded: ?
68 68
69 69 changeset: 2:650c6f3d55dd
70 70 user: test
71 71 date: Thu Jan 01 00:00:00 1970 +0000
72 72 summary: latin-1 e' encoded: ?
73 73
74 74 changeset: 1:0e5b7e3f9c4a
75 75 user: test
76 76 date: Mon Jan 12 13:46:40 1970 +0000
77 77 summary: koi8-r: ????? = u'\u0440\u0442\u0443\u0442\u044c'
78 78
79 79 changeset: 0:1e78a93102a3
80 80 user: test
81 81 date: Mon Jan 12 13:46:40 1970 +0000
82 82 summary: latin-1 e': ? = u'\xe9'
83 83
84 84
85 85 hg log (latin-1)
86 86
87 87 $ hg --encoding latin-1 log
88 88 changeset: 5:093c6077d1c8
89 89 branch: \xe9 (esc)
90 90 tag: tip
91 91 user: test
92 92 date: Thu Jan 01 00:00:00 1970 +0000
93 93 summary: latin1 branch
94 94
95 95 changeset: 4:94db611b4196
96 96 user: test
97 97 date: Thu Jan 01 00:00:00 1970 +0000
98 98 summary: Added tag \xe9 for changeset ca661e7520de (esc)
99 99
100 100 changeset: 3:ca661e7520de
101 101 tag: \xe9 (esc)
102 102 user: test
103 103 date: Thu Jan 01 00:00:00 1970 +0000
104 104 summary: utf-8 e' encoded: \xe9 (esc)
105 105
106 106 changeset: 2:650c6f3d55dd
107 107 user: test
108 108 date: Thu Jan 01 00:00:00 1970 +0000
109 109 summary: latin-1 e' encoded: \xe9 (esc)
110 110
111 111 changeset: 1:0e5b7e3f9c4a
112 112 user: test
113 113 date: Mon Jan 12 13:46:40 1970 +0000
114 114 summary: koi8-r: \xd2\xd4\xd5\xd4\xd8 = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
115 115
116 116 changeset: 0:1e78a93102a3
117 117 user: test
118 118 date: Mon Jan 12 13:46:40 1970 +0000
119 119 summary: latin-1 e': \xe9 = u'\\xe9' (esc)
120 120
121 121
122 122 hg log (utf-8)
123 123
124 124 $ hg --encoding utf-8 log
125 125 changeset: 5:093c6077d1c8
126 126 branch: \xc3\xa9 (esc)
127 127 tag: tip
128 128 user: test
129 129 date: Thu Jan 01 00:00:00 1970 +0000
130 130 summary: latin1 branch
131 131
132 132 changeset: 4:94db611b4196
133 133 user: test
134 134 date: Thu Jan 01 00:00:00 1970 +0000
135 135 summary: Added tag \xc3\xa9 for changeset ca661e7520de (esc)
136 136
137 137 changeset: 3:ca661e7520de
138 138 tag: \xc3\xa9 (esc)
139 139 user: test
140 140 date: Thu Jan 01 00:00:00 1970 +0000
141 141 summary: utf-8 e' encoded: \xc3\xa9 (esc)
142 142
143 143 changeset: 2:650c6f3d55dd
144 144 user: test
145 145 date: Thu Jan 01 00:00:00 1970 +0000
146 146 summary: latin-1 e' encoded: \xc3\xa9 (esc)
147 147
148 148 changeset: 1:0e5b7e3f9c4a
149 149 user: test
150 150 date: Mon Jan 12 13:46:40 1970 +0000
151 151 summary: koi8-r: \xc3\x92\xc3\x94\xc3\x95\xc3\x94\xc3\x98 = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
152 152
153 153 changeset: 0:1e78a93102a3
154 154 user: test
155 155 date: Mon Jan 12 13:46:40 1970 +0000
156 156 summary: latin-1 e': \xc3\xa9 = u'\\xe9' (esc)
157 157
158 158
159 159 hg tags (ascii)
160 160
161 161 $ HGENCODING=ascii hg tags
162 162 tip 5:093c6077d1c8
163 163 ? 3:ca661e7520de
164 164
165 165 hg tags (latin-1)
166 166
167 167 $ HGENCODING=latin-1 hg tags
168 168 tip 5:093c6077d1c8
169 169 \xe9 3:ca661e7520de (esc)
170 170
171 171 hg tags (utf-8)
172 172
173 173 $ HGENCODING=utf-8 hg tags
174 174 tip 5:093c6077d1c8
175 175 \xc3\xa9 3:ca661e7520de (esc)
176 176
177 177 hg branches (ascii)
178 178
179 179 $ HGENCODING=ascii hg branches
180 180 ? 5:093c6077d1c8
181 181 default 4:94db611b4196 (inactive)
182 182
183 183 hg branches (latin-1)
184 184
185 185 $ HGENCODING=latin-1 hg branches
186 186 \xe9 5:093c6077d1c8 (esc)
187 187 default 4:94db611b4196 (inactive)
188 188
189 189 hg branches (utf-8)
190 190
191 191 $ HGENCODING=utf-8 hg branches
192 192 \xc3\xa9 5:093c6077d1c8 (esc)
193 193 default 4:94db611b4196 (inactive)
194 194 $ echo '[ui]' >> .hg/hgrc
195 195 $ echo 'fallbackencoding = koi8-r' >> .hg/hgrc
196 196
197 197 hg log (utf-8)
198 198
199 199 $ HGENCODING=utf-8 hg log
200 200 changeset: 5:093c6077d1c8
201 201 branch: \xc3\xa9 (esc)
202 202 tag: tip
203 203 user: test
204 204 date: Thu Jan 01 00:00:00 1970 +0000
205 205 summary: latin1 branch
206 206
207 207 changeset: 4:94db611b4196
208 208 user: test
209 209 date: Thu Jan 01 00:00:00 1970 +0000
210 210 summary: Added tag \xc3\xa9 for changeset ca661e7520de (esc)
211 211
212 212 changeset: 3:ca661e7520de
213 213 tag: \xc3\xa9 (esc)
214 214 user: test
215 215 date: Thu Jan 01 00:00:00 1970 +0000
216 216 summary: utf-8 e' encoded: \xc3\xa9 (esc)
217 217
218 218 changeset: 2:650c6f3d55dd
219 219 user: test
220 220 date: Thu Jan 01 00:00:00 1970 +0000
221 221 summary: latin-1 e' encoded: \xc3\xa9 (esc)
222 222
223 223 changeset: 1:0e5b7e3f9c4a
224 224 user: test
225 225 date: Mon Jan 12 13:46:40 1970 +0000
226 226 summary: koi8-r: \xd1\x80\xd1\x82\xd1\x83\xd1\x82\xd1\x8c = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
227 227
228 228 changeset: 0:1e78a93102a3
229 229 user: test
230 230 date: Mon Jan 12 13:46:40 1970 +0000
231 231 summary: latin-1 e': \xd0\x98 = u'\\xe9' (esc)
232 232
233 233
234 234 hg log (dolphin)
235 235
236 236 $ HGENCODING=dolphin hg log
237 237 abort: unknown encoding: dolphin, please check your locale settings
238 238 [255]
239 239 $ HGENCODING=ascii hg branch `cat latin-1-tag`
240 240 abort: decoding near '\xe9': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)! (esc)
241 241 [255]
242 242 $ cp latin-1-tag .hg/branch
243 243 $ HGENCODING=latin-1 hg ci -m 'auto-promote legacy name'
244 244
245 245 Test roundtrip encoding of lookup tables when not using UTF-8 (issue2763)
246 246
247 247 $ HGENCODING=latin-1 hg up `cat latin-1-tag`
248 248 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
249 249
@@ -1,1074 +1,1074 b''
1 1 $ cat <<EOF >> $HGRCPATH
2 2 > [extensions]
3 3 > keyword =
4 4 > mq =
5 5 > notify =
6 6 > record =
7 7 > transplant =
8 8 > [ui]
9 9 > interactive = true
10 10 > EOF
11 11
12 12 Run kwdemo before [keyword] files are set up
13 13 as it would succeed without uisetup otherwise
14 14
15 15 $ hg --quiet kwdemo
16 16 [extensions]
17 17 keyword =
18 18 [keyword]
19 19 demo.txt =
20 20 [keywordset]
21 21 svn = False
22 22 [keywordmaps]
23 23 Author = {author|user}
24 24 Date = {date|utcdate}
25 25 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
26 26 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
27 27 RCSFile = {file|basename},v
28 28 RCSfile = {file|basename},v
29 29 Revision = {node|short}
30 30 Source = {root}/{file},v
31 31 $Author: test $
32 32 $Date: ????/??/?? ??:??:?? $ (glob)
33 33 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
34 34 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
35 35 $RCSFile: demo.txt,v $
36 36 $RCSfile: demo.txt,v $
37 37 $Revision: ???????????? $ (glob)
38 38 $Source: */demo.txt,v $ (glob)
39 39
40 40 $ hg --quiet kwdemo "Branch = {branches}"
41 41 [extensions]
42 42 keyword =
43 43 [keyword]
44 44 demo.txt =
45 45 [keywordset]
46 46 svn = False
47 47 [keywordmaps]
48 48 Branch = {branches}
49 49 $Branch: demobranch $
50 50
51 51 $ cat <<EOF >> $HGRCPATH
52 52 > [keyword]
53 53 > ** =
54 54 > b = ignore
55 55 > i = ignore
56 56 > [hooks]
57 57 > EOF
58 58 $ cp $HGRCPATH $HGRCPATH.nohooks
59 59 > cat <<EOF >> $HGRCPATH
60 60 > commit=
61 61 > commit.test=cp a hooktest
62 62 > EOF
63 63
64 64 $ hg init Test-bndl
65 65 $ cd Test-bndl
66 66
67 67 kwshrink should exit silently in empty/invalid repo
68 68
69 69 $ hg kwshrink
70 70
71 71 Symlinks cannot be created on Windows.
72 72 A bundle to test this was made with:
73 73 hg init t
74 74 cd t
75 75 echo a > a
76 76 ln -s a sym
77 77 hg add sym
78 78 hg ci -m addsym -u mercurial
79 79 hg bundle --base null ../test-keyword.hg
80 80
81 $ hg pull -u "$TESTDIR"/test-keyword.hg
81 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
82 82 pulling from *test-keyword.hg (glob)
83 83 requesting all changes
84 84 adding changesets
85 85 adding manifests
86 86 adding file changes
87 87 added 1 changesets with 1 changes to 1 files
88 88 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 89
90 90 $ echo 'expand $Id$' > a
91 91 $ echo 'do not process $Id:' >> a
92 92 $ echo 'xxx $' >> a
93 93 $ echo 'ignore $Id$' > b
94 94
95 95 Output files as they were created
96 96
97 97 $ cat a b
98 98 expand $Id$
99 99 do not process $Id:
100 100 xxx $
101 101 ignore $Id$
102 102
103 103 no kwfiles
104 104
105 105 $ hg kwfiles
106 106
107 107 untracked candidates
108 108
109 109 $ hg -v kwfiles --unknown
110 110 k a
111 111
112 112 Add files and check status
113 113
114 114 $ hg addremove
115 115 adding a
116 116 adding b
117 117 $ hg status
118 118 A a
119 119 A b
120 120
121 121
122 122 Default keyword expansion including commit hook
123 123 Interrupted commit should not change state or run commit hook
124 124
125 125 $ hg --debug commit
126 126 abort: empty commit message
127 127 [255]
128 128 $ hg status
129 129 A a
130 130 A b
131 131
132 132 Commit with several checks
133 133
134 134 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
135 135 a
136 136 b
137 137 overwriting a expanding keywords
138 138 running hook commit.test: cp a hooktest
139 139 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
140 140 $ hg status
141 141 ? hooktest
142 142 $ hg debugrebuildstate
143 143 $ hg --quiet identify
144 144 ef63ca68695b
145 145
146 146 cat files in working directory with keywords expanded
147 147
148 148 $ cat a b
149 149 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
150 150 do not process $Id:
151 151 xxx $
152 152 ignore $Id$
153 153
154 154 hg cat files and symlink, no expansion
155 155
156 156 $ hg cat sym a b && echo
157 157 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
158 158 do not process $Id:
159 159 xxx $
160 160 ignore $Id$
161 161 a
162 162
163 163 Test hook execution
164 164
165 165 $ diff a hooktest
166 166
167 167 $ cp $HGRCPATH.nohooks $HGRCPATH
168 168 $ rm hooktest
169 169
170 170 bundle
171 171
172 172 $ hg bundle --base null ../kw.hg
173 173 2 changesets found
174 174 $ cd ..
175 175 $ hg init Test
176 176 $ cd Test
177 177
178 178 Notify on pull to check whether keywords stay as is in email
179 179 ie. if patch.diff wrapper acts as it should
180 180
181 181 $ cat <<EOF >> $HGRCPATH
182 182 > [hooks]
183 183 > incoming.notify = python:hgext.notify.hook
184 184 > [notify]
185 185 > sources = pull
186 186 > diffstat = False
187 187 > maxsubject = 15
188 188 > [reposubs]
189 189 > * = Test
190 190 > EOF
191 191
192 192 Pull from bundle and trigger notify
193 193
194 194 $ hg pull -u ../kw.hg
195 195 pulling from ../kw.hg
196 196 requesting all changes
197 197 adding changesets
198 198 adding manifests
199 199 adding file changes
200 200 added 2 changesets with 3 changes to 3 files
201 201 Content-Type: text/plain; charset="us-ascii"
202 202 MIME-Version: 1.0
203 203 Content-Transfer-Encoding: 7bit
204 204 Date: * (glob)
205 205 Subject: changeset in...
206 206 From: mercurial
207 207 X-Hg-Notification: changeset a2392c293916
208 208 Message-Id: <hg.a2392c293916*> (glob)
209 209 To: Test
210 210
211 211 changeset a2392c293916 in $TESTTMP/Test
212 212 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
213 213 description:
214 214 addsym
215 215
216 216 diffs (6 lines):
217 217
218 218 diff -r 000000000000 -r a2392c293916 sym
219 219 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
220 220 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
221 221 @@ -0,0 +1,1 @@
222 222 +a
223 223 \ No newline at end of file
224 224 Content-Type: text/plain; charset="us-ascii"
225 225 MIME-Version: 1.0
226 226 Content-Transfer-Encoding: 7bit
227 227 Date:* (glob)
228 228 Subject: changeset in...
229 229 From: User Name <user@example.com>
230 230 X-Hg-Notification: changeset ef63ca68695b
231 231 Message-Id: <hg.ef63ca68695b*> (glob)
232 232 To: Test
233 233
234 234 changeset ef63ca68695b in $TESTTMP/Test
235 235 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
236 236 description:
237 237 absym
238 238
239 239 diffs (12 lines):
240 240
241 241 diff -r a2392c293916 -r ef63ca68695b a
242 242 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
243 243 +++ b/a Thu Jan 01 00:00:00 1970 +0000
244 244 @@ -0,0 +1,3 @@
245 245 +expand $Id$
246 246 +do not process $Id:
247 247 +xxx $
248 248 diff -r a2392c293916 -r ef63ca68695b b
249 249 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
250 250 +++ b/b Thu Jan 01 00:00:00 1970 +0000
251 251 @@ -0,0 +1,1 @@
252 252 +ignore $Id$
253 253 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 254
255 255 $ cp $HGRCPATH.nohooks $HGRCPATH
256 256
257 257 Touch files and check with status
258 258
259 259 $ touch a b
260 260 $ hg status
261 261
262 262 Update and expand
263 263
264 264 $ rm sym a b
265 265 $ hg update -C
266 266 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 267 $ cat a b
268 268 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
269 269 do not process $Id:
270 270 xxx $
271 271 ignore $Id$
272 272
273 273 Check whether expansion is filewise
274 274
275 275 $ echo '$Id$' > c
276 276 $ echo 'tests for different changenodes' >> c
277 277
278 278 commit file c
279 279
280 280 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
281 281 adding c
282 282
283 283 force expansion
284 284
285 285 $ hg -v kwexpand
286 286 overwriting a expanding keywords
287 287 overwriting c expanding keywords
288 288
289 289 compare changenodes in a and c
290 290
291 291 $ cat a c
292 292 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
293 293 do not process $Id:
294 294 xxx $
295 295 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
296 296 tests for different changenodes
297 297
298 298 record
299 299
300 300 $ echo '$Id$' > r
301 301 $ hg add r
302 302
303 303 record chunk
304 304
305 305 $ python -c \
306 306 > 'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
307 307 $ hg record -d '1 10' -m rectest a<<EOF
308 308 > y
309 309 > y
310 310 > n
311 311 > EOF
312 312 diff --git a/a b/a
313 313 2 hunks, 2 lines changed
314 314 examine changes to 'a'? [Ynsfdaq?]
315 315 @@ -1,3 +1,4 @@
316 316 expand $Id$
317 317 +foo
318 318 do not process $Id:
319 319 xxx $
320 320 record change 1/2 to 'a'? [Ynsfdaq?]
321 321 @@ -2,2 +3,3 @@
322 322 do not process $Id:
323 323 xxx $
324 324 +bar
325 325 record change 2/2 to 'a'? [Ynsfdaq?]
326 326
327 327 $ hg identify
328 328 d17e03c92c97+ tip
329 329 $ hg status
330 330 M a
331 331 A r
332 332
333 333 Cat modified file a
334 334
335 335 $ cat a
336 336 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
337 337 foo
338 338 do not process $Id:
339 339 xxx $
340 340 bar
341 341
342 342 Diff remaining chunk
343 343
344 344 $ hg diff a
345 345 diff -r d17e03c92c97 a
346 346 --- a/a Wed Dec 31 23:59:51 1969 -0000
347 347 +++ b/a * (glob)
348 348 @@ -2,3 +2,4 @@
349 349 foo
350 350 do not process $Id:
351 351 xxx $
352 352 +bar
353 353
354 354 $ hg rollback
355 355 repository tip rolled back to revision 2 (undo commit)
356 356 working directory now based on revision 2
357 357
358 358 Record all chunks in file a
359 359
360 360 $ echo foo > msg
361 361
362 362 - do not use "hg record -m" here!
363 363
364 364 $ hg record -l msg -d '1 11' a<<EOF
365 365 > y
366 366 > y
367 367 > y
368 368 > EOF
369 369 diff --git a/a b/a
370 370 2 hunks, 2 lines changed
371 371 examine changes to 'a'? [Ynsfdaq?]
372 372 @@ -1,3 +1,4 @@
373 373 expand $Id$
374 374 +foo
375 375 do not process $Id:
376 376 xxx $
377 377 record change 1/2 to 'a'? [Ynsfdaq?]
378 378 @@ -2,2 +3,3 @@
379 379 do not process $Id:
380 380 xxx $
381 381 +bar
382 382 record change 2/2 to 'a'? [Ynsfdaq?]
383 383
384 384 File a should be clean
385 385
386 386 $ hg status -A a
387 387 C a
388 388
389 389 rollback and revert expansion
390 390
391 391 $ cat a
392 392 expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
393 393 foo
394 394 do not process $Id:
395 395 xxx $
396 396 bar
397 397 $ hg --verbose rollback
398 398 repository tip rolled back to revision 2 (undo commit)
399 399 working directory now based on revision 2
400 400 overwriting a expanding keywords
401 401 $ hg status a
402 402 M a
403 403 $ cat a
404 404 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
405 405 foo
406 406 do not process $Id:
407 407 xxx $
408 408 bar
409 409 $ echo '$Id$' > y
410 410 $ echo '$Id$' > z
411 411 $ hg add y
412 412 $ hg commit -Am "rollback only" z
413 413 $ cat z
414 414 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
415 415 $ hg --verbose rollback
416 416 repository tip rolled back to revision 2 (undo commit)
417 417 working directory now based on revision 2
418 418 overwriting z shrinking keywords
419 419
420 420 Only z should be overwritten
421 421
422 422 $ hg status a y z
423 423 M a
424 424 A y
425 425 A z
426 426 $ cat z
427 427 $Id$
428 428 $ hg forget y z
429 429 $ rm y z
430 430
431 431 record added file alone
432 432
433 433 $ hg -v record -l msg -d '1 12' r<<EOF
434 434 > y
435 435 > EOF
436 436 diff --git a/r b/r
437 437 new file mode 100644
438 438 examine changes to 'r'? [Ynsfdaq?]
439 439 r
440 440 committed changeset 3:899491280810
441 441 overwriting r expanding keywords
442 442 $ hg --verbose rollback
443 443 repository tip rolled back to revision 2 (undo commit)
444 444 working directory now based on revision 2
445 445 overwriting r shrinking keywords
446 446 $ hg forget r
447 447 $ rm msg r
448 448 $ hg update -C
449 449 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 450
451 451 record added keyword ignored file
452 452
453 453 $ echo '$Id$' > i
454 454 $ hg add i
455 455 $ hg --verbose record -d '1 13' -m recignored<<EOF
456 456 > y
457 457 > EOF
458 458 diff --git a/i b/i
459 459 new file mode 100644
460 460 examine changes to 'i'? [Ynsfdaq?]
461 461 i
462 462 committed changeset 3:5f40fe93bbdc
463 463 $ cat i
464 464 $Id$
465 465 $ hg -q rollback
466 466 $ hg forget i
467 467 $ rm i
468 468
469 469 Test patch queue repo
470 470
471 471 $ hg init --mq
472 472 $ hg qimport -r tip -n mqtest.diff
473 473 $ hg commit --mq -m mqtest
474 474
475 475 Keywords should not be expanded in patch
476 476
477 477 $ cat .hg/patches/mqtest.diff
478 478 # HG changeset patch
479 479 # User User Name <user@example.com>
480 480 # Date 1 0
481 481 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
482 482 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
483 483 cndiff
484 484
485 485 diff -r ef63ca68695b -r 40a904bbbe4c c
486 486 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
487 487 +++ b/c Thu Jan 01 00:00:01 1970 +0000
488 488 @@ -0,0 +1,2 @@
489 489 +$Id$
490 490 +tests for different changenodes
491 491
492 492 $ hg qpop
493 493 popping mqtest.diff
494 494 patch queue now empty
495 495
496 496 qgoto, implying qpush, should expand
497 497
498 498 $ hg qgoto mqtest.diff
499 499 applying mqtest.diff
500 500 now at: mqtest.diff
501 501 $ cat c
502 502 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
503 503 tests for different changenodes
504 504 $ hg cat c
505 505 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
506 506 tests for different changenodes
507 507
508 508 Keywords should not be expanded in filelog
509 509
510 510 $ hg --config 'extensions.keyword=!' cat c
511 511 $Id$
512 512 tests for different changenodes
513 513
514 514 qpop and move on
515 515
516 516 $ hg qpop
517 517 popping mqtest.diff
518 518 patch queue now empty
519 519
520 520 Copy and show added kwfiles
521 521
522 522 $ hg cp a c
523 523 $ hg kwfiles
524 524 a
525 525 c
526 526
527 527 Commit and show expansion in original and copy
528 528
529 529 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
530 530 c
531 531 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
532 532 overwriting c expanding keywords
533 533 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
534 534 $ cat a c
535 535 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
536 536 do not process $Id:
537 537 xxx $
538 538 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
539 539 do not process $Id:
540 540 xxx $
541 541
542 542 Touch copied c and check its status
543 543
544 544 $ touch c
545 545 $ hg status
546 546
547 547 Copy kwfile to keyword ignored file unexpanding keywords
548 548
549 549 $ hg --verbose copy a i
550 550 copying a to i
551 551 overwriting i shrinking keywords
552 552 $ head -n 1 i
553 553 expand $Id$
554 554 $ hg forget i
555 555 $ rm i
556 556
557 557 Copy ignored file to ignored file: no overwriting
558 558
559 559 $ hg --verbose copy b i
560 560 copying b to i
561 561 $ hg forget i
562 562 $ rm i
563 563
564 564 cp symlink file; hg cp -A symlink file (part1)
565 565 - copied symlink points to kwfile: overwrite
566 566
567 567 $ cp sym i
568 568 $ ls -l i
569 569 -rw-r--r--* (glob)
570 570 $ head -1 i
571 571 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
572 572 $ hg copy --after --verbose sym i
573 573 copying sym to i
574 574 overwriting i shrinking keywords
575 575 $ head -1 i
576 576 expand $Id$
577 577 $ hg forget i
578 578 $ rm i
579 579
580 580 Test different options of hg kwfiles
581 581
582 582 $ hg kwfiles
583 583 a
584 584 c
585 585 $ hg -v kwfiles --ignore
586 586 I b
587 587 I sym
588 588 $ hg kwfiles --all
589 589 K a
590 590 K c
591 591 I b
592 592 I sym
593 593
594 594 Diff specific revision
595 595
596 596 $ hg diff --rev 1
597 597 diff -r ef63ca68695b c
598 598 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
599 599 +++ b/c * (glob)
600 600 @@ -0,0 +1,3 @@
601 601 +expand $Id$
602 602 +do not process $Id:
603 603 +xxx $
604 604
605 605 Status after rollback:
606 606
607 607 $ hg rollback
608 608 repository tip rolled back to revision 1 (undo commit)
609 609 working directory now based on revision 1
610 610 $ hg status
611 611 A c
612 612 $ hg update --clean
613 613 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
614 614
615 615 cp symlink file; hg cp -A symlink file (part2)
616 616 - copied symlink points to kw ignored file: do not overwrite
617 617
618 618 $ cat a > i
619 619 $ ln -s i symignored
620 620 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
621 621 $ cp symignored x
622 622 $ hg copy --after --verbose symignored x
623 623 copying symignored to x
624 624 $ head -n 1 x
625 625 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
626 626 $ hg forget x
627 627 $ rm x
628 628
629 629 $ hg rollback
630 630 repository tip rolled back to revision 1 (undo commit)
631 631 working directory now based on revision 1
632 632 $ hg update --clean
633 633 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
634 634 $ rm i symignored
635 635
636 636 Custom keywordmaps as argument to kwdemo
637 637
638 638 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
639 639 [extensions]
640 640 keyword =
641 641 [keyword]
642 642 ** =
643 643 b = ignore
644 644 demo.txt =
645 645 i = ignore
646 646 [keywordset]
647 647 svn = False
648 648 [keywordmaps]
649 649 Xinfo = {author}: {desc}
650 650 $Xinfo: test: hg keyword configuration and expansion example $
651 651
652 652 Configure custom keywordmaps
653 653
654 654 $ cat <<EOF >>$HGRCPATH
655 655 > [keywordmaps]
656 656 > Id = {file} {node|short} {date|rfc822date} {author|user}
657 657 > Xinfo = {author}: {desc}
658 658 > EOF
659 659
660 660 Cat and hg cat files before custom expansion
661 661
662 662 $ cat a b
663 663 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
664 664 do not process $Id:
665 665 xxx $
666 666 ignore $Id$
667 667 $ hg cat sym a b && echo
668 668 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
669 669 do not process $Id:
670 670 xxx $
671 671 ignore $Id$
672 672 a
673 673
674 674 Write custom keyword and prepare multiline commit message
675 675
676 676 $ echo '$Xinfo$' >> a
677 677 $ cat <<EOF >> log
678 678 > firstline
679 679 > secondline
680 680 > EOF
681 681
682 682 Interrupted commit should not change state
683 683
684 684 $ hg commit
685 685 abort: empty commit message
686 686 [255]
687 687 $ hg status
688 688 M a
689 689 ? c
690 690 ? log
691 691
692 692 Commit with multiline message and custom expansion
693 693
694 694 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
695 695 a
696 696 overwriting a expanding keywords
697 697 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
698 698 $ rm log
699 699
700 700 Stat, verify and show custom expansion (firstline)
701 701
702 702 $ hg status
703 703 ? c
704 704 $ hg verify
705 705 checking changesets
706 706 checking manifests
707 707 crosschecking files in changesets and manifests
708 708 checking files
709 709 3 files, 3 changesets, 4 total revisions
710 710 $ cat a b
711 711 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
712 712 do not process $Id:
713 713 xxx $
714 714 $Xinfo: User Name <user@example.com>: firstline $
715 715 ignore $Id$
716 716 $ hg cat sym a b && echo
717 717 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
718 718 do not process $Id:
719 719 xxx $
720 720 $Xinfo: User Name <user@example.com>: firstline $
721 721 ignore $Id$
722 722 a
723 723
724 724 annotate
725 725
726 726 $ hg annotate a
727 727 1: expand $Id$
728 728 1: do not process $Id:
729 729 1: xxx $
730 730 2: $Xinfo$
731 731
732 732 remove with status checks
733 733
734 734 $ hg debugrebuildstate
735 735 $ hg remove a
736 736 $ hg --debug commit -m rma
737 737 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
738 738 $ hg status
739 739 ? c
740 740
741 741 Rollback, revert, and check expansion
742 742
743 743 $ hg rollback
744 744 repository tip rolled back to revision 2 (undo commit)
745 745 working directory now based on revision 2
746 746 $ hg status
747 747 R a
748 748 ? c
749 749 $ hg revert --no-backup --rev tip a
750 750 $ cat a
751 751 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
752 752 do not process $Id:
753 753 xxx $
754 754 $Xinfo: User Name <user@example.com>: firstline $
755 755
756 756 Clone to test global and local configurations
757 757
758 758 $ cd ..
759 759
760 760 Expansion in destinaton with global configuration
761 761
762 762 $ hg --quiet clone Test globalconf
763 763 $ cat globalconf/a
764 764 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
765 765 do not process $Id:
766 766 xxx $
767 767 $Xinfo: User Name <user@example.com>: firstline $
768 768
769 769 No expansion in destination with local configuration in origin only
770 770
771 771 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
772 772 $ cat localconf/a
773 773 expand $Id$
774 774 do not process $Id:
775 775 xxx $
776 776 $Xinfo$
777 777
778 778 Clone to test incoming
779 779
780 780 $ hg clone -r1 Test Test-a
781 781 adding changesets
782 782 adding manifests
783 783 adding file changes
784 784 added 2 changesets with 3 changes to 3 files
785 785 updating to branch default
786 786 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
787 787 $ cd Test-a
788 788 $ cat <<EOF >> .hg/hgrc
789 789 > [paths]
790 790 > default = ../Test
791 791 > EOF
792 792 $ hg incoming
793 793 comparing with $TESTTMP/Test
794 794 searching for changes
795 795 changeset: 2:bb948857c743
796 796 tag: tip
797 797 user: User Name <user@example.com>
798 798 date: Thu Jan 01 00:00:02 1970 +0000
799 799 summary: firstline
800 800
801 801 Imported patch should not be rejected
802 802
803 803 $ python -c \
804 804 > 'import re; s=re.sub("(Id.*)","\\1 rejecttest",open("a").read()); open("a","wb").write(s);'
805 805 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
806 806 a
807 807 overwriting a expanding keywords
808 808 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
809 809 $ hg export -o ../rejecttest.diff tip
810 810 $ cd ../Test
811 811 $ hg import ../rejecttest.diff
812 812 applying ../rejecttest.diff
813 813 $ cat a b
814 814 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
815 815 do not process $Id: rejecttest
816 816 xxx $
817 817 $Xinfo: User Name <user@example.com>: rejects? $
818 818 ignore $Id$
819 819
820 820 $ hg rollback
821 821 repository tip rolled back to revision 2 (undo commit)
822 822 working directory now based on revision 2
823 823 $ hg update --clean
824 824 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
825 825
826 826 kwexpand/kwshrink on selected files
827 827
828 828 $ mkdir x
829 829 $ hg copy a x/a
830 830 $ hg --verbose kwshrink a
831 831 overwriting a shrinking keywords
832 832 $ hg status a
833 833 $ hg --verbose kwexpand a
834 834 overwriting a expanding keywords
835 835 $ hg status a
836 836
837 837 kwexpand x/a should abort
838 838
839 839 $ hg --verbose kwexpand x/a
840 840 abort: outstanding uncommitted changes
841 841 [255]
842 842 $ cd x
843 843 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
844 844 x/a
845 845 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
846 846 overwriting x/a expanding keywords
847 847 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
848 848 $ cat a
849 849 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
850 850 do not process $Id:
851 851 xxx $
852 852 $Xinfo: User Name <user@example.com>: xa $
853 853
854 854 kwshrink a inside directory x
855 855
856 856 $ hg --verbose kwshrink a
857 857 overwriting x/a shrinking keywords
858 858 $ cat a
859 859 expand $Id$
860 860 do not process $Id:
861 861 xxx $
862 862 $Xinfo$
863 863 $ cd ..
864 864
865 865 kwexpand nonexistent
866 866
867 867 $ hg kwexpand nonexistent
868 868 nonexistent:* (glob)
869 869
870 870
871 871 hg serve
872 872 - expand with hgweb file
873 873 - no expansion with hgweb annotate/changeset/filediff
874 874 - check errors
875 875
876 876 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
877 877 $ cat hg.pid >> $DAEMON_PIDS
878 878 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/file/tip/a/?style=raw'
879 879 200 Script output follows
880 880
881 881 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
882 882 do not process $Id:
883 883 xxx $
884 884 $Xinfo: User Name <user@example.com>: firstline $
885 885 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/annotate/tip/a/?style=raw'
886 886 200 Script output follows
887 887
888 888
889 889 user@1: expand $Id$
890 890 user@1: do not process $Id:
891 891 user@1: xxx $
892 892 user@2: $Xinfo$
893 893
894 894
895 895
896 896
897 897 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw'
898 898 200 Script output follows
899 899
900 900
901 901 # HG changeset patch
902 902 # User User Name <user@example.com>
903 903 # Date 3 0
904 904 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
905 905 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
906 906 xa
907 907
908 908 diff -r bb948857c743 -r b4560182a3f9 x/a
909 909 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
910 910 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
911 911 @@ -0,0 +1,4 @@
912 912 +expand $Id$
913 913 +do not process $Id:
914 914 +xxx $
915 915 +$Xinfo$
916 916
917 917 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
918 918 200 Script output follows
919 919
920 920
921 921 diff -r ef63ca68695b -r bb948857c743 a
922 922 --- a/a Thu Jan 01 00:00:00 1970 +0000
923 923 +++ b/a Thu Jan 01 00:00:02 1970 +0000
924 924 @@ -1,3 +1,4 @@
925 925 expand $Id$
926 926 do not process $Id:
927 927 xxx $
928 928 +$Xinfo$
929 929
930 930
931 931
932 932
933 933 $ cat errors.log
934 934
935 935 Prepare merge and resolve tests
936 936
937 937 $ echo '$Id$' > m
938 938 $ hg add m
939 939 $ hg commit -m 4kw
940 940 $ echo foo >> m
941 941 $ hg commit -m 5foo
942 942
943 943 simplemerge
944 944
945 945 $ hg update 4
946 946 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
947 947 $ echo foo >> m
948 948 $ hg commit -m 6foo
949 949 created new head
950 950 $ hg merge
951 951 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
952 952 (branch merge, don't forget to commit)
953 953 $ hg commit -m simplemerge
954 954 $ cat m
955 955 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
956 956 foo
957 957
958 958 conflict: keyword should stay outside conflict zone
959 959
960 960 $ hg update 4
961 961 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
962 962 $ echo bar >> m
963 963 $ hg commit -m 8bar
964 964 created new head
965 965 $ hg merge
966 966 merging m
967 967 warning: conflicts during merge.
968 968 merging m failed!
969 969 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
970 970 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
971 971 [1]
972 972 $ cat m
973 973 $Id$
974 974 <<<<<<< local
975 975 bar
976 976 =======
977 977 foo
978 978 >>>>>>> other
979 979
980 980 resolve to local
981 981
982 982 $ HGMERGE=internal:local hg resolve -a
983 983 $ hg commit -m localresolve
984 984 $ cat m
985 985 $Id: m 41efa6d38e9b Thu, 01 Jan 1970 00:00:00 +0000 test $
986 986 bar
987 987
988 988 Test restricted mode with transplant -b
989 989
990 990 $ hg update 6
991 991 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
992 992 $ hg branch foo
993 993 marked working directory as branch foo
994 994 $ mv a a.bak
995 995 $ echo foobranch > a
996 996 $ cat a.bak >> a
997 997 $ rm a.bak
998 998 $ hg commit -m 9foobranch
999 999 $ hg update default
1000 1000 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1001 1001 $ hg -y transplant -b foo tip
1002 1002 applying 4aa30d025d50
1003 1003 4aa30d025d50 transplanted to 5a4da427c162
1004 1004
1005 1005 Expansion in changeset but not in file
1006 1006
1007 1007 $ hg tip -p
1008 1008 changeset: 11:5a4da427c162
1009 1009 tag: tip
1010 1010 parent: 9:41efa6d38e9b
1011 1011 user: test
1012 1012 date: Thu Jan 01 00:00:00 1970 +0000
1013 1013 summary: 9foobranch
1014 1014
1015 1015 diff -r 41efa6d38e9b -r 5a4da427c162 a
1016 1016 --- a/a Thu Jan 01 00:00:00 1970 +0000
1017 1017 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1018 1018 @@ -1,3 +1,4 @@
1019 1019 +foobranch
1020 1020 expand $Id$
1021 1021 do not process $Id:
1022 1022 xxx $
1023 1023
1024 1024 $ head -n 2 a
1025 1025 foobranch
1026 1026 expand $Id: a 5a4da427c162 Thu, 01 Jan 1970 00:00:00 +0000 test $
1027 1027
1028 1028 Turn off expansion
1029 1029
1030 1030 $ hg -q rollback
1031 1031 $ hg -q update -C
1032 1032
1033 1033 kwshrink with unknown file u
1034 1034
1035 1035 $ cp a u
1036 1036 $ hg --verbose kwshrink
1037 1037 overwriting a shrinking keywords
1038 1038 overwriting m shrinking keywords
1039 1039 overwriting x/a shrinking keywords
1040 1040
1041 1041 Keywords shrunk in working directory, but not yet disabled
1042 1042 - cat shows unexpanded keywords
1043 1043 - hg cat shows expanded keywords
1044 1044
1045 1045 $ cat a b
1046 1046 expand $Id$
1047 1047 do not process $Id:
1048 1048 xxx $
1049 1049 $Xinfo$
1050 1050 ignore $Id$
1051 1051 $ hg cat sym a b && echo
1052 1052 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1053 1053 do not process $Id:
1054 1054 xxx $
1055 1055 $Xinfo: User Name <user@example.com>: firstline $
1056 1056 ignore $Id$
1057 1057 a
1058 1058
1059 1059 Now disable keyword expansion
1060 1060
1061 1061 $ rm "$HGRCPATH"
1062 1062 $ cat a b
1063 1063 expand $Id$
1064 1064 do not process $Id:
1065 1065 xxx $
1066 1066 $Xinfo$
1067 1067 ignore $Id$
1068 1068 $ hg cat sym a b && echo
1069 1069 expand $Id$
1070 1070 do not process $Id:
1071 1071 xxx $
1072 1072 $Xinfo$
1073 1073 ignore $Id$
1074 1074 a
@@ -1,65 +1,65 b''
1 1 Source bundle was generated with the following script:
2 2
3 3 # hg init
4 4 # echo a > a
5 5 # ln -s a l
6 6 # hg ci -Ama -d'0 0'
7 7 # mkdir b
8 8 # echo a > b/a
9 9 # chmod +x b/a
10 10 # hg ci -Amb -d'1 0'
11 11
12 12 $ hg init
13 $ hg -q pull "$TESTDIR/test-manifest.hg"
13 $ hg -q pull "$TESTDIR/bundles/test-manifest.hg"
14 14
15 15 The next call is expected to return nothing:
16 16
17 17 $ hg manifest
18 18
19 19 $ hg co
20 20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 21
22 22 $ hg manifest
23 23 a
24 24 b/a
25 25 l
26 26
27 27 $ hg manifest -v
28 28 644 a
29 29 755 * b/a
30 30 644 @ l
31 31
32 32 $ hg manifest --debug
33 33 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
34 34 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
35 35 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
36 36
37 37 $ hg manifest -r 0
38 38 a
39 39 l
40 40
41 41 $ hg manifest -r 1
42 42 a
43 43 b/a
44 44 l
45 45
46 46 $ hg manifest -r tip
47 47 a
48 48 b/a
49 49 l
50 50
51 51 $ hg manifest tip
52 52 a
53 53 b/a
54 54 l
55 55
56 56
57 57 The next two calls are expected to abort:
58 58
59 59 $ hg manifest -r 2
60 60 abort: unknown revision '2'!
61 61 [255]
62 62
63 63 $ hg manifest -r tip tip
64 64 abort: please specify just one revision
65 65 [255]
@@ -1,62 +1,62 b''
1 1
2 2 $ cat > echo.py <<EOF
3 3 > #!/usr/bin/env python
4 4 > import os, sys
5 5 > try:
6 6 > import msvcrt
7 7 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
8 8 > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
9 9 > except ImportError:
10 10 > pass
11 11 >
12 12 > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
13 13 > print k, os.environ[k]
14 14 > EOF
15 15
16 16 Create 2 heads containing the same file, once as
17 17 a file, once as a link. Bundle was generated with:
18 18
19 19 # hg init t
20 20 # cd t
21 21 # echo a > a
22 22 # hg ci -qAm t0 -d '0 0'
23 23 # echo l > l
24 24 # hg ci -qAm t1 -d '1 0'
25 25 # hg up -C 0
26 26 # ln -s a l
27 27 # hg ci -qAm t2 -d '2 0'
28 28 # echo l2 > l2
29 29 # hg ci -qAm t3 -d '3 0'
30 30
31 31 $ hg init t
32 32 $ cd t
33 $ hg -q pull "$TESTDIR/test-merge-symlinks.hg"
33 $ hg -q pull "$TESTDIR/bundles/test-merge-symlinks.hg"
34 34 $ hg up -C 3
35 35 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 36
37 37 Merge them and display *_ISLINK vars
38 38 merge heads
39 39
40 40 $ hg merge --tool="python ../echo.py"
41 41 merging l
42 42 HG_FILE l
43 43 HG_MY_ISLINK 1
44 44 HG_OTHER_ISLINK 0
45 45 HG_BASE_ISLINK 0
46 46 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
47 47 (branch merge, don't forget to commit)
48 48
49 49 Test working directory symlink bit calculation wrt copies,
50 50 especially on non-supporting systems.
51 51 merge working directory
52 52
53 53 $ hg up -C 2
54 54 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
55 55 $ hg copy l l2
56 56 $ HGMERGE="python ../echo.py" hg up 3
57 57 merging l2
58 58 HG_FILE l2
59 59 HG_MY_ISLINK 1
60 60 HG_OTHER_ISLINK 0
61 61 HG_BASE_ISLINK 0
62 62 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -1,59 +1,59 b''
1 1 $ "$TESTDIR/hghave" no-symlink || exit 80
2 2
3 3 # The following script was used to create the bundle:
4 4 #
5 5 # hg init symlinks
6 6 # cd symlinks
7 7 # echo a > a
8 8 # mkdir d
9 9 # echo b > d/b
10 10 # ln -s a a.lnk
11 11 # ln -s d/b d/b.lnk
12 12 # hg ci -Am t
13 13 # hg bundle --base null ../test-no-symlinks.hg
14 14
15 15 Extract a symlink on a platform not supporting them
16 16
17 17 $ hg init t
18 18 $ cd t
19 $ hg pull -q "$TESTDIR/test-no-symlinks.hg"
19 $ hg pull -q "$TESTDIR/bundles/test-no-symlinks.hg"
20 20 $ hg update
21 21 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 22 $ cat a.lnk && echo
23 23 a
24 24 $ cat d/b.lnk && echo
25 25 d/b
26 26
27 27 Copy a symlink and move another
28 28
29 29 $ hg copy a.lnk d/a2.lnk
30 30 $ hg mv d/b.lnk b2.lnk
31 31 $ hg ci -Am copy
32 32 $ cat d/a2.lnk && echo
33 33 a
34 34 $ cat b2.lnk && echo
35 35 d/b
36 36
37 37 Bundle and extract again
38 38
39 39 $ hg bundle --base null ../symlinks.hg
40 40 2 changesets found
41 41 $ cd ..
42 42 $ hg init t2
43 43 $ cd t2
44 44 $ hg pull ../symlinks.hg
45 45 pulling from ../symlinks.hg
46 46 requesting all changes
47 47 adding changesets
48 48 adding manifests
49 49 adding file changes
50 50 added 2 changesets with 6 changes to 6 files
51 51 (run 'hg update' to get a working copy)
52 52 $ hg update
53 53 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 54 $ cat a.lnk && echo
55 55 a
56 56 $ cat d/a2.lnk && echo
57 57 a
58 58 $ cat b2.lnk && echo
59 59 d/b
General Comments 0
You need to be logged in to leave comments. Login now