Mercurial > hg
annotate tests/test-profile.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 | cd2c82510aa2 |
children | 39a0b11158d8 |
rev | line source |
---|---|
12478 | 1 test --time |
5099
105d4cf7ec24
Test --time, --profile and --lsprof
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 |
16933
30143c3dd102
dispatch: lowercase --time message
Martin Geisler <mg@aragost.com>
parents:
16913
diff
changeset
|
3 $ hg --time help -q help 2>&1 | grep time > /dev/null |
12478 | 4 $ hg init a |
5 $ cd a | |
8022
4f3fdfaa3874
profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
8021
diff
changeset
|
6 |
16898
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
7 #if lsprof |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
8 |
12478 | 9 test --profile |
8022
4f3fdfaa3874
profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
8021
diff
changeset
|
10 |
16898
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
11 $ hg --profile st 2>../out |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
12 $ grep CallCount ../out > /dev/null || cat ../out |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
13 |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
14 $ hg --profile --config profiling.output=../out st |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
15 $ grep CallCount ../out > /dev/null || cat ../out |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
16 |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
17 $ hg --profile --config profiling.format=text st 2>../out |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
18 $ grep CallCount ../out > /dev/null || cat ../out |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
19 |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
20 $ echo "[profiling]" >> $HGRCPATH |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
21 $ echo "format=kcachegrind" >> $HGRCPATH |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
22 |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
23 $ hg --profile st 2>../out |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
24 $ grep 'events: Ticks' ../out > /dev/null || cat ../out |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
25 |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
26 $ hg --profile --config profiling.output=../out st |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
27 $ grep 'events: Ticks' ../out > /dev/null || cat ../out |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
28 |
bb91c602d4ad
tests: change odd uses of 'if hghave' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
12478
diff
changeset
|
29 #endif |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16898
diff
changeset
|
30 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16898
diff
changeset
|
31 $ cd .. |