annotate tests/test-simple-update.t @ 24787:9d5c27890790

largefiles: for update -C, only update largefiles when necessary Before, a --clean update with largefiles would use the "optimization" that it didn't read hashes from standin files before and after the update. Instead of trusting the content of the standin files, it would rehash all the actual largefiles that lfdirstate reported clean and update the standins that didn't have the expected content. It could thus in some "impossible" situations automatically recover from some "largefile got out sync with its standin" issues (even there apparently still were weird corner cases where it could fail). This extra checking is similar to what core --clean intentionally do not do, and it made update --clean unbearable slow. Usually in core Mercurial, --clean will rely on the dirstate to find the files it should update. (It is thus intentionally possible (when trying to trick the system or if there should be bugs) to end up in situations where --clean not will restore the working directory content correctly.) Checking every file when we "know" it is ok is however not an option - that would be too slow. Instead, trust the content of the standin files. Use the same logic for --clean as for linear updates and trust the dirstate and that our "logic" will keep them in sync. It is much cheaper to just rehash the largefiles reported dirty by a status walk and read all standins than to hash largefiles. Most of the changes are just a change of indentation now when the different kinds of updates no longer are handled that differently. Standins for added files are however only written when doing a normal update, while deleted and removed files only will be updated for --clean updates.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 15 Apr 2015 15:22:16 -0400
parents f2719b387380
children 92bca12328d1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 12365
diff changeset
1 $ hg init test
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
2 $ cd test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
3 $ echo foo>foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
4 $ hg addremove
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
5 adding foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
6 $ hg commit -m "1"
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
7
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
8 $ hg verify
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
9 checking changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
10 checking manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
11 crosschecking files in changesets and manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
12 checking files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
13 1 files, 1 changesets, 1 total revisions
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
14
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
15 $ hg clone . ../branch
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
16 updating to branch default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
18 $ cd ../branch
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
19 $ hg co
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
20 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
21 $ echo bar>>foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
22 $ hg commit -m "2"
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
23
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
24 $ cd ../test
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
25
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
26 $ hg pull ../branch
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
27 pulling from ../branch
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
28 searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
29 adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
30 adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
31 adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
32 added 1 changesets with 1 changes to 1 files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
33 (run 'hg update' to get a working copy)
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
34
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
35 $ hg verify
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
36 checking changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
37 checking manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
38 crosschecking files in changesets and manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
39 checking files
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
40 1 files, 2 changesets, 2 total revisions
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
41
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
42 $ hg co
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
44
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
45 $ cat foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
46 foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
47 bar
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
48
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
49 $ hg manifest --debug
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
50 6f4310b00b9a147241b071a60c28a650827fb03d 644 foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 3736
diff changeset
51
13960
190e5f2043d9 update: fix check for no rev when a date is given
Idan Kamara <idankk86@gmail.com>
parents: 13956
diff changeset
52 update to rev 0 with a date
190e5f2043d9 update: fix check for no rev when a date is given
Idan Kamara <idankk86@gmail.com>
parents: 13956
diff changeset
53
190e5f2043d9 update: fix check for no rev when a date is given
Idan Kamara <idankk86@gmail.com>
parents: 13956
diff changeset
54 $ hg upd -d foo 0
190e5f2043d9 update: fix check for no rev when a date is given
Idan Kamara <idankk86@gmail.com>
parents: 13956
diff changeset
55 abort: you can't specify a revision and a date
190e5f2043d9 update: fix check for no rev when a date is given
Idan Kamara <idankk86@gmail.com>
parents: 13956
diff changeset
56 [255]
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 13960
diff changeset
57
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 13960
diff changeset
58 $ cd ..