##// END OF EJS Templates
merge with stable
Matt Mackall -
r19118:b09acf81 merge default
parent child Browse files
Show More
@@ -1,136 +1,136 b''
1 1 Create user cache directory
2 2
3 3 $ USERCACHE=`pwd`/cache; export USERCACHE
4 4 $ cat <<EOF >> ${HGRCPATH}
5 5 > [extensions]
6 6 > hgext.largefiles=
7 7 > [largefiles]
8 8 > usercache=${USERCACHE}
9 9 > EOF
10 10 $ mkdir -p ${USERCACHE}
11 11
12 12 Create source repo, and commit adding largefile.
13 13
14 14 $ hg init src
15 15 $ cd src
16 16 $ echo large > large
17 17 $ hg add --large large
18 18 $ hg commit -m 'add largefile'
19 19 $ hg rm large
20 20 $ hg commit -m 'branchhead without largefile'
21 21 $ hg up -qr 0
22 22 $ cd ..
23 23
24 24 Discard all cached largefiles in USERCACHE
25 25
26 26 $ rm -rf ${USERCACHE}
27 27
28 28 Create mirror repo, and pull from source without largefile:
29 29 "pull" is used instead of "clone" for suppression of (1) updating to
30 30 tip (= cahcing largefile from source repo), and (2) recording source
31 31 repo as "default" path in .hg/hgrc.
32 32
33 33 $ hg init mirror
34 34 $ cd mirror
35 35 $ hg pull ../src
36 36 pulling from ../src
37 37 requesting all changes
38 38 adding changesets
39 39 adding manifests
40 40 adding file changes
41 41 added 2 changesets with 1 changes to 1 files
42 42 (run 'hg update' to get a working copy)
43 43
44 44 Update working directory to "tip", which requires largefile("large"),
45 45 but there is no cache file for it. So, hg must treat it as
46 46 "missing"(!) file.
47 47
48 48 $ hg update -r0
49 49 getting changed largefiles
50 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:$TESTTMP/mirror
50 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:$TESTTMP/mirror (glob)
51 51 0 largefiles updated, 0 removed
52 52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 53 $ hg status
54 54 ! large
55 55
56 56 Update working directory to null: this cleanup .hg/largefiles/dirstate
57 57
58 58 $ hg update null
59 59 getting changed largefiles
60 60 0 largefiles updated, 0 removed
61 61 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
62 62
63 63 Update working directory to tip, again.
64 64
65 65 $ hg update -r0
66 66 getting changed largefiles
67 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:$TESTTMP/mirror
67 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:$TESTTMP/mirror (glob)
68 68 0 largefiles updated, 0 removed
69 69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 70 $ hg status
71 71 ! large
72 72 $ cd ..
73 73
74 74 Verify that largefiles from pulled branchheads are fetched, also to an empty repo
75 75
76 76 $ hg init mirror2
77 77 $ hg -R mirror2 pull src -r0
78 78 pulling from src
79 79 adding changesets
80 80 adding manifests
81 81 adding file changes
82 82 added 1 changesets with 1 changes to 1 files
83 83 (run 'hg update' to get a working copy)
84 84
85 85 #if unix-permissions
86 86
87 87 Portable way to print file permissions:
88 88
89 89 $ cat > ls-l.py <<EOF
90 90 > #!/usr/bin/env python
91 91 > import sys, os
92 92 > path = sys.argv[1]
93 93 > print '%03o' % (os.lstat(path).st_mode & 0777)
94 94 > EOF
95 95 $ chmod +x ls-l.py
96 96
97 97 Test that files in .hg/largefiles inherit mode from .hg/store, not
98 98 from file in working copy:
99 99
100 100 $ cd src
101 101 $ chmod 750 .hg/store
102 102 $ chmod 660 large
103 103 $ echo change >> large
104 104 $ hg commit -m change
105 105 created new head
106 106 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
107 107 640
108 108
109 109 Test permission of with files in .hg/largefiles created by update:
110 110
111 111 $ cd ../mirror
112 112 $ rm -r "$USERCACHE" .hg/largefiles # avoid links
113 113 $ chmod 750 .hg/store
114 114 $ hg pull ../src --update -q
115 115 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
116 116 640
117 117
118 118 Test permission of files created by push:
119 119
120 120 $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
121 121 > --config "web.allow_push=*" --config web.push_ssl=no
122 122 $ cat hg.pid >> $DAEMON_PIDS
123 123
124 124 $ echo change >> large
125 125 $ hg commit -m change
126 126
127 127 $ rm -r "$USERCACHE"
128 128
129 129 $ hg push -q http://localhost:$HGPORT/
130 130
131 131 $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
132 132 640
133 133
134 134 $ cd ..
135 135
136 136 #endif
@@ -1,2191 +1,2191 b''
1 1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 2 $ mkdir "${USERCACHE}"
3 3 $ cat >> $HGRCPATH <<EOF
4 4 > [extensions]
5 5 > largefiles=
6 6 > purge=
7 7 > rebase=
8 8 > transplant=
9 9 > [phases]
10 10 > publish=False
11 11 > [largefiles]
12 12 > minsize=2
13 13 > patterns=glob:**.dat
14 14 > usercache=${USERCACHE}
15 15 > [hooks]
16 16 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
17 17 > EOF
18 18
19 19 Create the repo with a couple of revisions of both large and normal
20 20 files.
21 21 Test status and dirstate of largefiles and that summary output is correct.
22 22
23 23 $ hg init a
24 24 $ cd a
25 25 $ mkdir sub
26 26 $ echo normal1 > normal1
27 27 $ echo normal2 > sub/normal2
28 28 $ echo large1 > large1
29 29 $ echo large2 > sub/large2
30 30 $ hg add normal1 sub/normal2
31 31 $ hg add --large large1 sub/large2
32 32 $ hg commit -m "add files"
33 33 Invoking status precommit hook
34 34 A large1
35 35 A normal1
36 36 A sub/large2
37 37 A sub/normal2
38 38 $ touch large1 sub/large2
39 39 $ sleep 1
40 40 $ hg st
41 41 $ hg debugstate --nodates
42 42 n 644 41 .hglf/large1
43 43 n 644 41 .hglf/sub/large2
44 44 n 644 8 normal1
45 45 n 644 8 sub/normal2
46 46 $ hg debugstate --large
47 47 n 644 7 large1
48 48 n 644 7 sub/large2
49 49 $ echo normal11 > normal1
50 50 $ echo normal22 > sub/normal2
51 51 $ echo large11 > large1
52 52 $ echo large22 > sub/large2
53 53 $ hg commit -m "edit files"
54 54 Invoking status precommit hook
55 55 M large1
56 56 M normal1
57 57 M sub/large2
58 58 M sub/normal2
59 59 $ hg sum --large
60 60 parent: 1:ce8896473775 tip
61 61 edit files
62 62 branch: default
63 63 commit: (clean)
64 64 update: (current)
65 65 largefiles: (no remote repo)
66 66
67 67 Commit preserved largefile contents.
68 68
69 69 $ cat normal1
70 70 normal11
71 71 $ cat large1
72 72 large11
73 73 $ cat sub/normal2
74 74 normal22
75 75 $ cat sub/large2
76 76 large22
77 77
78 78 Test status, subdir and unknown files
79 79
80 80 $ echo unknown > sub/unknown
81 81 $ hg st --all
82 82 ? sub/unknown
83 83 C large1
84 84 C normal1
85 85 C sub/large2
86 86 C sub/normal2
87 87 $ hg st --all sub
88 88 ? sub/unknown
89 89 C sub/large2
90 90 C sub/normal2
91 91 $ rm sub/unknown
92 92
93 93 Test messages and exit codes for remove warning cases
94 94
95 95 $ hg remove -A large1
96 96 not removing large1: file still exists
97 97 [1]
98 98 $ echo 'modified' > large1
99 99 $ hg remove large1
100 100 not removing large1: file is modified (use -f to force removal)
101 101 [1]
102 102 $ echo 'new' > normalnew
103 103 $ hg add normalnew
104 104 $ echo 'new' > largenew
105 105 $ hg add --large normalnew
106 106 normalnew already tracked!
107 107 $ hg remove normalnew largenew
108 108 not removing largenew: file is untracked
109 109 not removing normalnew: file has been marked for add (use forget to undo)
110 110 [1]
111 111 $ rm normalnew largenew
112 112 $ hg up -Cq
113 113
114 114 Remove both largefiles and normal files.
115 115
116 116 $ hg remove normal1 large1
117 117 $ hg status large1
118 118 R large1
119 119 $ hg commit -m "remove files"
120 120 Invoking status precommit hook
121 121 R large1
122 122 R normal1
123 123 $ ls
124 124 sub
125 125 $ echo "testlargefile" > large1-test
126 126 $ hg add --large large1-test
127 127 $ hg st
128 128 A large1-test
129 129 $ hg rm large1-test
130 130 not removing large1-test: file has been marked for add (use forget to undo)
131 131 [1]
132 132 $ hg st
133 133 A large1-test
134 134 $ hg forget large1-test
135 135 $ hg st
136 136 ? large1-test
137 137 $ hg remove large1-test
138 138 not removing large1-test: file is untracked
139 139 [1]
140 140 $ hg forget large1-test
141 141 not removing large1-test: file is already untracked
142 142 [1]
143 143 $ rm large1-test
144 144
145 145 Copy both largefiles and normal files (testing that status output is correct).
146 146
147 147 $ hg cp sub/normal2 normal1
148 148 $ hg cp sub/large2 large1
149 149 $ hg commit -m "copy files"
150 150 Invoking status precommit hook
151 151 A large1
152 152 A normal1
153 153 $ cat normal1
154 154 normal22
155 155 $ cat large1
156 156 large22
157 157
158 158 Test moving largefiles and verify that normal files are also unaffected.
159 159
160 160 $ hg mv normal1 normal3
161 161 $ hg mv large1 large3
162 162 $ hg mv sub/normal2 sub/normal4
163 163 $ hg mv sub/large2 sub/large4
164 164 $ hg commit -m "move files"
165 165 Invoking status precommit hook
166 166 A large3
167 167 A normal3
168 168 A sub/large4
169 169 A sub/normal4
170 170 R large1
171 171 R normal1
172 172 R sub/large2
173 173 R sub/normal2
174 174 $ cat normal3
175 175 normal22
176 176 $ cat large3
177 177 large22
178 178 $ cat sub/normal4
179 179 normal22
180 180 $ cat sub/large4
181 181 large22
182 182
183 183 Test copies and moves from a directory other than root (issue3516)
184 184
185 185 $ cd ..
186 186 $ hg init lf_cpmv
187 187 $ cd lf_cpmv
188 188 $ mkdir dira
189 189 $ mkdir dira/dirb
190 190 $ touch dira/dirb/largefile
191 191 $ hg add --large dira/dirb/largefile
192 192 $ hg commit -m "added"
193 193 Invoking status precommit hook
194 194 A dira/dirb/largefile
195 195 $ cd dira
196 196 $ hg cp dirb/largefile foo/largefile
197 197 $ hg ci -m "deep copy"
198 198 Invoking status precommit hook
199 199 A dira/foo/largefile
200 200 $ find . | sort
201 201 .
202 202 ./dirb
203 203 ./dirb/largefile
204 204 ./foo
205 205 ./foo/largefile
206 206 $ hg mv foo/largefile baz/largefile
207 207 $ hg ci -m "moved"
208 208 Invoking status precommit hook
209 209 A dira/baz/largefile
210 210 R dira/foo/largefile
211 211 $ find . | sort
212 212 .
213 213 ./baz
214 214 ./baz/largefile
215 215 ./dirb
216 216 ./dirb/largefile
217 217 ./foo
218 218 $ cd ../../a
219 219
220 220 #if serve
221 221 Test display of largefiles in hgweb
222 222
223 223 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
224 224 $ cat ../hg.pid >> $DAEMON_PIDS
225 225 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
226 226 200 Script output follows
227 227
228 228
229 229 drwxr-xr-x sub
230 230 -rw-r--r-- 41 large3
231 231 -rw-r--r-- 9 normal3
232 232
233 233
234 234 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
235 235 200 Script output follows
236 236
237 237
238 238 -rw-r--r-- 41 large4
239 239 -rw-r--r-- 9 normal4
240 240
241 241
242 242 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
243 243 #endif
244 244
245 245 Test archiving the various revisions. These hit corner cases known with
246 246 archiving.
247 247
248 248 $ hg archive -r 0 ../archive0
249 249 $ hg archive -r 1 ../archive1
250 250 $ hg archive -r 2 ../archive2
251 251 $ hg archive -r 3 ../archive3
252 252 $ hg archive -r 4 ../archive4
253 253 $ cd ../archive0
254 254 $ cat normal1
255 255 normal1
256 256 $ cat large1
257 257 large1
258 258 $ cat sub/normal2
259 259 normal2
260 260 $ cat sub/large2
261 261 large2
262 262 $ cd ../archive1
263 263 $ cat normal1
264 264 normal11
265 265 $ cat large1
266 266 large11
267 267 $ cat sub/normal2
268 268 normal22
269 269 $ cat sub/large2
270 270 large22
271 271 $ cd ../archive2
272 272 $ ls
273 273 sub
274 274 $ cat sub/normal2
275 275 normal22
276 276 $ cat sub/large2
277 277 large22
278 278 $ cd ../archive3
279 279 $ cat normal1
280 280 normal22
281 281 $ cat large1
282 282 large22
283 283 $ cat sub/normal2
284 284 normal22
285 285 $ cat sub/large2
286 286 large22
287 287 $ cd ../archive4
288 288 $ cat normal3
289 289 normal22
290 290 $ cat large3
291 291 large22
292 292 $ cat sub/normal4
293 293 normal22
294 294 $ cat sub/large4
295 295 large22
296 296
297 297 Commit corner case: specify files to commit.
298 298
299 299 $ cd ../a
300 300 $ echo normal3 > normal3
301 301 $ echo large3 > large3
302 302 $ echo normal4 > sub/normal4
303 303 $ echo large4 > sub/large4
304 304 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
305 305 Invoking status precommit hook
306 306 M large3
307 307 M normal3
308 308 M sub/large4
309 309 M sub/normal4
310 310 $ cat normal3
311 311 normal3
312 312 $ cat large3
313 313 large3
314 314 $ cat sub/normal4
315 315 normal4
316 316 $ cat sub/large4
317 317 large4
318 318
319 319 One more commit corner case: commit from a subdirectory.
320 320
321 321 $ cd ../a
322 322 $ echo normal33 > normal3
323 323 $ echo large33 > large3
324 324 $ echo normal44 > sub/normal4
325 325 $ echo large44 > sub/large4
326 326 $ cd sub
327 327 $ hg commit -m "edit files yet again"
328 328 Invoking status precommit hook
329 329 M large3
330 330 M normal3
331 331 M sub/large4
332 332 M sub/normal4
333 333 $ cat ../normal3
334 334 normal33
335 335 $ cat ../large3
336 336 large33
337 337 $ cat normal4
338 338 normal44
339 339 $ cat large4
340 340 large44
341 341
342 342 Committing standins is not allowed.
343 343
344 344 $ cd ..
345 345 $ echo large3 > large3
346 346 $ hg commit .hglf/large3 -m "try to commit standin"
347 347 abort: file ".hglf/large3" is a largefile standin
348 348 (commit the largefile itself instead)
349 349 [255]
350 350
351 351 Corner cases for adding largefiles.
352 352
353 353 $ echo large5 > large5
354 354 $ hg add --large large5
355 355 $ hg add --large large5
356 356 large5 already a largefile
357 357 $ mkdir sub2
358 358 $ echo large6 > sub2/large6
359 359 $ echo large7 > sub2/large7
360 360 $ hg add --large sub2
361 361 adding sub2/large6 as a largefile (glob)
362 362 adding sub2/large7 as a largefile (glob)
363 363 $ hg st
364 364 M large3
365 365 A large5
366 366 A sub2/large6
367 367 A sub2/large7
368 368
369 369 Committing directories containing only largefiles.
370 370
371 371 $ mkdir -p z/y/x/m
372 372 $ touch z/y/x/m/large1
373 373 $ touch z/y/x/large2
374 374 $ hg add --large z/y/x/m/large1 z/y/x/large2
375 375 $ hg commit -m "Subdir with directory only containing largefiles" z
376 376 Invoking status precommit hook
377 377 M large3
378 378 A large5
379 379 A sub2/large6
380 380 A sub2/large7
381 381 A z/y/x/large2
382 382 A z/y/x/m/large1
383 383 $ hg rollback --quiet
384 384 $ touch z/y/x/m/normal
385 385 $ hg add z/y/x/m/normal
386 386 $ hg commit -m "Subdir with mixed contents" z
387 387 Invoking status precommit hook
388 388 M large3
389 389 A large5
390 390 A sub2/large6
391 391 A sub2/large7
392 392 A z/y/x/large2
393 393 A z/y/x/m/large1
394 394 A z/y/x/m/normal
395 395 $ hg st
396 396 M large3
397 397 A large5
398 398 A sub2/large6
399 399 A sub2/large7
400 400 $ hg rollback --quiet
401 401 $ hg revert z/y/x/large2 z/y/x/m/large1
402 402 $ rm z/y/x/large2 z/y/x/m/large1
403 403 $ hg commit -m "Subdir with normal contents" z
404 404 Invoking status precommit hook
405 405 M large3
406 406 A large5
407 407 A sub2/large6
408 408 A sub2/large7
409 409 A z/y/x/m/normal
410 410 $ hg st
411 411 M large3
412 412 A large5
413 413 A sub2/large6
414 414 A sub2/large7
415 415 $ hg rollback --quiet
416 416 $ hg revert --quiet z
417 417 $ hg commit -m "Empty subdir" z
418 418 abort: z: no match under directory!
419 419 [255]
420 420 $ rm -rf z
421 421 $ hg ci -m "standin" .hglf
422 422 abort: file ".hglf" is a largefile standin
423 423 (commit the largefile itself instead)
424 424 [255]
425 425
426 426 Test "hg status" with combination of 'file pattern' and 'directory
427 427 pattern' for largefiles:
428 428
429 429 $ hg status sub2/large6 sub2
430 430 A sub2/large6
431 431 A sub2/large7
432 432
433 433 Config settings (pattern **.dat, minsize 2 MB) are respected.
434 434
435 435 $ echo testdata > test.dat
436 436 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
437 437 $ hg add
438 438 adding reallylarge as a largefile
439 439 adding test.dat as a largefile
440 440
441 441 Test that minsize and --lfsize handle float values;
442 442 also tests that --lfsize overrides largefiles.minsize.
443 443 (0.250 MB = 256 kB = 262144 B)
444 444
445 445 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
446 446 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
447 447 $ hg --config largefiles.minsize=.25 add
448 448 adding ratherlarge as a largefile
449 449 adding medium
450 450 $ hg forget medium
451 451 $ hg --config largefiles.minsize=.25 add --lfsize=.125
452 452 adding medium as a largefile
453 453 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
454 454 $ hg --config largefiles.minsize=.25 add --lfsize=.125
455 455 adding notlarge
456 456 $ hg forget notlarge
457 457
458 458 Test forget on largefiles.
459 459
460 460 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
461 461 $ hg commit -m "add/edit more largefiles"
462 462 Invoking status precommit hook
463 463 A sub2/large6
464 464 A sub2/large7
465 465 R large3
466 466 ? large5
467 467 ? medium
468 468 ? notlarge
469 469 ? ratherlarge
470 470 ? reallylarge
471 471 ? test.dat
472 472 $ hg st
473 473 ? large3
474 474 ? large5
475 475 ? medium
476 476 ? notlarge
477 477 ? ratherlarge
478 478 ? reallylarge
479 479 ? test.dat
480 480
481 481 Purge with largefiles: verify that largefiles are still in the working
482 482 dir after a purge.
483 483
484 484 $ hg purge --all
485 485 $ cat sub/large4
486 486 large44
487 487 $ cat sub2/large6
488 488 large6
489 489 $ cat sub2/large7
490 490 large7
491 491
492 492 Test addremove: verify that files that should be added as largfiles are added as
493 493 such and that already-existing largfiles are not added as normal files by
494 494 accident.
495 495
496 496 $ rm normal3
497 497 $ rm sub/large4
498 498 $ echo "testing addremove with patterns" > testaddremove.dat
499 499 $ echo "normaladdremove" > normaladdremove
500 500 $ hg addremove
501 501 removing sub/large4
502 502 adding testaddremove.dat as a largefile
503 503 removing normal3
504 504 adding normaladdremove
505 505
506 506 Test addremove with -R
507 507
508 508 $ hg up -C
509 509 getting changed largefiles
510 510 1 largefiles updated, 0 removed
511 511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 512 $ rm normal3
513 513 $ rm sub/large4
514 514 $ echo "testing addremove with patterns" > testaddremove.dat
515 515 $ echo "normaladdremove" > normaladdremove
516 516 $ cd ..
517 517 $ hg -R a addremove
518 518 removing sub/large4
519 519 adding a/testaddremove.dat as a largefile (glob)
520 520 removing normal3
521 521 adding normaladdremove
522 522 $ cd a
523 523
524 524 Test 3364
525 525 $ hg clone . ../addrm
526 526 updating to branch default
527 527 getting changed largefiles
528 528 3 largefiles updated, 0 removed
529 529 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
530 530 $ cd ../addrm
531 531 $ cat >> .hg/hgrc <<EOF
532 532 > [hooks]
533 533 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
534 534 > EOF
535 535 $ touch foo
536 536 $ hg add --large foo
537 537 $ hg ci -m "add foo"
538 538 Invoking status precommit hook
539 539 A foo
540 540 Invoking status postcommit hook
541 541 C foo
542 542 C normal3
543 543 C sub/large4
544 544 C sub/normal4
545 545 C sub2/large6
546 546 C sub2/large7
547 547 $ rm foo
548 548 $ hg st
549 549 ! foo
550 550 hmm.. no precommit invoked, but there is a postcommit??
551 551 $ hg ci -m "will not checkin"
552 552 nothing changed
553 553 Invoking status postcommit hook
554 554 ! foo
555 555 C normal3
556 556 C sub/large4
557 557 C sub/normal4
558 558 C sub2/large6
559 559 C sub2/large7
560 560 [1]
561 561 $ hg addremove
562 562 removing foo
563 563 $ hg st
564 564 R foo
565 565 $ hg ci -m "used to say nothing changed"
566 566 Invoking status precommit hook
567 567 R foo
568 568 Invoking status postcommit hook
569 569 C normal3
570 570 C sub/large4
571 571 C sub/normal4
572 572 C sub2/large6
573 573 C sub2/large7
574 574 $ hg st
575 575
576 576 Test 3507 (both normal files and largefiles were a problem)
577 577
578 578 $ touch normal
579 579 $ touch large
580 580 $ hg add normal
581 581 $ hg add --large large
582 582 $ hg ci -m "added"
583 583 Invoking status precommit hook
584 584 A large
585 585 A normal
586 586 Invoking status postcommit hook
587 587 C large
588 588 C normal
589 589 C normal3
590 590 C sub/large4
591 591 C sub/normal4
592 592 C sub2/large6
593 593 C sub2/large7
594 594 $ hg remove normal
595 595 $ hg addremove --traceback
596 596 $ hg ci -m "addremoved normal"
597 597 Invoking status precommit hook
598 598 R normal
599 599 Invoking status postcommit hook
600 600 C large
601 601 C normal3
602 602 C sub/large4
603 603 C sub/normal4
604 604 C sub2/large6
605 605 C sub2/large7
606 606 $ hg up -C '.^'
607 607 getting changed largefiles
608 608 0 largefiles updated, 0 removed
609 609 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
610 610 $ hg remove large
611 611 $ hg addremove --traceback
612 612 $ hg ci -m "removed large"
613 613 Invoking status precommit hook
614 614 R large
615 615 created new head
616 616 Invoking status postcommit hook
617 617 C normal
618 618 C normal3
619 619 C sub/large4
620 620 C sub/normal4
621 621 C sub2/large6
622 622 C sub2/large7
623 623
624 624 Test commit -A (issue 3542)
625 625 $ echo large8 > large8
626 626 $ hg add --large large8
627 627 $ hg ci -Am 'this used to add large8 as normal and commit both'
628 628 Invoking status precommit hook
629 629 A large8
630 630 Invoking status postcommit hook
631 631 C large8
632 632 C normal
633 633 C normal3
634 634 C sub/large4
635 635 C sub/normal4
636 636 C sub2/large6
637 637 C sub2/large7
638 638 $ rm large8
639 639 $ hg ci -Am 'this used to not notice the rm'
640 640 removing large8
641 641 Invoking status precommit hook
642 642 R large8
643 643 Invoking status postcommit hook
644 644 C normal
645 645 C normal3
646 646 C sub/large4
647 647 C sub/normal4
648 648 C sub2/large6
649 649 C sub2/large7
650 650
651 651 Test that a standin can't be added as a large file
652 652
653 653 $ touch large
654 654 $ hg add --large large
655 655 $ hg ci -m "add"
656 656 Invoking status precommit hook
657 657 A large
658 658 Invoking status postcommit hook
659 659 C large
660 660 C normal
661 661 C normal3
662 662 C sub/large4
663 663 C sub/normal4
664 664 C sub2/large6
665 665 C sub2/large7
666 666 $ hg remove large
667 667 $ touch large
668 668 $ hg addremove --config largefiles.patterns=**large --traceback
669 669 adding large as a largefile
670 670
671 671 Test that outgoing --large works (with revsets too)
672 672 $ hg outgoing --rev '.^' --large
673 673 comparing with $TESTTMP/a (glob)
674 674 searching for changes
675 675 changeset: 8:c02fd3b77ec4
676 676 user: test
677 677 date: Thu Jan 01 00:00:00 1970 +0000
678 678 summary: add foo
679 679
680 680 changeset: 9:289dd08c9bbb
681 681 user: test
682 682 date: Thu Jan 01 00:00:00 1970 +0000
683 683 summary: used to say nothing changed
684 684
685 685 changeset: 10:34f23ac6ac12
686 686 user: test
687 687 date: Thu Jan 01 00:00:00 1970 +0000
688 688 summary: added
689 689
690 690 changeset: 12:710c1b2f523c
691 691 parent: 10:34f23ac6ac12
692 692 user: test
693 693 date: Thu Jan 01 00:00:00 1970 +0000
694 694 summary: removed large
695 695
696 696 changeset: 13:0a3e75774479
697 697 user: test
698 698 date: Thu Jan 01 00:00:00 1970 +0000
699 699 summary: this used to add large8 as normal and commit both
700 700
701 701 changeset: 14:84f3d378175c
702 702 user: test
703 703 date: Thu Jan 01 00:00:00 1970 +0000
704 704 summary: this used to not notice the rm
705 705
706 706 searching for changes
707 707 largefiles to upload:
708 708 foo
709 709 large
710 710 large8
711 711
712 712 $ cd ../a
713 713
714 714 Clone a largefiles repo.
715 715
716 716 $ hg clone . ../b
717 717 updating to branch default
718 718 getting changed largefiles
719 719 3 largefiles updated, 0 removed
720 720 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
721 721 $ cd ../b
722 722 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
723 723 7:daea875e9014 add/edit more largefiles
724 724 6:4355d653f84f edit files yet again
725 725 5:9d5af5072dbd edit files again
726 726 4:74c02385b94c move files
727 727 3:9e8fbc4bce62 copy files
728 728 2:51a0ae4d5864 remove files
729 729 1:ce8896473775 edit files
730 730 0:30d30fe6a5be add files
731 731 $ cat normal3
732 732 normal33
733 733 $ cat sub/normal4
734 734 normal44
735 735 $ cat sub/large4
736 736 large44
737 737 $ cat sub2/large6
738 738 large6
739 739 $ cat sub2/large7
740 740 large7
741 741 $ cd ..
742 742 $ hg clone a -r 3 c
743 743 adding changesets
744 744 adding manifests
745 745 adding file changes
746 746 added 4 changesets with 10 changes to 4 files
747 747 updating to branch default
748 748 getting changed largefiles
749 749 2 largefiles updated, 0 removed
750 750 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
751 751 $ cd c
752 752 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
753 753 3:9e8fbc4bce62 copy files
754 754 2:51a0ae4d5864 remove files
755 755 1:ce8896473775 edit files
756 756 0:30d30fe6a5be add files
757 757 $ cat normal1
758 758 normal22
759 759 $ cat large1
760 760 large22
761 761 $ cat sub/normal2
762 762 normal22
763 763 $ cat sub/large2
764 764 large22
765 765
766 766 Old revisions of a clone have correct largefiles content (this also
767 767 tests update).
768 768
769 769 $ hg update -r 1
770 770 getting changed largefiles
771 771 1 largefiles updated, 0 removed
772 772 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 773 $ cat large1
774 774 large11
775 775 $ cat sub/large2
776 776 large22
777 777 $ cd ..
778 778
779 779 Test cloning with --all-largefiles flag
780 780
781 781 $ rm "${USERCACHE}"/*
782 782 $ hg clone --all-largefiles a a-backup
783 783 updating to branch default
784 784 getting changed largefiles
785 785 3 largefiles updated, 0 removed
786 786 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
787 787 8 additional largefiles cached
788 788
789 789 $ rm "${USERCACHE}"/*
790 790 $ hg clone --all-largefiles -u 0 a a-clone0
791 791 updating to branch default
792 792 getting changed largefiles
793 793 2 largefiles updated, 0 removed
794 794 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
795 795 9 additional largefiles cached
796 796 $ hg -R a-clone0 sum
797 797 parent: 0:30d30fe6a5be
798 798 add files
799 799 branch: default
800 800 commit: (clean)
801 801 update: 7 new changesets (update)
802 802
803 803 $ rm "${USERCACHE}"/*
804 804 $ hg clone --all-largefiles -u 1 a a-clone1
805 805 updating to branch default
806 806 getting changed largefiles
807 807 2 largefiles updated, 0 removed
808 808 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
809 809 8 additional largefiles cached
810 810 $ hg -R a-clone1 verify --large --lfa --lfc
811 811 checking changesets
812 812 checking manifests
813 813 crosschecking files in changesets and manifests
814 814 checking files
815 815 10 files, 8 changesets, 24 total revisions
816 816 searching 8 changesets for largefiles
817 817 verified contents of 13 revisions of 6 largefiles
818 818 $ hg -R a-clone1 sum
819 819 parent: 1:ce8896473775
820 820 edit files
821 821 branch: default
822 822 commit: (clean)
823 823 update: 6 new changesets (update)
824 824
825 825 $ rm "${USERCACHE}"/*
826 826 $ hg clone --all-largefiles -U a a-clone-u
827 827 11 additional largefiles cached
828 828 $ hg -R a-clone-u sum
829 829 parent: -1:000000000000 (no revision checked out)
830 830 branch: default
831 831 commit: (clean)
832 832 update: 8 new changesets (update)
833 833
834 834 Show computed destination directory:
835 835
836 836 $ mkdir xyz
837 837 $ cd xyz
838 838 $ hg clone ../a
839 839 destination directory: a
840 840 updating to branch default
841 841 getting changed largefiles
842 842 3 largefiles updated, 0 removed
843 843 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
844 844 $ cd ..
845 845
846 846 Clone URL without path:
847 847
848 848 $ hg clone file://
849 849 abort: repository / not found!
850 850 [255]
851 851
852 852 Ensure base clone command argument validation
853 853
854 854 $ hg clone -U -u 0 a a-clone-failure
855 855 abort: cannot specify both --noupdate and --updaterev
856 856 [255]
857 857
858 858 $ hg clone --all-largefiles a ssh://localhost/a
859 859 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
860 860 [255]
861 861
862 862 Test pulling with --all-largefiles flag. Also test that the largefiles are
863 863 downloaded from 'default' instead of 'default-push' when no source is specified
864 864 (issue3584)
865 865
866 866 $ rm -Rf a-backup
867 867 $ hg clone -r 1 a a-backup
868 868 adding changesets
869 869 adding manifests
870 870 adding file changes
871 871 added 2 changesets with 8 changes to 4 files
872 872 updating to branch default
873 873 getting changed largefiles
874 874 2 largefiles updated, 0 removed
875 875 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
876 876 $ rm "${USERCACHE}"/*
877 877 $ cd a-backup
878 878 $ hg pull --all-largefiles --config paths.default-push=bogus/path
879 879 pulling from $TESTTMP/a (glob)
880 880 searching for changes
881 881 adding changesets
882 882 adding manifests
883 883 adding file changes
884 884 added 6 changesets with 16 changes to 8 files
885 885 (run 'hg update' to get a working copy)
886 886 6 largefiles cached
887 887
888 888 redo pull with --lfrev and check it pulls largefiles for the right revs
889 889
890 890 $ hg rollback
891 891 repository tip rolled back to revision 1 (undo pull)
892 892 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
893 893 pulling from $TESTTMP/a (glob)
894 894 searching for changes
895 895 all local heads known remotely
896 896 6 changesets found
897 897 adding changesets
898 898 adding manifests
899 899 adding file changes
900 900 added 6 changesets with 16 changes to 8 files
901 901 calling hook changegroup.lfiles: <function checkrequireslfiles at *> (glob)
902 902 (run 'hg update' to get a working copy)
903 903 pulling largefiles for revision 7
904 904 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
905 905 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
906 906 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
907 907 pulling largefiles for revision 2
908 908 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
909 909 0 largefiles cached
910 910
911 911 lfpull
912 912
913 913 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
914 914 2 largefiles cached
915 915 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
916 916 pulling largefiles for revision 4
917 917 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
918 918 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
919 919 pulling largefiles for revision 2
920 920 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
921 921 0 largefiles cached
922 922
923 923 $ ls usercache-lfpull/* | sort
924 924 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
925 925 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
926 926
927 927 $ cd ..
928 928
929 929 Rebasing between two repositories does not revert largefiles to old
930 930 revisions (this was a very bad bug that took a lot of work to fix).
931 931
932 932 $ hg clone a d
933 933 updating to branch default
934 934 getting changed largefiles
935 935 3 largefiles updated, 0 removed
936 936 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
937 937 $ cd b
938 938 $ echo large4-modified > sub/large4
939 939 $ echo normal3-modified > normal3
940 940 $ hg commit -m "modify normal file and largefile in repo b"
941 941 Invoking status precommit hook
942 942 M normal3
943 943 M sub/large4
944 944 $ cd ../d
945 945 $ echo large6-modified > sub2/large6
946 946 $ echo normal4-modified > sub/normal4
947 947 $ hg commit -m "modify normal file largefile in repo d"
948 948 Invoking status precommit hook
949 949 M sub/normal4
950 950 M sub2/large6
951 951 $ cd ..
952 952 $ hg clone d e
953 953 updating to branch default
954 954 getting changed largefiles
955 955 3 largefiles updated, 0 removed
956 956 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
957 957 $ cd d
958 958
959 959 More rebase testing, but also test that the largefiles are downloaded from
960 960 'default-push' when no source is specified (issue3584). (The largefile from the
961 961 pulled revision is however not downloaded but found in the local cache.)
962 962 Largefiles are fetched for the new pulled revision, not for existing revisions,
963 963 rebased or not.
964 964
965 965 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
966 966 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
967 967 pulling from $TESTTMP/b (glob)
968 968 searching for changes
969 969 adding changesets
970 970 adding manifests
971 971 adding file changes
972 972 added 1 changesets with 2 changes to 2 files (+1 heads)
973 973 Invoking status precommit hook
974 974 M sub/normal4
975 975 M sub2/large6
976 976 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
977 977 0 largefiles cached
978 978 nothing to rebase
979 979 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
980 980 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
981 981 9:598410d3eb9a modify normal file largefile in repo d
982 982 8:a381d2c8c80e modify normal file and largefile in repo b
983 983 7:daea875e9014 add/edit more largefiles
984 984 6:4355d653f84f edit files yet again
985 985 5:9d5af5072dbd edit files again
986 986 4:74c02385b94c move files
987 987 3:9e8fbc4bce62 copy files
988 988 2:51a0ae4d5864 remove files
989 989 1:ce8896473775 edit files
990 990 0:30d30fe6a5be add files
991 991 $ cat normal3
992 992 normal3-modified
993 993 $ cat sub/normal4
994 994 normal4-modified
995 995 $ cat sub/large4
996 996 large4-modified
997 997 $ cat sub2/large6
998 998 large6-modified
999 999 $ cat sub2/large7
1000 1000 large7
1001 1001 $ cd ../e
1002 1002 $ hg pull ../b
1003 1003 pulling from ../b
1004 1004 searching for changes
1005 1005 adding changesets
1006 1006 adding manifests
1007 1007 adding file changes
1008 1008 added 1 changesets with 2 changes to 2 files (+1 heads)
1009 1009 (run 'hg heads' to see heads, 'hg merge' to merge)
1010 1010 $ hg rebase
1011 1011 Invoking status precommit hook
1012 1012 M sub/normal4
1013 1013 M sub2/large6
1014 1014 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1015 1015 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1016 1016 9:598410d3eb9a modify normal file largefile in repo d
1017 1017 8:a381d2c8c80e modify normal file and largefile in repo b
1018 1018 7:daea875e9014 add/edit more largefiles
1019 1019 6:4355d653f84f edit files yet again
1020 1020 5:9d5af5072dbd edit files again
1021 1021 4:74c02385b94c move files
1022 1022 3:9e8fbc4bce62 copy files
1023 1023 2:51a0ae4d5864 remove files
1024 1024 1:ce8896473775 edit files
1025 1025 0:30d30fe6a5be add files
1026 1026 $ cat normal3
1027 1027 normal3-modified
1028 1028 $ cat sub/normal4
1029 1029 normal4-modified
1030 1030 $ cat sub/large4
1031 1031 large4-modified
1032 1032 $ cat sub2/large6
1033 1033 large6-modified
1034 1034 $ cat sub2/large7
1035 1035 large7
1036 1036
1037 1037 Log on largefiles
1038 1038
1039 1039 - same output
1040 1040 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1041 1041 8:a381d2c8c80e modify normal file and largefile in repo b
1042 1042 6:4355d653f84f edit files yet again
1043 1043 5:9d5af5072dbd edit files again
1044 1044 4:74c02385b94c move files
1045 1045 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1046 1046 8:a381d2c8c80e modify normal file and largefile in repo b
1047 1047 6:4355d653f84f edit files yet again
1048 1048 5:9d5af5072dbd edit files again
1049 1049 4:74c02385b94c move files
1050 1050
1051 1051 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1052 1052 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1053 1053 8:a381d2c8c80e modify normal file and largefile in repo b
1054 1054 6:4355d653f84f edit files yet again
1055 1055 5:9d5af5072dbd edit files again
1056 1056 4:74c02385b94c move files
1057 1057 1:ce8896473775 edit files
1058 1058 0:30d30fe6a5be add files
1059 1059 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1060 1060 9:598410d3eb9a modify normal file largefile in repo d
1061 1061 8:a381d2c8c80e modify normal file and largefile in repo b
1062 1062 6:4355d653f84f edit files yet again
1063 1063 5:9d5af5072dbd edit files again
1064 1064 4:74c02385b94c move files
1065 1065 1:ce8896473775 edit files
1066 1066 0:30d30fe6a5be add files
1067 1067
1068 1068 - globbing gives same result
1069 1069 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1070 1070 9:598410d3eb9a modify normal file largefile in repo d
1071 1071 8:a381d2c8c80e modify normal file and largefile in repo b
1072 1072 6:4355d653f84f edit files yet again
1073 1073 5:9d5af5072dbd edit files again
1074 1074 4:74c02385b94c move files
1075 1075 1:ce8896473775 edit files
1076 1076 0:30d30fe6a5be add files
1077 1077
1078 1078 Rollback on largefiles.
1079 1079
1080 1080 $ echo large4-modified-again > sub/large4
1081 1081 $ hg commit -m "Modify large4 again"
1082 1082 Invoking status precommit hook
1083 1083 M sub/large4
1084 1084 $ hg rollback
1085 1085 repository tip rolled back to revision 9 (undo commit)
1086 1086 working directory now based on revision 9
1087 1087 $ hg st
1088 1088 M sub/large4
1089 1089 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1090 1090 9:598410d3eb9a modify normal file largefile in repo d
1091 1091 8:a381d2c8c80e modify normal file and largefile in repo b
1092 1092 7:daea875e9014 add/edit more largefiles
1093 1093 6:4355d653f84f edit files yet again
1094 1094 5:9d5af5072dbd edit files again
1095 1095 4:74c02385b94c move files
1096 1096 3:9e8fbc4bce62 copy files
1097 1097 2:51a0ae4d5864 remove files
1098 1098 1:ce8896473775 edit files
1099 1099 0:30d30fe6a5be add files
1100 1100 $ cat sub/large4
1101 1101 large4-modified-again
1102 1102
1103 1103 "update --check" refuses to update with uncommitted changes.
1104 1104 $ hg update --check 8
1105 1105 abort: uncommitted local changes
1106 1106 [255]
1107 1107
1108 1108 "update --clean" leaves correct largefiles in working copy, even when there is
1109 1109 .orig files from revert in .hglf.
1110 1110
1111 1111 $ echo mistake > sub2/large7
1112 1112 $ hg revert sub2/large7
1113 1113 $ hg -q update --clean -r null
1114 1114 $ hg update --clean
1115 1115 getting changed largefiles
1116 1116 3 largefiles updated, 0 removed
1117 1117 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1118 1118 $ cat normal3
1119 1119 normal3-modified
1120 1120 $ cat sub/normal4
1121 1121 normal4-modified
1122 1122 $ cat sub/large4
1123 1123 large4-modified
1124 1124 $ cat sub2/large6
1125 1125 large6-modified
1126 1126 $ cat sub2/large7
1127 1127 large7
1128 1128 $ cat sub2/large7.orig
1129 1129 mistake
1130 1130 $ cat .hglf/sub2/large7.orig
1131 1131 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31
1132 1132
1133 1133 demonstrate misfeature: .orig file is overwritten on every update -C,
1134 1134 also when clean:
1135 1135 $ hg update --clean
1136 1136 getting changed largefiles
1137 1137 0 largefiles updated, 0 removed
1138 1138 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1139 1139 $ cat sub2/large7.orig
1140 1140 large7
1141 1141 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1142 1142
1143 1143 Now "update check" is happy.
1144 1144 $ hg update --check 8
1145 1145 getting changed largefiles
1146 1146 1 largefiles updated, 0 removed
1147 1147 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1148 1148 $ hg update --check
1149 1149 getting changed largefiles
1150 1150 1 largefiles updated, 0 removed
1151 1151 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1152 1152
1153 1153 Test removing empty largefiles directories on update
1154 1154 $ test -d sub2 && echo "sub2 exists"
1155 1155 sub2 exists
1156 1156 $ hg update -q null
1157 1157 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1158 1158 [1]
1159 1159 $ hg update -q
1160 1160
1161 1161 Test hg remove removes empty largefiles directories
1162 1162 $ test -d sub2 && echo "sub2 exists"
1163 1163 sub2 exists
1164 1164 $ hg remove sub2/*
1165 1165 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1166 1166 [1]
1167 1167 $ hg revert sub2/large6 sub2/large7
1168 1168
1169 1169 "revert" works on largefiles (and normal files too).
1170 1170 $ echo hack3 >> normal3
1171 1171 $ echo hack4 >> sub/normal4
1172 1172 $ echo hack4 >> sub/large4
1173 1173 $ rm sub2/large6
1174 1174 $ hg revert sub2/large6
1175 1175 $ hg rm sub2/large6
1176 1176 $ echo new >> sub2/large8
1177 1177 $ hg add --large sub2/large8
1178 1178 # XXX we don't really want to report that we're reverting the standin;
1179 1179 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1180 1180 $ hg revert sub
1181 1181 reverting .hglf/sub/large4 (glob)
1182 1182 reverting sub/normal4 (glob)
1183 1183 $ hg status
1184 1184 M normal3
1185 1185 A sub2/large8
1186 1186 R sub2/large6
1187 1187 ? sub/large4.orig
1188 1188 ? sub/normal4.orig
1189 1189 $ cat sub/normal4
1190 1190 normal4-modified
1191 1191 $ cat sub/large4
1192 1192 large4-modified
1193 1193 $ hg revert -a --no-backup
1194 1194 undeleting .hglf/sub2/large6 (glob)
1195 1195 forgetting .hglf/sub2/large8 (glob)
1196 1196 reverting normal3
1197 1197 $ hg status
1198 1198 ? sub/large4.orig
1199 1199 ? sub/normal4.orig
1200 1200 ? sub2/large8
1201 1201 $ cat normal3
1202 1202 normal3-modified
1203 1203 $ cat sub2/large6
1204 1204 large6-modified
1205 1205 $ rm sub/*.orig sub2/large8
1206 1206
1207 1207 revert some files to an older revision
1208 1208 $ hg revert --no-backup -r 8 sub2
1209 1209 reverting .hglf/sub2/large6 (glob)
1210 1210 $ cat sub2/large6
1211 1211 large6
1212 1212 $ hg revert --no-backup -C -r '.^' sub2
1213 1213 reverting .hglf/sub2/large6 (glob)
1214 1214 $ hg revert --no-backup sub2
1215 1215 reverting .hglf/sub2/large6 (glob)
1216 1216 $ hg status
1217 1217
1218 1218 "verify --large" actually verifies largefiles
1219 1219
1220 1220 - Where Do We Come From? What Are We? Where Are We Going?
1221 1221 $ pwd
1222 1222 $TESTTMP/e
1223 1223 $ hg paths
1224 1224 default = $TESTTMP/d (glob)
1225 1225
1226 1226 $ hg verify --large
1227 1227 checking changesets
1228 1228 checking manifests
1229 1229 crosschecking files in changesets and manifests
1230 1230 checking files
1231 1231 10 files, 10 changesets, 28 total revisions
1232 1232 searching 1 changesets for largefiles
1233 1233 verified existence of 3 revisions of 3 largefiles
1234 1234
1235 1235 - introduce missing blob in local store repo and make sure that this is caught:
1236 1236 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1237 1237 $ hg verify --large
1238 1238 checking changesets
1239 1239 checking manifests
1240 1240 crosschecking files in changesets and manifests
1241 1241 checking files
1242 1242 10 files, 10 changesets, 28 total revisions
1243 1243 searching 1 changesets for largefiles
1244 1244 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1245 1245 verified existence of 3 revisions of 3 largefiles
1246 1246 [1]
1247 1247
1248 1248 - introduce corruption and make sure that it is caught when checking content:
1249 1249 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1250 1250 $ hg verify -q --large --lfc
1251 1251 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1252 1252 [1]
1253 1253
1254 1254 - cleanup
1255 1255 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1256 1256
1257 1257 - verifying all revisions will fail because we didn't clone all largefiles to d:
1258 1258 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1259 1259 $ hg verify -q --lfa --lfc
1260 1260 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1261 1261 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1262 1262 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1263 1263 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1264 1264 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1265 1265 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1266 1266 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1267 1267 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1268 1268 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1269 1269 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1270 1270 [1]
1271 1271
1272 1272 - cleanup
1273 1273 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1274 1274 $ rm -f .hglf/sub/*.orig
1275 1275
1276 1276 Update to revision with missing largefile - and make sure it really is missing
1277 1277
1278 1278 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1279 1279 $ hg up -r 6
1280 1280 getting changed largefiles
1281 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d
1281 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d (glob)
1282 1282 1 largefiles updated, 2 removed
1283 1283 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1284 1284 $ rm normal3
1285 1285 $ echo >> sub/normal4
1286 1286 $ hg ci -m 'commit with missing files'
1287 1287 Invoking status precommit hook
1288 1288 M sub/normal4
1289 1289 ! large3
1290 1290 ! normal3
1291 1291 created new head
1292 1292 $ hg st
1293 1293 ! large3
1294 1294 ! normal3
1295 1295 $ hg up -r.
1296 1296 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1297 1297 $ hg st
1298 1298 ! large3
1299 1299 ! normal3
1300 1300 $ hg up -Cr.
1301 1301 getting changed largefiles
1302 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d
1302 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d (glob)
1303 1303 0 largefiles updated, 0 removed
1304 1304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1305 1305 $ hg st
1306 1306 ! large3
1307 1307 $ hg rollback
1308 1308 repository tip rolled back to revision 9 (undo commit)
1309 1309 working directory now based on revision 6
1310 1310
1311 1311 Merge with revision with missing largefile - and make sure it tries to fetch it.
1312 1312
1313 1313 $ hg up -Cqr null
1314 1314 $ echo f > f
1315 1315 $ hg ci -Am branch
1316 1316 adding f
1317 1317 Invoking status precommit hook
1318 1318 A f
1319 1319 created new head
1320 1320 $ hg merge -r 6
1321 1321 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1322 1322 (branch merge, don't forget to commit)
1323 1323 getting changed largefiles
1324 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d
1324 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d (glob)
1325 1325 1 largefiles updated, 0 removed
1326 1326
1327 1327 $ hg rollback -q
1328 1328 $ hg up -Cq
1329 1329
1330 1330 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1331 1331
1332 1332 $ hg pull --all-largefiles
1333 1333 pulling from $TESTTMP/d (glob)
1334 1334 searching for changes
1335 1335 no changes found
1336 1336
1337 1337 Merging does not revert to old versions of largefiles and also check
1338 1338 that merging after having pulled from a non-default remote works
1339 1339 correctly.
1340 1340
1341 1341 $ cd ..
1342 1342 $ hg clone -r 7 e temp
1343 1343 adding changesets
1344 1344 adding manifests
1345 1345 adding file changes
1346 1346 added 8 changesets with 24 changes to 10 files
1347 1347 updating to branch default
1348 1348 getting changed largefiles
1349 1349 3 largefiles updated, 0 removed
1350 1350 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1351 1351 $ hg clone temp f
1352 1352 updating to branch default
1353 1353 getting changed largefiles
1354 1354 3 largefiles updated, 0 removed
1355 1355 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1356 1356 # Delete the largefiles in the largefiles system cache so that we have an
1357 1357 # opportunity to test that caching after a pull works.
1358 1358 $ rm "${USERCACHE}"/*
1359 1359 $ cd f
1360 1360 $ echo "large4-merge-test" > sub/large4
1361 1361 $ hg commit -m "Modify large4 to test merge"
1362 1362 Invoking status precommit hook
1363 1363 M sub/large4
1364 1364 # Test --cache-largefiles flag
1365 1365 $ hg pull --lfrev 'heads(pulled())' ../e
1366 1366 pulling from ../e
1367 1367 searching for changes
1368 1368 adding changesets
1369 1369 adding manifests
1370 1370 adding file changes
1371 1371 added 2 changesets with 4 changes to 4 files (+1 heads)
1372 1372 (run 'hg heads' to see heads, 'hg merge' to merge)
1373 1373 2 largefiles cached
1374 1374 $ hg merge
1375 1375 merging sub/large4
1376 1376 largefile sub/large4 has a merge conflict
1377 1377 keep (l)ocal or take (o)ther? l
1378 1378 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1379 1379 (branch merge, don't forget to commit)
1380 1380 getting changed largefiles
1381 1381 1 largefiles updated, 0 removed
1382 1382 $ hg commit -m "Merge repos e and f"
1383 1383 Invoking status precommit hook
1384 1384 M normal3
1385 1385 M sub/normal4
1386 1386 M sub2/large6
1387 1387 $ cat normal3
1388 1388 normal3-modified
1389 1389 $ cat sub/normal4
1390 1390 normal4-modified
1391 1391 $ cat sub/large4
1392 1392 large4-merge-test
1393 1393 $ cat sub2/large6
1394 1394 large6-modified
1395 1395 $ cat sub2/large7
1396 1396 large7
1397 1397
1398 1398 Test status after merging with a branch that introduces a new largefile:
1399 1399
1400 1400 $ echo large > large
1401 1401 $ hg add --large large
1402 1402 $ hg commit -m 'add largefile'
1403 1403 Invoking status precommit hook
1404 1404 A large
1405 1405 $ hg update -q ".^"
1406 1406 $ echo change >> normal3
1407 1407 $ hg commit -m 'some change'
1408 1408 Invoking status precommit hook
1409 1409 M normal3
1410 1410 created new head
1411 1411 $ hg merge
1412 1412 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1413 1413 (branch merge, don't forget to commit)
1414 1414 getting changed largefiles
1415 1415 1 largefiles updated, 0 removed
1416 1416 $ hg status
1417 1417 M large
1418 1418
1419 1419 - make sure update of merge with removed largefiles fails as expected
1420 1420 $ hg rm sub2/large6
1421 1421 $ hg up -r.
1422 1422 abort: outstanding uncommitted merges
1423 1423 [255]
1424 1424
1425 1425 - revert should be able to revert files introduced in a pending merge
1426 1426 $ hg revert --all -r .
1427 1427 removing .hglf/large (glob)
1428 1428 undeleting .hglf/sub2/large6 (glob)
1429 1429
1430 1430 Test that a normal file and a largefile with the same name and path cannot
1431 1431 coexist.
1432 1432
1433 1433 $ rm sub2/large7
1434 1434 $ echo "largeasnormal" > sub2/large7
1435 1435 $ hg add sub2/large7
1436 1436 sub2/large7 already a largefile
1437 1437
1438 1438 Test that transplanting a largefile change works correctly.
1439 1439
1440 1440 $ cd ..
1441 1441 $ hg clone -r 8 d g
1442 1442 adding changesets
1443 1443 adding manifests
1444 1444 adding file changes
1445 1445 added 9 changesets with 26 changes to 10 files
1446 1446 updating to branch default
1447 1447 getting changed largefiles
1448 1448 3 largefiles updated, 0 removed
1449 1449 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1450 1450 $ cd g
1451 1451 $ hg transplant -s ../d 598410d3eb9a
1452 1452 searching for changes
1453 1453 searching for changes
1454 1454 adding changesets
1455 1455 adding manifests
1456 1456 adding file changes
1457 1457 added 1 changesets with 2 changes to 2 files
1458 1458 getting changed largefiles
1459 1459 1 largefiles updated, 0 removed
1460 1460 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1461 1461 9:598410d3eb9a modify normal file largefile in repo d
1462 1462 8:a381d2c8c80e modify normal file and largefile in repo b
1463 1463 7:daea875e9014 add/edit more largefiles
1464 1464 6:4355d653f84f edit files yet again
1465 1465 5:9d5af5072dbd edit files again
1466 1466 4:74c02385b94c move files
1467 1467 3:9e8fbc4bce62 copy files
1468 1468 2:51a0ae4d5864 remove files
1469 1469 1:ce8896473775 edit files
1470 1470 0:30d30fe6a5be add files
1471 1471 $ cat normal3
1472 1472 normal3-modified
1473 1473 $ cat sub/normal4
1474 1474 normal4-modified
1475 1475 $ cat sub/large4
1476 1476 large4-modified
1477 1477 $ cat sub2/large6
1478 1478 large6-modified
1479 1479 $ cat sub2/large7
1480 1480 large7
1481 1481
1482 1482 Cat a largefile
1483 1483 $ hg cat normal3
1484 1484 normal3-modified
1485 1485 $ hg cat sub/large4
1486 1486 large4-modified
1487 1487 $ rm "${USERCACHE}"/*
1488 1488 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1489 1489 $ cat cat.out
1490 1490 large4-modified
1491 1491 $ rm cat.out
1492 1492 $ hg cat -r a381d2c8c80e normal3
1493 1493 normal3-modified
1494 1494 $ hg cat -r '.^' normal3
1495 1495 normal3-modified
1496 1496 $ hg cat -r '.^' sub/large4 doesntexist
1497 1497 large4-modified
1498 1498 doesntexist: no such file in rev a381d2c8c80e
1499 1499 $ hg --cwd sub cat -r '.^' large4
1500 1500 large4-modified
1501 1501 $ hg --cwd sub cat -r '.^' ../normal3
1502 1502 normal3-modified
1503 1503
1504 1504 Test that renaming a largefile results in correct output for status
1505 1505
1506 1506 $ hg rename sub/large4 large4-renamed
1507 1507 $ hg commit -m "test rename output"
1508 1508 Invoking status precommit hook
1509 1509 A large4-renamed
1510 1510 R sub/large4
1511 1511 $ cat large4-renamed
1512 1512 large4-modified
1513 1513 $ cd sub2
1514 1514 $ hg rename large6 large6-renamed
1515 1515 $ hg st
1516 1516 A sub2/large6-renamed
1517 1517 R sub2/large6
1518 1518 $ cd ..
1519 1519
1520 1520 Test --normal flag
1521 1521
1522 1522 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1523 1523 $ hg add --normal --large new-largefile
1524 1524 abort: --normal cannot be used with --large
1525 1525 [255]
1526 1526 $ hg add --normal new-largefile
1527 1527 new-largefile: up to 69 MB of RAM may be required to manage this file
1528 1528 (use 'hg revert new-largefile' to cancel the pending addition)
1529 1529 $ cd ..
1530 1530
1531 1531 #if serve
1532 1532 vanilla clients not locked out from largefiles servers on vanilla repos
1533 1533 $ mkdir r1
1534 1534 $ cd r1
1535 1535 $ hg init
1536 1536 $ echo c1 > f1
1537 1537 $ hg add f1
1538 1538 $ hg commit -m "m1"
1539 1539 Invoking status precommit hook
1540 1540 A f1
1541 1541 $ cd ..
1542 1542 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1543 1543 $ cat hg.pid >> $DAEMON_PIDS
1544 1544 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1545 1545 requesting all changes
1546 1546 adding changesets
1547 1547 adding manifests
1548 1548 adding file changes
1549 1549 added 1 changesets with 1 changes to 1 files
1550 1550 updating to branch default
1551 1551 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1552 1552
1553 1553 largefiles clients still work with vanilla servers
1554 1554 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1555 1555 $ cat hg.pid >> $DAEMON_PIDS
1556 1556 $ hg clone http://localhost:$HGPORT1 r3
1557 1557 requesting all changes
1558 1558 adding changesets
1559 1559 adding manifests
1560 1560 adding file changes
1561 1561 added 1 changesets with 1 changes to 1 files
1562 1562 updating to branch default
1563 1563 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1564 1564 #endif
1565 1565
1566 1566
1567 1567 vanilla clients locked out from largefiles http repos
1568 1568 $ mkdir r4
1569 1569 $ cd r4
1570 1570 $ hg init
1571 1571 $ echo c1 > f1
1572 1572 $ hg add --large f1
1573 1573 $ hg commit -m "m1"
1574 1574 Invoking status precommit hook
1575 1575 A f1
1576 1576 $ cd ..
1577 1577
1578 1578 largefiles can be pushed locally (issue3583)
1579 1579 $ hg init dest
1580 1580 $ cd r4
1581 1581 $ hg outgoing ../dest
1582 1582 comparing with ../dest
1583 1583 searching for changes
1584 1584 changeset: 0:639881c12b4c
1585 1585 tag: tip
1586 1586 user: test
1587 1587 date: Thu Jan 01 00:00:00 1970 +0000
1588 1588 summary: m1
1589 1589
1590 1590 $ hg push ../dest
1591 1591 pushing to ../dest
1592 1592 searching for changes
1593 1593 searching for changes
1594 1594 adding changesets
1595 1595 adding manifests
1596 1596 adding file changes
1597 1597 added 1 changesets with 1 changes to 1 files
1598 1598
1599 1599 exit code with nothing outgoing (issue3611)
1600 1600 $ hg outgoing ../dest
1601 1601 comparing with ../dest
1602 1602 searching for changes
1603 1603 no changes found
1604 1604 [1]
1605 1605 $ cd ..
1606 1606
1607 1607 #if serve
1608 1608 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1609 1609 $ cat hg.pid >> $DAEMON_PIDS
1610 1610 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1611 1611 abort: remote error:
1612 1612
1613 1613 This repository uses the largefiles extension.
1614 1614
1615 1615 Please enable it in your Mercurial config file.
1616 1616 [255]
1617 1617
1618 1618 used all HGPORTs, kill all daemons
1619 1619 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1620 1620 #endif
1621 1621
1622 1622 vanilla clients locked out from largefiles ssh repos
1623 1623 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1624 1624 abort: remote error:
1625 1625
1626 1626 This repository uses the largefiles extension.
1627 1627
1628 1628 Please enable it in your Mercurial config file.
1629 1629 [255]
1630 1630
1631 1631 #if serve
1632 1632
1633 1633 largefiles clients refuse to push largefiles repos to vanilla servers
1634 1634 $ mkdir r6
1635 1635 $ cd r6
1636 1636 $ hg init
1637 1637 $ echo c1 > f1
1638 1638 $ hg add f1
1639 1639 $ hg commit -m "m1"
1640 1640 Invoking status precommit hook
1641 1641 A f1
1642 1642 $ cat >> .hg/hgrc <<!
1643 1643 > [web]
1644 1644 > push_ssl = false
1645 1645 > allow_push = *
1646 1646 > !
1647 1647 $ cd ..
1648 1648 $ hg clone r6 r7
1649 1649 updating to branch default
1650 1650 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1651 1651 $ cd r7
1652 1652 $ echo c2 > f2
1653 1653 $ hg add --large f2
1654 1654 $ hg commit -m "m2"
1655 1655 Invoking status precommit hook
1656 1656 A f2
1657 1657 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1658 1658 $ cat ../hg.pid >> $DAEMON_PIDS
1659 1659 $ hg push http://localhost:$HGPORT
1660 1660 pushing to http://localhost:$HGPORT/
1661 1661 searching for changes
1662 1662 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1663 1663 [255]
1664 1664 $ cd ..
1665 1665
1666 1666 putlfile errors are shown (issue3123)
1667 1667 Corrupt the cached largefile in r7 and move it out of the servers usercache
1668 1668 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1669 1669 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1670 1670 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1671 1671 $ hg init empty
1672 1672 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1673 1673 > --config 'web.allow_push=*' --config web.push_ssl=False
1674 1674 $ cat hg.pid >> $DAEMON_PIDS
1675 1675 $ hg push -R r7 http://localhost:$HGPORT1
1676 1676 pushing to http://localhost:$HGPORT1/
1677 1677 searching for changes
1678 1678 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1679 1679 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1680 1680 [255]
1681 1681 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1682 1682 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1683 1683 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1684 1684 $ hg push -R r7 http://localhost:$HGPORT1
1685 1685 pushing to http://localhost:$HGPORT1/
1686 1686 searching for changes
1687 1687 searching for changes
1688 1688 remote: adding changesets
1689 1689 remote: adding manifests
1690 1690 remote: adding file changes
1691 1691 remote: added 2 changesets with 2 changes to 2 files
1692 1692 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1693 1693 server side corruption
1694 1694 $ rm -rf empty
1695 1695
1696 1696 Push a largefiles repository to a served empty repository
1697 1697 $ hg init r8
1698 1698 $ echo c3 > r8/f1
1699 1699 $ hg add --large r8/f1 -R r8
1700 1700 $ hg commit -m "m1" -R r8
1701 1701 Invoking status precommit hook
1702 1702 A f1
1703 1703 $ hg init empty
1704 1704 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1705 1705 > --config 'web.allow_push=*' --config web.push_ssl=False
1706 1706 $ cat hg.pid >> $DAEMON_PIDS
1707 1707 $ rm "${USERCACHE}"/*
1708 1708 $ hg push -R r8 http://localhost:$HGPORT2/#default
1709 1709 pushing to http://localhost:$HGPORT2/
1710 1710 searching for changes
1711 1711 searching for changes
1712 1712 remote: adding changesets
1713 1713 remote: adding manifests
1714 1714 remote: adding file changes
1715 1715 remote: added 1 changesets with 1 changes to 1 files
1716 1716 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1717 1717 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1718 1718
1719 1719 Clone over http, no largefiles pulled on clone.
1720 1720
1721 1721 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1722 1722 adding changesets
1723 1723 adding manifests
1724 1724 adding file changes
1725 1725 added 1 changesets with 1 changes to 1 files
1726 1726
1727 1727 test 'verify' with remotestore:
1728 1728
1729 1729 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1730 1730 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1731 1731 $ hg -R http-clone verify --large --lfa
1732 1732 checking changesets
1733 1733 checking manifests
1734 1734 crosschecking files in changesets and manifests
1735 1735 checking files
1736 1736 1 files, 1 changesets, 1 total revisions
1737 1737 searching 1 changesets for largefiles
1738 1738 changeset 0:cf03e5bb9936: f1 missing
1739 1739 verified existence of 1 revisions of 1 largefiles
1740 1740 [1]
1741 1741 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1742 1742 $ hg -R http-clone -q verify --large --lfa
1743 1743
1744 1744 largefiles pulled on update - a largefile missing on the server:
1745 1745 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1746 1746 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1747 1747 getting changed largefiles
1748 1748 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
1749 1749 0 largefiles updated, 0 removed
1750 1750 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1751 1751 $ hg -R http-clone st
1752 1752 ! f1
1753 1753 $ hg -R http-clone up -Cqr null
1754 1754
1755 1755 largefiles pulled on update - a largefile corrupted on the server:
1756 1756 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1757 1757 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1758 1758 getting changed largefiles
1759 1759 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1760 1760 0 largefiles updated, 0 removed
1761 1761 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1762 1762 $ hg -R http-clone st
1763 1763 ! f1
1764 1764 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1765 1765 $ [ ! -f http-clone/f1 ]
1766 1766 $ [ ! -f http-clone-usercache ]
1767 1767 $ hg -R http-clone verify --large --lfc
1768 1768 checking changesets
1769 1769 checking manifests
1770 1770 crosschecking files in changesets and manifests
1771 1771 checking files
1772 1772 1 files, 1 changesets, 1 total revisions
1773 1773 searching 1 changesets for largefiles
1774 1774 verified contents of 1 revisions of 1 largefiles
1775 1775 $ hg -R http-clone up -Cqr null
1776 1776
1777 1777 largefiles pulled on update - no server side problems:
1778 1778 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1779 1779 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1780 1780 resolving manifests
1781 1781 branchmerge: False, force: False, partial: False
1782 1782 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1783 1783 .hglf/f1: remote created -> g
1784 1784 getting .hglf/f1
1785 1785 updating: .hglf/f1 1/1 files (100.00%)
1786 1786 getting changed largefiles
1787 1787 using http://localhost:$HGPORT2/
1788 1788 sending capabilities command
1789 1789 sending batch command
1790 1790 getting largefiles: 0/1 lfile (0.00%)
1791 1791 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1792 1792 sending getlfile command
1793 1793 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1794 1794 1 largefiles updated, 0 removed
1795 1795 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1796 1796
1797 1797 $ ls http-clone-usercache/*
1798 1798 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1799 1799
1800 1800 $ rm -rf empty http-clone*
1801 1801
1802 1802 used all HGPORTs, kill all daemons
1803 1803 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1804 1804
1805 1805 #endif
1806 1806
1807 1807
1808 1808 #if unix-permissions
1809 1809
1810 1810 Clone a local repository owned by another user
1811 1811 We have to simulate that here by setting $HOME and removing write permissions
1812 1812 $ ORIGHOME="$HOME"
1813 1813 $ mkdir alice
1814 1814 $ HOME="`pwd`/alice"
1815 1815 $ cd alice
1816 1816 $ hg init pubrepo
1817 1817 $ cd pubrepo
1818 1818 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1819 1819 $ hg add --large a-large-file
1820 1820 $ hg commit -m "Add a large file"
1821 1821 Invoking status precommit hook
1822 1822 A a-large-file
1823 1823 $ cd ..
1824 1824 $ chmod -R a-w pubrepo
1825 1825 $ cd ..
1826 1826 $ mkdir bob
1827 1827 $ HOME="`pwd`/bob"
1828 1828 $ cd bob
1829 1829 $ hg clone --pull ../alice/pubrepo pubrepo
1830 1830 requesting all changes
1831 1831 adding changesets
1832 1832 adding manifests
1833 1833 adding file changes
1834 1834 added 1 changesets with 1 changes to 1 files
1835 1835 updating to branch default
1836 1836 getting changed largefiles
1837 1837 1 largefiles updated, 0 removed
1838 1838 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1839 1839 $ cd ..
1840 1840 $ chmod -R u+w alice/pubrepo
1841 1841 $ HOME="$ORIGHOME"
1842 1842
1843 1843 #endif
1844 1844
1845 1845 #if symlink
1846 1846
1847 1847 Symlink to a large largefile should behave the same as a symlink to a normal file
1848 1848 $ hg init largesymlink
1849 1849 $ cd largesymlink
1850 1850 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1851 1851 $ hg add --large largefile
1852 1852 $ hg commit -m "commit a large file"
1853 1853 Invoking status precommit hook
1854 1854 A largefile
1855 1855 $ ln -s largefile largelink
1856 1856 $ hg add largelink
1857 1857 $ hg commit -m "commit a large symlink"
1858 1858 Invoking status precommit hook
1859 1859 A largelink
1860 1860 $ rm -f largelink
1861 1861 $ hg up >/dev/null
1862 1862 $ test -f largelink
1863 1863 [1]
1864 1864 $ test -L largelink
1865 1865 [1]
1866 1866 $ rm -f largelink # make next part of the test independent of the previous
1867 1867 $ hg up -C >/dev/null
1868 1868 $ test -f largelink
1869 1869 $ test -L largelink
1870 1870 $ cd ..
1871 1871
1872 1872 #endif
1873 1873
1874 1874 test for pattern matching on 'hg status':
1875 1875 to boost performance, largefiles checks whether specified patterns are
1876 1876 related to largefiles in working directory (NOT to STANDIN) or not.
1877 1877
1878 1878 $ hg init statusmatch
1879 1879 $ cd statusmatch
1880 1880
1881 1881 $ mkdir -p a/b/c/d
1882 1882 $ echo normal > a/b/c/d/e.normal.txt
1883 1883 $ hg add a/b/c/d/e.normal.txt
1884 1884 $ echo large > a/b/c/d/e.large.txt
1885 1885 $ hg add --large a/b/c/d/e.large.txt
1886 1886 $ mkdir -p a/b/c/x
1887 1887 $ echo normal > a/b/c/x/y.normal.txt
1888 1888 $ hg add a/b/c/x/y.normal.txt
1889 1889 $ hg commit -m 'add files'
1890 1890 Invoking status precommit hook
1891 1891 A a/b/c/d/e.large.txt
1892 1892 A a/b/c/d/e.normal.txt
1893 1893 A a/b/c/x/y.normal.txt
1894 1894
1895 1895 (1) no pattern: no performance boost
1896 1896 $ hg status -A
1897 1897 C a/b/c/d/e.large.txt
1898 1898 C a/b/c/d/e.normal.txt
1899 1899 C a/b/c/x/y.normal.txt
1900 1900
1901 1901 (2) pattern not related to largefiles: performance boost
1902 1902 $ hg status -A a/b/c/x
1903 1903 C a/b/c/x/y.normal.txt
1904 1904
1905 1905 (3) pattern related to largefiles: no performance boost
1906 1906 $ hg status -A a/b/c/d
1907 1907 C a/b/c/d/e.large.txt
1908 1908 C a/b/c/d/e.normal.txt
1909 1909
1910 1910 (4) pattern related to STANDIN (not to largefiles): performance boost
1911 1911 $ hg status -A .hglf/a
1912 1912 C .hglf/a/b/c/d/e.large.txt
1913 1913
1914 1914 (5) mixed case: no performance boost
1915 1915 $ hg status -A a/b/c/x a/b/c/d
1916 1916 C a/b/c/d/e.large.txt
1917 1917 C a/b/c/d/e.normal.txt
1918 1918 C a/b/c/x/y.normal.txt
1919 1919
1920 1920 verify that largefiles doesn't break filesets
1921 1921
1922 1922 $ hg log --rev . --exclude "set:binary()"
1923 1923 changeset: 0:41bd42f10efa
1924 1924 tag: tip
1925 1925 user: test
1926 1926 date: Thu Jan 01 00:00:00 1970 +0000
1927 1927 summary: add files
1928 1928
1929 1929 verify that large files in subrepos handled properly
1930 1930 $ hg init subrepo
1931 1931 $ echo "subrepo = subrepo" > .hgsub
1932 1932 $ hg add .hgsub
1933 1933 $ hg ci -m "add subrepo"
1934 1934 Invoking status precommit hook
1935 1935 A .hgsub
1936 1936 ? .hgsubstate
1937 1937 $ echo "rev 1" > subrepo/large.txt
1938 1938 $ hg -R subrepo add --large subrepo/large.txt
1939 1939 $ hg sum
1940 1940 parent: 1:8ee150ea2e9c tip
1941 1941 add subrepo
1942 1942 branch: default
1943 1943 commit: 1 subrepos
1944 1944 update: (current)
1945 1945 $ hg st
1946 1946 $ hg st -S
1947 1947 A subrepo/large.txt
1948 1948 $ hg ci -S -m "commit top repo"
1949 1949 committing subrepository subrepo
1950 1950 Invoking status precommit hook
1951 1951 A large.txt
1952 1952 Invoking status precommit hook
1953 1953 M .hgsubstate
1954 1954 # No differences
1955 1955 $ hg st -S
1956 1956 $ hg sum
1957 1957 parent: 2:ce4cd0c527a6 tip
1958 1958 commit top repo
1959 1959 branch: default
1960 1960 commit: (clean)
1961 1961 update: (current)
1962 1962 $ echo "rev 2" > subrepo/large.txt
1963 1963 $ hg st -S
1964 1964 M subrepo/large.txt
1965 1965 $ hg sum
1966 1966 parent: 2:ce4cd0c527a6 tip
1967 1967 commit top repo
1968 1968 branch: default
1969 1969 commit: 1 subrepos
1970 1970 update: (current)
1971 1971 $ hg ci -m "this commit should fail without -S"
1972 1972 abort: uncommitted changes in subrepo subrepo
1973 1973 (use --subrepos for recursive commit)
1974 1974 [255]
1975 1975
1976 1976 Add a normal file to the subrepo, then test archiving
1977 1977
1978 1978 $ echo 'normal file' > subrepo/normal.txt
1979 1979 $ hg -R subrepo add subrepo/normal.txt
1980 1980
1981 1981 Lock in subrepo, otherwise the change isn't archived
1982 1982
1983 1983 $ hg ci -S -m "add normal file to top level"
1984 1984 committing subrepository subrepo
1985 1985 Invoking status precommit hook
1986 1986 M large.txt
1987 1987 A normal.txt
1988 1988 Invoking status precommit hook
1989 1989 M .hgsubstate
1990 1990 $ hg archive -S ../lf_subrepo_archive
1991 1991 $ find ../lf_subrepo_archive | sort
1992 1992 ../lf_subrepo_archive
1993 1993 ../lf_subrepo_archive/.hg_archival.txt
1994 1994 ../lf_subrepo_archive/.hgsub
1995 1995 ../lf_subrepo_archive/.hgsubstate
1996 1996 ../lf_subrepo_archive/a
1997 1997 ../lf_subrepo_archive/a/b
1998 1998 ../lf_subrepo_archive/a/b/c
1999 1999 ../lf_subrepo_archive/a/b/c/d
2000 2000 ../lf_subrepo_archive/a/b/c/d/e.large.txt
2001 2001 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
2002 2002 ../lf_subrepo_archive/a/b/c/x
2003 2003 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
2004 2004 ../lf_subrepo_archive/subrepo
2005 2005 ../lf_subrepo_archive/subrepo/large.txt
2006 2006 ../lf_subrepo_archive/subrepo/normal.txt
2007 2007
2008 2008 Test update with subrepos.
2009 2009
2010 2010 $ hg update 0
2011 2011 getting changed largefiles
2012 2012 0 largefiles updated, 1 removed
2013 2013 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2014 2014 $ hg status -S
2015 2015 $ hg update tip
2016 2016 getting changed largefiles
2017 2017 1 largefiles updated, 0 removed
2018 2018 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2019 2019 $ hg status -S
2020 2020 # modify a large file
2021 2021 $ echo "modified" > subrepo/large.txt
2022 2022 $ hg st -S
2023 2023 M subrepo/large.txt
2024 2024 # update -C should revert the change.
2025 2025 $ hg update -C
2026 2026 getting changed largefiles
2027 2027 1 largefiles updated, 0 removed
2028 2028 getting changed largefiles
2029 2029 0 largefiles updated, 0 removed
2030 2030 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2031 2031 $ hg status -S
2032 2032
2033 2033 Test archiving a revision that references a subrepo that is not yet
2034 2034 cloned (see test-subrepo-recursion.t):
2035 2035
2036 2036 $ hg clone -U . ../empty
2037 2037 $ cd ../empty
2038 2038 $ hg archive --subrepos -r tip ../archive.tar.gz
2039 2039 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
2040 2040 $ cd ..
2041 2041
2042 2042 Test that addremove picks up largefiles prior to the initial commit (issue3541)
2043 2043
2044 2044 $ hg init addrm2
2045 2045 $ cd addrm2
2046 2046 $ touch large.dat
2047 2047 $ touch large2.dat
2048 2048 $ touch normal
2049 2049 $ hg add --large large.dat
2050 2050 $ hg addremove -v
2051 2051 adding large2.dat as a largefile
2052 2052 adding normal
2053 2053
2054 2054 Test that forgetting all largefiles reverts to islfilesrepo() == False
2055 2055 (addremove will add *.dat as normal files now)
2056 2056 $ hg forget large.dat
2057 2057 $ hg forget large2.dat
2058 2058 $ hg addremove -v
2059 2059 adding large.dat
2060 2060 adding large2.dat
2061 2061
2062 2062 Test commit's addremove option prior to the first commit
2063 2063 $ hg forget large.dat
2064 2064 $ hg forget large2.dat
2065 2065 $ hg add --large large.dat
2066 2066 $ hg ci -Am "commit"
2067 2067 adding large2.dat as a largefile
2068 2068 Invoking status precommit hook
2069 2069 A large.dat
2070 2070 A large2.dat
2071 2071 A normal
2072 2072 $ find .hglf | sort
2073 2073 .hglf
2074 2074 .hglf/large.dat
2075 2075 .hglf/large2.dat
2076 2076
2077 2077 Test actions on largefiles using relative paths from subdir
2078 2078
2079 2079 $ mkdir sub
2080 2080 $ cd sub
2081 2081 $ echo anotherlarge > anotherlarge
2082 2082 $ hg add --large anotherlarge
2083 2083 $ hg st
2084 2084 A sub/anotherlarge
2085 2085 $ hg st anotherlarge
2086 2086 A anotherlarge
2087 2087 $ hg commit -m anotherlarge anotherlarge
2088 2088 Invoking status precommit hook
2089 2089 A sub/anotherlarge
2090 2090 $ hg log anotherlarge
2091 2091 changeset: 1:9627a577c5e9
2092 2092 tag: tip
2093 2093 user: test
2094 2094 date: Thu Jan 01 00:00:00 1970 +0000
2095 2095 summary: anotherlarge
2096 2096
2097 2097 $ echo more >> anotherlarge
2098 2098 $ hg st .
2099 2099 M anotherlarge
2100 2100 $ hg cat anotherlarge
2101 2101 anotherlarge
2102 2102 $ hg revert anotherlarge
2103 2103 $ hg st
2104 2104 ? sub/anotherlarge.orig
2105 2105 $ cd ..
2106 2106
2107 2107 $ cd ..
2108 2108
2109 2109 issue3651: summary/outgoing with largefiles shows "no remote repo"
2110 2110 unexpectedly
2111 2111
2112 2112 $ mkdir issue3651
2113 2113 $ cd issue3651
2114 2114
2115 2115 $ hg init src
2116 2116 $ echo a > src/a
2117 2117 $ hg -R src add --large src/a
2118 2118 $ hg -R src commit -m '#0'
2119 2119 Invoking status precommit hook
2120 2120 A a
2121 2121
2122 2122 check messages when no remote repository is specified:
2123 2123 "no remote repo" route for "hg outgoing --large" is not tested here,
2124 2124 because it can't be reproduced easily.
2125 2125
2126 2126 $ hg init clone1
2127 2127 $ hg -R clone1 -q pull src
2128 2128 $ hg -R clone1 -q update
2129 2129 $ hg -R clone1 paths | grep default
2130 2130 [1]
2131 2131
2132 2132 $ hg -R clone1 summary --large
2133 2133 parent: 0:fc0bd45326d3 tip
2134 2134 #0
2135 2135 branch: default
2136 2136 commit: (clean)
2137 2137 update: (current)
2138 2138 largefiles: (no remote repo)
2139 2139
2140 2140 check messages when there is no files to upload:
2141 2141
2142 2142 $ hg -q clone src clone2
2143 2143 $ hg -R clone2 paths | grep default
2144 2144 default = $TESTTMP/issue3651/src (glob)
2145 2145
2146 2146 $ hg -R clone2 summary --large
2147 2147 parent: 0:fc0bd45326d3 tip
2148 2148 #0
2149 2149 branch: default
2150 2150 commit: (clean)
2151 2151 update: (current)
2152 2152 searching for changes
2153 2153 largefiles: (no files to upload)
2154 2154 $ hg -R clone2 outgoing --large
2155 2155 comparing with $TESTTMP/issue3651/src (glob)
2156 2156 searching for changes
2157 2157 no changes found
2158 2158 searching for changes
2159 2159 largefiles: no files to upload
2160 2160 [1]
2161 2161
2162 2162 check messages when there are files to upload:
2163 2163
2164 2164 $ echo b > clone2/b
2165 2165 $ hg -R clone2 add --large clone2/b
2166 2166 $ hg -R clone2 commit -m '#1'
2167 2167 Invoking status precommit hook
2168 2168 A b
2169 2169 $ hg -R clone2 summary --large
2170 2170 parent: 1:1acbe71ce432 tip
2171 2171 #1
2172 2172 branch: default
2173 2173 commit: (clean)
2174 2174 update: (current)
2175 2175 searching for changes
2176 2176 largefiles: 1 to upload
2177 2177 $ hg -R clone2 outgoing --large
2178 2178 comparing with $TESTTMP/issue3651/src (glob)
2179 2179 searching for changes
2180 2180 changeset: 1:1acbe71ce432
2181 2181 tag: tip
2182 2182 user: test
2183 2183 date: Thu Jan 01 00:00:00 1970 +0000
2184 2184 summary: #1
2185 2185
2186 2186 searching for changes
2187 2187 largefiles to upload:
2188 2188 b
2189 2189
2190 2190
2191 2191 $ cd ..
@@ -1,350 +1,350 b''
1 1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 2 $ mkdir "${USERCACHE}"
3 3 $ cat >> $HGRCPATH <<EOF
4 4 > [extensions]
5 5 > largefiles =
6 6 > share =
7 7 > graphlog =
8 8 > mq =
9 9 > convert =
10 10 > [largefiles]
11 11 > minsize = 0.5
12 12 > patterns = **.other
13 13 > **.dat
14 14 > usercache=${USERCACHE}
15 15 > EOF
16 16
17 17 "lfconvert" works
18 18 $ hg init bigfile-repo
19 19 $ cd bigfile-repo
20 20 $ cat >> .hg/hgrc <<EOF
21 21 > [extensions]
22 22 > largefiles = !
23 23 > EOF
24 24 $ mkdir sub
25 25 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
26 26 $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null
27 27 $ echo normal > normal1
28 28 $ echo alsonormal > sub/normal2
29 29 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
30 30 $ hg addremove
31 31 adding large
32 32 adding large2
33 33 adding normal1
34 34 adding sub/maybelarge.dat
35 35 adding sub/normal2
36 36 $ hg commit -m"add large, normal1" large normal1
37 37 $ hg commit -m"add sub/*" sub
38 38
39 39 Test tag parsing
40 40 $ cat >> .hgtags <<EOF
41 41 > IncorrectlyFormattedTag!
42 42 > invalidhash sometag
43 43 > 0123456789abcdef anothertag
44 44 > EOF
45 45 $ hg add .hgtags
46 46 $ hg commit -m"add large2" large2 .hgtags
47 47
48 48 Test link+rename largefile codepath
49 49 $ [ -d .hg/largefiles ] && echo fail || echo pass
50 50 pass
51 51 $ cd ..
52 52 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
53 53 initializing destination largefiles-repo
54 54 skipping incorrectly formatted tag IncorrectlyFormattedTag!
55 55 skipping incorrectly formatted id invalidhash
56 56 no mapping for id 0123456789abcdef
57 57 #if symlink
58 58 $ hg --cwd bigfile-repo rename large2 large3
59 59 $ ln -sf large bigfile-repo/large3
60 60 $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3
61 61 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink
62 62 initializing destination largefiles-repo-symlink
63 63 skipping incorrectly formatted tag IncorrectlyFormattedTag!
64 64 skipping incorrectly formatted id invalidhash
65 65 no mapping for id 0123456789abcdef
66 66 abort: renamed/copied largefile large3 becomes symlink
67 67 [255]
68 68 #endif
69 69 $ cd bigfile-repo
70 70 $ hg strip --no-backup 2
71 71 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
72 72 $ cd ..
73 73 $ rm -rf largefiles-repo largefiles-repo-symlink
74 74
75 75 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
76 76 initializing destination largefiles-repo
77 77
78 78 "lfconvert" converts content correctly
79 79 $ cd largefiles-repo
80 80 $ hg up
81 81 getting changed largefiles
82 82 2 largefiles updated, 0 removed
83 83 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 84 $ hg locate
85 85 .hglf/large
86 86 .hglf/sub/maybelarge.dat
87 87 normal1
88 88 sub/normal2
89 89 $ cat normal1
90 90 normal
91 91 $ cat sub/normal2
92 92 alsonormal
93 93 $ "$TESTDIR/md5sum.py" large sub/maybelarge.dat
94 94 ec87a838931d4d5d2e94a04644788a55 large
95 95 1276481102f218c981e0324180bafd9f sub/maybelarge.dat
96 96
97 97 "lfconvert" adds 'largefiles' to .hg/requires.
98 98 $ cat .hg/requires
99 99 dotencode
100 100 fncache
101 101 largefiles
102 102 revlogv1
103 103 store
104 104
105 105 "lfconvert" includes a newline at the end of the standin files.
106 106 $ cat .hglf/large .hglf/sub/maybelarge.dat
107 107 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
108 108 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
109 109 $ cd ..
110 110
111 111 add some changesets to rename/remove/merge
112 112 $ cd bigfile-repo
113 113 $ hg mv -q sub stuff
114 114 $ hg commit -m"rename sub/ to stuff/"
115 115 $ hg update -q 1
116 116 $ echo blah >> normal3
117 117 $ echo blah >> sub/normal2
118 118 $ echo blah >> sub/maybelarge.dat
119 119 $ "$TESTDIR/md5sum.py" sub/maybelarge.dat
120 120 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat
121 121 $ hg commit -A -m"add normal3, modify sub/*"
122 122 adding normal3
123 123 created new head
124 124 $ hg rm large normal3
125 125 $ hg commit -q -m"remove large, normal3"
126 126 $ hg merge
127 127 merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat
128 128 warning: $TESTTMP/bigfile-repo/stuff/maybelarge.dat looks like a binary file. (glob)
129 129 merging stuff/maybelarge.dat incomplete! (edit conflicts, then use 'hg resolve --mark')
130 130 merging sub/normal2 and stuff/normal2 to stuff/normal2
131 131 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
132 132 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
133 133 [1]
134 134 $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat
135 135 $ hg resolve -m stuff/maybelarge.dat
136 136 $ hg commit -m"merge"
137 137 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
138 138 @ 5:4884f215abda merge
139 139 |\
140 140 | o 4:7285f817b77e remove large, normal3
141 141 | |
142 142 | o 3:67e3892e3534 add normal3, modify sub/*
143 143 | |
144 144 o | 2:c96c8beb5d56 rename sub/ to stuff/
145 145 |/
146 146 o 1:020c65d24e11 add sub/*
147 147 |
148 148 o 0:117b8328f97a add large, normal1
149 149
150 150 $ cd ..
151 151
152 152 lfconvert with rename, merge, and remove
153 153 $ rm -rf largefiles-repo
154 154 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
155 155 initializing destination largefiles-repo
156 156 $ cd largefiles-repo
157 157 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
158 158 o 5:8e05f5f2b77e merge
159 159 |\
160 160 | o 4:a5a02de7a8e4 remove large, normal3
161 161 | |
162 162 | o 3:55759520c76f add normal3, modify sub/*
163 163 | |
164 164 o | 2:261ad3f3f037 rename sub/ to stuff/
165 165 |/
166 166 o 1:334e5237836d add sub/*
167 167 |
168 168 o 0:d4892ec57ce2 add large, normal1
169 169
170 170 $ hg locate -r 2
171 171 .hglf/large
172 172 .hglf/stuff/maybelarge.dat
173 173 normal1
174 174 stuff/normal2
175 175 $ hg locate -r 3
176 176 .hglf/large
177 177 .hglf/sub/maybelarge.dat
178 178 normal1
179 179 normal3
180 180 sub/normal2
181 181 $ hg locate -r 4
182 182 .hglf/sub/maybelarge.dat
183 183 normal1
184 184 sub/normal2
185 185 $ hg locate -r 5
186 186 .hglf/stuff/maybelarge.dat
187 187 normal1
188 188 stuff/normal2
189 189 $ hg update
190 190 getting changed largefiles
191 191 1 largefiles updated, 0 removed
192 192 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 193 $ cat stuff/normal2
194 194 alsonormal
195 195 blah
196 196 $ "$TESTDIR/md5sum.py" stuff/maybelarge.dat
197 197 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat
198 198 $ cat .hglf/stuff/maybelarge.dat
199 199 76236b6a2c6102826c61af4297dd738fb3b1de38
200 200 $ cd ..
201 201
202 202 "lfconvert" error cases
203 203 $ hg lfconvert http://localhost/foo foo
204 204 abort: http://localhost/foo is not a local Mercurial repo
205 205 [255]
206 206 $ hg lfconvert foo ssh://localhost/foo
207 207 abort: ssh://localhost/foo is not a local Mercurial repo
208 208 [255]
209 209 $ hg lfconvert nosuchrepo foo
210 210 abort: repository nosuchrepo not found!
211 211 [255]
212 212 $ hg share -q -U bigfile-repo shared
213 213 $ printf 'bogus' > shared/.hg/sharedpath
214 214 $ hg lfconvert shared foo
215 215 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus! (glob)
216 216 [255]
217 217 $ hg lfconvert bigfile-repo largefiles-repo
218 218 initializing destination largefiles-repo
219 219 abort: repository largefiles-repo already exists!
220 220 [255]
221 221
222 222 add another largefile to the new largefiles repo
223 223 $ cd largefiles-repo
224 224 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
225 225 $ hg add --lfsize=1 anotherlarge
226 226 $ hg commit -m "add anotherlarge (should be a largefile)"
227 227 $ cat .hglf/anotherlarge
228 228 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
229 229 $ cd ..
230 230
231 231 round-trip: converting back to a normal (non-largefiles) repo with
232 232 "lfconvert --to-normal" should give the same as ../bigfile-repo
233 233 $ cd largefiles-repo
234 234 $ hg lfconvert --to-normal . ../normal-repo
235 235 initializing destination ../normal-repo
236 236 $ cd ../normal-repo
237 237 $ cat >> .hg/hgrc <<EOF
238 238 > [extensions]
239 239 > largefiles = !
240 240 > EOF
241 241
242 242 # Hmmm: the changeset ID for rev 5 is different from the original
243 243 # normal repo (../bigfile-repo), because the changelog filelist
244 244 # differs between the two incarnations of rev 5: this repo includes
245 245 # 'large' in the list, but ../bigfile-repo does not. Since rev 5
246 246 # removes 'large' relative to the first parent in both repos, it seems
247 247 # to me that lfconvert is doing a *better* job than
248 248 # "hg remove" + "hg merge" + "hg commit".
249 249 # $ hg -R ../bigfile-repo debugdata -c 5
250 250 # $ hg debugdata -c 5
251 251 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
252 252 o 6:1635824e6f59 add anotherlarge (should be a largefile)
253 253 |
254 254 o 5:7215f8deeaaf merge
255 255 |\
256 256 | o 4:7285f817b77e remove large, normal3
257 257 | |
258 258 | o 3:67e3892e3534 add normal3, modify sub/*
259 259 | |
260 260 o | 2:c96c8beb5d56 rename sub/ to stuff/
261 261 |/
262 262 o 1:020c65d24e11 add sub/*
263 263 |
264 264 o 0:117b8328f97a add large, normal1
265 265
266 266 $ hg update
267 267 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 268 $ hg locate
269 269 anotherlarge
270 270 normal1
271 271 stuff/maybelarge.dat
272 272 stuff/normal2
273 273 $ [ -d .hg/largefiles ] && echo fail || echo pass
274 274 pass
275 275
276 276 $ cd ..
277 277
278 278 Clearing the usercache ensures that commitctx doesn't try to cache largefiles
279 279 from the working dir on a convert.
280 280 $ rm "${USERCACHE}"/*
281 281 $ hg convert largefiles-repo
282 282 assuming destination largefiles-repo-hg
283 283 initializing destination largefiles-repo-hg repository
284 284 scanning source...
285 285 sorting...
286 286 converting...
287 287 6 add large, normal1
288 288 5 add sub/*
289 289 4 rename sub/ to stuff/
290 290 3 add normal3, modify sub/*
291 291 2 remove large, normal3
292 292 1 merge
293 293 0 add anotherlarge (should be a largefile)
294 294
295 295 $ hg -R largefiles-repo-hg glog --template "{rev}:{node|short} {desc|firstline}\n"
296 296 o 6:17126745edfd add anotherlarge (should be a largefile)
297 297 |
298 298 o 5:9cc5aa7204f0 merge
299 299 |\
300 300 | o 4:a5a02de7a8e4 remove large, normal3
301 301 | |
302 302 | o 3:55759520c76f add normal3, modify sub/*
303 303 | |
304 304 o | 2:261ad3f3f037 rename sub/ to stuff/
305 305 |/
306 306 o 1:334e5237836d add sub/*
307 307 |
308 308 o 0:d4892ec57ce2 add large, normal1
309 309
310 310 Verify will fail (for now) if the usercache is purged before converting, since
311 311 largefiles are not cached in the converted repo's local store by the conversion
312 312 process.
313 313 $ hg -R largefiles-repo-hg verify --large --lfa
314 314 checking changesets
315 315 checking manifests
316 316 crosschecking files in changesets and manifests
317 317 checking files
318 318 8 files, 7 changesets, 12 total revisions
319 319 searching 7 changesets for largefiles
320 320 changeset 0:d4892ec57ce2: large references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/2e000fa7e85759c7f4c254d4d9c33ef481e459a7 (glob)
321 321 changeset 1:334e5237836d: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c (glob)
322 322 changeset 2:261ad3f3f037: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c (glob)
323 323 changeset 3:55759520c76f: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 (glob)
324 324 changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 (glob)
325 325 changeset 6:17126745edfd: anotherlarge references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 (glob)
326 326 verified existence of 6 revisions of 4 largefiles
327 327 [1]
328 328 $ hg -R largefiles-repo-hg showconfig paths
329 329
330 330
331 331 Avoid a traceback if a largefile isn't available (issue3519)
332 332
333 333 Ensure the largefile can be cached in the source if necessary
334 334 $ hg clone -U largefiles-repo issue3519
335 335 $ rm -f "${USERCACHE}"/*
336 336 $ hg lfconvert --to-normal issue3519 normalized3519
337 337 initializing destination normalized3519
338 338
339 339 Ensure the abort message is useful if a largefile is entirely unavailable
340 340 $ rm -rf normalized3519
341 341 $ rm "${USERCACHE}"/*
342 342 $ rm issue3519/.hg/largefiles/*
343 343 $ rm largefiles-repo/.hg/largefiles/*
344 344 $ hg lfconvert --to-normal issue3519 normalized3519
345 345 initializing destination normalized3519
346 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:$TESTTMP/largefiles-repo
346 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:$TESTTMP/largefiles-repo (glob)
347 347 abort: missing largefile 'large' from revision d4892ec57ce212905215fad1d9018f56b99202ad
348 348 [255]
349 349
350 350
@@ -1,1104 +1,1106 b''
1 1 $ "$TESTDIR/hghave" killdaemons || exit 80
2 2
3 3 $ cat >> $HGRCPATH <<EOF
4 4 > [extensions]
5 5 > graphlog=
6 6 > EOF
7 7 $ hgph() { hg log -G --template "{rev} {phase} {desc} - {node|short}\n" $*; }
8 8
9 9 $ mkcommit() {
10 10 > echo "$1" > "$1"
11 11 > hg add "$1"
12 12 > message="$1"
13 13 > shift
14 14 > hg ci -m "$message" $*
15 15 > }
16 16
17 17 $ hg init alpha
18 18 $ cd alpha
19 19 $ mkcommit a-A
20 20 $ mkcommit a-B
21 21 $ mkcommit a-C
22 22 $ mkcommit a-D
23 23 $ hgph
24 24 @ 3 draft a-D - b555f63b6063
25 25 |
26 26 o 2 draft a-C - 54acac6f23ab
27 27 |
28 28 o 1 draft a-B - 548a3d25dbf0
29 29 |
30 30 o 0 draft a-A - 054250a37db4
31 31
32 32
33 33 $ hg init ../beta
34 34 $ hg push -r 1 ../beta
35 35 pushing to ../beta
36 36 searching for changes
37 37 adding changesets
38 38 adding manifests
39 39 adding file changes
40 40 added 2 changesets with 2 changes to 2 files
41 41 $ hgph
42 42 @ 3 draft a-D - b555f63b6063
43 43 |
44 44 o 2 draft a-C - 54acac6f23ab
45 45 |
46 46 o 1 public a-B - 548a3d25dbf0
47 47 |
48 48 o 0 public a-A - 054250a37db4
49 49
50 50
51 51 $ cd ../beta
52 52 $ hgph
53 53 o 1 public a-B - 548a3d25dbf0
54 54 |
55 55 o 0 public a-A - 054250a37db4
56 56
57 57 $ hg up -q
58 58 $ mkcommit b-A
59 59 $ hgph
60 60 @ 2 draft b-A - f54f1bb90ff3
61 61 |
62 62 o 1 public a-B - 548a3d25dbf0
63 63 |
64 64 o 0 public a-A - 054250a37db4
65 65
66 66 $ hg pull ../alpha
67 67 pulling from ../alpha
68 68 searching for changes
69 69 adding changesets
70 70 adding manifests
71 71 adding file changes
72 72 added 2 changesets with 2 changes to 2 files (+1 heads)
73 73 (run 'hg heads' to see heads, 'hg merge' to merge)
74 74 $ hgph
75 75 o 4 public a-D - b555f63b6063
76 76 |
77 77 o 3 public a-C - 54acac6f23ab
78 78 |
79 79 | @ 2 draft b-A - f54f1bb90ff3
80 80 |/
81 81 o 1 public a-B - 548a3d25dbf0
82 82 |
83 83 o 0 public a-A - 054250a37db4
84 84
85 85
86 86 pull did not updated ../alpha state.
87 87 push from alpha to beta should update phase even if nothing is transferred
88 88
89 89 $ cd ../alpha
90 90 $ hgph # not updated by remote pull
91 91 @ 3 draft a-D - b555f63b6063
92 92 |
93 93 o 2 draft a-C - 54acac6f23ab
94 94 |
95 95 o 1 public a-B - 548a3d25dbf0
96 96 |
97 97 o 0 public a-A - 054250a37db4
98 98
99 99 $ hg push ../beta
100 100 pushing to ../beta
101 101 searching for changes
102 102 no changes found
103 103 [1]
104 104 $ hgph
105 105 @ 3 public a-D - b555f63b6063
106 106 |
107 107 o 2 public a-C - 54acac6f23ab
108 108 |
109 109 o 1 public a-B - 548a3d25dbf0
110 110 |
111 111 o 0 public a-A - 054250a37db4
112 112
113 113
114 114 update must update phase of common changeset too
115 115
116 116 $ hg pull ../beta # getting b-A
117 117 pulling from ../beta
118 118 searching for changes
119 119 adding changesets
120 120 adding manifests
121 121 adding file changes
122 122 added 1 changesets with 1 changes to 1 files (+1 heads)
123 123 (run 'hg heads' to see heads, 'hg merge' to merge)
124 124
125 125 $ cd ../beta
126 126 $ hgph # not updated by remote pull
127 127 o 4 public a-D - b555f63b6063
128 128 |
129 129 o 3 public a-C - 54acac6f23ab
130 130 |
131 131 | @ 2 draft b-A - f54f1bb90ff3
132 132 |/
133 133 o 1 public a-B - 548a3d25dbf0
134 134 |
135 135 o 0 public a-A - 054250a37db4
136 136
137 137 $ hg pull ../alpha
138 138 pulling from ../alpha
139 139 searching for changes
140 140 no changes found
141 141 $ hgph
142 142 o 4 public a-D - b555f63b6063
143 143 |
144 144 o 3 public a-C - 54acac6f23ab
145 145 |
146 146 | @ 2 public b-A - f54f1bb90ff3
147 147 |/
148 148 o 1 public a-B - 548a3d25dbf0
149 149 |
150 150 o 0 public a-A - 054250a37db4
151 151
152 152
153 153 Publish configuration option
154 154 ----------------------------
155 155
156 156 Pull
157 157 ````
158 158
159 159 changegroup are added without phase movement
160 160
161 161 $ hg bundle -a ../base.bundle
162 162 5 changesets found
163 163 $ cd ..
164 164 $ hg init mu
165 165 $ cd mu
166 166 $ cat > .hg/hgrc << EOF
167 167 > [phases]
168 168 > publish=0
169 169 > EOF
170 170 $ hg unbundle ../base.bundle
171 171 adding changesets
172 172 adding manifests
173 173 adding file changes
174 174 added 5 changesets with 5 changes to 5 files (+1 heads)
175 175 (run 'hg heads' to see heads, 'hg merge' to merge)
176 176 $ hgph
177 177 o 4 draft a-D - b555f63b6063
178 178 |
179 179 o 3 draft a-C - 54acac6f23ab
180 180 |
181 181 | o 2 draft b-A - f54f1bb90ff3
182 182 |/
183 183 o 1 draft a-B - 548a3d25dbf0
184 184 |
185 185 o 0 draft a-A - 054250a37db4
186 186
187 187 $ cd ..
188 188
189 189 Pulling from publish=False to publish=False does not move boundary.
190 190
191 191 $ hg init nu
192 192 $ cd nu
193 193 $ cat > .hg/hgrc << EOF
194 194 > [phases]
195 195 > publish=0
196 196 > EOF
197 197 $ hg pull ../mu -r 54acac6f23ab
198 198 pulling from ../mu
199 199 adding changesets
200 200 adding manifests
201 201 adding file changes
202 202 added 3 changesets with 3 changes to 3 files
203 203 (run 'hg update' to get a working copy)
204 204 $ hgph
205 205 o 2 draft a-C - 54acac6f23ab
206 206 |
207 207 o 1 draft a-B - 548a3d25dbf0
208 208 |
209 209 o 0 draft a-A - 054250a37db4
210 210
211 211
212 212 Even for common
213 213
214 214 $ hg pull ../mu -r f54f1bb90ff3
215 215 pulling from ../mu
216 216 searching for changes
217 217 adding changesets
218 218 adding manifests
219 219 adding file changes
220 220 added 1 changesets with 1 changes to 1 files (+1 heads)
221 221 (run 'hg heads' to see heads, 'hg merge' to merge)
222 222 $ hgph
223 223 o 3 draft b-A - f54f1bb90ff3
224 224 |
225 225 | o 2 draft a-C - 54acac6f23ab
226 226 |/
227 227 o 1 draft a-B - 548a3d25dbf0
228 228 |
229 229 o 0 draft a-A - 054250a37db4
230 230
231 231
232 232
233 233 Pulling from Publish=True to Publish=False move boundary in common set.
234 234 we are in nu
235 235
236 236 $ hg pull ../alpha -r b555f63b6063
237 237 pulling from ../alpha
238 238 searching for changes
239 239 adding changesets
240 240 adding manifests
241 241 adding file changes
242 242 added 1 changesets with 1 changes to 1 files
243 243 (run 'hg update' to get a working copy)
244 244 $ hgph # f54f1bb90ff3 stay draft, not ancestor of -r
245 245 o 4 public a-D - b555f63b6063
246 246 |
247 247 | o 3 draft b-A - f54f1bb90ff3
248 248 | |
249 249 o | 2 public a-C - 54acac6f23ab
250 250 |/
251 251 o 1 public a-B - 548a3d25dbf0
252 252 |
253 253 o 0 public a-A - 054250a37db4
254 254
255 255
256 256 pulling from Publish=False to publish=False with some public
257 257
258 258 $ hg up -q f54f1bb90ff3
259 259 $ mkcommit n-A
260 260 $ mkcommit n-B
261 261 $ hgph
262 262 @ 6 draft n-B - 145e75495359
263 263 |
264 264 o 5 draft n-A - d6bcb4f74035
265 265 |
266 266 | o 4 public a-D - b555f63b6063
267 267 | |
268 268 o | 3 draft b-A - f54f1bb90ff3
269 269 | |
270 270 | o 2 public a-C - 54acac6f23ab
271 271 |/
272 272 o 1 public a-B - 548a3d25dbf0
273 273 |
274 274 o 0 public a-A - 054250a37db4
275 275
276 276 $ cd ../mu
277 277 $ hg pull ../nu
278 278 pulling from ../nu
279 279 searching for changes
280 280 adding changesets
281 281 adding manifests
282 282 adding file changes
283 283 added 2 changesets with 2 changes to 2 files
284 284 (run 'hg update' to get a working copy)
285 285 $ hgph
286 286 o 6 draft n-B - 145e75495359
287 287 |
288 288 o 5 draft n-A - d6bcb4f74035
289 289 |
290 290 | o 4 public a-D - b555f63b6063
291 291 | |
292 292 | o 3 public a-C - 54acac6f23ab
293 293 | |
294 294 o | 2 draft b-A - f54f1bb90ff3
295 295 |/
296 296 o 1 public a-B - 548a3d25dbf0
297 297 |
298 298 o 0 public a-A - 054250a37db4
299 299
300 300 $ cd ..
301 301
302 302 pulling into publish=True
303 303
304 304 $ cd alpha
305 305 $ hgph
306 306 o 4 public b-A - f54f1bb90ff3
307 307 |
308 308 | @ 3 public a-D - b555f63b6063
309 309 | |
310 310 | o 2 public a-C - 54acac6f23ab
311 311 |/
312 312 o 1 public a-B - 548a3d25dbf0
313 313 |
314 314 o 0 public a-A - 054250a37db4
315 315
316 316 $ hg pull ../mu
317 317 pulling from ../mu
318 318 searching for changes
319 319 adding changesets
320 320 adding manifests
321 321 adding file changes
322 322 added 2 changesets with 2 changes to 2 files
323 323 (run 'hg update' to get a working copy)
324 324 $ hgph
325 325 o 6 draft n-B - 145e75495359
326 326 |
327 327 o 5 draft n-A - d6bcb4f74035
328 328 |
329 329 o 4 public b-A - f54f1bb90ff3
330 330 |
331 331 | @ 3 public a-D - b555f63b6063
332 332 | |
333 333 | o 2 public a-C - 54acac6f23ab
334 334 |/
335 335 o 1 public a-B - 548a3d25dbf0
336 336 |
337 337 o 0 public a-A - 054250a37db4
338 338
339 339 $ cd ..
340 340
341 341 pulling back into original repo
342 342
343 343 $ cd nu
344 344 $ hg pull ../alpha
345 345 pulling from ../alpha
346 346 searching for changes
347 347 no changes found
348 348 $ hgph
349 349 @ 6 public n-B - 145e75495359
350 350 |
351 351 o 5 public n-A - d6bcb4f74035
352 352 |
353 353 | o 4 public a-D - b555f63b6063
354 354 | |
355 355 o | 3 public b-A - f54f1bb90ff3
356 356 | |
357 357 | o 2 public a-C - 54acac6f23ab
358 358 |/
359 359 o 1 public a-B - 548a3d25dbf0
360 360 |
361 361 o 0 public a-A - 054250a37db4
362 362
363 363
364 364 Push
365 365 ````
366 366
367 367 (inserted)
368 368
369 369 Test that phase are pushed even when they are nothing to pus
370 370 (this might be tested later bu are very convenient to not alter too much test)
371 371
372 372 Push back to alpha
373 373
374 374 $ hg push ../alpha # from nu
375 375 pushing to ../alpha
376 376 searching for changes
377 377 no changes found
378 378 [1]
379 379 $ cd ..
380 380 $ cd alpha
381 381 $ hgph
382 382 o 6 public n-B - 145e75495359
383 383 |
384 384 o 5 public n-A - d6bcb4f74035
385 385 |
386 386 o 4 public b-A - f54f1bb90ff3
387 387 |
388 388 | @ 3 public a-D - b555f63b6063
389 389 | |
390 390 | o 2 public a-C - 54acac6f23ab
391 391 |/
392 392 o 1 public a-B - 548a3d25dbf0
393 393 |
394 394 o 0 public a-A - 054250a37db4
395 395
396 396
397 397 (end insertion)
398 398
399 399
400 400 initial setup
401 401
402 402 $ hg glog # of alpha
403 403 o changeset: 6:145e75495359
404 404 | tag: tip
405 405 | user: test
406 406 | date: Thu Jan 01 00:00:00 1970 +0000
407 407 | summary: n-B
408 408 |
409 409 o changeset: 5:d6bcb4f74035
410 410 | user: test
411 411 | date: Thu Jan 01 00:00:00 1970 +0000
412 412 | summary: n-A
413 413 |
414 414 o changeset: 4:f54f1bb90ff3
415 415 | parent: 1:548a3d25dbf0
416 416 | user: test
417 417 | date: Thu Jan 01 00:00:00 1970 +0000
418 418 | summary: b-A
419 419 |
420 420 | @ changeset: 3:b555f63b6063
421 421 | | user: test
422 422 | | date: Thu Jan 01 00:00:00 1970 +0000
423 423 | | summary: a-D
424 424 | |
425 425 | o changeset: 2:54acac6f23ab
426 426 |/ user: test
427 427 | date: Thu Jan 01 00:00:00 1970 +0000
428 428 | summary: a-C
429 429 |
430 430 o changeset: 1:548a3d25dbf0
431 431 | user: test
432 432 | date: Thu Jan 01 00:00:00 1970 +0000
433 433 | summary: a-B
434 434 |
435 435 o changeset: 0:054250a37db4
436 436 user: test
437 437 date: Thu Jan 01 00:00:00 1970 +0000
438 438 summary: a-A
439 439
440 440 $ mkcommit a-E
441 441 $ mkcommit a-F
442 442 $ mkcommit a-G
443 443 $ hg up d6bcb4f74035 -q
444 444 $ mkcommit a-H
445 445 created new head
446 446 $ hgph
447 447 @ 10 draft a-H - 967b449fbc94
448 448 |
449 449 | o 9 draft a-G - 3e27b6f1eee1
450 450 | |
451 451 | o 8 draft a-F - b740e3e5c05d
452 452 | |
453 453 | o 7 draft a-E - e9f537e46dea
454 454 | |
455 455 +---o 6 public n-B - 145e75495359
456 456 | |
457 457 o | 5 public n-A - d6bcb4f74035
458 458 | |
459 459 o | 4 public b-A - f54f1bb90ff3
460 460 | |
461 461 | o 3 public a-D - b555f63b6063
462 462 | |
463 463 | o 2 public a-C - 54acac6f23ab
464 464 |/
465 465 o 1 public a-B - 548a3d25dbf0
466 466 |
467 467 o 0 public a-A - 054250a37db4
468 468
469 469
470 470 Pulling from bundle does not alter phases of changeset not present in the bundle
471 471
472 472 $ hg bundle --base 1 -r 6 -r 3 ../partial-bundle.hg
473 473 5 changesets found
474 474 $ hg pull ../partial-bundle.hg
475 475 pulling from ../partial-bundle.hg
476 476 searching for changes
477 477 no changes found
478 478 $ hgph
479 479 @ 10 draft a-H - 967b449fbc94
480 480 |
481 481 | o 9 draft a-G - 3e27b6f1eee1
482 482 | |
483 483 | o 8 draft a-F - b740e3e5c05d
484 484 | |
485 485 | o 7 draft a-E - e9f537e46dea
486 486 | |
487 487 +---o 6 public n-B - 145e75495359
488 488 | |
489 489 o | 5 public n-A - d6bcb4f74035
490 490 | |
491 491 o | 4 public b-A - f54f1bb90ff3
492 492 | |
493 493 | o 3 public a-D - b555f63b6063
494 494 | |
495 495 | o 2 public a-C - 54acac6f23ab
496 496 |/
497 497 o 1 public a-B - 548a3d25dbf0
498 498 |
499 499 o 0 public a-A - 054250a37db4
500 500
501 501
502 502 Pushing to Publish=False (unknown changeset)
503 503
504 504 $ hg push ../mu -r b740e3e5c05d # a-F
505 505 pushing to ../mu
506 506 searching for changes
507 507 adding changesets
508 508 adding manifests
509 509 adding file changes
510 510 added 2 changesets with 2 changes to 2 files
511 511 $ hgph
512 512 @ 10 draft a-H - 967b449fbc94
513 513 |
514 514 | o 9 draft a-G - 3e27b6f1eee1
515 515 | |
516 516 | o 8 draft a-F - b740e3e5c05d
517 517 | |
518 518 | o 7 draft a-E - e9f537e46dea
519 519 | |
520 520 +---o 6 public n-B - 145e75495359
521 521 | |
522 522 o | 5 public n-A - d6bcb4f74035
523 523 | |
524 524 o | 4 public b-A - f54f1bb90ff3
525 525 | |
526 526 | o 3 public a-D - b555f63b6063
527 527 | |
528 528 | o 2 public a-C - 54acac6f23ab
529 529 |/
530 530 o 1 public a-B - 548a3d25dbf0
531 531 |
532 532 o 0 public a-A - 054250a37db4
533 533
534 534
535 535 $ cd ../mu
536 536 $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft,
537 537 > # not ancestor of -r
538 538 o 8 draft a-F - b740e3e5c05d
539 539 |
540 540 o 7 draft a-E - e9f537e46dea
541 541 |
542 542 | o 6 draft n-B - 145e75495359
543 543 | |
544 544 | o 5 draft n-A - d6bcb4f74035
545 545 | |
546 546 o | 4 public a-D - b555f63b6063
547 547 | |
548 548 o | 3 public a-C - 54acac6f23ab
549 549 | |
550 550 | o 2 draft b-A - f54f1bb90ff3
551 551 |/
552 552 o 1 public a-B - 548a3d25dbf0
553 553 |
554 554 o 0 public a-A - 054250a37db4
555 555
556 556
557 557 Pushing to Publish=True (unknown changeset)
558 558
559 559 $ hg push ../beta -r b740e3e5c05d
560 560 pushing to ../beta
561 561 searching for changes
562 562 adding changesets
563 563 adding manifests
564 564 adding file changes
565 565 added 2 changesets with 2 changes to 2 files
566 566 $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft,
567 567 > # not ancestor of -r
568 568 o 8 public a-F - b740e3e5c05d
569 569 |
570 570 o 7 public a-E - e9f537e46dea
571 571 |
572 572 | o 6 draft n-B - 145e75495359
573 573 | |
574 574 | o 5 draft n-A - d6bcb4f74035
575 575 | |
576 576 o | 4 public a-D - b555f63b6063
577 577 | |
578 578 o | 3 public a-C - 54acac6f23ab
579 579 | |
580 580 | o 2 draft b-A - f54f1bb90ff3
581 581 |/
582 582 o 1 public a-B - 548a3d25dbf0
583 583 |
584 584 o 0 public a-A - 054250a37db4
585 585
586 586
587 587 Pushing to Publish=True (common changeset)
588 588
589 589 $ cd ../beta
590 590 $ hg push ../alpha
591 591 pushing to ../alpha
592 592 searching for changes
593 593 no changes found
594 594 [1]
595 595 $ hgph
596 596 o 6 public a-F - b740e3e5c05d
597 597 |
598 598 o 5 public a-E - e9f537e46dea
599 599 |
600 600 o 4 public a-D - b555f63b6063
601 601 |
602 602 o 3 public a-C - 54acac6f23ab
603 603 |
604 604 | @ 2 public b-A - f54f1bb90ff3
605 605 |/
606 606 o 1 public a-B - 548a3d25dbf0
607 607 |
608 608 o 0 public a-A - 054250a37db4
609 609
610 610 $ cd ../alpha
611 611 $ hgph
612 612 @ 10 draft a-H - 967b449fbc94
613 613 |
614 614 | o 9 draft a-G - 3e27b6f1eee1
615 615 | |
616 616 | o 8 public a-F - b740e3e5c05d
617 617 | |
618 618 | o 7 public a-E - e9f537e46dea
619 619 | |
620 620 +---o 6 public n-B - 145e75495359
621 621 | |
622 622 o | 5 public n-A - d6bcb4f74035
623 623 | |
624 624 o | 4 public b-A - f54f1bb90ff3
625 625 | |
626 626 | o 3 public a-D - b555f63b6063
627 627 | |
628 628 | o 2 public a-C - 54acac6f23ab
629 629 |/
630 630 o 1 public a-B - 548a3d25dbf0
631 631 |
632 632 o 0 public a-A - 054250a37db4
633 633
634 634
635 635 Pushing to Publish=False (common changeset that change phase + unknown one)
636 636
637 637 $ hg push ../mu -r 967b449fbc94 -f
638 638 pushing to ../mu
639 639 searching for changes
640 640 adding changesets
641 641 adding manifests
642 642 adding file changes
643 643 added 1 changesets with 1 changes to 1 files (+1 heads)
644 644 $ hgph
645 645 @ 10 draft a-H - 967b449fbc94
646 646 |
647 647 | o 9 draft a-G - 3e27b6f1eee1
648 648 | |
649 649 | o 8 public a-F - b740e3e5c05d
650 650 | |
651 651 | o 7 public a-E - e9f537e46dea
652 652 | |
653 653 +---o 6 public n-B - 145e75495359
654 654 | |
655 655 o | 5 public n-A - d6bcb4f74035
656 656 | |
657 657 o | 4 public b-A - f54f1bb90ff3
658 658 | |
659 659 | o 3 public a-D - b555f63b6063
660 660 | |
661 661 | o 2 public a-C - 54acac6f23ab
662 662 |/
663 663 o 1 public a-B - 548a3d25dbf0
664 664 |
665 665 o 0 public a-A - 054250a37db4
666 666
667 667 $ cd ../mu
668 668 $ hgph # d6bcb4f74035 should have changed phase
669 669 > # 145e75495359 is still draft. not ancestor of -r
670 670 o 9 draft a-H - 967b449fbc94
671 671 |
672 672 | o 8 public a-F - b740e3e5c05d
673 673 | |
674 674 | o 7 public a-E - e9f537e46dea
675 675 | |
676 676 +---o 6 draft n-B - 145e75495359
677 677 | |
678 678 o | 5 public n-A - d6bcb4f74035
679 679 | |
680 680 | o 4 public a-D - b555f63b6063
681 681 | |
682 682 | o 3 public a-C - 54acac6f23ab
683 683 | |
684 684 o | 2 public b-A - f54f1bb90ff3
685 685 |/
686 686 o 1 public a-B - 548a3d25dbf0
687 687 |
688 688 o 0 public a-A - 054250a37db4
689 689
690 690
691 691
692 692 Pushing to Publish=True (common changeset from publish=False)
693 693
694 694 (in mu)
695 695 $ hg push ../alpha
696 696 pushing to ../alpha
697 697 searching for changes
698 698 no changes found
699 699 [1]
700 700 $ hgph
701 701 o 9 public a-H - 967b449fbc94
702 702 |
703 703 | o 8 public a-F - b740e3e5c05d
704 704 | |
705 705 | o 7 public a-E - e9f537e46dea
706 706 | |
707 707 +---o 6 public n-B - 145e75495359
708 708 | |
709 709 o | 5 public n-A - d6bcb4f74035
710 710 | |
711 711 | o 4 public a-D - b555f63b6063
712 712 | |
713 713 | o 3 public a-C - 54acac6f23ab
714 714 | |
715 715 o | 2 public b-A - f54f1bb90ff3
716 716 |/
717 717 o 1 public a-B - 548a3d25dbf0
718 718 |
719 719 o 0 public a-A - 054250a37db4
720 720
721 721 $ hgph -R ../alpha # a-H should have been synced to 0
722 722 @ 10 public a-H - 967b449fbc94
723 723 |
724 724 | o 9 draft a-G - 3e27b6f1eee1
725 725 | |
726 726 | o 8 public a-F - b740e3e5c05d
727 727 | |
728 728 | o 7 public a-E - e9f537e46dea
729 729 | |
730 730 +---o 6 public n-B - 145e75495359
731 731 | |
732 732 o | 5 public n-A - d6bcb4f74035
733 733 | |
734 734 o | 4 public b-A - f54f1bb90ff3
735 735 | |
736 736 | o 3 public a-D - b555f63b6063
737 737 | |
738 738 | o 2 public a-C - 54acac6f23ab
739 739 |/
740 740 o 1 public a-B - 548a3d25dbf0
741 741 |
742 742 o 0 public a-A - 054250a37db4
743 743
744 744
745 745
746 746 Discovery locally secret changeset on a remote repository:
747 747
748 748 - should make it non-secret
749 749
750 750 $ cd ../alpha
751 751 $ mkcommit A-secret --config phases.new-commit=2
752 752 $ hgph
753 753 @ 11 secret A-secret - 435b5d83910c
754 754 |
755 755 o 10 public a-H - 967b449fbc94
756 756 |
757 757 | o 9 draft a-G - 3e27b6f1eee1
758 758 | |
759 759 | o 8 public a-F - b740e3e5c05d
760 760 | |
761 761 | o 7 public a-E - e9f537e46dea
762 762 | |
763 763 +---o 6 public n-B - 145e75495359
764 764 | |
765 765 o | 5 public n-A - d6bcb4f74035
766 766 | |
767 767 o | 4 public b-A - f54f1bb90ff3
768 768 | |
769 769 | o 3 public a-D - b555f63b6063
770 770 | |
771 771 | o 2 public a-C - 54acac6f23ab
772 772 |/
773 773 o 1 public a-B - 548a3d25dbf0
774 774 |
775 775 o 0 public a-A - 054250a37db4
776 776
777 777 $ hg bundle --base 'parents(.)' -r . ../secret-bundle.hg
778 778 1 changesets found
779 779 $ hg -R ../mu unbundle ../secret-bundle.hg
780 780 adding changesets
781 781 adding manifests
782 782 adding file changes
783 783 added 1 changesets with 1 changes to 1 files
784 784 (run 'hg update' to get a working copy)
785 785 $ hgph -R ../mu
786 786 o 10 draft A-secret - 435b5d83910c
787 787 |
788 788 o 9 public a-H - 967b449fbc94
789 789 |
790 790 | o 8 public a-F - b740e3e5c05d
791 791 | |
792 792 | o 7 public a-E - e9f537e46dea
793 793 | |
794 794 +---o 6 public n-B - 145e75495359
795 795 | |
796 796 o | 5 public n-A - d6bcb4f74035
797 797 | |
798 798 | o 4 public a-D - b555f63b6063
799 799 | |
800 800 | o 3 public a-C - 54acac6f23ab
801 801 | |
802 802 o | 2 public b-A - f54f1bb90ff3
803 803 |/
804 804 o 1 public a-B - 548a3d25dbf0
805 805 |
806 806 o 0 public a-A - 054250a37db4
807 807
808 808 $ hg pull ../mu
809 809 pulling from ../mu
810 810 searching for changes
811 811 no changes found
812 812 $ hgph
813 813 @ 11 draft A-secret - 435b5d83910c
814 814 |
815 815 o 10 public a-H - 967b449fbc94
816 816 |
817 817 | o 9 draft a-G - 3e27b6f1eee1
818 818 | |
819 819 | o 8 public a-F - b740e3e5c05d
820 820 | |
821 821 | o 7 public a-E - e9f537e46dea
822 822 | |
823 823 +---o 6 public n-B - 145e75495359
824 824 | |
825 825 o | 5 public n-A - d6bcb4f74035
826 826 | |
827 827 o | 4 public b-A - f54f1bb90ff3
828 828 | |
829 829 | o 3 public a-D - b555f63b6063
830 830 | |
831 831 | o 2 public a-C - 54acac6f23ab
832 832 |/
833 833 o 1 public a-B - 548a3d25dbf0
834 834 |
835 835 o 0 public a-A - 054250a37db4
836 836
837 837
838 838 pushing a locally public and draft changesets remotly secret should make them
839 839 appear on the remote side.
840 840
841 841
842 842 $ hg -R ../mu phase --secret --force 967b449fbc94
843 843 $ hg push -r 435b5d83910c ../mu
844 844 pushing to ../mu
845 845 searching for changes
846 846 abort: push creates new remote head 435b5d83910c!
847 847 (did you forget to merge? use push -f to force)
848 848 [255]
849 849 $ hg push -fr 435b5d83910c ../mu # because the push will create new visible head
850 850 pushing to ../mu
851 851 searching for changes
852 852 adding changesets
853 853 adding manifests
854 854 adding file changes
855 855 added 0 changesets with 0 changes to 2 files
856 856 $ hgph -R ../mu
857 857 o 10 draft A-secret - 435b5d83910c
858 858 |
859 859 o 9 public a-H - 967b449fbc94
860 860 |
861 861 | o 8 public a-F - b740e3e5c05d
862 862 | |
863 863 | o 7 public a-E - e9f537e46dea
864 864 | |
865 865 +---o 6 public n-B - 145e75495359
866 866 | |
867 867 o | 5 public n-A - d6bcb4f74035
868 868 | |
869 869 | o 4 public a-D - b555f63b6063
870 870 | |
871 871 | o 3 public a-C - 54acac6f23ab
872 872 | |
873 873 o | 2 public b-A - f54f1bb90ff3
874 874 |/
875 875 o 1 public a-B - 548a3d25dbf0
876 876 |
877 877 o 0 public a-A - 054250a37db4
878 878
879 879
880 880 pull new changeset with common draft locally
881 881
882 882 $ hg up -q 967b449fbc94 # create a new root for draft
883 883 $ mkcommit 'alpha-more'
884 884 created new head
885 885 $ hg push -fr . ../mu
886 886 pushing to ../mu
887 887 searching for changes
888 888 adding changesets
889 889 adding manifests
890 890 adding file changes
891 891 added 1 changesets with 1 changes to 1 files (+1 heads)
892 892 $ cd ../mu
893 893 $ hg phase --secret --force 1c5cfd894796
894 894 $ hg up -q 435b5d83910c
895 895 $ mkcommit 'mu-more'
896 896 $ cd ../alpha
897 897 $ hg pull ../mu
898 898 pulling from ../mu
899 899 searching for changes
900 900 adding changesets
901 901 adding manifests
902 902 adding file changes
903 903 added 1 changesets with 1 changes to 1 files
904 904 (run 'hg update' to get a working copy)
905 905 $ hgph
906 906 o 13 draft mu-more - 5237fb433fc8
907 907 |
908 908 | @ 12 draft alpha-more - 1c5cfd894796
909 909 | |
910 910 o | 11 draft A-secret - 435b5d83910c
911 911 |/
912 912 o 10 public a-H - 967b449fbc94
913 913 |
914 914 | o 9 draft a-G - 3e27b6f1eee1
915 915 | |
916 916 | o 8 public a-F - b740e3e5c05d
917 917 | |
918 918 | o 7 public a-E - e9f537e46dea
919 919 | |
920 920 +---o 6 public n-B - 145e75495359
921 921 | |
922 922 o | 5 public n-A - d6bcb4f74035
923 923 | |
924 924 o | 4 public b-A - f54f1bb90ff3
925 925 | |
926 926 | o 3 public a-D - b555f63b6063
927 927 | |
928 928 | o 2 public a-C - 54acac6f23ab
929 929 |/
930 930 o 1 public a-B - 548a3d25dbf0
931 931 |
932 932 o 0 public a-A - 054250a37db4
933 933
934 934
935 935 Test that test are properly ignored on remote event when existing locally
936 936
937 937 $ cd ..
938 938 $ hg clone -qU -r b555f63b6063 -r f54f1bb90ff3 beta gamma
939 939
940 940 # pathological case are
941 941 #
942 942 # * secret remotely
943 943 # * known locally
944 944 # * repo have uncommon changeset
945 945
946 946 $ hg -R beta phase --secret --force f54f1bb90ff3
947 947 $ hg -R gamma phase --draft --force f54f1bb90ff3
948 948
949 949 $ cd gamma
950 950 $ hg pull ../beta
951 951 pulling from ../beta
952 952 searching for changes
953 953 adding changesets
954 954 adding manifests
955 955 adding file changes
956 956 added 2 changesets with 2 changes to 2 files
957 957 (run 'hg update' to get a working copy)
958 958 $ hg phase f54f1bb90ff3
959 959 2: draft
960 960
961 961 same over the wire
962 962
963 963 $ cd ../beta
964 964 $ hg serve -p $HGPORT -d --pid-file=../beta.pid -E ../beta-error.log
965 965 $ cat ../beta.pid >> $DAEMON_PIDS
966 966 $ cd ../gamma
967 967
968 968 $ hg pull http://localhost:$HGPORT/
969 969 pulling from http://localhost:$HGPORT/
970 970 searching for changes
971 971 no changes found
972 972 $ hg phase f54f1bb90ff3
973 973 2: draft
974 974
975 975 check that secret local on both side are not synced to public
976 976
977 977 $ hg push -r b555f63b6063 http://localhost:$HGPORT/
978 978 pushing to http://localhost:$HGPORT/
979 979 searching for changes
980 980 no changes found
981 981 [1]
982 982 $ hg phase f54f1bb90ff3
983 983 2: draft
984 984
985 985 put the changeset in the draft state again
986 986 (first test after this one expect to be able to copy)
987 987
988 988 $ cd ..
989 989
990 990
991 991 Test Clone behavior
992 992
993 993 A. Clone without secret changeset
994 994
995 995 1. cloning non-publishing repository
996 996 (Phase should be preserved)
997 997
998 998 # make sure there is no secret so we can use a copy clone
999 999
1000 1000 $ hg -R mu phase --draft 'secret()'
1001 1001
1002 1002 $ hg clone -U mu Tau
1003 1003 $ hgph -R Tau
1004 1004 o 12 draft mu-more - 5237fb433fc8
1005 1005 |
1006 1006 | o 11 draft alpha-more - 1c5cfd894796
1007 1007 | |
1008 1008 o | 10 draft A-secret - 435b5d83910c
1009 1009 |/
1010 1010 o 9 public a-H - 967b449fbc94
1011 1011 |
1012 1012 | o 8 public a-F - b740e3e5c05d
1013 1013 | |
1014 1014 | o 7 public a-E - e9f537e46dea
1015 1015 | |
1016 1016 +---o 6 public n-B - 145e75495359
1017 1017 | |
1018 1018 o | 5 public n-A - d6bcb4f74035
1019 1019 | |
1020 1020 | o 4 public a-D - b555f63b6063
1021 1021 | |
1022 1022 | o 3 public a-C - 54acac6f23ab
1023 1023 | |
1024 1024 o | 2 public b-A - f54f1bb90ff3
1025 1025 |/
1026 1026 o 1 public a-B - 548a3d25dbf0
1027 1027 |
1028 1028 o 0 public a-A - 054250a37db4
1029 1029
1030 1030
1031 1031 2. cloning publishing repository
1032 1032
1033 1033 (everything should be public)
1034 1034
1035 1035 $ hg clone -U alpha Upsilon
1036 1036 $ hgph -R Upsilon
1037 1037 o 13 public mu-more - 5237fb433fc8
1038 1038 |
1039 1039 | o 12 public alpha-more - 1c5cfd894796
1040 1040 | |
1041 1041 o | 11 public A-secret - 435b5d83910c
1042 1042 |/
1043 1043 o 10 public a-H - 967b449fbc94
1044 1044 |
1045 1045 | o 9 public a-G - 3e27b6f1eee1
1046 1046 | |
1047 1047 | o 8 public a-F - b740e3e5c05d
1048 1048 | |
1049 1049 | o 7 public a-E - e9f537e46dea
1050 1050 | |
1051 1051 +---o 6 public n-B - 145e75495359
1052 1052 | |
1053 1053 o | 5 public n-A - d6bcb4f74035
1054 1054 | |
1055 1055 o | 4 public b-A - f54f1bb90ff3
1056 1056 | |
1057 1057 | o 3 public a-D - b555f63b6063
1058 1058 | |
1059 1059 | o 2 public a-C - 54acac6f23ab
1060 1060 |/
1061 1061 o 1 public a-B - 548a3d25dbf0
1062 1062 |
1063 1063 o 0 public a-A - 054250a37db4
1064 1064
1065 #if unix-permissions
1065 1066
1066 1067 Pushing From an unlockable repo
1067 1068 --------------------------------
1068 1069 (issue3684)
1069 1070
1070 1071 Unability to lock the source repo should not prevent the push. It will prevent
1071 1072 the retrieval of remote phase during push. For example, pushing to a publishing
1072 1073 server won't turn changeset public.
1073 1074
1074 1075 1. Test that push is not prevented
1075 1076
1076 1077 $ hg init Phi
1077 1078 $ cd Upsilon
1078 1079 $ chmod -R -w .hg
1079 1080 $ hg push ../Phi
1080 1081 pushing to ../Phi
1081 1082 searching for changes
1082 1083 adding changesets
1083 1084 adding manifests
1084 1085 adding file changes
1085 1086 added 14 changesets with 14 changes to 14 files (+3 heads)
1086 1087 $ chmod -R +w .hg
1087 1088
1088 1089 2. Test that failed phases movement are reported
1089 1090
1090 1091 $ hg phase --force --draft 3
1091 1092 $ chmod -R -w .hg
1092 1093 $ hg push ../Phi
1093 1094 pushing to ../Phi
1094 1095 searching for changes
1095 1096 no changes found
1096 1097 cannot lock source repo, skipping local public phase update
1097 1098 [1]
1098 1099 $ chmod -R +w .hg
1099 1100 $ hgph Upsilon
1100 1101
1101 1102 $ cd ..
1102 1103
1103 1104 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1104 1105
1106 #endif
@@ -1,1216 +1,1216 b''
1 1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2 2
3 3 $ echo "[ui]" >> $HGRCPATH
4 4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5 5
6 6 $ hg init t
7 7 $ cd t
8 8
9 9 first revision, no sub
10 10
11 11 $ echo a > a
12 12 $ hg ci -Am0
13 13 adding a
14 14
15 15 add first sub
16 16
17 17 $ echo s = s > .hgsub
18 18 $ hg add .hgsub
19 19 $ hg init s
20 20 $ echo a > s/a
21 21
22 22 Issue2232: committing a subrepo without .hgsub
23 23
24 24 $ hg ci -mbad s
25 25 abort: can't commit subrepos without .hgsub
26 26 [255]
27 27
28 28 $ hg -R s ci -Ams0
29 29 adding a
30 30 $ hg sum
31 31 parent: 0:f7b1eb17ad24 tip
32 32 0
33 33 branch: default
34 34 commit: 1 added, 1 subrepos
35 35 update: (current)
36 36 $ hg ci -m1
37 37
38 38 Revert subrepo and test subrepo fileset keyword:
39 39
40 40 $ echo b > s/a
41 41 $ hg revert "set:subrepo('glob:s*')"
42 42 reverting subrepo s
43 43 reverting s/a (glob)
44 44 $ rm s/a.orig
45 45
46 46 Revert subrepo with no backup. The "reverting s/a" line is gone since
47 47 we're really running 'hg update' in the subrepo:
48 48
49 49 $ echo b > s/a
50 50 $ hg revert --no-backup s
51 51 reverting subrepo s
52 52
53 53 Issue2022: update -C
54 54
55 55 $ echo b > s/a
56 56 $ hg sum
57 57 parent: 1:7cf8cfea66e4 tip
58 58 1
59 59 branch: default
60 60 commit: 1 subrepos
61 61 update: (current)
62 62 $ hg co -C 1
63 63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 64 $ hg sum
65 65 parent: 1:7cf8cfea66e4 tip
66 66 1
67 67 branch: default
68 68 commit: (clean)
69 69 update: (current)
70 70
71 71 commands that require a clean repo should respect subrepos
72 72
73 73 $ echo b >> s/a
74 74 $ hg backout tip
75 75 abort: uncommitted changes in subrepo s
76 76 [255]
77 77 $ hg revert -C -R s s/a
78 78
79 79 add sub sub
80 80
81 81 $ echo ss = ss > s/.hgsub
82 82 $ hg init s/ss
83 83 $ echo a > s/ss/a
84 84 $ hg -R s add s/.hgsub
85 85 $ hg -R s/ss add s/ss/a
86 86 $ hg sum
87 87 parent: 1:7cf8cfea66e4 tip
88 88 1
89 89 branch: default
90 90 commit: 1 subrepos
91 91 update: (current)
92 92 $ hg ci -m2
93 93 committing subrepository s
94 94 committing subrepository s/ss (glob)
95 95 $ hg sum
96 96 parent: 2:df30734270ae tip
97 97 2
98 98 branch: default
99 99 commit: (clean)
100 100 update: (current)
101 101
102 102 bump sub rev (and check it is ignored by ui.commitsubrepos)
103 103
104 104 $ echo b > s/a
105 105 $ hg -R s ci -ms1
106 106 $ hg --config ui.commitsubrepos=no ci -m3
107 107
108 108 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
109 109
110 110 $ echo c > s/a
111 111 $ hg --config ui.commitsubrepos=no ci -m4
112 112 abort: uncommitted changes in subrepo s
113 113 (use --subrepos for recursive commit)
114 114 [255]
115 115 $ hg id
116 116 f6affe3fbfaa+ tip
117 117 $ hg -R s ci -mc
118 118 $ hg id
119 119 f6affe3fbfaa+ tip
120 120 $ echo d > s/a
121 121 $ hg ci -m4
122 122 committing subrepository s
123 123 $ hg tip -R s
124 124 changeset: 4:02dcf1d70411
125 125 tag: tip
126 126 user: test
127 127 date: Thu Jan 01 00:00:00 1970 +0000
128 128 summary: 4
129 129
130 130
131 131 check caching
132 132
133 133 $ hg co 0
134 134 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
135 135 $ hg debugsub
136 136
137 137 restore
138 138
139 139 $ hg co
140 140 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 141 $ hg debugsub
142 142 path s
143 143 source s
144 144 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
145 145
146 146 new branch for merge tests
147 147
148 148 $ hg co 1
149 149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 150 $ echo t = t >> .hgsub
151 151 $ hg init t
152 152 $ echo t > t/t
153 153 $ hg -R t add t
154 154 adding t/t (glob)
155 155
156 156 5
157 157
158 158 $ hg ci -m5 # add sub
159 159 committing subrepository t
160 160 created new head
161 161 $ echo t2 > t/t
162 162
163 163 6
164 164
165 165 $ hg st -R s
166 166 $ hg ci -m6 # change sub
167 167 committing subrepository t
168 168 $ hg debugsub
169 169 path s
170 170 source s
171 171 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
172 172 path t
173 173 source t
174 174 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
175 175 $ echo t3 > t/t
176 176
177 177 7
178 178
179 179 $ hg ci -m7 # change sub again for conflict test
180 180 committing subrepository t
181 181 $ hg rm .hgsub
182 182
183 183 8
184 184
185 185 $ hg ci -m8 # remove sub
186 186
187 187 merge tests
188 188
189 189 $ hg co -C 3
190 190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 191 $ hg merge 5 # test adding
192 192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 193 (branch merge, don't forget to commit)
194 194 $ hg debugsub
195 195 path s
196 196 source s
197 197 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
198 198 path t
199 199 source t
200 200 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
201 201 $ hg ci -m9
202 202 created new head
203 203 $ hg merge 6 --debug # test change
204 204 searching for copies back to rev 2
205 205 resolving manifests
206 206 branchmerge: True, force: False, partial: False
207 207 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
208 208 .hgsubstate: versions differ -> m
209 209 updating: .hgsubstate 1/1 files (100.00%)
210 210 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
211 211 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
212 212 getting subrepo t
213 213 resolving manifests
214 214 branchmerge: False, force: False, partial: False
215 215 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
216 216 t: remote is newer -> g
217 217 getting t
218 218 updating: t 1/1 files (100.00%)
219 219 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
220 220 (branch merge, don't forget to commit)
221 221 $ hg debugsub
222 222 path s
223 223 source s
224 224 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
225 225 path t
226 226 source t
227 227 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
228 228 $ echo conflict > t/t
229 229 $ hg ci -m10
230 230 committing subrepository t
231 231 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
232 232 searching for copies back to rev 2
233 233 resolving manifests
234 234 branchmerge: True, force: False, partial: False
235 235 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
236 236 .hgsubstate: versions differ -> m
237 237 updating: .hgsubstate 1/1 files (100.00%)
238 238 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
239 239 subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
240 240 merging subrepo t
241 241 searching for copies back to rev 2
242 242 resolving manifests
243 243 branchmerge: True, force: False, partial: False
244 244 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
245 245 t: versions differ -> m
246 246 preserving t for resolve of t
247 247 updating: t 1/1 files (100.00%)
248 248 picked tool 'internal:merge' for t (binary False symlink False)
249 249 merging t
250 250 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
251 251 warning: conflicts during merge.
252 252 merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
253 253 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
254 254 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
255 255 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 256 (branch merge, don't forget to commit)
257 257
258 258 should conflict
259 259
260 260 $ cat t/t
261 261 <<<<<<< local
262 262 conflict
263 263 =======
264 264 t3
265 265 >>>>>>> other
266 266
267 267 clone
268 268
269 269 $ cd ..
270 270 $ hg clone t tc
271 271 updating to branch default
272 272 cloning subrepo s from $TESTTMP/t/s
273 273 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
274 274 cloning subrepo t from $TESTTMP/t/t
275 275 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 276 $ cd tc
277 277 $ hg debugsub
278 278 path s
279 279 source s
280 280 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
281 281 path t
282 282 source t
283 283 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
284 284
285 285 push
286 286
287 287 $ echo bah > t/t
288 288 $ hg ci -m11
289 289 committing subrepository t
290 290 $ hg push
291 291 pushing to $TESTTMP/t (glob)
292 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
292 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
293 293 no changes made to subrepo s since last push to $TESTTMP/t/s
294 294 pushing subrepo t to $TESTTMP/t/t
295 295 searching for changes
296 296 adding changesets
297 297 adding manifests
298 298 adding file changes
299 299 added 1 changesets with 1 changes to 1 files
300 300 searching for changes
301 301 adding changesets
302 302 adding manifests
303 303 adding file changes
304 304 added 1 changesets with 1 changes to 1 files
305 305
306 306 push -f
307 307
308 308 $ echo bah > s/a
309 309 $ hg ci -m12
310 310 committing subrepository s
311 311 $ hg push
312 312 pushing to $TESTTMP/t (glob)
313 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
313 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
314 314 pushing subrepo s to $TESTTMP/t/s
315 315 searching for changes
316 316 abort: push creates new remote head 12a213df6fa9! (in subrepo s)
317 317 (did you forget to merge? use push -f to force)
318 318 [255]
319 319 $ hg push -f
320 320 pushing to $TESTTMP/t (glob)
321 321 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
322 322 searching for changes
323 323 no changes found
324 324 pushing subrepo s to $TESTTMP/t/s
325 325 searching for changes
326 326 adding changesets
327 327 adding manifests
328 328 adding file changes
329 329 added 1 changesets with 1 changes to 1 files (+1 heads)
330 330 pushing subrepo t to $TESTTMP/t/t
331 331 searching for changes
332 332 no changes found
333 333 searching for changes
334 334 adding changesets
335 335 adding manifests
336 336 adding file changes
337 337 added 1 changesets with 1 changes to 1 files
338 338
339 339 check that unmodified subrepos are not pushed
340 340
341 341 $ hg clone . ../tcc
342 342 updating to branch default
343 343 cloning subrepo s from $TESTTMP/tc/s
344 cloning subrepo s/ss from $TESTTMP/tc/s/ss
344 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
345 345 cloning subrepo t from $TESTTMP/tc/t
346 346 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
347 347
348 348 the subrepos on the new clone have nothing to push to its source
349 349
350 350 $ hg push -R ../tcc .
351 351 pushing to .
352 no changes made to subrepo s/ss since last push to s/ss
352 no changes made to subrepo s/ss since last push to s/ss (glob)
353 353 no changes made to subrepo s since last push to s
354 354 no changes made to subrepo t since last push to t
355 355 searching for changes
356 356 no changes found
357 357 [1]
358 358
359 359 the subrepos on the source do not have a clean store versus the clone target
360 360 because they were never explicitly pushed to the source
361 361
362 362 $ hg push ../tcc
363 363 pushing to ../tcc
364 pushing subrepo s/ss to ../tcc/s/ss
364 pushing subrepo s/ss to ../tcc/s/ss (glob)
365 365 searching for changes
366 366 no changes found
367 367 pushing subrepo s to ../tcc/s
368 368 searching for changes
369 369 no changes found
370 370 pushing subrepo t to ../tcc/t
371 371 searching for changes
372 372 no changes found
373 373 searching for changes
374 374 no changes found
375 375 [1]
376 376
377 377 after push their stores become clean
378 378
379 379 $ hg push ../tcc
380 380 pushing to ../tcc
381 no changes made to subrepo s/ss since last push to ../tcc/s/ss
381 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
382 382 no changes made to subrepo s since last push to ../tcc/s
383 383 no changes made to subrepo t since last push to ../tcc/t
384 384 searching for changes
385 385 no changes found
386 386 [1]
387 387
388 388 updating a subrepo to a different revision or changing
389 389 its working directory does not make its store dirty
390 390
391 391 $ hg -R s update '.^'
392 392 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
393 393 $ hg push
394 394 pushing to $TESTTMP/t
395 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
395 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
396 396 no changes made to subrepo s since last push to $TESTTMP/t/s
397 397 no changes made to subrepo t since last push to $TESTTMP/t/t
398 398 searching for changes
399 399 no changes found
400 400 [1]
401 401 $ echo foo >> s/a
402 402 $ hg push
403 403 pushing to $TESTTMP/t
404 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
404 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
405 405 no changes made to subrepo s since last push to $TESTTMP/t/s
406 406 no changes made to subrepo t since last push to $TESTTMP/t/t
407 407 searching for changes
408 408 no changes found
409 409 [1]
410 410 $ hg -R s update -C tip
411 411 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
412 412
413 413 committing into a subrepo makes its store (but not its parent's store) dirty
414 414
415 415 $ echo foo >> s/ss/a
416 416 $ hg -R s/ss commit -m 'test dirty store detection'
417 417 $ hg push
418 418 pushing to $TESTTMP/t
419 pushing subrepo s/ss to $TESTTMP/t/s/ss
419 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
420 420 searching for changes
421 421 adding changesets
422 422 adding manifests
423 423 adding file changes
424 424 added 1 changesets with 1 changes to 1 files
425 425 no changes made to subrepo s since last push to $TESTTMP/t/s
426 426 no changes made to subrepo t since last push to $TESTTMP/t/t
427 427 searching for changes
428 428 no changes found
429 429 [1]
430 430
431 431 a subrepo store may be clean versus one repo but not versus another
432 432
433 433 $ hg push
434 434 pushing to $TESTTMP/t
435 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss
435 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
436 436 no changes made to subrepo s since last push to $TESTTMP/t/s
437 437 no changes made to subrepo t since last push to $TESTTMP/t/t
438 438 searching for changes
439 439 no changes found
440 440 [1]
441 441 $ hg push ../tcc
442 442 pushing to ../tcc
443 443 pushing subrepo s/ss to ../tcc/s/ss
444 444 searching for changes
445 445 adding changesets
446 446 adding manifests
447 447 adding file changes
448 448 added 1 changesets with 1 changes to 1 files
449 449 no changes made to subrepo s since last push to ../tcc/s
450 450 no changes made to subrepo t since last push to ../tcc/t
451 451 searching for changes
452 452 no changes found
453 453 [1]
454 454
455 455 update
456 456
457 457 $ cd ../t
458 458 $ hg up -C # discard our earlier merge
459 459 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
460 460 $ echo blah > t/t
461 461 $ hg ci -m13
462 462 committing subrepository t
463 463
464 464 backout calls revert internally with minimal opts, which should not raise
465 465 KeyError
466 466
467 467 $ hg backout ".^"
468 468 reverting .hgsubstate
469 469 reverting subrepo s
470 reverting s/a
470 reverting s/a (glob)
471 471 reverting subrepo ss
472 472 reverting subrepo t
473 473 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
474 474
475 475 $ hg up -C # discard changes
476 476 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
477 477
478 478 pull
479 479
480 480 $ cd ../tc
481 481 $ hg pull
482 482 pulling from $TESTTMP/t (glob)
483 483 searching for changes
484 484 adding changesets
485 485 adding manifests
486 486 adding file changes
487 487 added 1 changesets with 1 changes to 1 files
488 488 (run 'hg update' to get a working copy)
489 489
490 490 should pull t
491 491
492 492 $ hg up
493 493 pulling subrepo t from $TESTTMP/t/t
494 494 searching for changes
495 495 adding changesets
496 496 adding manifests
497 497 adding file changes
498 498 added 1 changesets with 1 changes to 1 files
499 499 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
500 500 $ cat t/t
501 501 blah
502 502
503 503 bogus subrepo path aborts
504 504
505 505 $ echo 'bogus=[boguspath' >> .hgsub
506 506 $ hg ci -m 'bogus subrepo path'
507 507 abort: missing ] in subrepo source
508 508 [255]
509 509
510 510 Issue1986: merge aborts when trying to merge a subrepo that
511 511 shouldn't need merging
512 512
513 513 # subrepo layout
514 514 #
515 515 # o 5 br
516 516 # /|
517 517 # o | 4 default
518 518 # | |
519 519 # | o 3 br
520 520 # |/|
521 521 # o | 2 default
522 522 # | |
523 523 # | o 1 br
524 524 # |/
525 525 # o 0 default
526 526
527 527 $ cd ..
528 528 $ rm -rf sub
529 529 $ hg init main
530 530 $ cd main
531 531 $ hg init s
532 532 $ cd s
533 533 $ echo a > a
534 534 $ hg ci -Am1
535 535 adding a
536 536 $ hg branch br
537 537 marked working directory as branch br
538 538 (branches are permanent and global, did you want a bookmark?)
539 539 $ echo a >> a
540 540 $ hg ci -m1
541 541 $ hg up default
542 542 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
543 543 $ echo b > b
544 544 $ hg ci -Am1
545 545 adding b
546 546 $ hg up br
547 547 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
548 548 $ hg merge tip
549 549 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
550 550 (branch merge, don't forget to commit)
551 551 $ hg ci -m1
552 552 $ hg up 2
553 553 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
554 554 $ echo c > c
555 555 $ hg ci -Am1
556 556 adding c
557 557 $ hg up 3
558 558 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
559 559 $ hg merge 4
560 560 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
561 561 (branch merge, don't forget to commit)
562 562 $ hg ci -m1
563 563
564 564 # main repo layout:
565 565 #
566 566 # * <-- try to merge default into br again
567 567 # .`|
568 568 # . o 5 br --> substate = 5
569 569 # . |
570 570 # o | 4 default --> substate = 4
571 571 # | |
572 572 # | o 3 br --> substate = 2
573 573 # |/|
574 574 # o | 2 default --> substate = 2
575 575 # | |
576 576 # | o 1 br --> substate = 3
577 577 # |/
578 578 # o 0 default --> substate = 2
579 579
580 580 $ cd ..
581 581 $ echo 's = s' > .hgsub
582 582 $ hg -R s up 2
583 583 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
584 584 $ hg ci -Am1
585 585 adding .hgsub
586 586 $ hg branch br
587 587 marked working directory as branch br
588 588 (branches are permanent and global, did you want a bookmark?)
589 589 $ echo b > b
590 590 $ hg -R s up 3
591 591 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
592 592 $ hg ci -Am1
593 593 adding b
594 594 $ hg up default
595 595 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
596 596 $ echo c > c
597 597 $ hg ci -Am1
598 598 adding c
599 599 $ hg up 1
600 600 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
601 601 $ hg merge 2
602 602 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
603 603 (branch merge, don't forget to commit)
604 604 $ hg ci -m1
605 605 $ hg up 2
606 606 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
607 607 $ hg -R s up 4
608 608 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
609 609 $ echo d > d
610 610 $ hg ci -Am1
611 611 adding d
612 612 $ hg up 3
613 613 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
614 614 $ hg -R s up 5
615 615 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
616 616 $ echo e > e
617 617 $ hg ci -Am1
618 618 adding e
619 619
620 620 $ hg up 5
621 621 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
622 622 $ hg merge 4 # try to merge default into br again
623 623 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
624 624 (branch merge, don't forget to commit)
625 625 $ cd ..
626 626
627 627 test subrepo delete from .hgsubstate
628 628
629 629 $ hg init testdelete
630 630 $ mkdir testdelete/nested testdelete/nested2
631 631 $ hg init testdelete/nested
632 632 $ hg init testdelete/nested2
633 633 $ echo test > testdelete/nested/foo
634 634 $ echo test > testdelete/nested2/foo
635 635 $ hg -R testdelete/nested add
636 636 adding testdelete/nested/foo (glob)
637 637 $ hg -R testdelete/nested2 add
638 638 adding testdelete/nested2/foo (glob)
639 639 $ hg -R testdelete/nested ci -m test
640 640 $ hg -R testdelete/nested2 ci -m test
641 641 $ echo nested = nested > testdelete/.hgsub
642 642 $ echo nested2 = nested2 >> testdelete/.hgsub
643 643 $ hg -R testdelete add
644 644 adding testdelete/.hgsub (glob)
645 645 $ hg -R testdelete ci -m "nested 1 & 2 added"
646 646 $ echo nested = nested > testdelete/.hgsub
647 647 $ hg -R testdelete ci -m "nested 2 deleted"
648 648 $ cat testdelete/.hgsubstate
649 649 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
650 650 $ hg -R testdelete remove testdelete/.hgsub
651 651 $ hg -R testdelete ci -m ".hgsub deleted"
652 652 $ cat testdelete/.hgsubstate
653 653 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
654 654
655 655 test repository cloning
656 656
657 657 $ mkdir mercurial mercurial2
658 658 $ hg init nested_absolute
659 659 $ echo test > nested_absolute/foo
660 660 $ hg -R nested_absolute add
661 661 adding nested_absolute/foo (glob)
662 662 $ hg -R nested_absolute ci -mtest
663 663 $ cd mercurial
664 664 $ hg init nested_relative
665 665 $ echo test2 > nested_relative/foo2
666 666 $ hg -R nested_relative add
667 667 adding nested_relative/foo2 (glob)
668 668 $ hg -R nested_relative ci -mtest2
669 669 $ hg init main
670 670 $ echo "nested_relative = ../nested_relative" > main/.hgsub
671 671 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
672 672 $ hg -R main add
673 673 adding main/.hgsub (glob)
674 674 $ hg -R main ci -m "add subrepos"
675 675 $ cd ..
676 676 $ hg clone mercurial/main mercurial2/main
677 677 updating to branch default
678 678 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
679 679 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
680 680 > mercurial2/main/nested_relative/.hg/hgrc
681 681 [paths]
682 682 default = $TESTTMP/mercurial/nested_absolute
683 683 [paths]
684 684 default = $TESTTMP/mercurial/nested_relative
685 685 $ rm -rf mercurial mercurial2
686 686
687 687 Issue1977: multirepo push should fail if subrepo push fails
688 688
689 689 $ hg init repo
690 690 $ hg init repo/s
691 691 $ echo a > repo/s/a
692 692 $ hg -R repo/s ci -Am0
693 693 adding a
694 694 $ echo s = s > repo/.hgsub
695 695 $ hg -R repo ci -Am1
696 696 adding .hgsub
697 697 $ hg clone repo repo2
698 698 updating to branch default
699 699 cloning subrepo s from $TESTTMP/repo/s
700 700 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
701 701 $ hg -q -R repo2 pull -u
702 702 $ echo 1 > repo2/s/a
703 703 $ hg -R repo2/s ci -m2
704 704 $ hg -q -R repo2/s push
705 705 $ hg -R repo2/s up -C 0
706 706 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
707 707 $ echo 2 > repo2/s/b
708 708 $ hg -R repo2/s ci -m3 -A
709 709 adding b
710 710 created new head
711 711 $ hg -R repo2 ci -m3
712 712 $ hg -q -R repo2 push
713 713 abort: push creates new remote head cc505f09a8b2! (in subrepo s)
714 714 (did you forget to merge? use push -f to force)
715 715 [255]
716 716 $ hg -R repo update
717 717 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
718 718
719 719 test if untracked file is not overwritten
720 720
721 721 $ echo issue3276_ok > repo/s/b
722 722 $ hg -R repo2 push -f -q
723 723 $ hg -R repo update
724 724 b: untracked file differs
725 725 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
726 726 [255]
727 727
728 728 $ cat repo/s/b
729 729 issue3276_ok
730 730 $ rm repo/s/b
731 731 $ hg -R repo revert --all
732 732 reverting repo/.hgsubstate (glob)
733 733 reverting subrepo s
734 734 $ hg -R repo update
735 735 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
736 736 $ cat repo/s/b
737 737 2
738 738 $ rm -rf repo2 repo
739 739
740 740
741 741 Issue1852 subrepos with relative paths always push/pull relative to default
742 742
743 743 Prepare a repo with subrepo
744 744
745 745 $ hg init issue1852a
746 746 $ cd issue1852a
747 747 $ hg init sub/repo
748 748 $ echo test > sub/repo/foo
749 749 $ hg -R sub/repo add sub/repo/foo
750 750 $ echo sub/repo = sub/repo > .hgsub
751 751 $ hg add .hgsub
752 752 $ hg ci -mtest
753 753 committing subrepository sub/repo (glob)
754 754 $ echo test >> sub/repo/foo
755 755 $ hg ci -mtest
756 756 committing subrepository sub/repo (glob)
757 757 $ cd ..
758 758
759 759 Create repo without default path, pull top repo, and see what happens on update
760 760
761 761 $ hg init issue1852b
762 762 $ hg -R issue1852b pull issue1852a
763 763 pulling from issue1852a
764 764 requesting all changes
765 765 adding changesets
766 766 adding manifests
767 767 adding file changes
768 768 added 2 changesets with 3 changes to 2 files
769 769 (run 'hg update' to get a working copy)
770 770 $ hg -R issue1852b update
771 771 abort: default path for subrepository not found (in subrepo sub/repo) (glob)
772 772 [255]
773 773
774 774 Ensure a full traceback, not just the SubrepoAbort part
775 775
776 776 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise util\.Abort'
777 777 raise util.Abort(_("default path for subrepository not found"))
778 778
779 779 Pull -u now doesn't help
780 780
781 781 $ hg -R issue1852b pull -u issue1852a
782 782 pulling from issue1852a
783 783 searching for changes
784 784 no changes found
785 785
786 786 Try the same, but with pull -u
787 787
788 788 $ hg init issue1852c
789 789 $ hg -R issue1852c pull -r0 -u issue1852a
790 790 pulling from issue1852a
791 791 adding changesets
792 792 adding manifests
793 793 adding file changes
794 794 added 1 changesets with 2 changes to 2 files
795 795 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
796 796 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
797 797
798 798 Try to push from the other side
799 799
800 800 $ hg -R issue1852a push `pwd`/issue1852c
801 801 pushing to $TESTTMP/issue1852c
802 802 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
803 803 searching for changes
804 804 no changes found
805 805 searching for changes
806 806 adding changesets
807 807 adding manifests
808 808 adding file changes
809 809 added 1 changesets with 1 changes to 1 files
810 810
811 811 Incoming and outgoing should not use the default path:
812 812
813 813 $ hg clone -q issue1852a issue1852d
814 814 $ hg -R issue1852d outgoing --subrepos issue1852c
815 815 comparing with issue1852c
816 816 searching for changes
817 817 no changes found
818 818 comparing with issue1852c/sub/repo
819 819 searching for changes
820 820 no changes found
821 821 [1]
822 822 $ hg -R issue1852d incoming --subrepos issue1852c
823 823 comparing with issue1852c
824 824 searching for changes
825 825 no changes found
826 826 comparing with issue1852c/sub/repo
827 827 searching for changes
828 828 no changes found
829 829 [1]
830 830
831 831 Check status of files when none of them belong to the first
832 832 subrepository:
833 833
834 834 $ hg init subrepo-status
835 835 $ cd subrepo-status
836 836 $ hg init subrepo-1
837 837 $ hg init subrepo-2
838 838 $ cd subrepo-2
839 839 $ touch file
840 840 $ hg add file
841 841 $ cd ..
842 842 $ echo subrepo-1 = subrepo-1 > .hgsub
843 843 $ echo subrepo-2 = subrepo-2 >> .hgsub
844 844 $ hg add .hgsub
845 845 $ hg ci -m 'Added subrepos'
846 846 committing subrepository subrepo-2
847 847 $ hg st subrepo-2/file
848 848
849 849 Check that share works with subrepo
850 850 $ hg --config extensions.share= share . ../shared
851 851 updating working directory
852 852 cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
853 853 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
854 854 $ test -f ../shared/subrepo-1/.hg/sharedpath
855 855 [1]
856 856 $ hg -R ../shared in
857 857 abort: repository default not found!
858 858 [255]
859 859 $ hg -R ../shared/subrepo-2 showconfig paths
860 860 paths.default=$TESTTMP/subrepo-status/subrepo-2
861 861 $ hg -R ../shared/subrepo-1 sum --remote
862 862 parent: -1:000000000000 tip (empty repository)
863 863 branch: default
864 864 commit: (clean)
865 865 update: (current)
866 866 remote: (synced)
867 867
868 868 Check hg update --clean
869 869 $ cd $TESTTMP/t
870 870 $ rm -r t/t.orig
871 871 $ hg status -S --all
872 872 C .hgsub
873 873 C .hgsubstate
874 874 C a
875 875 C s/.hgsub
876 876 C s/.hgsubstate
877 877 C s/a
878 878 C s/ss/a
879 879 C t/t
880 880 $ echo c1 > s/a
881 881 $ cd s
882 882 $ echo c1 > b
883 883 $ echo c1 > c
884 884 $ hg add b
885 885 $ cd ..
886 886 $ hg status -S
887 887 M s/a
888 888 A s/b
889 889 ? s/c
890 890 $ hg update -C
891 891 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
892 892 $ hg status -S
893 893 ? s/b
894 894 ? s/c
895 895
896 896 Sticky subrepositories, no changes
897 897 $ cd $TESTTMP/t
898 898 $ hg id
899 899 925c17564ef8 tip
900 900 $ hg -R s id
901 901 12a213df6fa9 tip
902 902 $ hg -R t id
903 903 52c0adc0515a tip
904 904 $ hg update 11
905 905 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
906 906 $ hg id
907 907 365661e5936a
908 908 $ hg -R s id
909 909 fc627a69481f
910 910 $ hg -R t id
911 911 e95bcfa18a35
912 912
913 913 Sticky subrepositorys, file changes
914 914 $ touch s/f1
915 915 $ touch t/f1
916 916 $ hg add -S s/f1
917 917 $ hg add -S t/f1
918 918 $ hg id
919 919 365661e5936a+
920 920 $ hg -R s id
921 921 fc627a69481f+
922 922 $ hg -R t id
923 923 e95bcfa18a35+
924 924 $ hg update tip
925 925 subrepository sources for s differ
926 926 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
927 927 l
928 928 subrepository sources for t differ
929 929 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)?
930 930 l
931 931 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
932 932 $ hg id
933 933 925c17564ef8+ tip
934 934 $ hg -R s id
935 935 fc627a69481f+
936 936 $ hg -R t id
937 937 e95bcfa18a35+
938 938 $ hg update --clean tip
939 939 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
940 940
941 941 Sticky subrepository, revision updates
942 942 $ hg id
943 943 925c17564ef8 tip
944 944 $ hg -R s id
945 945 12a213df6fa9 tip
946 946 $ hg -R t id
947 947 52c0adc0515a tip
948 948 $ cd s
949 949 $ hg update -r -2
950 950 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
951 951 $ cd ../t
952 952 $ hg update -r 2
953 953 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
954 954 $ cd ..
955 955 $ hg update 10
956 956 subrepository sources for t differ (in checked out version)
957 957 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)?
958 958 l
959 959 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
960 960 $ hg id
961 961 e45c8b14af55+
962 962 $ hg -R s id
963 963 02dcf1d70411
964 964 $ hg -R t id
965 965 7af322bc1198
966 966
967 967 Sticky subrepository, file changes and revision updates
968 968 $ touch s/f1
969 969 $ touch t/f1
970 970 $ hg add -S s/f1
971 971 $ hg add -S t/f1
972 972 $ hg id
973 973 e45c8b14af55+
974 974 $ hg -R s id
975 975 02dcf1d70411+
976 976 $ hg -R t id
977 977 7af322bc1198+
978 978 $ hg update tip
979 979 subrepository sources for s differ
980 980 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)?
981 981 l
982 982 subrepository sources for t differ
983 983 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)?
984 984 l
985 985 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
986 986 $ hg id
987 987 925c17564ef8+ tip
988 988 $ hg -R s id
989 989 02dcf1d70411+
990 990 $ hg -R t id
991 991 7af322bc1198+
992 992
993 993 Sticky repository, update --clean
994 994 $ hg update --clean tip
995 995 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
996 996 $ hg id
997 997 925c17564ef8 tip
998 998 $ hg -R s id
999 999 12a213df6fa9 tip
1000 1000 $ hg -R t id
1001 1001 52c0adc0515a tip
1002 1002
1003 1003 Test subrepo already at intended revision:
1004 1004 $ cd s
1005 1005 $ hg update fc627a69481f
1006 1006 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1007 1007 $ cd ..
1008 1008 $ hg update 11
1009 1009 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1010 1010 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1011 1011 $ hg id -n
1012 1012 11+
1013 1013 $ hg -R s id
1014 1014 fc627a69481f
1015 1015 $ hg -R t id
1016 1016 e95bcfa18a35
1017 1017
1018 1018 Test that removing .hgsubstate doesn't break anything:
1019 1019
1020 1020 $ hg rm -f .hgsubstate
1021 1021 $ hg ci -mrm
1022 1022 nothing changed
1023 1023 [1]
1024 1024 $ hg log -vr tip
1025 1025 changeset: 13:925c17564ef8
1026 1026 tag: tip
1027 1027 user: test
1028 1028 date: Thu Jan 01 00:00:00 1970 +0000
1029 1029 files: .hgsubstate
1030 1030 description:
1031 1031 13
1032 1032
1033 1033
1034 1034
1035 1035 Test that removing .hgsub removes .hgsubstate:
1036 1036
1037 1037 $ hg rm .hgsub
1038 1038 $ hg ci -mrm2
1039 1039 created new head
1040 1040 $ hg log -vr tip
1041 1041 changeset: 14:2400bccd50af
1042 1042 tag: tip
1043 1043 parent: 11:365661e5936a
1044 1044 user: test
1045 1045 date: Thu Jan 01 00:00:00 1970 +0000
1046 1046 files: .hgsub .hgsubstate
1047 1047 description:
1048 1048 rm2
1049 1049
1050 1050
1051 1051 Test issue3153: diff -S with deleted subrepos
1052 1052
1053 1053 $ hg diff --nodates -S -c .
1054 1054 diff -r 365661e5936a -r 2400bccd50af .hgsub
1055 1055 --- a/.hgsub
1056 1056 +++ /dev/null
1057 1057 @@ -1,2 +0,0 @@
1058 1058 -s = s
1059 1059 -t = t
1060 1060 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1061 1061 --- a/.hgsubstate
1062 1062 +++ /dev/null
1063 1063 @@ -1,2 +0,0 @@
1064 1064 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1065 1065 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1066 1066
1067 1067 Test behavior of add for explicit path in subrepo:
1068 1068 $ cd ..
1069 1069 $ hg init explicit
1070 1070 $ cd explicit
1071 1071 $ echo s = s > .hgsub
1072 1072 $ hg add .hgsub
1073 1073 $ hg init s
1074 1074 $ hg ci -m0
1075 1075 Adding with an explicit path in a subrepo adds the file
1076 1076 $ echo c1 > f1
1077 1077 $ echo c2 > s/f2
1078 1078 $ hg st -S
1079 1079 ? f1
1080 1080 ? s/f2
1081 1081 $ hg add s/f2
1082 1082 $ hg st -S
1083 1083 A s/f2
1084 1084 ? f1
1085 1085 $ hg ci -R s -m0
1086 1086 $ hg ci -Am1
1087 1087 adding f1
1088 1088 Adding with an explicit path in a subrepo with -S has the same behavior
1089 1089 $ echo c3 > f3
1090 1090 $ echo c4 > s/f4
1091 1091 $ hg st -S
1092 1092 ? f3
1093 1093 ? s/f4
1094 1094 $ hg add -S s/f4
1095 1095 $ hg st -S
1096 1096 A s/f4
1097 1097 ? f3
1098 1098 $ hg ci -R s -m1
1099 1099 $ hg ci -Ama2
1100 1100 adding f3
1101 1101 Adding without a path or pattern silently ignores subrepos
1102 1102 $ echo c5 > f5
1103 1103 $ echo c6 > s/f6
1104 1104 $ echo c7 > s/f7
1105 1105 $ hg st -S
1106 1106 ? f5
1107 1107 ? s/f6
1108 1108 ? s/f7
1109 1109 $ hg add
1110 1110 adding f5
1111 1111 $ hg st -S
1112 1112 A f5
1113 1113 ? s/f6
1114 1114 ? s/f7
1115 1115 $ hg ci -R s -Am2
1116 1116 adding f6
1117 1117 adding f7
1118 1118 $ hg ci -m3
1119 1119 Adding without a path or pattern with -S also adds files in subrepos
1120 1120 $ echo c8 > f8
1121 1121 $ echo c9 > s/f9
1122 1122 $ echo c10 > s/f10
1123 1123 $ hg st -S
1124 1124 ? f8
1125 1125 ? s/f10
1126 1126 ? s/f9
1127 1127 $ hg add -S
1128 1128 adding f8
1129 1129 adding s/f10 (glob)
1130 1130 adding s/f9 (glob)
1131 1131 $ hg st -S
1132 1132 A f8
1133 1133 A s/f10
1134 1134 A s/f9
1135 1135 $ hg ci -R s -m3
1136 1136 $ hg ci -m4
1137 1137 Adding with a pattern silently ignores subrepos
1138 1138 $ echo c11 > fm11
1139 1139 $ echo c12 > fn12
1140 1140 $ echo c13 > s/fm13
1141 1141 $ echo c14 > s/fn14
1142 1142 $ hg st -S
1143 1143 ? fm11
1144 1144 ? fn12
1145 1145 ? s/fm13
1146 1146 ? s/fn14
1147 1147 $ hg add 'glob:**fm*'
1148 1148 adding fm11
1149 1149 $ hg st -S
1150 1150 A fm11
1151 1151 ? fn12
1152 1152 ? s/fm13
1153 1153 ? s/fn14
1154 1154 $ hg ci -R s -Am4
1155 1155 adding fm13
1156 1156 adding fn14
1157 1157 $ hg ci -Am5
1158 1158 adding fn12
1159 1159 Adding with a pattern with -S also adds matches in subrepos
1160 1160 $ echo c15 > fm15
1161 1161 $ echo c16 > fn16
1162 1162 $ echo c17 > s/fm17
1163 1163 $ echo c18 > s/fn18
1164 1164 $ hg st -S
1165 1165 ? fm15
1166 1166 ? fn16
1167 1167 ? s/fm17
1168 1168 ? s/fn18
1169 1169 $ hg add -S 'glob:**fm*'
1170 1170 adding fm15
1171 1171 adding s/fm17 (glob)
1172 1172 $ hg st -S
1173 1173 A fm15
1174 1174 A s/fm17
1175 1175 ? fn16
1176 1176 ? s/fn18
1177 1177 $ hg ci -R s -Am5
1178 1178 adding fn18
1179 1179 $ hg ci -Am6
1180 1180 adding fn16
1181 1181
1182 1182 Test behavior of forget for explicit path in subrepo:
1183 1183 Forgetting an explicit path in a subrepo untracks the file
1184 1184 $ echo c19 > s/f19
1185 1185 $ hg add s/f19
1186 1186 $ hg st -S
1187 1187 A s/f19
1188 1188 $ hg forget s/f19
1189 1189 $ hg st -S
1190 1190 ? s/f19
1191 1191 $ rm s/f19
1192 1192 $ cd ..
1193 1193
1194 1194 Courtesy phases synchronisation to publishing server does not block the push
1195 1195 (issue3781)
1196 1196
1197 1197 $ cp -r main issue3781
1198 1198 $ cp -r main issue3781-dest
1199 1199 $ cd issue3781-dest/s
1200 1200 $ hg phase tip # show we have draft changeset
1201 1201 5: draft
1202 1202 $ chmod a-w .hg/store/phaseroots # prevent phase push
1203 1203 $ cd ../../issue3781
1204 1204 $ cat >> .hg/hgrc << EOF
1205 1205 > [paths]
1206 1206 > default=../issue3781-dest/
1207 1207 > EOF
1208 1208 $ hg push
1209 1209 pushing to $TESTTMP/issue3781-dest (glob)
1210 1210 pushing subrepo s to $TESTTMP/issue3781-dest/s
1211 1211 searching for changes
1212 1212 no changes found
1213 1213 searching for changes
1214 1214 no changes found
1215 1215 [1]
1216 1216
General Comments 0
You need to be logged in to leave comments. Login now