Show More
@@ -1,84 +1,90 | |||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |
|
2 | ||
|
3 | 1 |
|
|
4 | 2 | |
|
5 | should fail | |
|
3 | audit of .hg | |
|
6 | 4 | |
|
7 | 5 | $ hg add .hg/00changelog.i |
|
8 | 6 | abort: path contains illegal component: .hg/00changelog.i (glob) |
|
9 | 7 | [255] |
|
10 | 8 | |
|
9 | #if symlink | |
|
10 | ||
|
11 | Symlinks | |
|
12 | ||
|
11 | 13 | $ mkdir a |
|
12 | 14 | $ echo a > a/a |
|
13 | 15 | $ hg ci -Ama |
|
14 | 16 | adding a/a |
|
15 | 17 | $ ln -s a b |
|
16 | 18 | $ echo b > a/b |
|
17 | ||
|
18 | should fail | |
|
19 | ||
|
20 | 19 | $ hg add b/b |
|
21 | 20 | abort: path 'b/b' traverses symbolic link 'b' (glob) |
|
22 | 21 | [255] |
|
23 | ||
|
24 | should succeed | |
|
25 | ||
|
26 | 22 | $ hg add b |
|
27 | 23 | |
|
28 | 24 | should still fail - maybe |
|
29 | 25 | |
|
30 | 26 | $ hg add b/b |
|
31 | 27 | abort: path 'b/b' traverses symbolic link 'b' (glob) |
|
32 | 28 | [255] |
|
33 | 29 | |
|
30 | #endif | |
|
31 | ||
|
32 | ||
|
34 | 33 | unbundle tampered bundle |
|
35 | 34 | |
|
36 | 35 | $ hg init target |
|
37 | 36 | $ cd target |
|
38 | 37 | $ hg unbundle "$TESTDIR/bundles/tampered.hg" |
|
39 | 38 | adding changesets |
|
40 | 39 | adding manifests |
|
41 | 40 | adding file changes |
|
42 | 41 | added 5 changesets with 6 changes to 6 files (+4 heads) |
|
43 | 42 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
44 | 43 | |
|
45 | 44 | attack .hg/test |
|
46 | 45 | |
|
47 | 46 | $ hg manifest -r0 |
|
48 | 47 | .hg/test |
|
49 | 48 | $ hg update -Cr0 |
|
50 | abort: path contains illegal component: .hg/test | |
|
49 | abort: path contains illegal component: .hg/test (glob) | |
|
51 | 50 | [255] |
|
52 | 51 | |
|
53 | 52 | attack foo/.hg/test |
|
54 | 53 | |
|
55 | 54 | $ hg manifest -r1 |
|
56 | 55 | foo/.hg/test |
|
57 | 56 | $ hg update -Cr1 |
|
58 | abort: path 'foo/.hg/test' is inside nested repo 'foo' | |
|
57 | abort: path 'foo/.hg/test' is inside nested repo 'foo' (glob) | |
|
59 | 58 | [255] |
|
60 | 59 | |
|
61 | 60 | attack back/test where back symlinks to .. |
|
62 | 61 | |
|
63 | 62 | $ hg manifest -r2 |
|
64 | 63 | back |
|
65 | 64 | back/test |
|
65 | #if symlink | |
|
66 | 66 | $ hg update -Cr2 |
|
67 | 67 | abort: path 'back/test' traverses symbolic link 'back' |
|
68 | 68 | [255] |
|
69 | #else | |
|
70 | ('back' will be a file and cause some other system specific error) | |
|
71 | $ hg update -Cr2 | |
|
72 | abort: * (glob) | |
|
73 | [255] | |
|
74 | #endif | |
|
69 | 75 | |
|
70 | 76 | attack ../test |
|
71 | 77 | |
|
72 | 78 | $ hg manifest -r3 |
|
73 | 79 | ../test |
|
74 | 80 | $ hg update -Cr3 |
|
75 | abort: path contains illegal component: ../test | |
|
81 | abort: path contains illegal component: ../test (glob) | |
|
76 | 82 | [255] |
|
77 | 83 | |
|
78 | 84 | attack /tmp/test |
|
79 | 85 | |
|
80 | 86 | $ hg manifest -r4 |
|
81 | 87 | /tmp/test |
|
82 | 88 | $ hg update -Cr4 |
|
83 | 89 | abort: *: $TESTTMP/target//tmp/test (glob) |
|
84 | 90 | [255] |
@@ -1,1125 +1,1129 | |||
|
1 |
$ "$TESTDIR/hghave" |
|
|
1 | $ "$TESTDIR/hghave" unix-permissions serve || exit 80 | |
|
2 | 2 | |
|
3 | 3 | $ cat <<EOF >> $HGRCPATH |
|
4 | 4 | > [extensions] |
|
5 | 5 | > keyword = |
|
6 | 6 | > mq = |
|
7 | 7 | > notify = |
|
8 | 8 | > record = |
|
9 | 9 | > transplant = |
|
10 | 10 | > [ui] |
|
11 | 11 | > interactive = true |
|
12 | 12 | > EOF |
|
13 | 13 | |
|
14 | 14 | Run kwdemo before [keyword] files are set up |
|
15 | 15 | as it would succeed without uisetup otherwise |
|
16 | 16 | |
|
17 | 17 | $ hg --quiet kwdemo |
|
18 | 18 | [extensions] |
|
19 | 19 | keyword = |
|
20 | 20 | [keyword] |
|
21 | 21 | demo.txt = |
|
22 | 22 | [keywordset] |
|
23 | 23 | svn = False |
|
24 | 24 | [keywordmaps] |
|
25 | 25 | Author = {author|user} |
|
26 | 26 | Date = {date|utcdate} |
|
27 | 27 | Header = {root}/{file},v {node|short} {date|utcdate} {author|user} |
|
28 | 28 | Id = {file|basename},v {node|short} {date|utcdate} {author|user} |
|
29 | 29 | RCSFile = {file|basename},v |
|
30 | 30 | RCSfile = {file|basename},v |
|
31 | 31 | Revision = {node|short} |
|
32 | 32 | Source = {root}/{file},v |
|
33 | 33 | $Author: test $ |
|
34 | 34 | $Date: ????/??/?? ??:??:?? $ (glob) |
|
35 | 35 | $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) |
|
36 | 36 | $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) |
|
37 | 37 | $RCSFile: demo.txt,v $ |
|
38 | 38 | $RCSfile: demo.txt,v $ |
|
39 | 39 | $Revision: ???????????? $ (glob) |
|
40 | 40 | $Source: */demo.txt,v $ (glob) |
|
41 | 41 | |
|
42 | 42 | $ hg --quiet kwdemo "Branch = {branches}" |
|
43 | 43 | [extensions] |
|
44 | 44 | keyword = |
|
45 | 45 | [keyword] |
|
46 | 46 | demo.txt = |
|
47 | 47 | [keywordset] |
|
48 | 48 | svn = False |
|
49 | 49 | [keywordmaps] |
|
50 | 50 | Branch = {branches} |
|
51 | 51 | $Branch: demobranch $ |
|
52 | 52 | |
|
53 | 53 | $ cat <<EOF >> $HGRCPATH |
|
54 | 54 | > [keyword] |
|
55 | 55 | > ** = |
|
56 | 56 | > b = ignore |
|
57 | 57 | > i = ignore |
|
58 | 58 | > [hooks] |
|
59 | 59 | > EOF |
|
60 | 60 | $ cp $HGRCPATH $HGRCPATH.nohooks |
|
61 | 61 | > cat <<EOF >> $HGRCPATH |
|
62 | 62 | > commit= |
|
63 | 63 | > commit.test=cp a hooktest |
|
64 | 64 | > EOF |
|
65 | 65 | |
|
66 | 66 | $ hg init Test-bndl |
|
67 | 67 | $ cd Test-bndl |
|
68 | 68 | |
|
69 | 69 | kwshrink should exit silently in empty/invalid repo |
|
70 | 70 | |
|
71 | 71 | $ hg kwshrink |
|
72 | 72 | |
|
73 | 73 | Symlinks cannot be created on Windows. |
|
74 | 74 | A bundle to test this was made with: |
|
75 | 75 | hg init t |
|
76 | 76 | cd t |
|
77 | 77 | echo a > a |
|
78 | 78 | ln -s a sym |
|
79 | 79 | hg add sym |
|
80 | 80 | hg ci -m addsym -u mercurial |
|
81 | 81 | hg bundle --base null ../test-keyword.hg |
|
82 | 82 | |
|
83 | 83 | $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg |
|
84 | 84 | pulling from *test-keyword.hg (glob) |
|
85 | 85 | requesting all changes |
|
86 | 86 | adding changesets |
|
87 | 87 | adding manifests |
|
88 | 88 | adding file changes |
|
89 | 89 | added 1 changesets with 1 changes to 1 files |
|
90 | 90 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
91 | 91 | |
|
92 | 92 | $ echo 'expand $Id$' > a |
|
93 | 93 | $ echo 'do not process $Id:' >> a |
|
94 | 94 | $ echo 'xxx $' >> a |
|
95 | 95 | $ echo 'ignore $Id$' > b |
|
96 | 96 | |
|
97 | 97 | Output files as they were created |
|
98 | 98 | |
|
99 | 99 | $ cat a b |
|
100 | 100 | expand $Id$ |
|
101 | 101 | do not process $Id: |
|
102 | 102 | xxx $ |
|
103 | 103 | ignore $Id$ |
|
104 | 104 | |
|
105 | 105 | no kwfiles |
|
106 | 106 | |
|
107 | 107 | $ hg kwfiles |
|
108 | 108 | |
|
109 | 109 | untracked candidates |
|
110 | 110 | |
|
111 | 111 | $ hg -v kwfiles --unknown |
|
112 | 112 | k a |
|
113 | 113 | |
|
114 | 114 | Add files and check status |
|
115 | 115 | |
|
116 | 116 | $ hg addremove |
|
117 | 117 | adding a |
|
118 | 118 | adding b |
|
119 | 119 | $ hg status |
|
120 | 120 | A a |
|
121 | 121 | A b |
|
122 | 122 | |
|
123 | 123 | |
|
124 | 124 | Default keyword expansion including commit hook |
|
125 | 125 | Interrupted commit should not change state or run commit hook |
|
126 | 126 | |
|
127 | 127 | $ hg --debug commit |
|
128 | 128 | abort: empty commit message |
|
129 | 129 | [255] |
|
130 | 130 | $ hg status |
|
131 | 131 | A a |
|
132 | 132 | A b |
|
133 | 133 | |
|
134 | 134 | Commit with several checks |
|
135 | 135 | |
|
136 | 136 | $ hg --debug commit -mabsym -u 'User Name <user@example.com>' |
|
137 | 137 | a |
|
138 | 138 | b |
|
139 | 139 | overwriting a expanding keywords |
|
140 | 140 | running hook commit.test: cp a hooktest |
|
141 | 141 | committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9 |
|
142 | 142 | $ hg status |
|
143 | 143 | ? hooktest |
|
144 | 144 | $ hg debugrebuildstate |
|
145 | 145 | $ hg --quiet identify |
|
146 | 146 | ef63ca68695b |
|
147 | 147 | |
|
148 | 148 | cat files in working directory with keywords expanded |
|
149 | 149 | |
|
150 | 150 | $ cat a b |
|
151 | 151 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
152 | 152 | do not process $Id: |
|
153 | 153 | xxx $ |
|
154 | 154 | ignore $Id$ |
|
155 | 155 | |
|
156 | 156 | hg cat files and symlink, no expansion |
|
157 | 157 | |
|
158 | 158 | $ hg cat sym a b && echo |
|
159 | 159 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
160 | 160 | do not process $Id: |
|
161 | 161 | xxx $ |
|
162 | 162 | ignore $Id$ |
|
163 | 163 | a |
|
164 | 164 | |
|
165 | 165 | $ diff a hooktest |
|
166 | 166 | |
|
167 | 167 | $ cp $HGRCPATH.nohooks $HGRCPATH |
|
168 | 168 | $ rm hooktest |
|
169 | 169 | |
|
170 | 170 | hg status of kw-ignored binary file starting with '\1\n' |
|
171 | 171 | |
|
172 | 172 | >>> open("i", "wb").write("\1\nfoo") |
|
173 | 173 | $ hg -q commit -Am metasep i |
|
174 | 174 | $ hg status |
|
175 | 175 | >>> open("i", "wb").write("\1\nbar") |
|
176 | 176 | $ hg status |
|
177 | 177 | M i |
|
178 | 178 | $ hg -q commit -m "modify metasep" i |
|
179 | 179 | $ hg status --rev 2:3 |
|
180 | 180 | M i |
|
181 | 181 | $ touch empty |
|
182 | 182 | $ hg -q commit -A -m "another file" |
|
183 | 183 | $ hg status -A --rev 3:4 i |
|
184 | 184 | C i |
|
185 | 185 | |
|
186 | 186 | $ hg -q strip -n 2 |
|
187 | 187 | |
|
188 | 188 | Test hook execution |
|
189 | 189 | |
|
190 | 190 | bundle |
|
191 | 191 | |
|
192 | 192 | $ hg bundle --base null ../kw.hg |
|
193 | 193 | 2 changesets found |
|
194 | 194 | $ cd .. |
|
195 | 195 | $ hg init Test |
|
196 | 196 | $ cd Test |
|
197 | 197 | |
|
198 | 198 | Notify on pull to check whether keywords stay as is in email |
|
199 | 199 | ie. if patch.diff wrapper acts as it should |
|
200 | 200 | |
|
201 | 201 | $ cat <<EOF >> $HGRCPATH |
|
202 | 202 | > [hooks] |
|
203 | 203 | > incoming.notify = python:hgext.notify.hook |
|
204 | 204 | > [notify] |
|
205 | 205 | > sources = pull |
|
206 | 206 | > diffstat = False |
|
207 | 207 | > maxsubject = 15 |
|
208 | 208 | > [reposubs] |
|
209 | 209 | > * = Test |
|
210 | 210 | > EOF |
|
211 | 211 | |
|
212 | 212 | Pull from bundle and trigger notify |
|
213 | 213 | |
|
214 | 214 | $ hg pull -u ../kw.hg |
|
215 | 215 | pulling from ../kw.hg |
|
216 | 216 | requesting all changes |
|
217 | 217 | adding changesets |
|
218 | 218 | adding manifests |
|
219 | 219 | adding file changes |
|
220 | 220 | added 2 changesets with 3 changes to 3 files |
|
221 | 221 | Content-Type: text/plain; charset="us-ascii" |
|
222 | 222 | MIME-Version: 1.0 |
|
223 | 223 | Content-Transfer-Encoding: 7bit |
|
224 | 224 | Date: * (glob) |
|
225 | 225 | Subject: changeset in... |
|
226 | 226 | From: mercurial |
|
227 | 227 | X-Hg-Notification: changeset a2392c293916 |
|
228 | 228 | Message-Id: <hg.a2392c293916*> (glob) |
|
229 | 229 | To: Test |
|
230 | 230 | |
|
231 | 231 | changeset a2392c293916 in $TESTTMP/Test (glob) |
|
232 | 232 | details: $TESTTMP/Test?cmd=changeset;node=a2392c293916 |
|
233 | 233 | description: |
|
234 | 234 | addsym |
|
235 | 235 | |
|
236 | 236 | diffs (6 lines): |
|
237 | 237 | |
|
238 | 238 | diff -r 000000000000 -r a2392c293916 sym |
|
239 | 239 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
240 | 240 | +++ b/sym Sat Feb 09 20:25:47 2008 +0100 |
|
241 | 241 | @@ -0,0 +1,1 @@ |
|
242 | 242 | +a |
|
243 | 243 | \ No newline at end of file |
|
244 | 244 | Content-Type: text/plain; charset="us-ascii" |
|
245 | 245 | MIME-Version: 1.0 |
|
246 | 246 | Content-Transfer-Encoding: 7bit |
|
247 | 247 | Date:* (glob) |
|
248 | 248 | Subject: changeset in... |
|
249 | 249 | From: User Name <user@example.com> |
|
250 | 250 | X-Hg-Notification: changeset ef63ca68695b |
|
251 | 251 | Message-Id: <hg.ef63ca68695b*> (glob) |
|
252 | 252 | To: Test |
|
253 | 253 | |
|
254 | 254 | changeset ef63ca68695b in $TESTTMP/Test (glob) |
|
255 | 255 | details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b |
|
256 | 256 | description: |
|
257 | 257 | absym |
|
258 | 258 | |
|
259 | 259 | diffs (12 lines): |
|
260 | 260 | |
|
261 | 261 | diff -r a2392c293916 -r ef63ca68695b a |
|
262 | 262 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
263 | 263 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
264 | 264 | @@ -0,0 +1,3 @@ |
|
265 | 265 | +expand $Id$ |
|
266 | 266 | +do not process $Id: |
|
267 | 267 | +xxx $ |
|
268 | 268 | diff -r a2392c293916 -r ef63ca68695b b |
|
269 | 269 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
270 | 270 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 |
|
271 | 271 | @@ -0,0 +1,1 @@ |
|
272 | 272 | +ignore $Id$ |
|
273 | 273 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
274 | 274 | |
|
275 | 275 | $ cp $HGRCPATH.nohooks $HGRCPATH |
|
276 | 276 | |
|
277 | 277 | Touch files and check with status |
|
278 | 278 | |
|
279 | 279 | $ touch a b |
|
280 | 280 | $ hg status |
|
281 | 281 | |
|
282 | 282 | Update and expand |
|
283 | 283 | |
|
284 | 284 | $ rm sym a b |
|
285 | 285 | $ hg update -C |
|
286 | 286 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
287 | 287 | $ cat a b |
|
288 | 288 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
289 | 289 | do not process $Id: |
|
290 | 290 | xxx $ |
|
291 | 291 | ignore $Id$ |
|
292 | 292 | |
|
293 | 293 | Check whether expansion is filewise and file mode is preserved |
|
294 | 294 | |
|
295 | 295 | $ echo '$Id$' > c |
|
296 | 296 | $ echo 'tests for different changenodes' >> c |
|
297 | 297 | $ chmod 600 c |
|
298 | 298 | $ ls -l c | cut -b 1-10 |
|
299 | 299 | -rw------- |
|
300 | 300 | |
|
301 | 301 | commit file c |
|
302 | 302 | |
|
303 | 303 | $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>' |
|
304 | 304 | adding c |
|
305 | 305 | $ ls -l c | cut -b 1-10 |
|
306 | 306 | -rw------- |
|
307 | 307 | |
|
308 | 308 | force expansion |
|
309 | 309 | |
|
310 | 310 | $ hg -v kwexpand |
|
311 | 311 | overwriting a expanding keywords |
|
312 | 312 | overwriting c expanding keywords |
|
313 | 313 | |
|
314 | 314 | compare changenodes in a and c |
|
315 | 315 | |
|
316 | 316 | $ cat a c |
|
317 | 317 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
318 | 318 | do not process $Id: |
|
319 | 319 | xxx $ |
|
320 | 320 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
321 | 321 | tests for different changenodes |
|
322 | 322 | |
|
323 | 323 | record |
|
324 | 324 | |
|
325 | 325 | $ echo '$Id$' > r |
|
326 | 326 | $ hg add r |
|
327 | 327 | |
|
328 | 328 | record chunk |
|
329 | 329 | |
|
330 | 330 | >>> lines = open('a').readlines() |
|
331 | 331 | >>> lines.insert(1, 'foo\n') |
|
332 | 332 | >>> lines.append('bar\n') |
|
333 | 333 | >>> open('a', 'w').writelines(lines) |
|
334 | 334 | $ hg record -d '1 10' -m rectest a<<EOF |
|
335 | 335 | > y |
|
336 | 336 | > y |
|
337 | 337 | > n |
|
338 | 338 | > EOF |
|
339 | 339 | diff --git a/a b/a |
|
340 | 340 | 2 hunks, 2 lines changed |
|
341 | 341 | examine changes to 'a'? [Ynesfdaq?] |
|
342 | 342 | @@ -1,3 +1,4 @@ |
|
343 | 343 | expand $Id$ |
|
344 | 344 | +foo |
|
345 | 345 | do not process $Id: |
|
346 | 346 | xxx $ |
|
347 | 347 | record change 1/2 to 'a'? [Ynesfdaq?] |
|
348 | 348 | @@ -2,2 +3,3 @@ |
|
349 | 349 | do not process $Id: |
|
350 | 350 | xxx $ |
|
351 | 351 | +bar |
|
352 | 352 | record change 2/2 to 'a'? [Ynesfdaq?] |
|
353 | 353 | |
|
354 | 354 | $ hg identify |
|
355 | 355 | d17e03c92c97+ tip |
|
356 | 356 | $ hg status |
|
357 | 357 | M a |
|
358 | 358 | A r |
|
359 | 359 | |
|
360 | 360 | Cat modified file a |
|
361 | 361 | |
|
362 | 362 | $ cat a |
|
363 | 363 | expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $ |
|
364 | 364 | foo |
|
365 | 365 | do not process $Id: |
|
366 | 366 | xxx $ |
|
367 | 367 | bar |
|
368 | 368 | |
|
369 | 369 | Diff remaining chunk |
|
370 | 370 | |
|
371 | 371 | $ hg diff a |
|
372 | 372 | diff -r d17e03c92c97 a |
|
373 | 373 | --- a/a Wed Dec 31 23:59:51 1969 -0000 |
|
374 | 374 | +++ b/a * (glob) |
|
375 | 375 | @@ -2,3 +2,4 @@ |
|
376 | 376 | foo |
|
377 | 377 | do not process $Id: |
|
378 | 378 | xxx $ |
|
379 | 379 | +bar |
|
380 | 380 | |
|
381 | 381 | $ hg rollback |
|
382 | 382 | repository tip rolled back to revision 2 (undo commit) |
|
383 | 383 | working directory now based on revision 2 |
|
384 | 384 | |
|
385 | 385 | Record all chunks in file a |
|
386 | 386 | |
|
387 | 387 | $ echo foo > msg |
|
388 | 388 | |
|
389 | 389 | - do not use "hg record -m" here! |
|
390 | 390 | |
|
391 | 391 | $ hg record -l msg -d '1 11' a<<EOF |
|
392 | 392 | > y |
|
393 | 393 | > y |
|
394 | 394 | > y |
|
395 | 395 | > EOF |
|
396 | 396 | diff --git a/a b/a |
|
397 | 397 | 2 hunks, 2 lines changed |
|
398 | 398 | examine changes to 'a'? [Ynesfdaq?] |
|
399 | 399 | @@ -1,3 +1,4 @@ |
|
400 | 400 | expand $Id$ |
|
401 | 401 | +foo |
|
402 | 402 | do not process $Id: |
|
403 | 403 | xxx $ |
|
404 | 404 | record change 1/2 to 'a'? [Ynesfdaq?] |
|
405 | 405 | @@ -2,2 +3,3 @@ |
|
406 | 406 | do not process $Id: |
|
407 | 407 | xxx $ |
|
408 | 408 | +bar |
|
409 | 409 | record change 2/2 to 'a'? [Ynesfdaq?] |
|
410 | 410 | |
|
411 | 411 | File a should be clean |
|
412 | 412 | |
|
413 | 413 | $ hg status -A a |
|
414 | 414 | C a |
|
415 | 415 | |
|
416 | 416 | rollback and revert expansion |
|
417 | 417 | |
|
418 | 418 | $ cat a |
|
419 | 419 | expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $ |
|
420 | 420 | foo |
|
421 | 421 | do not process $Id: |
|
422 | 422 | xxx $ |
|
423 | 423 | bar |
|
424 | 424 | $ hg --verbose rollback |
|
425 | 425 | repository tip rolled back to revision 2 (undo commit) |
|
426 | 426 | working directory now based on revision 2 |
|
427 | 427 | overwriting a expanding keywords |
|
428 | 428 | $ hg status a |
|
429 | 429 | M a |
|
430 | 430 | $ cat a |
|
431 | 431 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
432 | 432 | foo |
|
433 | 433 | do not process $Id: |
|
434 | 434 | xxx $ |
|
435 | 435 | bar |
|
436 | 436 | $ echo '$Id$' > y |
|
437 | 437 | $ echo '$Id$' > z |
|
438 | 438 | $ hg add y |
|
439 | 439 | $ hg commit -Am "rollback only" z |
|
440 | 440 | $ cat z |
|
441 | 441 | $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $ |
|
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 z shrinking keywords |
|
446 | 446 | |
|
447 | 447 | Only z should be overwritten |
|
448 | 448 | |
|
449 | 449 | $ hg status a y z |
|
450 | 450 | M a |
|
451 | 451 | A y |
|
452 | 452 | A z |
|
453 | 453 | $ cat z |
|
454 | 454 | $Id$ |
|
455 | 455 | $ hg forget y z |
|
456 | 456 | $ rm y z |
|
457 | 457 | |
|
458 | 458 | record added file alone |
|
459 | 459 | |
|
460 | 460 | $ hg -v record -l msg -d '1 12' r<<EOF |
|
461 | 461 | > y |
|
462 | 462 | > EOF |
|
463 | 463 | diff --git a/r b/r |
|
464 | 464 | new file mode 100644 |
|
465 | 465 | examine changes to 'r'? [Ynesfdaq?] |
|
466 | 466 | r |
|
467 | 467 | committed changeset 3:899491280810 |
|
468 | 468 | overwriting r expanding keywords |
|
469 | 469 | - status call required for dirstate.normallookup() check |
|
470 | 470 | $ hg status r |
|
471 | 471 | $ hg --verbose rollback |
|
472 | 472 | repository tip rolled back to revision 2 (undo commit) |
|
473 | 473 | working directory now based on revision 2 |
|
474 | 474 | overwriting r shrinking keywords |
|
475 | 475 | $ hg forget r |
|
476 | 476 | $ rm msg r |
|
477 | 477 | $ hg update -C |
|
478 | 478 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
479 | 479 | |
|
480 | 480 | record added keyword ignored file |
|
481 | 481 | |
|
482 | 482 | $ echo '$Id$' > i |
|
483 | 483 | $ hg add i |
|
484 | 484 | $ hg --verbose record -d '1 13' -m recignored<<EOF |
|
485 | 485 | > y |
|
486 | 486 | > EOF |
|
487 | 487 | diff --git a/i b/i |
|
488 | 488 | new file mode 100644 |
|
489 | 489 | examine changes to 'i'? [Ynesfdaq?] |
|
490 | 490 | i |
|
491 | 491 | committed changeset 3:5f40fe93bbdc |
|
492 | 492 | $ cat i |
|
493 | 493 | $Id$ |
|
494 | 494 | $ hg -q rollback |
|
495 | 495 | $ hg forget i |
|
496 | 496 | $ rm i |
|
497 | 497 | |
|
498 | 498 | amend |
|
499 | 499 | |
|
500 | 500 | $ echo amend >> a |
|
501 | 501 | $ echo amend >> b |
|
502 | 502 | $ hg -q commit -d '1 14' -m 'prepare amend' |
|
503 | 503 | |
|
504 | 504 | $ hg --debug commit --amend -d '1 15' -m 'amend without changes' | grep keywords |
|
505 | 505 | invalidating branch cache (tip differs) |
|
506 | 506 | overwriting a expanding keywords |
|
507 | 507 | $ hg -q id |
|
508 | 508 | a71343332ea9 |
|
509 | 509 | $ head -1 a |
|
510 | 510 | expand $Id: a,v a71343332ea9 1970/01/01 00:00:01 test $ |
|
511 | 511 | |
|
512 | 512 | $ hg -q strip -n tip |
|
513 | 513 | |
|
514 | 514 | Test patch queue repo |
|
515 | 515 | |
|
516 | 516 | $ hg init --mq |
|
517 | 517 | $ hg qimport -r tip -n mqtest.diff |
|
518 | 518 | $ hg commit --mq -m mqtest |
|
519 | 519 | |
|
520 | 520 | Keywords should not be expanded in patch |
|
521 | 521 | |
|
522 | 522 | $ cat .hg/patches/mqtest.diff |
|
523 | 523 | # HG changeset patch |
|
524 | 524 | # User User Name <user@example.com> |
|
525 | 525 | # Date 1 0 |
|
526 | 526 | # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad |
|
527 | 527 | # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 |
|
528 | 528 | cndiff |
|
529 | 529 | |
|
530 | 530 | diff -r ef63ca68695b -r 40a904bbbe4c c |
|
531 | 531 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
532 | 532 | +++ b/c Thu Jan 01 00:00:01 1970 +0000 |
|
533 | 533 | @@ -0,0 +1,2 @@ |
|
534 | 534 | +$Id$ |
|
535 | 535 | +tests for different changenodes |
|
536 | 536 | |
|
537 | 537 | $ hg qpop |
|
538 | 538 | popping mqtest.diff |
|
539 | 539 | patch queue now empty |
|
540 | 540 | |
|
541 | 541 | qgoto, implying qpush, should expand |
|
542 | 542 | |
|
543 | 543 | $ hg qgoto mqtest.diff |
|
544 | 544 | applying mqtest.diff |
|
545 | 545 | now at: mqtest.diff |
|
546 | 546 | $ cat c |
|
547 | 547 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
548 | 548 | tests for different changenodes |
|
549 | 549 | $ hg cat c |
|
550 | 550 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
551 | 551 | tests for different changenodes |
|
552 | 552 | |
|
553 | 553 | Keywords should not be expanded in filelog |
|
554 | 554 | |
|
555 | 555 | $ hg --config 'extensions.keyword=!' cat c |
|
556 | 556 | $Id$ |
|
557 | 557 | tests for different changenodes |
|
558 | 558 | |
|
559 | 559 | qpop and move on |
|
560 | 560 | |
|
561 | 561 | $ hg qpop |
|
562 | 562 | popping mqtest.diff |
|
563 | 563 | patch queue now empty |
|
564 | 564 | |
|
565 | 565 | Copy and show added kwfiles |
|
566 | 566 | |
|
567 | 567 | $ hg cp a c |
|
568 | 568 | $ hg kwfiles |
|
569 | 569 | a |
|
570 | 570 | c |
|
571 | 571 | |
|
572 | 572 | Commit and show expansion in original and copy |
|
573 | 573 | |
|
574 | 574 | $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>' |
|
575 | 575 | c |
|
576 | 576 | c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 |
|
577 | 577 | removing unknown node 40a904bbbe4c from 1-phase boundary |
|
578 | 578 | overwriting c expanding keywords |
|
579 | 579 | committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d |
|
580 | 580 | $ cat a c |
|
581 | 581 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
582 | 582 | do not process $Id: |
|
583 | 583 | xxx $ |
|
584 | 584 | expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $ |
|
585 | 585 | do not process $Id: |
|
586 | 586 | xxx $ |
|
587 | 587 | |
|
588 | 588 | Touch copied c and check its status |
|
589 | 589 | |
|
590 | 590 | $ touch c |
|
591 | 591 | $ hg status |
|
592 | 592 | |
|
593 | 593 | Copy kwfile to keyword ignored file unexpanding keywords |
|
594 | 594 | |
|
595 | 595 | $ hg --verbose copy a i |
|
596 | 596 | copying a to i |
|
597 | 597 | overwriting i shrinking keywords |
|
598 | 598 | $ head -n 1 i |
|
599 | 599 | expand $Id$ |
|
600 | 600 | $ hg forget i |
|
601 | 601 | $ rm i |
|
602 | 602 | |
|
603 | 603 | Copy ignored file to ignored file: no overwriting |
|
604 | 604 | |
|
605 | 605 | $ hg --verbose copy b i |
|
606 | 606 | copying b to i |
|
607 | 607 | $ hg forget i |
|
608 | 608 | $ rm i |
|
609 | 609 | |
|
610 | 610 | cp symlink file; hg cp -A symlink file (part1) |
|
611 | 611 | - copied symlink points to kwfile: overwrite |
|
612 | 612 | |
|
613 | 613 | $ cp sym i |
|
614 | 614 | $ ls -l i |
|
615 | 615 | -rw-r--r--* (glob) |
|
616 | 616 | $ head -1 i |
|
617 | 617 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
618 | 618 | $ hg copy --after --verbose sym i |
|
619 | 619 | copying sym to i |
|
620 | 620 | overwriting i shrinking keywords |
|
621 | 621 | $ head -1 i |
|
622 | 622 | expand $Id$ |
|
623 | 623 | $ hg forget i |
|
624 | 624 | $ rm i |
|
625 | 625 | |
|
626 | 626 | Test different options of hg kwfiles |
|
627 | 627 | |
|
628 | 628 | $ hg kwfiles |
|
629 | 629 | a |
|
630 | 630 | c |
|
631 | 631 | $ hg -v kwfiles --ignore |
|
632 | 632 | I b |
|
633 | 633 | I sym |
|
634 | 634 | $ hg kwfiles --all |
|
635 | 635 | K a |
|
636 | 636 | K c |
|
637 | 637 | I b |
|
638 | 638 | I sym |
|
639 | 639 | |
|
640 | 640 | Diff specific revision |
|
641 | 641 | |
|
642 | 642 | $ hg diff --rev 1 |
|
643 | 643 | diff -r ef63ca68695b c |
|
644 | 644 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
645 | 645 | +++ b/c * (glob) |
|
646 | 646 | @@ -0,0 +1,3 @@ |
|
647 | 647 | +expand $Id$ |
|
648 | 648 | +do not process $Id: |
|
649 | 649 | +xxx $ |
|
650 | 650 | |
|
651 | 651 | Status after rollback: |
|
652 | 652 | |
|
653 | 653 | $ hg rollback |
|
654 | 654 | repository tip rolled back to revision 1 (undo commit) |
|
655 | 655 | working directory now based on revision 1 |
|
656 | 656 | $ hg status |
|
657 | 657 | A c |
|
658 | 658 | $ hg update --clean |
|
659 | 659 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
660 | 660 | |
|
661 | #if symlink | |
|
662 | ||
|
661 | 663 | cp symlink file; hg cp -A symlink file (part2) |
|
662 | 664 | - copied symlink points to kw ignored file: do not overwrite |
|
663 | 665 | |
|
664 | 666 | $ cat a > i |
|
665 | 667 | $ ln -s i symignored |
|
666 | 668 | $ hg commit -Am 'fake expansion in ignored and symlink' i symignored |
|
667 | 669 | $ cp symignored x |
|
668 | 670 | $ hg copy --after --verbose symignored x |
|
669 | 671 | copying symignored to x |
|
670 | 672 | $ head -n 1 x |
|
671 | 673 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
672 | 674 | $ hg forget x |
|
673 | 675 | $ rm x |
|
674 | 676 | |
|
675 | 677 | $ hg rollback |
|
676 | 678 | repository tip rolled back to revision 1 (undo commit) |
|
677 | 679 | working directory now based on revision 1 |
|
678 | 680 | $ hg update --clean |
|
679 | 681 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
680 | 682 | $ rm i symignored |
|
681 | 683 | |
|
684 | #endif | |
|
685 | ||
|
682 | 686 | Custom keywordmaps as argument to kwdemo |
|
683 | 687 | |
|
684 | 688 | $ hg --quiet kwdemo "Xinfo = {author}: {desc}" |
|
685 | 689 | [extensions] |
|
686 | 690 | keyword = |
|
687 | 691 | [keyword] |
|
688 | 692 | ** = |
|
689 | 693 | b = ignore |
|
690 | 694 | demo.txt = |
|
691 | 695 | i = ignore |
|
692 | 696 | [keywordset] |
|
693 | 697 | svn = False |
|
694 | 698 | [keywordmaps] |
|
695 | 699 | Xinfo = {author}: {desc} |
|
696 | 700 | $Xinfo: test: hg keyword configuration and expansion example $ |
|
697 | 701 | |
|
698 | 702 | Configure custom keywordmaps |
|
699 | 703 | |
|
700 | 704 | $ cat <<EOF >>$HGRCPATH |
|
701 | 705 | > [keywordmaps] |
|
702 | 706 | > Id = {file} {node|short} {date|rfc822date} {author|user} |
|
703 | 707 | > Xinfo = {author}: {desc} |
|
704 | 708 | > EOF |
|
705 | 709 | |
|
706 | 710 | Cat and hg cat files before custom expansion |
|
707 | 711 | |
|
708 | 712 | $ cat a b |
|
709 | 713 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
710 | 714 | do not process $Id: |
|
711 | 715 | xxx $ |
|
712 | 716 | ignore $Id$ |
|
713 | 717 | $ hg cat sym a b && echo |
|
714 | 718 | expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $ |
|
715 | 719 | do not process $Id: |
|
716 | 720 | xxx $ |
|
717 | 721 | ignore $Id$ |
|
718 | 722 | a |
|
719 | 723 | |
|
720 | 724 | Write custom keyword and prepare multiline commit message |
|
721 | 725 | |
|
722 | 726 | $ echo '$Xinfo$' >> a |
|
723 | 727 | $ cat <<EOF >> log |
|
724 | 728 | > firstline |
|
725 | 729 | > secondline |
|
726 | 730 | > EOF |
|
727 | 731 | |
|
728 | 732 | Interrupted commit should not change state |
|
729 | 733 | |
|
730 | 734 | $ hg commit |
|
731 | 735 | abort: empty commit message |
|
732 | 736 | [255] |
|
733 | 737 | $ hg status |
|
734 | 738 | M a |
|
735 | 739 | ? c |
|
736 | 740 | ? log |
|
737 | 741 | |
|
738 | 742 | Commit with multiline message and custom expansion |
|
739 | 743 | |
|
740 | 744 | $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>' |
|
741 | 745 | a |
|
742 | 746 | removing unknown node 40a904bbbe4c from 1-phase boundary |
|
743 | 747 | overwriting a expanding keywords |
|
744 | 748 | committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 |
|
745 | 749 | $ rm log |
|
746 | 750 | |
|
747 | 751 | Stat, verify and show custom expansion (firstline) |
|
748 | 752 | |
|
749 | 753 | $ hg status |
|
750 | 754 | ? c |
|
751 | 755 | $ hg verify |
|
752 | 756 | checking changesets |
|
753 | 757 | checking manifests |
|
754 | 758 | crosschecking files in changesets and manifests |
|
755 | 759 | checking files |
|
756 | 760 | 3 files, 3 changesets, 4 total revisions |
|
757 | 761 | $ cat a b |
|
758 | 762 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
759 | 763 | do not process $Id: |
|
760 | 764 | xxx $ |
|
761 | 765 | $Xinfo: User Name <user@example.com>: firstline $ |
|
762 | 766 | ignore $Id$ |
|
763 | 767 | $ hg cat sym a b && echo |
|
764 | 768 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
765 | 769 | do not process $Id: |
|
766 | 770 | xxx $ |
|
767 | 771 | $Xinfo: User Name <user@example.com>: firstline $ |
|
768 | 772 | ignore $Id$ |
|
769 | 773 | a |
|
770 | 774 | |
|
771 | 775 | annotate |
|
772 | 776 | |
|
773 | 777 | $ hg annotate a |
|
774 | 778 | 1: expand $Id$ |
|
775 | 779 | 1: do not process $Id: |
|
776 | 780 | 1: xxx $ |
|
777 | 781 | 2: $Xinfo$ |
|
778 | 782 | |
|
779 | 783 | remove with status checks |
|
780 | 784 | |
|
781 | 785 | $ hg debugrebuildstate |
|
782 | 786 | $ hg remove a |
|
783 | 787 | $ hg --debug commit -m rma |
|
784 | 788 | committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 |
|
785 | 789 | $ hg status |
|
786 | 790 | ? c |
|
787 | 791 | |
|
788 | 792 | Rollback, revert, and check expansion |
|
789 | 793 | |
|
790 | 794 | $ hg rollback |
|
791 | 795 | repository tip rolled back to revision 2 (undo commit) |
|
792 | 796 | working directory now based on revision 2 |
|
793 | 797 | $ hg status |
|
794 | 798 | R a |
|
795 | 799 | ? c |
|
796 | 800 | $ hg revert --no-backup --rev tip a |
|
797 | 801 | $ cat a |
|
798 | 802 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
799 | 803 | do not process $Id: |
|
800 | 804 | xxx $ |
|
801 | 805 | $Xinfo: User Name <user@example.com>: firstline $ |
|
802 | 806 | |
|
803 | 807 | Clone to test global and local configurations |
|
804 | 808 | |
|
805 | 809 | $ cd .. |
|
806 | 810 | |
|
807 | 811 | Expansion in destinaton with global configuration |
|
808 | 812 | |
|
809 | 813 | $ hg --quiet clone Test globalconf |
|
810 | 814 | $ cat globalconf/a |
|
811 | 815 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
812 | 816 | do not process $Id: |
|
813 | 817 | xxx $ |
|
814 | 818 | $Xinfo: User Name <user@example.com>: firstline $ |
|
815 | 819 | |
|
816 | 820 | No expansion in destination with local configuration in origin only |
|
817 | 821 | |
|
818 | 822 | $ hg --quiet --config 'keyword.**=ignore' clone Test localconf |
|
819 | 823 | $ cat localconf/a |
|
820 | 824 | expand $Id$ |
|
821 | 825 | do not process $Id: |
|
822 | 826 | xxx $ |
|
823 | 827 | $Xinfo$ |
|
824 | 828 | |
|
825 | 829 | Clone to test incoming |
|
826 | 830 | |
|
827 | 831 | $ hg clone -r1 Test Test-a |
|
828 | 832 | adding changesets |
|
829 | 833 | adding manifests |
|
830 | 834 | adding file changes |
|
831 | 835 | added 2 changesets with 3 changes to 3 files |
|
832 | 836 | updating to branch default |
|
833 | 837 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
834 | 838 | $ cd Test-a |
|
835 | 839 | $ cat <<EOF >> .hg/hgrc |
|
836 | 840 | > [paths] |
|
837 | 841 | > default = ../Test |
|
838 | 842 | > EOF |
|
839 | 843 | $ hg incoming |
|
840 | 844 | comparing with $TESTTMP/Test (glob) |
|
841 | 845 | searching for changes |
|
842 | 846 | changeset: 2:bb948857c743 |
|
843 | 847 | tag: tip |
|
844 | 848 | user: User Name <user@example.com> |
|
845 | 849 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
846 | 850 | summary: firstline |
|
847 | 851 | |
|
848 | 852 | Imported patch should not be rejected |
|
849 | 853 | |
|
850 | 854 | >>> import re |
|
851 | 855 | >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read()) |
|
852 | 856 | >>> open('a', 'wb').write(text) |
|
853 | 857 | $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>' |
|
854 | 858 | a |
|
855 | 859 | overwriting a expanding keywords |
|
856 | 860 | committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 |
|
857 | 861 | $ hg export -o ../rejecttest.diff tip |
|
858 | 862 | $ cd ../Test |
|
859 | 863 | $ hg import ../rejecttest.diff |
|
860 | 864 | applying ../rejecttest.diff |
|
861 | 865 | $ cat a b |
|
862 | 866 | expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest |
|
863 | 867 | do not process $Id: rejecttest |
|
864 | 868 | xxx $ |
|
865 | 869 | $Xinfo: User Name <user@example.com>: rejects? $ |
|
866 | 870 | ignore $Id$ |
|
867 | 871 | |
|
868 | 872 | $ hg rollback |
|
869 | 873 | repository tip rolled back to revision 2 (undo import) |
|
870 | 874 | working directory now based on revision 2 |
|
871 | 875 | $ hg update --clean |
|
872 | 876 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
873 | 877 | |
|
874 | 878 | kwexpand/kwshrink on selected files |
|
875 | 879 | |
|
876 | 880 | $ mkdir x |
|
877 | 881 | $ hg copy a x/a |
|
878 | 882 | $ hg --verbose kwshrink a |
|
879 | 883 | overwriting a shrinking keywords |
|
880 | 884 | - sleep required for dirstate.normal() check |
|
881 | 885 | $ sleep 1 |
|
882 | 886 | $ hg status a |
|
883 | 887 | $ hg --verbose kwexpand a |
|
884 | 888 | overwriting a expanding keywords |
|
885 | 889 | $ hg status a |
|
886 | 890 | |
|
887 | 891 | kwexpand x/a should abort |
|
888 | 892 | |
|
889 | 893 | $ hg --verbose kwexpand x/a |
|
890 | 894 | abort: outstanding uncommitted changes |
|
891 | 895 | [255] |
|
892 | 896 | $ cd x |
|
893 | 897 | $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>' |
|
894 | 898 | x/a |
|
895 | 899 | x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e |
|
896 | 900 | overwriting x/a expanding keywords |
|
897 | 901 | committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4 |
|
898 | 902 | $ cat a |
|
899 | 903 | expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $ |
|
900 | 904 | do not process $Id: |
|
901 | 905 | xxx $ |
|
902 | 906 | $Xinfo: User Name <user@example.com>: xa $ |
|
903 | 907 | |
|
904 | 908 | kwshrink a inside directory x |
|
905 | 909 | |
|
906 | 910 | $ hg --verbose kwshrink a |
|
907 | 911 | overwriting x/a shrinking keywords |
|
908 | 912 | $ cat a |
|
909 | 913 | expand $Id$ |
|
910 | 914 | do not process $Id: |
|
911 | 915 | xxx $ |
|
912 | 916 | $Xinfo$ |
|
913 | 917 | $ cd .. |
|
914 | 918 | |
|
915 | 919 | kwexpand nonexistent |
|
916 | 920 | |
|
917 | 921 | $ hg kwexpand nonexistent |
|
918 | 922 | nonexistent:* (glob) |
|
919 | 923 | |
|
920 | 924 | |
|
921 | 925 | hg serve |
|
922 | 926 | - expand with hgweb file |
|
923 | 927 | - no expansion with hgweb annotate/changeset/filediff |
|
924 | 928 | - check errors |
|
925 | 929 | |
|
926 | 930 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
927 | 931 | $ cat hg.pid >> $DAEMON_PIDS |
|
928 | 932 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/a/?style=raw' |
|
929 | 933 | 200 Script output follows |
|
930 | 934 | |
|
931 | 935 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
932 | 936 | do not process $Id: |
|
933 | 937 | xxx $ |
|
934 | 938 | $Xinfo: User Name <user@example.com>: firstline $ |
|
935 | 939 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/a/?style=raw' |
|
936 | 940 | 200 Script output follows |
|
937 | 941 | |
|
938 | 942 | |
|
939 | 943 | user@1: expand $Id$ |
|
940 | 944 | user@1: do not process $Id: |
|
941 | 945 | user@1: xxx $ |
|
942 | 946 | user@2: $Xinfo$ |
|
943 | 947 | |
|
944 | 948 | |
|
945 | 949 | |
|
946 | 950 | |
|
947 | 951 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/tip/?style=raw' |
|
948 | 952 | 200 Script output follows |
|
949 | 953 | |
|
950 | 954 | |
|
951 | 955 | # HG changeset patch |
|
952 | 956 | # User User Name <user@example.com> |
|
953 | 957 | # Date 3 0 |
|
954 | 958 | # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4 |
|
955 | 959 | # Parent bb948857c743469b22bbf51f7ec8112279ca5d83 |
|
956 | 960 | xa |
|
957 | 961 | |
|
958 | 962 | diff -r bb948857c743 -r b4560182a3f9 x/a |
|
959 | 963 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
960 | 964 | +++ b/x/a Thu Jan 01 00:00:03 1970 +0000 |
|
961 | 965 | @@ -0,0 +1,4 @@ |
|
962 | 966 | +expand $Id$ |
|
963 | 967 | +do not process $Id: |
|
964 | 968 | +xxx $ |
|
965 | 969 | +$Xinfo$ |
|
966 | 970 | |
|
967 | 971 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/bb948857c743/a?style=raw' |
|
968 | 972 | 200 Script output follows |
|
969 | 973 | |
|
970 | 974 | |
|
971 | 975 | diff -r ef63ca68695b -r bb948857c743 a |
|
972 | 976 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
973 | 977 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 |
|
974 | 978 | @@ -1,3 +1,4 @@ |
|
975 | 979 | expand $Id$ |
|
976 | 980 | do not process $Id: |
|
977 | 981 | xxx $ |
|
978 | 982 | +$Xinfo$ |
|
979 | 983 | |
|
980 | 984 | |
|
981 | 985 | |
|
982 | 986 | |
|
983 | 987 | $ cat errors.log |
|
984 | 988 | |
|
985 | 989 | Prepare merge and resolve tests |
|
986 | 990 | |
|
987 | 991 | $ echo '$Id$' > m |
|
988 | 992 | $ hg add m |
|
989 | 993 | $ hg commit -m 4kw |
|
990 | 994 | $ echo foo >> m |
|
991 | 995 | $ hg commit -m 5foo |
|
992 | 996 | |
|
993 | 997 | simplemerge |
|
994 | 998 | |
|
995 | 999 | $ hg update 4 |
|
996 | 1000 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
997 | 1001 | $ echo foo >> m |
|
998 | 1002 | $ hg commit -m 6foo |
|
999 | 1003 | created new head |
|
1000 | 1004 | $ hg merge |
|
1001 | 1005 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1002 | 1006 | (branch merge, don't forget to commit) |
|
1003 | 1007 | $ hg commit -m simplemerge |
|
1004 | 1008 | $ cat m |
|
1005 | 1009 | $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1006 | 1010 | foo |
|
1007 | 1011 | |
|
1008 | 1012 | conflict: keyword should stay outside conflict zone |
|
1009 | 1013 | |
|
1010 | 1014 | $ hg update 4 |
|
1011 | 1015 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1012 | 1016 | $ echo bar >> m |
|
1013 | 1017 | $ hg commit -m 8bar |
|
1014 | 1018 | created new head |
|
1015 | 1019 | $ hg merge |
|
1016 | 1020 | merging m |
|
1017 | 1021 | warning: conflicts during merge. |
|
1018 | 1022 | merging m incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
1019 | 1023 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
1020 | 1024 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
1021 | 1025 | [1] |
|
1022 | 1026 | $ cat m |
|
1023 | 1027 | $Id$ |
|
1024 | 1028 | <<<<<<< local |
|
1025 | 1029 | bar |
|
1026 | 1030 | ======= |
|
1027 | 1031 | foo |
|
1028 | 1032 | >>>>>>> other |
|
1029 | 1033 | |
|
1030 | 1034 | resolve to local |
|
1031 | 1035 | |
|
1032 | 1036 | $ HGMERGE=internal:local hg resolve -a |
|
1033 | 1037 | $ hg commit -m localresolve |
|
1034 | 1038 | $ cat m |
|
1035 | 1039 | $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1036 | 1040 | bar |
|
1037 | 1041 | |
|
1038 | 1042 | Test restricted mode with transplant -b |
|
1039 | 1043 | |
|
1040 | 1044 | $ hg update 6 |
|
1041 | 1045 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1042 | 1046 | $ hg branch foo |
|
1043 | 1047 | marked working directory as branch foo |
|
1044 | 1048 | (branches are permanent and global, did you want a bookmark?) |
|
1045 | 1049 | $ mv a a.bak |
|
1046 | 1050 | $ echo foobranch > a |
|
1047 | 1051 | $ cat a.bak >> a |
|
1048 | 1052 | $ rm a.bak |
|
1049 | 1053 | $ hg commit -m 9foobranch |
|
1050 | 1054 | $ hg update default |
|
1051 | 1055 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1052 | 1056 | $ hg -y transplant -b foo tip |
|
1053 | 1057 | applying 4aa30d025d50 |
|
1054 | 1058 | 4aa30d025d50 transplanted to e00abbf63521 |
|
1055 | 1059 | |
|
1056 | 1060 | Expansion in changeset but not in file |
|
1057 | 1061 | |
|
1058 | 1062 | $ hg tip -p |
|
1059 | 1063 | changeset: 11:e00abbf63521 |
|
1060 | 1064 | tag: tip |
|
1061 | 1065 | parent: 9:800511b3a22d |
|
1062 | 1066 | user: test |
|
1063 | 1067 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1064 | 1068 | summary: 9foobranch |
|
1065 | 1069 | |
|
1066 | 1070 | diff -r 800511b3a22d -r e00abbf63521 a |
|
1067 | 1071 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1068 | 1072 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
1069 | 1073 | @@ -1,3 +1,4 @@ |
|
1070 | 1074 | +foobranch |
|
1071 | 1075 | expand $Id$ |
|
1072 | 1076 | do not process $Id: |
|
1073 | 1077 | xxx $ |
|
1074 | 1078 | |
|
1075 | 1079 | $ head -n 2 a |
|
1076 | 1080 | foobranch |
|
1077 | 1081 | expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
1078 | 1082 | |
|
1079 | 1083 | Turn off expansion |
|
1080 | 1084 | |
|
1081 | 1085 | $ hg -q rollback |
|
1082 | 1086 | $ hg -q update -C |
|
1083 | 1087 | |
|
1084 | 1088 | kwshrink with unknown file u |
|
1085 | 1089 | |
|
1086 | 1090 | $ cp a u |
|
1087 | 1091 | $ hg --verbose kwshrink |
|
1088 | 1092 | overwriting a shrinking keywords |
|
1089 | 1093 | overwriting m shrinking keywords |
|
1090 | 1094 | overwriting x/a shrinking keywords |
|
1091 | 1095 | |
|
1092 | 1096 | Keywords shrunk in working directory, but not yet disabled |
|
1093 | 1097 | - cat shows unexpanded keywords |
|
1094 | 1098 | - hg cat shows expanded keywords |
|
1095 | 1099 | |
|
1096 | 1100 | $ cat a b |
|
1097 | 1101 | expand $Id$ |
|
1098 | 1102 | do not process $Id: |
|
1099 | 1103 | xxx $ |
|
1100 | 1104 | $Xinfo$ |
|
1101 | 1105 | ignore $Id$ |
|
1102 | 1106 | $ hg cat sym a b && echo |
|
1103 | 1107 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
1104 | 1108 | do not process $Id: |
|
1105 | 1109 | xxx $ |
|
1106 | 1110 | $Xinfo: User Name <user@example.com>: firstline $ |
|
1107 | 1111 | ignore $Id$ |
|
1108 | 1112 | a |
|
1109 | 1113 | |
|
1110 | 1114 | Now disable keyword expansion |
|
1111 | 1115 | |
|
1112 | 1116 | $ rm "$HGRCPATH" |
|
1113 | 1117 | $ cat a b |
|
1114 | 1118 | expand $Id$ |
|
1115 | 1119 | do not process $Id: |
|
1116 | 1120 | xxx $ |
|
1117 | 1121 | $Xinfo$ |
|
1118 | 1122 | ignore $Id$ |
|
1119 | 1123 | $ hg cat sym a b && echo |
|
1120 | 1124 | expand $Id$ |
|
1121 | 1125 | do not process $Id: |
|
1122 | 1126 | xxx $ |
|
1123 | 1127 | $Xinfo$ |
|
1124 | 1128 | ignore $Id$ |
|
1125 | 1129 | a |
@@ -1,1213 +1,1217 | |||
|
1 |
$ "$TESTDIR/hghave" |
|
|
1 | $ "$TESTDIR/hghave" unix-permissions serve || exit 80 | |
|
2 | 2 | $ USERCACHE=`pwd`/cache; export USERCACHE |
|
3 | 3 | $ mkdir -p ${USERCACHE} |
|
4 | 4 | $ cat >> $HGRCPATH <<EOF |
|
5 | 5 | > [extensions] |
|
6 | 6 | > largefiles= |
|
7 | 7 | > purge= |
|
8 | 8 | > rebase= |
|
9 | 9 | > transplant= |
|
10 | 10 | > [phases] |
|
11 | 11 | > publish=False |
|
12 | 12 | > [largefiles] |
|
13 | 13 | > minsize=2 |
|
14 | 14 | > patterns=glob:**.dat |
|
15 | 15 | > usercache=${USERCACHE} |
|
16 | 16 | > [hooks] |
|
17 | 17 | > precommit=echo "Invoking status precommit hook"; hg status |
|
18 | 18 | > EOF |
|
19 | 19 | |
|
20 | 20 | Create the repo with a couple of revisions of both large and normal |
|
21 | 21 | files, testing that status correctly shows largefiles and that summary output |
|
22 | 22 | is correct. |
|
23 | 23 | |
|
24 | 24 | $ hg init a |
|
25 | 25 | $ cd a |
|
26 | 26 | $ mkdir sub |
|
27 | 27 | $ echo normal1 > normal1 |
|
28 | 28 | $ echo normal2 > sub/normal2 |
|
29 | 29 | $ echo large1 > large1 |
|
30 | 30 | $ echo large2 > sub/large2 |
|
31 | 31 | $ hg add normal1 sub/normal2 |
|
32 | 32 | $ hg add --large large1 sub/large2 |
|
33 | 33 | $ hg commit -m "add files" |
|
34 | 34 | Invoking status precommit hook |
|
35 | 35 | A large1 |
|
36 | 36 | A normal1 |
|
37 | 37 | A sub/large2 |
|
38 | 38 | A sub/normal2 |
|
39 | 39 | $ echo normal11 > normal1 |
|
40 | 40 | $ echo normal22 > sub/normal2 |
|
41 | 41 | $ echo large11 > large1 |
|
42 | 42 | $ echo large22 > sub/large2 |
|
43 | 43 | $ hg commit -m "edit files" |
|
44 | 44 | Invoking status precommit hook |
|
45 | 45 | M large1 |
|
46 | 46 | M normal1 |
|
47 | 47 | M sub/large2 |
|
48 | 48 | M sub/normal2 |
|
49 | 49 | $ hg sum --large |
|
50 | 50 | parent: 1:ce8896473775 tip |
|
51 | 51 | edit files |
|
52 | 52 | branch: default |
|
53 | 53 | commit: (clean) |
|
54 | 54 | update: (current) |
|
55 | 55 | largefiles: No remote repo |
|
56 | 56 | |
|
57 | 57 | Commit preserved largefile contents. |
|
58 | 58 | |
|
59 | 59 | $ cat normal1 |
|
60 | 60 | normal11 |
|
61 | 61 | $ cat large1 |
|
62 | 62 | large11 |
|
63 | 63 | $ cat sub/normal2 |
|
64 | 64 | normal22 |
|
65 | 65 | $ cat sub/large2 |
|
66 | 66 | large22 |
|
67 | 67 | |
|
68 | 68 | Test status, subdir and unknown files |
|
69 | 69 | |
|
70 | 70 | $ echo unknown > sub/unknown |
|
71 | 71 | $ hg st --all |
|
72 | 72 | ? sub/unknown |
|
73 | 73 | C large1 |
|
74 | 74 | C normal1 |
|
75 | 75 | C sub/large2 |
|
76 | 76 | C sub/normal2 |
|
77 | 77 | $ hg st --all sub |
|
78 | 78 | ? sub/unknown |
|
79 | 79 | C sub/large2 |
|
80 | 80 | C sub/normal2 |
|
81 | 81 | $ rm sub/unknown |
|
82 | 82 | |
|
83 | 83 | Remove both largefiles and normal files. |
|
84 | 84 | |
|
85 | 85 | $ hg remove normal1 large1 |
|
86 | 86 | $ hg status large1 |
|
87 | 87 | R large1 |
|
88 | 88 | $ hg commit -m "remove files" |
|
89 | 89 | Invoking status precommit hook |
|
90 | 90 | R large1 |
|
91 | 91 | R normal1 |
|
92 | 92 | $ ls |
|
93 | 93 | sub |
|
94 | 94 | $ echo "testlargefile" > large1-test |
|
95 | 95 | $ hg add --large large1-test |
|
96 | 96 | $ hg st |
|
97 | 97 | A large1-test |
|
98 | 98 | $ hg rm large1-test |
|
99 | 99 | not removing large1-test: file has been marked for add (use forget to undo) |
|
100 | 100 | $ hg st |
|
101 | 101 | A large1-test |
|
102 | 102 | $ hg forget large1-test |
|
103 | 103 | $ hg st |
|
104 | 104 | ? large1-test |
|
105 | 105 | $ rm large1-test |
|
106 | 106 | |
|
107 | 107 | Copy both largefiles and normal files (testing that status output is correct). |
|
108 | 108 | |
|
109 | 109 | $ hg cp sub/normal2 normal1 |
|
110 | 110 | $ hg cp sub/large2 large1 |
|
111 | 111 | $ hg commit -m "copy files" |
|
112 | 112 | Invoking status precommit hook |
|
113 | 113 | A large1 |
|
114 | 114 | A normal1 |
|
115 | 115 | $ cat normal1 |
|
116 | 116 | normal22 |
|
117 | 117 | $ cat large1 |
|
118 | 118 | large22 |
|
119 | 119 | |
|
120 | 120 | Test moving largefiles and verify that normal files are also unaffected. |
|
121 | 121 | |
|
122 | 122 | $ hg mv normal1 normal3 |
|
123 | 123 | $ hg mv large1 large3 |
|
124 | 124 | $ hg mv sub/normal2 sub/normal4 |
|
125 | 125 | $ hg mv sub/large2 sub/large4 |
|
126 | 126 | $ hg commit -m "move files" |
|
127 | 127 | Invoking status precommit hook |
|
128 | 128 | A large3 |
|
129 | 129 | A normal3 |
|
130 | 130 | A sub/large4 |
|
131 | 131 | A sub/normal4 |
|
132 | 132 | R large1 |
|
133 | 133 | R normal1 |
|
134 | 134 | R sub/large2 |
|
135 | 135 | R sub/normal2 |
|
136 | 136 | $ cat normal3 |
|
137 | 137 | normal22 |
|
138 | 138 | $ cat large3 |
|
139 | 139 | large22 |
|
140 | 140 | $ cat sub/normal4 |
|
141 | 141 | normal22 |
|
142 | 142 | $ cat sub/large4 |
|
143 | 143 | large22 |
|
144 | 144 | |
|
145 | 145 | Test display of largefiles in hgweb |
|
146 | 146 | |
|
147 | 147 | $ hg serve -d -p $HGPORT --pid-file ../hg.pid |
|
148 | 148 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
149 | 149 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/tip/?style=raw' |
|
150 | 150 | 200 Script output follows |
|
151 | 151 | |
|
152 | 152 | |
|
153 | 153 | drwxr-xr-x sub |
|
154 | 154 | -rw-r--r-- 41 large3 |
|
155 | 155 | -rw-r--r-- 9 normal3 |
|
156 | 156 | |
|
157 | 157 | |
|
158 | 158 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/tip/sub/?style=raw' |
|
159 | 159 | 200 Script output follows |
|
160 | 160 | |
|
161 | 161 | |
|
162 | 162 | -rw-r--r-- 41 large4 |
|
163 | 163 | -rw-r--r-- 9 normal4 |
|
164 | 164 | |
|
165 | 165 | |
|
166 | 166 | $ "$TESTDIR/killdaemons.py" |
|
167 | 167 | |
|
168 | 168 | Test archiving the various revisions. These hit corner cases known with |
|
169 | 169 | archiving. |
|
170 | 170 | |
|
171 | 171 | $ hg archive -r 0 ../archive0 |
|
172 | 172 | $ hg archive -r 1 ../archive1 |
|
173 | 173 | $ hg archive -r 2 ../archive2 |
|
174 | 174 | $ hg archive -r 3 ../archive3 |
|
175 | 175 | $ hg archive -r 4 ../archive4 |
|
176 | 176 | $ cd ../archive0 |
|
177 | 177 | $ cat normal1 |
|
178 | 178 | normal1 |
|
179 | 179 | $ cat large1 |
|
180 | 180 | large1 |
|
181 | 181 | $ cat sub/normal2 |
|
182 | 182 | normal2 |
|
183 | 183 | $ cat sub/large2 |
|
184 | 184 | large2 |
|
185 | 185 | $ cd ../archive1 |
|
186 | 186 | $ cat normal1 |
|
187 | 187 | normal11 |
|
188 | 188 | $ cat large1 |
|
189 | 189 | large11 |
|
190 | 190 | $ cat sub/normal2 |
|
191 | 191 | normal22 |
|
192 | 192 | $ cat sub/large2 |
|
193 | 193 | large22 |
|
194 | 194 | $ cd ../archive2 |
|
195 | 195 | $ ls |
|
196 | 196 | sub |
|
197 | 197 | $ cat sub/normal2 |
|
198 | 198 | normal22 |
|
199 | 199 | $ cat sub/large2 |
|
200 | 200 | large22 |
|
201 | 201 | $ cd ../archive3 |
|
202 | 202 | $ cat normal1 |
|
203 | 203 | normal22 |
|
204 | 204 | $ cat large1 |
|
205 | 205 | large22 |
|
206 | 206 | $ cat sub/normal2 |
|
207 | 207 | normal22 |
|
208 | 208 | $ cat sub/large2 |
|
209 | 209 | large22 |
|
210 | 210 | $ cd ../archive4 |
|
211 | 211 | $ cat normal3 |
|
212 | 212 | normal22 |
|
213 | 213 | $ cat large3 |
|
214 | 214 | large22 |
|
215 | 215 | $ cat sub/normal4 |
|
216 | 216 | normal22 |
|
217 | 217 | $ cat sub/large4 |
|
218 | 218 | large22 |
|
219 | 219 | |
|
220 | 220 | Commit corner case: specify files to commit. |
|
221 | 221 | |
|
222 | 222 | $ cd ../a |
|
223 | 223 | $ echo normal3 > normal3 |
|
224 | 224 | $ echo large3 > large3 |
|
225 | 225 | $ echo normal4 > sub/normal4 |
|
226 | 226 | $ echo large4 > sub/large4 |
|
227 | 227 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" |
|
228 | 228 | Invoking status precommit hook |
|
229 | 229 | M large3 |
|
230 | 230 | M normal3 |
|
231 | 231 | M sub/large4 |
|
232 | 232 | M sub/normal4 |
|
233 | 233 | $ cat normal3 |
|
234 | 234 | normal3 |
|
235 | 235 | $ cat large3 |
|
236 | 236 | large3 |
|
237 | 237 | $ cat sub/normal4 |
|
238 | 238 | normal4 |
|
239 | 239 | $ cat sub/large4 |
|
240 | 240 | large4 |
|
241 | 241 | |
|
242 | 242 | One more commit corner case: commit from a subdirectory. |
|
243 | 243 | |
|
244 | 244 | $ cd ../a |
|
245 | 245 | $ echo normal33 > normal3 |
|
246 | 246 | $ echo large33 > large3 |
|
247 | 247 | $ echo normal44 > sub/normal4 |
|
248 | 248 | $ echo large44 > sub/large4 |
|
249 | 249 | $ cd sub |
|
250 | 250 | $ hg commit -m "edit files yet again" |
|
251 | 251 | Invoking status precommit hook |
|
252 | 252 | M large3 |
|
253 | 253 | M normal3 |
|
254 | 254 | M sub/large4 |
|
255 | 255 | M sub/normal4 |
|
256 | 256 | $ cat ../normal3 |
|
257 | 257 | normal33 |
|
258 | 258 | $ cat ../large3 |
|
259 | 259 | large33 |
|
260 | 260 | $ cat normal4 |
|
261 | 261 | normal44 |
|
262 | 262 | $ cat large4 |
|
263 | 263 | large44 |
|
264 | 264 | |
|
265 | 265 | Committing standins is not allowed. |
|
266 | 266 | |
|
267 | 267 | $ cd .. |
|
268 | 268 | $ echo large3 > large3 |
|
269 | 269 | $ hg commit .hglf/large3 -m "try to commit standin" |
|
270 | 270 | abort: file ".hglf/large3" is a largefile standin |
|
271 | 271 | (commit the largefile itself instead) |
|
272 | 272 | [255] |
|
273 | 273 | |
|
274 | 274 | Corner cases for adding largefiles. |
|
275 | 275 | |
|
276 | 276 | $ echo large5 > large5 |
|
277 | 277 | $ hg add --large large5 |
|
278 | 278 | $ hg add --large large5 |
|
279 | 279 | large5 already a largefile |
|
280 | 280 | $ mkdir sub2 |
|
281 | 281 | $ echo large6 > sub2/large6 |
|
282 | 282 | $ echo large7 > sub2/large7 |
|
283 | 283 | $ hg add --large sub2 |
|
284 | 284 | adding sub2/large6 as a largefile (glob) |
|
285 | 285 | adding sub2/large7 as a largefile (glob) |
|
286 | 286 | $ hg st |
|
287 | 287 | M large3 |
|
288 | 288 | A large5 |
|
289 | 289 | A sub2/large6 |
|
290 | 290 | A sub2/large7 |
|
291 | 291 | |
|
292 | 292 | Test "hg status" with combination of 'file pattern' and 'directory |
|
293 | 293 | pattern' for largefiles: |
|
294 | 294 | |
|
295 | 295 | $ hg status sub2/large6 sub2 |
|
296 | 296 | A sub2/large6 |
|
297 | 297 | A sub2/large7 |
|
298 | 298 | |
|
299 | 299 | Config settings (pattern **.dat, minsize 2 MB) are respected. |
|
300 | 300 | |
|
301 | 301 | $ echo testdata > test.dat |
|
302 | 302 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null |
|
303 | 303 | $ hg add |
|
304 | 304 | adding reallylarge as a largefile |
|
305 | 305 | adding test.dat as a largefile |
|
306 | 306 | |
|
307 | 307 | Test that minsize and --lfsize handle float values; |
|
308 | 308 | also tests that --lfsize overrides largefiles.minsize. |
|
309 | 309 | (0.250 MB = 256 kB = 262144 B) |
|
310 | 310 | |
|
311 | 311 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null |
|
312 | 312 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null |
|
313 | 313 | $ hg --config largefiles.minsize=.25 add |
|
314 | 314 | adding ratherlarge as a largefile |
|
315 | 315 | adding medium |
|
316 | 316 | $ hg forget medium |
|
317 | 317 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
318 | 318 | adding medium as a largefile |
|
319 | 319 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null |
|
320 | 320 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
321 | 321 | adding notlarge |
|
322 | 322 | $ hg forget notlarge |
|
323 | 323 | |
|
324 | 324 | Test forget on largefiles. |
|
325 | 325 | |
|
326 | 326 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium |
|
327 | 327 | $ hg commit -m "add/edit more largefiles" |
|
328 | 328 | Invoking status precommit hook |
|
329 | 329 | A sub2/large6 |
|
330 | 330 | A sub2/large7 |
|
331 | 331 | R large3 |
|
332 | 332 | ? large5 |
|
333 | 333 | ? medium |
|
334 | 334 | ? notlarge |
|
335 | 335 | ? ratherlarge |
|
336 | 336 | ? reallylarge |
|
337 | 337 | ? test.dat |
|
338 | 338 | $ hg st |
|
339 | 339 | ? large3 |
|
340 | 340 | ? large5 |
|
341 | 341 | ? medium |
|
342 | 342 | ? notlarge |
|
343 | 343 | ? ratherlarge |
|
344 | 344 | ? reallylarge |
|
345 | 345 | ? test.dat |
|
346 | 346 | |
|
347 | 347 | Purge with largefiles: verify that largefiles are still in the working |
|
348 | 348 | dir after a purge. |
|
349 | 349 | |
|
350 | 350 | $ hg purge --all |
|
351 | 351 | $ cat sub/large4 |
|
352 | 352 | large44 |
|
353 | 353 | $ cat sub2/large6 |
|
354 | 354 | large6 |
|
355 | 355 | $ cat sub2/large7 |
|
356 | 356 | large7 |
|
357 | 357 | |
|
358 | 358 | Test addremove: verify that files that should be added as largfiles are added as |
|
359 | 359 | such and that already-existing largfiles are not added as normal files by |
|
360 | 360 | accident. |
|
361 | 361 | |
|
362 | 362 | $ rm normal3 |
|
363 | 363 | $ rm sub/large4 |
|
364 | 364 | $ echo "testing addremove with patterns" > testaddremove.dat |
|
365 | 365 | $ echo "normaladdremove" > normaladdremove |
|
366 | 366 | $ hg addremove |
|
367 | 367 | removing sub/large4 |
|
368 | 368 | adding testaddremove.dat as a largefile |
|
369 | 369 | removing normal3 |
|
370 | 370 | adding normaladdremove |
|
371 | 371 | |
|
372 | 372 | Clone a largefiles repo. |
|
373 | 373 | |
|
374 | 374 | $ hg clone . ../b |
|
375 | 375 | updating to branch default |
|
376 | 376 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
377 | 377 | getting changed largefiles |
|
378 | 378 | 3 largefiles updated, 0 removed |
|
379 | 379 | $ cd ../b |
|
380 | 380 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
381 | 381 | 7:daea875e9014 add/edit more largefiles |
|
382 | 382 | 6:4355d653f84f edit files yet again |
|
383 | 383 | 5:9d5af5072dbd edit files again |
|
384 | 384 | 4:74c02385b94c move files |
|
385 | 385 | 3:9e8fbc4bce62 copy files |
|
386 | 386 | 2:51a0ae4d5864 remove files |
|
387 | 387 | 1:ce8896473775 edit files |
|
388 | 388 | 0:30d30fe6a5be add files |
|
389 | 389 | $ cat normal3 |
|
390 | 390 | normal33 |
|
391 | 391 | $ cat sub/normal4 |
|
392 | 392 | normal44 |
|
393 | 393 | $ cat sub/large4 |
|
394 | 394 | large44 |
|
395 | 395 | $ cat sub2/large6 |
|
396 | 396 | large6 |
|
397 | 397 | $ cat sub2/large7 |
|
398 | 398 | large7 |
|
399 | 399 | $ cd .. |
|
400 | 400 | $ hg clone a -r 3 c |
|
401 | 401 | adding changesets |
|
402 | 402 | adding manifests |
|
403 | 403 | adding file changes |
|
404 | 404 | added 4 changesets with 10 changes to 4 files |
|
405 | 405 | updating to branch default |
|
406 | 406 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
407 | 407 | getting changed largefiles |
|
408 | 408 | 2 largefiles updated, 0 removed |
|
409 | 409 | $ cd c |
|
410 | 410 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
411 | 411 | 3:9e8fbc4bce62 copy files |
|
412 | 412 | 2:51a0ae4d5864 remove files |
|
413 | 413 | 1:ce8896473775 edit files |
|
414 | 414 | 0:30d30fe6a5be add files |
|
415 | 415 | $ cat normal1 |
|
416 | 416 | normal22 |
|
417 | 417 | $ cat large1 |
|
418 | 418 | large22 |
|
419 | 419 | $ cat sub/normal2 |
|
420 | 420 | normal22 |
|
421 | 421 | $ cat sub/large2 |
|
422 | 422 | large22 |
|
423 | 423 | |
|
424 | 424 | Old revisions of a clone have correct largefiles content (this also |
|
425 | 425 | tests update). |
|
426 | 426 | |
|
427 | 427 | $ hg update -r 1 |
|
428 | 428 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
429 | 429 | getting changed largefiles |
|
430 | 430 | 1 largefiles updated, 0 removed |
|
431 | 431 | $ cat large1 |
|
432 | 432 | large11 |
|
433 | 433 | $ cat sub/large2 |
|
434 | 434 | large22 |
|
435 | 435 | $ cd .. |
|
436 | 436 | |
|
437 | 437 | Test cloning with --all-largefiles flag |
|
438 | 438 | |
|
439 | 439 | $ rm -Rf ${USERCACHE}/* |
|
440 | 440 | $ hg clone --all-largefiles a a-backup |
|
441 | 441 | updating to branch default |
|
442 | 442 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
443 | 443 | getting changed largefiles |
|
444 | 444 | 3 largefiles updated, 0 removed |
|
445 | 445 | 8 additional largefiles cached |
|
446 | 446 | |
|
447 | 447 | $ hg clone --all-largefiles a ssh://localhost/a |
|
448 | 448 | abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a |
|
449 | 449 | [255] |
|
450 | 450 | |
|
451 | 451 | Test pulling with --all-largefiles flag |
|
452 | 452 | |
|
453 | 453 | $ rm -Rf a-backup |
|
454 | 454 | $ hg clone -r 1 a a-backup |
|
455 | 455 | adding changesets |
|
456 | 456 | adding manifests |
|
457 | 457 | adding file changes |
|
458 | 458 | added 2 changesets with 8 changes to 4 files |
|
459 | 459 | updating to branch default |
|
460 | 460 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
461 | 461 | getting changed largefiles |
|
462 | 462 | 2 largefiles updated, 0 removed |
|
463 | 463 | $ rm -Rf ${USERCACHE}/* |
|
464 | 464 | $ cd a-backup |
|
465 | 465 | $ hg pull --all-largefiles |
|
466 | 466 | pulling from $TESTTMP/a |
|
467 | 467 | searching for changes |
|
468 | 468 | adding changesets |
|
469 | 469 | adding manifests |
|
470 | 470 | adding file changes |
|
471 | 471 | added 6 changesets with 16 changes to 8 files |
|
472 | 472 | (run 'hg update' to get a working copy) |
|
473 | 473 | caching new largefiles |
|
474 | 474 | 3 largefiles cached |
|
475 | 475 | 3 additional largefiles cached |
|
476 | 476 | $ cd .. |
|
477 | 477 | |
|
478 | 478 | Rebasing between two repositories does not revert largefiles to old |
|
479 | 479 | revisions (this was a very bad bug that took a lot of work to fix). |
|
480 | 480 | |
|
481 | 481 | $ hg clone a d |
|
482 | 482 | updating to branch default |
|
483 | 483 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
484 | 484 | getting changed largefiles |
|
485 | 485 | 3 largefiles updated, 0 removed |
|
486 | 486 | $ cd b |
|
487 | 487 | $ echo large4-modified > sub/large4 |
|
488 | 488 | $ echo normal3-modified > normal3 |
|
489 | 489 | $ hg commit -m "modify normal file and largefile in repo b" |
|
490 | 490 | Invoking status precommit hook |
|
491 | 491 | M normal3 |
|
492 | 492 | M sub/large4 |
|
493 | 493 | $ cd ../d |
|
494 | 494 | $ echo large6-modified > sub2/large6 |
|
495 | 495 | $ echo normal4-modified > sub/normal4 |
|
496 | 496 | $ hg commit -m "modify normal file largefile in repo d" |
|
497 | 497 | Invoking status precommit hook |
|
498 | 498 | M sub/normal4 |
|
499 | 499 | M sub2/large6 |
|
500 | 500 | $ cd .. |
|
501 | 501 | $ hg clone d e |
|
502 | 502 | updating to branch default |
|
503 | 503 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
504 | 504 | getting changed largefiles |
|
505 | 505 | 3 largefiles updated, 0 removed |
|
506 | 506 | $ cd d |
|
507 | 507 | $ hg pull --rebase ../b |
|
508 | 508 | pulling from ../b |
|
509 | 509 | searching for changes |
|
510 | 510 | adding changesets |
|
511 | 511 | adding manifests |
|
512 | 512 | adding file changes |
|
513 | 513 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
514 | 514 | Invoking status precommit hook |
|
515 | 515 | M sub/normal4 |
|
516 | 516 | M sub2/large6 |
|
517 | 517 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
518 | 518 | nothing to rebase |
|
519 | 519 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
520 | 520 | 9:598410d3eb9a modify normal file largefile in repo d |
|
521 | 521 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
522 | 522 | 7:daea875e9014 add/edit more largefiles |
|
523 | 523 | 6:4355d653f84f edit files yet again |
|
524 | 524 | 5:9d5af5072dbd edit files again |
|
525 | 525 | 4:74c02385b94c move files |
|
526 | 526 | 3:9e8fbc4bce62 copy files |
|
527 | 527 | 2:51a0ae4d5864 remove files |
|
528 | 528 | 1:ce8896473775 edit files |
|
529 | 529 | 0:30d30fe6a5be add files |
|
530 | 530 | $ cat normal3 |
|
531 | 531 | normal3-modified |
|
532 | 532 | $ cat sub/normal4 |
|
533 | 533 | normal4-modified |
|
534 | 534 | $ cat sub/large4 |
|
535 | 535 | large4-modified |
|
536 | 536 | $ cat sub2/large6 |
|
537 | 537 | large6-modified |
|
538 | 538 | $ cat sub2/large7 |
|
539 | 539 | large7 |
|
540 | 540 | $ cd ../e |
|
541 | 541 | $ hg pull ../b |
|
542 | 542 | pulling from ../b |
|
543 | 543 | searching for changes |
|
544 | 544 | adding changesets |
|
545 | 545 | adding manifests |
|
546 | 546 | adding file changes |
|
547 | 547 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
548 | 548 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
549 | 549 | caching new largefiles |
|
550 | 550 | 0 largefiles cached |
|
551 | 551 | $ hg rebase |
|
552 | 552 | Invoking status precommit hook |
|
553 | 553 | M sub/normal4 |
|
554 | 554 | M sub2/large6 |
|
555 | 555 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
556 | 556 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
557 | 557 | 9:598410d3eb9a modify normal file largefile in repo d |
|
558 | 558 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
559 | 559 | 7:daea875e9014 add/edit more largefiles |
|
560 | 560 | 6:4355d653f84f edit files yet again |
|
561 | 561 | 5:9d5af5072dbd edit files again |
|
562 | 562 | 4:74c02385b94c move files |
|
563 | 563 | 3:9e8fbc4bce62 copy files |
|
564 | 564 | 2:51a0ae4d5864 remove files |
|
565 | 565 | 1:ce8896473775 edit files |
|
566 | 566 | 0:30d30fe6a5be add files |
|
567 | 567 | $ cat normal3 |
|
568 | 568 | normal3-modified |
|
569 | 569 | $ cat sub/normal4 |
|
570 | 570 | normal4-modified |
|
571 | 571 | $ cat sub/large4 |
|
572 | 572 | large4-modified |
|
573 | 573 | $ cat sub2/large6 |
|
574 | 574 | large6-modified |
|
575 | 575 | $ cat sub2/large7 |
|
576 | 576 | large7 |
|
577 | 577 | |
|
578 | 578 | Rollback on largefiles. |
|
579 | 579 | |
|
580 | 580 | $ echo large4-modified-again > sub/large4 |
|
581 | 581 | $ hg commit -m "Modify large4 again" |
|
582 | 582 | Invoking status precommit hook |
|
583 | 583 | M sub/large4 |
|
584 | 584 | $ hg rollback |
|
585 | 585 | repository tip rolled back to revision 9 (undo commit) |
|
586 | 586 | working directory now based on revision 9 |
|
587 | 587 | $ hg st |
|
588 | 588 | M sub/large4 |
|
589 | 589 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
590 | 590 | 9:598410d3eb9a modify normal file largefile in repo d |
|
591 | 591 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
592 | 592 | 7:daea875e9014 add/edit more largefiles |
|
593 | 593 | 6:4355d653f84f edit files yet again |
|
594 | 594 | 5:9d5af5072dbd edit files again |
|
595 | 595 | 4:74c02385b94c move files |
|
596 | 596 | 3:9e8fbc4bce62 copy files |
|
597 | 597 | 2:51a0ae4d5864 remove files |
|
598 | 598 | 1:ce8896473775 edit files |
|
599 | 599 | 0:30d30fe6a5be add files |
|
600 | 600 | $ cat sub/large4 |
|
601 | 601 | large4-modified-again |
|
602 | 602 | |
|
603 | 603 | "update --check" refuses to update with uncommitted changes. |
|
604 | 604 | $ hg update --check 8 |
|
605 | 605 | abort: uncommitted local changes |
|
606 | 606 | [255] |
|
607 | 607 | |
|
608 | 608 | "update --clean" leaves correct largefiles in working copy. |
|
609 | 609 | |
|
610 | 610 | $ hg update --clean |
|
611 | 611 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
612 | 612 | getting changed largefiles |
|
613 | 613 | 1 largefiles updated, 0 removed |
|
614 | 614 | $ cat normal3 |
|
615 | 615 | normal3-modified |
|
616 | 616 | $ cat sub/normal4 |
|
617 | 617 | normal4-modified |
|
618 | 618 | $ cat sub/large4 |
|
619 | 619 | large4-modified |
|
620 | 620 | $ cat sub2/large6 |
|
621 | 621 | large6-modified |
|
622 | 622 | $ cat sub2/large7 |
|
623 | 623 | large7 |
|
624 | 624 | |
|
625 | 625 | Now "update check" is happy. |
|
626 | 626 | $ hg update --check 8 |
|
627 | 627 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
628 | 628 | getting changed largefiles |
|
629 | 629 | 1 largefiles updated, 0 removed |
|
630 | 630 | $ hg update --check |
|
631 | 631 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
632 | 632 | getting changed largefiles |
|
633 | 633 | 1 largefiles updated, 0 removed |
|
634 | 634 | |
|
635 | 635 | Test removing empty largefiles directories on update |
|
636 | 636 | $ test -d sub2 && echo "sub2 exists" |
|
637 | 637 | sub2 exists |
|
638 | 638 | $ hg update -q null |
|
639 | 639 | $ test -d sub2 && echo "error: sub2 should not exist anymore" |
|
640 | 640 | [1] |
|
641 | 641 | $ hg update -q |
|
642 | 642 | |
|
643 | 643 | Test hg remove removes empty largefiles directories |
|
644 | 644 | $ test -d sub2 && echo "sub2 exists" |
|
645 | 645 | sub2 exists |
|
646 | 646 | $ hg remove sub2/* |
|
647 | 647 | $ test -d sub2 && echo "error: sub2 should not exist anymore" |
|
648 | 648 | [1] |
|
649 | 649 | $ hg revert sub2/large6 sub2/large7 |
|
650 | 650 | |
|
651 | 651 | "revert" works on largefiles (and normal files too). |
|
652 | 652 | $ echo hack3 >> normal3 |
|
653 | 653 | $ echo hack4 >> sub/normal4 |
|
654 | 654 | $ echo hack4 >> sub/large4 |
|
655 | 655 | $ rm sub2/large6 |
|
656 | 656 | $ hg revert sub2/large6 |
|
657 | 657 | $ hg rm sub2/large6 |
|
658 | 658 | $ echo new >> sub2/large8 |
|
659 | 659 | $ hg add --large sub2/large8 |
|
660 | 660 | # XXX we don't really want to report that we're reverting the standin; |
|
661 | 661 | # that's just an implementation detail. But I don't see an obvious fix. ;-( |
|
662 | 662 | $ hg revert sub |
|
663 | 663 | reverting .hglf/sub/large4 (glob) |
|
664 | 664 | reverting sub/normal4 (glob) |
|
665 | 665 | $ hg status |
|
666 | 666 | M normal3 |
|
667 | 667 | A sub2/large8 |
|
668 | 668 | R sub2/large6 |
|
669 | 669 | ? sub/large4.orig |
|
670 | 670 | ? sub/normal4.orig |
|
671 | 671 | $ cat sub/normal4 |
|
672 | 672 | normal4-modified |
|
673 | 673 | $ cat sub/large4 |
|
674 | 674 | large4-modified |
|
675 | 675 | $ hg revert -a --no-backup |
|
676 | 676 | undeleting .hglf/sub2/large6 (glob) |
|
677 | 677 | forgetting .hglf/sub2/large8 (glob) |
|
678 | 678 | reverting normal3 |
|
679 | 679 | $ hg status |
|
680 | 680 | ? sub/large4.orig |
|
681 | 681 | ? sub/normal4.orig |
|
682 | 682 | ? sub2/large8 |
|
683 | 683 | $ cat normal3 |
|
684 | 684 | normal3-modified |
|
685 | 685 | $ cat sub2/large6 |
|
686 | 686 | large6-modified |
|
687 | 687 | $ rm sub/*.orig sub2/large8 |
|
688 | 688 | |
|
689 | 689 | revert some files to an older revision |
|
690 | 690 | $ hg revert --no-backup -r 8 sub2 |
|
691 | 691 | reverting .hglf/sub2/large6 (glob) |
|
692 | 692 | $ cat sub2/large6 |
|
693 | 693 | large6 |
|
694 | 694 | $ hg revert --no-backup sub2 |
|
695 | 695 | reverting .hglf/sub2/large6 (glob) |
|
696 | 696 | $ hg status |
|
697 | 697 | |
|
698 | 698 | "verify --large" actually verifies largefiles |
|
699 | 699 | |
|
700 | 700 | $ hg verify --large |
|
701 | 701 | checking changesets |
|
702 | 702 | checking manifests |
|
703 | 703 | crosschecking files in changesets and manifests |
|
704 | 704 | checking files |
|
705 | 705 | 10 files, 10 changesets, 28 total revisions |
|
706 | 706 | searching 1 changesets for largefiles |
|
707 | 707 | verified existence of 3 revisions of 3 largefiles |
|
708 | 708 | |
|
709 | 709 | Merging does not revert to old versions of largefiles and also check |
|
710 | 710 | that merging after having pulled from a non-default remote works |
|
711 | 711 | correctly. |
|
712 | 712 | |
|
713 | 713 | $ cd .. |
|
714 | 714 | $ hg clone -r 7 e temp |
|
715 | 715 | adding changesets |
|
716 | 716 | adding manifests |
|
717 | 717 | adding file changes |
|
718 | 718 | added 8 changesets with 24 changes to 10 files |
|
719 | 719 | updating to branch default |
|
720 | 720 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
721 | 721 | getting changed largefiles |
|
722 | 722 | 3 largefiles updated, 0 removed |
|
723 | 723 | $ hg clone temp f |
|
724 | 724 | updating to branch default |
|
725 | 725 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
726 | 726 | getting changed largefiles |
|
727 | 727 | 3 largefiles updated, 0 removed |
|
728 | 728 | # Delete the largefiles in the largefiles system cache so that we have an |
|
729 | 729 | # opportunity to test that caching after a pull works. |
|
730 | 730 | $ rm ${USERCACHE}/* |
|
731 | 731 | $ cd f |
|
732 | 732 | $ echo "large4-merge-test" > sub/large4 |
|
733 | 733 | $ hg commit -m "Modify large4 to test merge" |
|
734 | 734 | Invoking status precommit hook |
|
735 | 735 | M sub/large4 |
|
736 | 736 | $ hg pull ../e |
|
737 | 737 | pulling from ../e |
|
738 | 738 | searching for changes |
|
739 | 739 | adding changesets |
|
740 | 740 | adding manifests |
|
741 | 741 | adding file changes |
|
742 | 742 | added 2 changesets with 4 changes to 4 files (+1 heads) |
|
743 | 743 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
744 | 744 | caching new largefiles |
|
745 | 745 | 2 largefiles cached |
|
746 | 746 | $ hg merge |
|
747 | 747 | merging sub/large4 |
|
748 | 748 | largefile sub/large4 has a merge conflict |
|
749 | 749 | keep (l)ocal or take (o)ther? l |
|
750 | 750 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
751 | 751 | (branch merge, don't forget to commit) |
|
752 | 752 | getting changed largefiles |
|
753 | 753 | 1 largefiles updated, 0 removed |
|
754 | 754 | $ hg commit -m "Merge repos e and f" |
|
755 | 755 | Invoking status precommit hook |
|
756 | 756 | M normal3 |
|
757 | 757 | M sub/normal4 |
|
758 | 758 | M sub2/large6 |
|
759 | 759 | $ cat normal3 |
|
760 | 760 | normal3-modified |
|
761 | 761 | $ cat sub/normal4 |
|
762 | 762 | normal4-modified |
|
763 | 763 | $ cat sub/large4 |
|
764 | 764 | large4-merge-test |
|
765 | 765 | $ cat sub2/large6 |
|
766 | 766 | large6-modified |
|
767 | 767 | $ cat sub2/large7 |
|
768 | 768 | large7 |
|
769 | 769 | |
|
770 | 770 | Test status after merging with a branch that introduces a new largefile: |
|
771 | 771 | |
|
772 | 772 | $ echo large > large |
|
773 | 773 | $ hg add --large large |
|
774 | 774 | $ hg commit -m 'add largefile' |
|
775 | 775 | Invoking status precommit hook |
|
776 | 776 | A large |
|
777 | 777 | $ hg update -q ".^" |
|
778 | 778 | $ echo change >> normal3 |
|
779 | 779 | $ hg commit -m 'some change' |
|
780 | 780 | Invoking status precommit hook |
|
781 | 781 | M normal3 |
|
782 | 782 | created new head |
|
783 | 783 | $ hg merge |
|
784 | 784 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
785 | 785 | (branch merge, don't forget to commit) |
|
786 | 786 | getting changed largefiles |
|
787 | 787 | 1 largefiles updated, 0 removed |
|
788 | 788 | $ hg status |
|
789 | 789 | M large |
|
790 | 790 | |
|
791 | 791 | Test that a normal file and a largefile with the same name and path cannot |
|
792 | 792 | coexist. |
|
793 | 793 | |
|
794 | 794 | $ rm sub2/large7 |
|
795 | 795 | $ echo "largeasnormal" > sub2/large7 |
|
796 | 796 | $ hg add sub2/large7 |
|
797 | 797 | sub2/large7 already a largefile |
|
798 | 798 | |
|
799 | 799 | Test that transplanting a largefile change works correctly. |
|
800 | 800 | |
|
801 | 801 | $ cd .. |
|
802 | 802 | $ hg clone -r 8 d g |
|
803 | 803 | adding changesets |
|
804 | 804 | adding manifests |
|
805 | 805 | adding file changes |
|
806 | 806 | added 9 changesets with 26 changes to 10 files |
|
807 | 807 | updating to branch default |
|
808 | 808 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
809 | 809 | getting changed largefiles |
|
810 | 810 | 3 largefiles updated, 0 removed |
|
811 | 811 | $ cd g |
|
812 | 812 | $ hg transplant -s ../d 598410d3eb9a |
|
813 | 813 | searching for changes |
|
814 | 814 | searching for changes |
|
815 | 815 | adding changesets |
|
816 | 816 | adding manifests |
|
817 | 817 | adding file changes |
|
818 | 818 | added 1 changesets with 2 changes to 2 files |
|
819 | 819 | getting changed largefiles |
|
820 | 820 | 1 largefiles updated, 0 removed |
|
821 | 821 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
822 | 822 | 9:598410d3eb9a modify normal file largefile in repo d |
|
823 | 823 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
824 | 824 | 7:daea875e9014 add/edit more largefiles |
|
825 | 825 | 6:4355d653f84f edit files yet again |
|
826 | 826 | 5:9d5af5072dbd edit files again |
|
827 | 827 | 4:74c02385b94c move files |
|
828 | 828 | 3:9e8fbc4bce62 copy files |
|
829 | 829 | 2:51a0ae4d5864 remove files |
|
830 | 830 | 1:ce8896473775 edit files |
|
831 | 831 | 0:30d30fe6a5be add files |
|
832 | 832 | $ cat normal3 |
|
833 | 833 | normal3-modified |
|
834 | 834 | $ cat sub/normal4 |
|
835 | 835 | normal4-modified |
|
836 | 836 | $ cat sub/large4 |
|
837 | 837 | large4-modified |
|
838 | 838 | $ cat sub2/large6 |
|
839 | 839 | large6-modified |
|
840 | 840 | $ cat sub2/large7 |
|
841 | 841 | large7 |
|
842 | 842 | |
|
843 | 843 | Cat a largefile |
|
844 | 844 | $ hg cat normal3 |
|
845 | 845 | normal3-modified |
|
846 | 846 | $ hg cat sub/large4 |
|
847 | 847 | large4-modified |
|
848 | 848 | $ rm ${USERCACHE}/* |
|
849 | 849 | $ hg cat -r a381d2c8c80e -o cat.out sub/large4 |
|
850 | 850 | $ cat cat.out |
|
851 | 851 | large4-modified |
|
852 | 852 | $ rm cat.out |
|
853 | 853 | $ hg cat -r a381d2c8c80e normal3 |
|
854 | 854 | normal3-modified |
|
855 | 855 | |
|
856 | 856 | Test that renaming a largefile results in correct output for status |
|
857 | 857 | |
|
858 | 858 | $ hg rename sub/large4 large4-renamed |
|
859 | 859 | $ hg commit -m "test rename output" |
|
860 | 860 | Invoking status precommit hook |
|
861 | 861 | A large4-renamed |
|
862 | 862 | R sub/large4 |
|
863 | 863 | $ cat large4-renamed |
|
864 | 864 | large4-modified |
|
865 | 865 | $ cd sub2 |
|
866 | 866 | $ hg rename large6 large6-renamed |
|
867 | 867 | $ hg st |
|
868 | 868 | A sub2/large6-renamed |
|
869 | 869 | R sub2/large6 |
|
870 | 870 | $ cd .. |
|
871 | 871 | |
|
872 | 872 | Test --normal flag |
|
873 | 873 | |
|
874 | 874 | $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null |
|
875 | 875 | $ hg add --normal --large new-largefile |
|
876 | 876 | abort: --normal cannot be used with --large |
|
877 | 877 | [255] |
|
878 | 878 | $ hg add --normal new-largefile |
|
879 | 879 | new-largefile: up to 69 MB of RAM may be required to manage this file |
|
880 | 880 | (use 'hg revert new-largefile' to cancel the pending addition) |
|
881 | 881 | $ cd .. |
|
882 | 882 | |
|
883 | 883 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
884 | 884 | $ mkdir r1 |
|
885 | 885 | $ cd r1 |
|
886 | 886 | $ hg init |
|
887 | 887 | $ echo c1 > f1 |
|
888 | 888 | $ hg add f1 |
|
889 | 889 | $ hg commit -m "m1" |
|
890 | 890 | Invoking status precommit hook |
|
891 | 891 | A f1 |
|
892 | 892 | $ cd .. |
|
893 | 893 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid |
|
894 | 894 | $ cat hg.pid >> $DAEMON_PIDS |
|
895 | 895 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 |
|
896 | 896 | requesting all changes |
|
897 | 897 | adding changesets |
|
898 | 898 | adding manifests |
|
899 | 899 | adding file changes |
|
900 | 900 | added 1 changesets with 1 changes to 1 files |
|
901 | 901 | updating to branch default |
|
902 | 902 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
903 | 903 | |
|
904 | 904 | largefiles clients still work with vanilla servers |
|
905 | 905 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid |
|
906 | 906 | $ cat hg.pid >> $DAEMON_PIDS |
|
907 | 907 | $ hg clone http://localhost:$HGPORT1 r3 |
|
908 | 908 | requesting all changes |
|
909 | 909 | adding changesets |
|
910 | 910 | adding manifests |
|
911 | 911 | adding file changes |
|
912 | 912 | added 1 changesets with 1 changes to 1 files |
|
913 | 913 | updating to branch default |
|
914 | 914 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
915 | 915 | |
|
916 | 916 | vanilla clients locked out from largefiles http repos |
|
917 | 917 | $ mkdir r4 |
|
918 | 918 | $ cd r4 |
|
919 | 919 | $ hg init |
|
920 | 920 | $ echo c1 > f1 |
|
921 | 921 | $ hg add --large f1 |
|
922 | 922 | $ hg commit -m "m1" |
|
923 | 923 | Invoking status precommit hook |
|
924 | 924 | A f1 |
|
925 | 925 | $ cd .. |
|
926 | 926 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid |
|
927 | 927 | $ cat hg.pid >> $DAEMON_PIDS |
|
928 | 928 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 |
|
929 | 929 | abort: remote error: |
|
930 | 930 | |
|
931 | 931 | This repository uses the largefiles extension. |
|
932 | 932 | |
|
933 | 933 | Please enable it in your Mercurial config file. |
|
934 | 934 | [255] |
|
935 | 935 | |
|
936 | 936 | used all HGPORTs, kill all daemons |
|
937 | 937 | $ "$TESTDIR/killdaemons.py" |
|
938 | 938 | |
|
939 | 939 | vanilla clients locked out from largefiles ssh repos |
|
940 | 940 | $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5 |
|
941 | 941 | abort: remote error: |
|
942 | 942 | |
|
943 | 943 | This repository uses the largefiles extension. |
|
944 | 944 | |
|
945 | 945 | Please enable it in your Mercurial config file. |
|
946 | 946 | [255] |
|
947 | 947 | |
|
948 | 948 | largefiles clients refuse to push largefiles repos to vanilla servers |
|
949 | 949 | $ mkdir r6 |
|
950 | 950 | $ cd r6 |
|
951 | 951 | $ hg init |
|
952 | 952 | $ echo c1 > f1 |
|
953 | 953 | $ hg add f1 |
|
954 | 954 | $ hg commit -m "m1" |
|
955 | 955 | Invoking status precommit hook |
|
956 | 956 | A f1 |
|
957 | 957 | $ cat >> .hg/hgrc <<! |
|
958 | 958 | > [web] |
|
959 | 959 | > push_ssl = false |
|
960 | 960 | > allow_push = * |
|
961 | 961 | > ! |
|
962 | 962 | $ cd .. |
|
963 | 963 | $ hg clone r6 r7 |
|
964 | 964 | updating to branch default |
|
965 | 965 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
966 | 966 | $ cd r7 |
|
967 | 967 | $ echo c2 > f2 |
|
968 | 968 | $ hg add --large f2 |
|
969 | 969 | $ hg commit -m "m2" |
|
970 | 970 | Invoking status precommit hook |
|
971 | 971 | A f2 |
|
972 | 972 | $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid |
|
973 | 973 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
974 | 974 | $ hg push http://localhost:$HGPORT |
|
975 | 975 | pushing to http://localhost:$HGPORT/ |
|
976 | 976 | searching for changes |
|
977 | 977 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store |
|
978 | 978 | [255] |
|
979 | 979 | $ cd .. |
|
980 | 980 | |
|
981 | 981 | putlfile errors are shown (issue3123) |
|
982 | 982 | Corrupt the cached largefile in r7 |
|
983 | 983 | $ echo corruption > $USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
984 | 984 | $ hg init empty |
|
985 | 985 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ |
|
986 | 986 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
987 | 987 | $ cat hg.pid >> $DAEMON_PIDS |
|
988 | 988 | $ hg push -R r7 http://localhost:$HGPORT1 |
|
989 | 989 | pushing to http://localhost:$HGPORT1/ |
|
990 | 990 | searching for changes |
|
991 | 991 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash |
|
992 | 992 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ |
|
993 | 993 | [255] |
|
994 | 994 | $ rm -rf empty |
|
995 | 995 | |
|
996 | 996 | Push a largefiles repository to a served empty repository |
|
997 | 997 | $ hg init r8 |
|
998 | 998 | $ echo c3 > r8/f1 |
|
999 | 999 | $ hg add --large r8/f1 -R r8 |
|
1000 | 1000 | $ hg commit -m "m1" -R r8 |
|
1001 | 1001 | Invoking status precommit hook |
|
1002 | 1002 | A f1 |
|
1003 | 1003 | $ hg init empty |
|
1004 | 1004 | $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \ |
|
1005 | 1005 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
1006 | 1006 | $ cat hg.pid >> $DAEMON_PIDS |
|
1007 | 1007 | $ rm ${USERCACHE}/* |
|
1008 | 1008 | $ hg push -R r8 http://localhost:$HGPORT2 |
|
1009 | 1009 | pushing to http://localhost:$HGPORT2/ |
|
1010 | 1010 | searching for changes |
|
1011 | 1011 | searching for changes |
|
1012 | 1012 | remote: adding changesets |
|
1013 | 1013 | remote: adding manifests |
|
1014 | 1014 | remote: adding file changes |
|
1015 | 1015 | remote: added 1 changesets with 1 changes to 1 files |
|
1016 | 1016 | $ rm -rf empty |
|
1017 | 1017 | |
|
1018 | 1018 | used all HGPORTs, kill all daemons |
|
1019 | 1019 | $ "$TESTDIR/killdaemons.py" |
|
1020 | 1020 | |
|
1021 | 1021 | Clone a local repository owned by another user |
|
1022 | 1022 | We have to simulate that here by setting $HOME and removing write permissions |
|
1023 | 1023 | $ ORIGHOME="$HOME" |
|
1024 | 1024 | $ mkdir alice |
|
1025 | 1025 | $ HOME="`pwd`/alice" |
|
1026 | 1026 | $ cd alice |
|
1027 | 1027 | $ hg init pubrepo |
|
1028 | 1028 | $ cd pubrepo |
|
1029 | 1029 | $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null |
|
1030 | 1030 | $ hg add --large a-large-file |
|
1031 | 1031 | $ hg commit -m "Add a large file" |
|
1032 | 1032 | Invoking status precommit hook |
|
1033 | 1033 | A a-large-file |
|
1034 | 1034 | $ cd .. |
|
1035 | 1035 | $ chmod -R a-w pubrepo |
|
1036 | 1036 | $ cd .. |
|
1037 | 1037 | $ mkdir bob |
|
1038 | 1038 | $ HOME="`pwd`/bob" |
|
1039 | 1039 | $ cd bob |
|
1040 | 1040 | $ hg clone --pull ../alice/pubrepo pubrepo |
|
1041 | 1041 | requesting all changes |
|
1042 | 1042 | adding changesets |
|
1043 | 1043 | adding manifests |
|
1044 | 1044 | adding file changes |
|
1045 | 1045 | added 1 changesets with 1 changes to 1 files |
|
1046 | 1046 | updating to branch default |
|
1047 | 1047 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1048 | 1048 | getting changed largefiles |
|
1049 | 1049 | 1 largefiles updated, 0 removed |
|
1050 | 1050 | $ cd .. |
|
1051 | 1051 | $ chmod -R u+w alice/pubrepo |
|
1052 | 1052 | $ HOME="$ORIGHOME" |
|
1053 | 1053 | |
|
1054 | #if symlink | |
|
1055 | ||
|
1054 | 1056 | Symlink to a large largefile should behave the same as a symlink to a normal file |
|
1055 | 1057 | $ hg init largesymlink |
|
1056 | 1058 | $ cd largesymlink |
|
1057 | 1059 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null |
|
1058 | 1060 | $ hg add --large largefile |
|
1059 | 1061 | $ hg commit -m "commit a large file" |
|
1060 | 1062 | Invoking status precommit hook |
|
1061 | 1063 | A largefile |
|
1062 | 1064 | $ ln -s largefile largelink |
|
1063 | 1065 | $ hg add largelink |
|
1064 | 1066 | $ hg commit -m "commit a large symlink" |
|
1065 | 1067 | Invoking status precommit hook |
|
1066 | 1068 | A largelink |
|
1067 | 1069 | $ rm -f largelink |
|
1068 | 1070 | $ hg up >/dev/null |
|
1069 | 1071 | $ test -f largelink |
|
1070 | 1072 | [1] |
|
1071 | 1073 | $ test -L largelink |
|
1072 | 1074 | [1] |
|
1073 | 1075 | $ rm -f largelink # make next part of the test independent of the previous |
|
1074 | 1076 | $ hg up -C >/dev/null |
|
1075 | 1077 | $ test -f largelink |
|
1076 | 1078 | $ test -L largelink |
|
1077 | 1079 | $ cd .. |
|
1078 | 1080 | |
|
1081 | #endif | |
|
1082 | ||
|
1079 | 1083 | test for pattern matching on 'hg status': |
|
1080 | 1084 | to boost performance, largefiles checks whether specified patterns are |
|
1081 | 1085 | related to largefiles in working directory (NOT to STANDIN) or not. |
|
1082 | 1086 | |
|
1083 | 1087 | $ hg init statusmatch |
|
1084 | 1088 | $ cd statusmatch |
|
1085 | 1089 | |
|
1086 | 1090 | $ mkdir -p a/b/c/d |
|
1087 | 1091 | $ echo normal > a/b/c/d/e.normal.txt |
|
1088 | 1092 | $ hg add a/b/c/d/e.normal.txt |
|
1089 | 1093 | $ echo large > a/b/c/d/e.large.txt |
|
1090 | 1094 | $ hg add --large a/b/c/d/e.large.txt |
|
1091 | 1095 | $ mkdir -p a/b/c/x |
|
1092 | 1096 | $ echo normal > a/b/c/x/y.normal.txt |
|
1093 | 1097 | $ hg add a/b/c/x/y.normal.txt |
|
1094 | 1098 | $ hg commit -m 'add files' |
|
1095 | 1099 | Invoking status precommit hook |
|
1096 | 1100 | A a/b/c/d/e.large.txt |
|
1097 | 1101 | A a/b/c/d/e.normal.txt |
|
1098 | 1102 | A a/b/c/x/y.normal.txt |
|
1099 | 1103 | |
|
1100 | 1104 | (1) no pattern: no performance boost |
|
1101 | 1105 | $ hg status -A |
|
1102 | 1106 | C a/b/c/d/e.large.txt |
|
1103 | 1107 | C a/b/c/d/e.normal.txt |
|
1104 | 1108 | C a/b/c/x/y.normal.txt |
|
1105 | 1109 | |
|
1106 | 1110 | (2) pattern not related to largefiles: performance boost |
|
1107 | 1111 | $ hg status -A a/b/c/x |
|
1108 | 1112 | C a/b/c/x/y.normal.txt |
|
1109 | 1113 | |
|
1110 | 1114 | (3) pattern related to largefiles: no performance boost |
|
1111 | 1115 | $ hg status -A a/b/c/d |
|
1112 | 1116 | C a/b/c/d/e.large.txt |
|
1113 | 1117 | C a/b/c/d/e.normal.txt |
|
1114 | 1118 | |
|
1115 | 1119 | (4) pattern related to STANDIN (not to largefiles): performance boost |
|
1116 | 1120 | $ hg status -A .hglf/a |
|
1117 | 1121 | C .hglf/a/b/c/d/e.large.txt |
|
1118 | 1122 | |
|
1119 | 1123 | (5) mixed case: no performance boost |
|
1120 | 1124 | $ hg status -A a/b/c/x a/b/c/d |
|
1121 | 1125 | C a/b/c/d/e.large.txt |
|
1122 | 1126 | C a/b/c/d/e.normal.txt |
|
1123 | 1127 | C a/b/c/x/y.normal.txt |
|
1124 | 1128 | |
|
1125 | 1129 | verify that largefiles doesn't break filesets |
|
1126 | 1130 | |
|
1127 | 1131 | $ hg log --rev . --exclude "set:binary()" |
|
1128 | 1132 | changeset: 0:41bd42f10efa |
|
1129 | 1133 | tag: tip |
|
1130 | 1134 | user: test |
|
1131 | 1135 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1132 | 1136 | summary: add files |
|
1133 | 1137 | |
|
1134 | 1138 | verify that large files in subrepos handled properly |
|
1135 | 1139 | $ hg init subrepo |
|
1136 | 1140 | $ echo "subrepo = subrepo" > .hgsub |
|
1137 | 1141 | $ hg add .hgsub |
|
1138 | 1142 | $ hg ci -m "add subrepo" |
|
1139 | 1143 | Invoking status precommit hook |
|
1140 | 1144 | A .hgsub |
|
1141 | 1145 | ? .hgsubstate |
|
1142 | 1146 | $ echo "rev 1" > subrepo/large.txt |
|
1143 | 1147 | $ hg -R subrepo add --large subrepo/large.txt |
|
1144 | 1148 | $ hg sum |
|
1145 | 1149 | parent: 1:8ee150ea2e9c tip |
|
1146 | 1150 | add subrepo |
|
1147 | 1151 | branch: default |
|
1148 | 1152 | commit: 1 subrepos |
|
1149 | 1153 | update: (current) |
|
1150 | 1154 | $ hg st |
|
1151 | 1155 | $ hg st -S |
|
1152 | 1156 | A subrepo/large.txt |
|
1153 | 1157 | $ hg ci -S -m "commit top repo" |
|
1154 | 1158 | committing subrepository subrepo |
|
1155 | 1159 | Invoking status precommit hook |
|
1156 | 1160 | A large.txt |
|
1157 | 1161 | Invoking status precommit hook |
|
1158 | 1162 | M .hgsubstate |
|
1159 | 1163 | # No differences |
|
1160 | 1164 | $ hg st -S |
|
1161 | 1165 | $ hg sum |
|
1162 | 1166 | parent: 2:ce4cd0c527a6 tip |
|
1163 | 1167 | commit top repo |
|
1164 | 1168 | branch: default |
|
1165 | 1169 | commit: (clean) |
|
1166 | 1170 | update: (current) |
|
1167 | 1171 | $ echo "rev 2" > subrepo/large.txt |
|
1168 | 1172 | $ hg st -S |
|
1169 | 1173 | M subrepo/large.txt |
|
1170 | 1174 | $ hg sum |
|
1171 | 1175 | parent: 2:ce4cd0c527a6 tip |
|
1172 | 1176 | commit top repo |
|
1173 | 1177 | branch: default |
|
1174 | 1178 | commit: 1 subrepos |
|
1175 | 1179 | update: (current) |
|
1176 | 1180 | $ hg ci -m "this commit should fail without -S" |
|
1177 | 1181 | abort: uncommitted changes in subrepo subrepo |
|
1178 | 1182 | (use --subrepos for recursive commit) |
|
1179 | 1183 | [255] |
|
1180 | 1184 | |
|
1181 | 1185 | Add a normal file to the subrepo, then test archiving |
|
1182 | 1186 | |
|
1183 | 1187 | $ echo 'normal file' > subrepo/normal.txt |
|
1184 | 1188 | $ hg -R subrepo add subrepo/normal.txt |
|
1185 | 1189 | |
|
1186 | 1190 | Lock in subrepo, otherwise the change isn't archived |
|
1187 | 1191 | |
|
1188 | 1192 | $ hg ci -S -m "add normal file to top level" |
|
1189 | 1193 | committing subrepository subrepo |
|
1190 | 1194 | Invoking status precommit hook |
|
1191 | 1195 | M large.txt |
|
1192 | 1196 | A normal.txt |
|
1193 | 1197 | Invoking status precommit hook |
|
1194 | 1198 | M .hgsubstate |
|
1195 | 1199 | $ hg archive -S lf_subrepo_archive |
|
1196 | 1200 | $ find lf_subrepo_archive | sort |
|
1197 | 1201 | lf_subrepo_archive |
|
1198 | 1202 | lf_subrepo_archive/.hg_archival.txt |
|
1199 | 1203 | lf_subrepo_archive/.hgsub |
|
1200 | 1204 | lf_subrepo_archive/.hgsubstate |
|
1201 | 1205 | lf_subrepo_archive/a |
|
1202 | 1206 | lf_subrepo_archive/a/b |
|
1203 | 1207 | lf_subrepo_archive/a/b/c |
|
1204 | 1208 | lf_subrepo_archive/a/b/c/d |
|
1205 | 1209 | lf_subrepo_archive/a/b/c/d/e.large.txt |
|
1206 | 1210 | lf_subrepo_archive/a/b/c/d/e.normal.txt |
|
1207 | 1211 | lf_subrepo_archive/a/b/c/x |
|
1208 | 1212 | lf_subrepo_archive/a/b/c/x/y.normal.txt |
|
1209 | 1213 | lf_subrepo_archive/subrepo |
|
1210 | 1214 | lf_subrepo_archive/subrepo/large.txt |
|
1211 | 1215 | lf_subrepo_archive/subrepo/normal.txt |
|
1212 | 1216 | |
|
1213 | 1217 | $ cd .. |
@@ -1,262 +1,270 | |||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |
|
2 | ||
|
3 | 1 |
|
|
4 | 2 | > [extensions] |
|
5 | 3 | > largefiles = |
|
6 | 4 | > share = |
|
7 | 5 | > graphlog = |
|
8 | 6 | > mq = |
|
9 | 7 | > [largefiles] |
|
10 | 8 | > minsize = 0.5 |
|
11 | 9 | > patterns = **.other |
|
12 | 10 | > **.dat |
|
13 | 11 | > EOF |
|
14 | 12 | |
|
15 | 13 | "lfconvert" works |
|
16 | 14 | $ hg init bigfile-repo |
|
17 | 15 | $ cd bigfile-repo |
|
18 | 16 | $ cat >> .hg/hgrc <<EOF |
|
19 | 17 | > [extensions] |
|
20 | 18 | > largefiles = ! |
|
21 | 19 | > EOF |
|
22 | 20 | $ mkdir sub |
|
23 | 21 | $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null |
|
24 | 22 | $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null |
|
25 | 23 | $ echo normal > normal1 |
|
26 | 24 | $ echo alsonormal > sub/normal2 |
|
27 | 25 | $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null |
|
28 | 26 | $ hg addremove |
|
29 | 27 | adding large |
|
30 | 28 | adding large2 |
|
31 | 29 | adding normal1 |
|
32 | 30 | adding sub/maybelarge.dat |
|
33 | 31 | adding sub/normal2 |
|
34 | 32 | $ hg commit -m"add large, normal1" large normal1 |
|
35 | 33 | $ hg commit -m"add sub/*" sub |
|
34 | ||
|
36 | 35 | Test tag parsing |
|
37 | 36 | $ cat >> .hgtags <<EOF |
|
38 | 37 | > IncorrectlyFormattedTag! |
|
39 | 38 | > invalidhash sometag |
|
40 | 39 | > 0123456789abcdef anothertag |
|
41 | 40 | > EOF |
|
42 | 41 | $ hg add .hgtags |
|
43 | 42 | $ hg commit -m"add large2" large2 .hgtags |
|
44 | $ hg rename large2 large3 | |
|
43 | ||
|
45 | 44 | Test link+rename largefile codepath |
|
46 | $ ln -sf large large3 | |
|
47 | $ hg commit -m"make large2 a symlink" large2 large3 | |
|
48 | 45 | $ [ -d .hg/largefiles ] && echo fail || echo pass |
|
49 | 46 | pass |
|
50 | 47 | $ cd .. |
|
51 | 48 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo |
|
52 | 49 | initializing destination largefiles-repo |
|
53 | 50 | skipping incorrectly formatted tag IncorrectlyFormattedTag! |
|
54 | 51 | skipping incorrectly formatted id invalidhash |
|
55 | 52 | no mapping for id 0123456789abcdef |
|
53 | #if symlink | |
|
54 | $ hg --cwd bigfile-repo rename large2 large3 | |
|
55 | $ ln -sf large bigfile-repo/large3 | |
|
56 | $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3 | |
|
57 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink | |
|
58 | initializing destination largefiles-repo-symlink | |
|
59 | skipping incorrectly formatted tag IncorrectlyFormattedTag! | |
|
60 | skipping incorrectly formatted id invalidhash | |
|
61 | no mapping for id 0123456789abcdef | |
|
56 | 62 | abort: renamed/copied largefile large3 becomes symlink |
|
57 | 63 | [255] |
|
64 | #endif | |
|
58 | 65 | $ cd bigfile-repo |
|
59 | 66 | $ hg strip --no-backup 2 |
|
60 | 67 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
61 | 68 | $ cd .. |
|
62 | $ rm -rf largefiles-repo | |
|
69 | $ rm -rf largefiles-repo largefiles-repo-symlink | |
|
70 | ||
|
63 | 71 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo |
|
64 | 72 | initializing destination largefiles-repo |
|
65 | 73 | |
|
66 | 74 | "lfconvert" converts content correctly |
|
67 | 75 | $ cd largefiles-repo |
|
68 | 76 | $ hg up |
|
69 | 77 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
70 | 78 | getting changed largefiles |
|
71 | 79 | 2 largefiles updated, 0 removed |
|
72 | 80 | $ hg locate |
|
73 | 81 | .hglf/large |
|
74 | 82 | .hglf/sub/maybelarge.dat |
|
75 | 83 | normal1 |
|
76 | 84 | sub/normal2 |
|
77 | 85 | $ cat normal1 |
|
78 | 86 | normal |
|
79 | 87 | $ cat sub/normal2 |
|
80 | 88 | alsonormal |
|
81 | 89 | $ "$TESTDIR/md5sum.py" large sub/maybelarge.dat |
|
82 | 90 | ec87a838931d4d5d2e94a04644788a55 large |
|
83 | 91 | 1276481102f218c981e0324180bafd9f sub/maybelarge.dat |
|
84 | 92 | |
|
85 | 93 | "lfconvert" adds 'largefiles' to .hg/requires. |
|
86 | 94 | $ cat .hg/requires |
|
87 | 95 | largefiles |
|
88 | 96 | revlogv1 |
|
89 | 97 | fncache |
|
90 | 98 | store |
|
91 | 99 | dotencode |
|
92 | 100 | |
|
93 | 101 | "lfconvert" includes a newline at the end of the standin files. |
|
94 | 102 | $ cat .hglf/large .hglf/sub/maybelarge.dat |
|
95 | 103 | 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 |
|
96 | 104 | 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c |
|
97 | 105 | $ cd .. |
|
98 | 106 | |
|
99 | 107 | add some changesets to rename/remove/merge |
|
100 | 108 | $ cd bigfile-repo |
|
101 | 109 | $ hg mv -q sub stuff |
|
102 | 110 | $ hg commit -m"rename sub/ to stuff/" |
|
103 | 111 | $ hg update -q 1 |
|
104 | 112 | $ echo blah >> normal3 |
|
105 | 113 | $ echo blah >> sub/normal2 |
|
106 | 114 | $ echo blah >> sub/maybelarge.dat |
|
107 | 115 | $ "$TESTDIR/md5sum.py" sub/maybelarge.dat |
|
108 | 116 | 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat |
|
109 | 117 | $ hg commit -A -m"add normal3, modify sub/*" |
|
110 | 118 | adding normal3 |
|
111 | 119 | created new head |
|
112 | 120 | $ hg rm large normal3 |
|
113 | 121 | $ hg commit -q -m"remove large, normal3" |
|
114 | 122 | $ hg merge |
|
115 | 123 | merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat |
|
116 | 124 | warning: $TESTTMP/bigfile-repo/stuff/maybelarge.dat looks like a binary file. (glob) |
|
117 | 125 | merging stuff/maybelarge.dat incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
118 | 126 | merging sub/normal2 and stuff/normal2 to stuff/normal2 |
|
119 | 127 | 0 files updated, 1 files merged, 0 files removed, 1 files unresolved |
|
120 | 128 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
121 | 129 | [1] |
|
122 | 130 | $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat |
|
123 | 131 | $ hg resolve -m stuff/maybelarge.dat |
|
124 | 132 | $ hg commit -m"merge" |
|
125 | 133 | $ hg glog --template "{rev}:{node|short} {desc|firstline}\n" |
|
126 | 134 | @ 5:4884f215abda merge |
|
127 | 135 | |\ |
|
128 | 136 | | o 4:7285f817b77e remove large, normal3 |
|
129 | 137 | | | |
|
130 | 138 | | o 3:67e3892e3534 add normal3, modify sub/* |
|
131 | 139 | | | |
|
132 | 140 | o | 2:c96c8beb5d56 rename sub/ to stuff/ |
|
133 | 141 | |/ |
|
134 | 142 | o 1:020c65d24e11 add sub/* |
|
135 | 143 | | |
|
136 | 144 | o 0:117b8328f97a add large, normal1 |
|
137 | 145 | |
|
138 | 146 | $ cd .. |
|
139 | 147 | |
|
140 | 148 | lfconvert with rename, merge, and remove |
|
141 | 149 | $ rm -rf largefiles-repo |
|
142 | 150 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo |
|
143 | 151 | initializing destination largefiles-repo |
|
144 | 152 | $ cd largefiles-repo |
|
145 | 153 | $ hg glog --template "{rev}:{node|short} {desc|firstline}\n" |
|
146 | 154 | o 5:8e05f5f2b77e merge |
|
147 | 155 | |\ |
|
148 | 156 | | o 4:a5a02de7a8e4 remove large, normal3 |
|
149 | 157 | | | |
|
150 | 158 | | o 3:55759520c76f add normal3, modify sub/* |
|
151 | 159 | | | |
|
152 | 160 | o | 2:261ad3f3f037 rename sub/ to stuff/ |
|
153 | 161 | |/ |
|
154 | 162 | o 1:334e5237836d add sub/* |
|
155 | 163 | | |
|
156 | 164 | o 0:d4892ec57ce2 add large, normal1 |
|
157 | 165 | |
|
158 | 166 | $ hg locate -r 2 |
|
159 | 167 | .hglf/large |
|
160 | 168 | .hglf/stuff/maybelarge.dat |
|
161 | 169 | normal1 |
|
162 | 170 | stuff/normal2 |
|
163 | 171 | $ hg locate -r 3 |
|
164 | 172 | .hglf/large |
|
165 | 173 | .hglf/sub/maybelarge.dat |
|
166 | 174 | normal1 |
|
167 | 175 | normal3 |
|
168 | 176 | sub/normal2 |
|
169 | 177 | $ hg locate -r 4 |
|
170 | 178 | .hglf/sub/maybelarge.dat |
|
171 | 179 | normal1 |
|
172 | 180 | sub/normal2 |
|
173 | 181 | $ hg locate -r 5 |
|
174 | 182 | .hglf/stuff/maybelarge.dat |
|
175 | 183 | normal1 |
|
176 | 184 | stuff/normal2 |
|
177 | 185 | $ hg update |
|
178 | 186 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
179 | 187 | getting changed largefiles |
|
180 | 188 | 1 largefiles updated, 0 removed |
|
181 | 189 | $ cat stuff/normal2 |
|
182 | 190 | alsonormal |
|
183 | 191 | blah |
|
184 | 192 | $ "$TESTDIR/md5sum.py" stuff/maybelarge.dat |
|
185 | 193 | 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat |
|
186 | 194 | $ cat .hglf/stuff/maybelarge.dat |
|
187 | 195 | 76236b6a2c6102826c61af4297dd738fb3b1de38 |
|
188 | 196 | $ cd .. |
|
189 | 197 | |
|
190 | 198 | "lfconvert" error cases |
|
191 | 199 | $ hg lfconvert http://localhost/foo foo |
|
192 | 200 | abort: http://localhost/foo is not a local Mercurial repo |
|
193 | 201 | [255] |
|
194 | 202 | $ hg lfconvert foo ssh://localhost/foo |
|
195 | 203 | abort: ssh://localhost/foo is not a local Mercurial repo |
|
196 | 204 | [255] |
|
197 | 205 | $ hg lfconvert nosuchrepo foo |
|
198 | 206 | abort: repository nosuchrepo not found! |
|
199 | 207 | [255] |
|
200 | 208 | $ hg share -q -U bigfile-repo shared |
|
201 | 209 | $ printf 'bogus' > shared/.hg/sharedpath |
|
202 | 210 | $ hg lfconvert shared foo |
|
203 | 211 | abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus! (glob) |
|
204 | 212 | [255] |
|
205 | 213 | $ hg lfconvert bigfile-repo largefiles-repo |
|
206 | 214 | initializing destination largefiles-repo |
|
207 | 215 | abort: repository largefiles-repo already exists! |
|
208 | 216 | [255] |
|
209 | 217 | |
|
210 | 218 | add another largefile to the new largefiles repo |
|
211 | 219 | $ cd largefiles-repo |
|
212 | 220 | $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null |
|
213 | 221 | $ hg add --lfsize=1 anotherlarge |
|
214 | 222 | $ hg commit -m "add anotherlarge (should be a largefile)" |
|
215 | 223 | $ cat .hglf/anotherlarge |
|
216 | 224 | 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 |
|
217 | 225 | $ cd .. |
|
218 | 226 | |
|
219 | 227 | round-trip: converting back to a normal (non-largefiles) repo with |
|
220 | 228 | "lfconvert --to-normal" should give the same as ../bigfile-repo |
|
221 | 229 | $ cd largefiles-repo |
|
222 | 230 | $ hg lfconvert --to-normal . ../normal-repo |
|
223 | 231 | initializing destination ../normal-repo |
|
224 | 232 | $ cd ../normal-repo |
|
225 | 233 | $ cat >> .hg/hgrc <<EOF |
|
226 | 234 | > [extensions] |
|
227 | 235 | > largefiles = ! |
|
228 | 236 | > EOF |
|
229 | 237 | |
|
230 | 238 | # Hmmm: the changeset ID for rev 5 is different from the original |
|
231 | 239 | # normal repo (../bigfile-repo), because the changelog filelist |
|
232 | 240 | # differs between the two incarnations of rev 5: this repo includes |
|
233 | 241 | # 'large' in the list, but ../bigfile-repo does not. Since rev 5 |
|
234 | 242 | # removes 'large' relative to the first parent in both repos, it seems |
|
235 | 243 | # to me that lfconvert is doing a *better* job than |
|
236 | 244 | # "hg remove" + "hg merge" + "hg commit". |
|
237 | 245 | # $ hg -R ../bigfile-repo debugdata -c 5 |
|
238 | 246 | # $ hg debugdata -c 5 |
|
239 | 247 | $ hg glog --template "{rev}:{node|short} {desc|firstline}\n" |
|
240 | 248 | o 6:1635824e6f59 add anotherlarge (should be a largefile) |
|
241 | 249 | | |
|
242 | 250 | o 5:7215f8deeaaf merge |
|
243 | 251 | |\ |
|
244 | 252 | | o 4:7285f817b77e remove large, normal3 |
|
245 | 253 | | | |
|
246 | 254 | | o 3:67e3892e3534 add normal3, modify sub/* |
|
247 | 255 | | | |
|
248 | 256 | o | 2:c96c8beb5d56 rename sub/ to stuff/ |
|
249 | 257 | |/ |
|
250 | 258 | o 1:020c65d24e11 add sub/* |
|
251 | 259 | | |
|
252 | 260 | o 0:117b8328f97a add large, normal1 |
|
253 | 261 | |
|
254 | 262 | $ hg update |
|
255 | 263 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
256 | 264 | $ hg locate |
|
257 | 265 | anotherlarge |
|
258 | 266 | normal1 |
|
259 | 267 | stuff/maybelarge.dat |
|
260 | 268 | stuff/normal2 |
|
261 | 269 | $ [ -d .hg/largefiles ] && echo fail || echo pass |
|
262 | 270 | pass |
General Comments 0
You need to be logged in to leave comments.
Login now