Mercurial > hg
annotate tests/test-merge-internal-tools-pattern.t @ 23923:ab6fd3205dad stable
largefiles: fix commit of a directory with no largefile changes (issue4330)
When a directory is named in the commit file list, the previous behavior was to
walk the list, and if no normal files in the directory were also named, add the
corresponding standin for each largefile in that directory. The directory is
then dropped from the list, so that committing a directory with no normal file
changes works. It then added the corresponding standin directory for the first
largefile seen, by prefixing it with '.hglf/'.
The latter is unnecessary since each affected largefile is explicitly referenced
by its standin in the list. It also caused an abort if there were no changed
largefiles in the directory, because none of its standins changed:
abort: .hglf/foo/bar: no match under directory!
This list of files is used to tweak a matcher in lfutil.updatestandinsbymatch(),
which is what is passed to commit().
The status() call that is ultimately done in the commit code with this matcher
seems to have some OS specific differences. It is not necessary to append '.'
for Windows to run the largefiles tests cleanly. But if '.' is not added to the
list, the match function isn't called on Linux, so status() would miss any
normal files that were also in a named directory. The commit then proceeds
without those normal files, or says "nothing changed" if there were no changed
largefiles in the directory. This is not filesystem specific, as VFAT on Linux
had the same behavior as when run on ext4. It is also not an issue with
lfilesrepo.status(), since that only calls the overridden implementation when
paths are passed to commit. I dont have access to an OS X machine ATM to test
there.
Maybe there's a better way to do this. But since the standin directory for the
first largefile was previously being added, and that caused the same walk in
status(), there's no preformance change to this. There is no danger of
erroneously committing files in '.', because the original match function is
called, and if it fails, the lfutil.updatestandinsbymatch() tweaked matcher only
indicates a match if the file is in the list of standins- and '.' never is. The
added tests confirm this.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 18 Jan 2015 15:15:40 -0500 |
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 |