Mercurial > hg
annotate tests/test-merge-internal-tools-pattern.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 | b63f6422d2a7 |
children | ff12a6c63c3d |
rev | line source |
---|---|
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
1 Make sure that the internal merge tools (internal:fail, internal:local, and |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
2 internal:other) are used when matched by a merge-pattern in hgrc |
6521
a3668330f14a
test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
3 |
12257
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
4 Make sure HGMERGE doesn't interfere with the test: |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
5 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
6 $ unset HGMERGE |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
7 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
8 $ hg init |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
9 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
10 Initial file contents: |
6521
a3668330f14a
test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
11 |
12257
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
12 $ echo "line 1" > f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
13 $ echo "line 2" >> f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
14 $ echo "line 3" >> f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
15 $ hg ci -Am "revision 0" |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
16 adding f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
17 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
18 $ cat f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
19 line 1 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
20 line 2 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
21 line 3 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
22 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
23 Branch 1: editing line 1: |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
24 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
25 $ sed 's/line 1/first line/' f > f.new |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
26 $ mv f.new f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
27 $ hg ci -Am "edited first line" |
6521
a3668330f14a
test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
28 |
12257
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
29 Branch 2: editing line 3: |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
30 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
31 $ hg update 0 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
32 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
33 $ sed 's/line 3/third line/' f > f.new |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
34 $ mv f.new f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
35 $ hg ci -Am "edited third line" |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
36 created new head |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
37 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
38 Merge using internal:fail tool: |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
39 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
40 $ echo "[merge-patterns]" > .hg/hgrc |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
41 $ echo "* = internal:fail" >> .hg/hgrc |
6521
a3668330f14a
test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
42 |
12257
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
43 $ hg merge |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
44 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
12314
f2daa6ab514a
merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'
Brodie Rao <brodie@bitheap.org>
parents:
12257
diff
changeset
|
45 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12314
diff
changeset
|
46 [1] |
12257
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
47 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
48 $ cat f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
49 line 1 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
50 line 2 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
51 third line |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
52 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
53 $ hg stat |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
54 M f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
55 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
56 Merge using internal:local tool: |
6521
a3668330f14a
test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
57 |
12257
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
58 $ hg update -C 2 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
60 $ sed 's/internal:fail/internal:local/' .hg/hgrc > .hg/hgrc.new |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
61 $ mv .hg/hgrc.new .hg/hgrc |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
62 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
63 $ hg merge |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
64 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
65 (branch merge, don't forget to commit) |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
66 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
67 $ cat f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
68 line 1 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
69 line 2 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
70 third line |
6521
a3668330f14a
test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
71 |
12257
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
72 $ hg stat |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
73 M f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
74 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
75 Merge using internal:other tool: |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
76 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
77 $ hg update -C 2 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
78 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
79 $ sed 's/internal:local/internal:other/' .hg/hgrc > .hg/hgrc.new |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
80 $ mv .hg/hgrc.new .hg/hgrc |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
81 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
82 $ hg merge |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
83 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
84 (branch merge, don't forget to commit) |
6521
a3668330f14a
test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
85 |
12257
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
86 $ cat f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
87 first line |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
88 line 2 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
89 line 3 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
90 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
91 $ hg stat |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
92 M f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
93 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
94 Merge using default tool: |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
95 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
96 $ hg update -C 2 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
98 $ rm .hg/hgrc |
6521
a3668330f14a
test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
99 |
12257
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
100 $ hg merge |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
101 merging f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
102 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
103 (branch merge, don't forget to commit) |
6521
a3668330f14a
test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff
changeset
|
104 |
12257
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
105 $ cat f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
106 first line |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
107 line 2 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
108 third line |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
109 |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
110 $ hg stat |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
111 M f |
470e0b1ddc6e
tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents:
12156
diff
changeset
|
112 |