Mercurial > hg
annotate tests/test-merge5.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 | fe80fdf68ba7 |
children | 72072cfc7e91 |
rev | line source |
---|---|
11978
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
1 $ hg init |
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
2 $ echo This is file a1 > a |
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
3 $ echo This is file b1 > b |
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
4 $ hg add a b |
12155
94ad12aa0530
test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents:
12154
diff
changeset
|
5 $ hg commit -m "commit #0" |
11978
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
6 $ echo This is file b22 > b |
12155
94ad12aa0530
test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents:
12154
diff
changeset
|
7 $ hg commit -m "comment #1" |
11978
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
8 $ hg update 0 |
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
9 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
10 $ rm b |
12155
94ad12aa0530
test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents:
12154
diff
changeset
|
11 $ hg commit -A -m "comment #2" |
11978
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
12 removing b |
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
13 created new head |
12154
c85e07a2d783
test-merge5: ensure updating to tip across branches is tested
Brodie Rao <brodie@bitheap.org>
parents:
11978
diff
changeset
|
14 $ hg update 1 |
c85e07a2d783
test-merge5: ensure updating to tip across branches is tested
Brodie Rao <brodie@bitheap.org>
parents:
11978
diff
changeset
|
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
c85e07a2d783
test-merge5: ensure updating to tip across branches is tested
Brodie Rao <brodie@bitheap.org>
parents:
11978
diff
changeset
|
16 $ hg update |
19798
76df01e56e7f
update: improve error message for clean non-linear update
Siddharth Agarwal <sid0@fb.com>
parents:
17849
diff
changeset
|
17 abort: not a linear update |
76df01e56e7f
update: improve error message for clean non-linear update
Siddharth Agarwal <sid0@fb.com>
parents:
17849
diff
changeset
|
18 (merge or update --check to force update) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12155
diff
changeset
|
19 [255] |
17849
6da47b655d97
update: check for missing files with --check (issue3595)
Matt Mackall <mpm@selenic.com>
parents:
14485
diff
changeset
|
20 $ rm b |
6da47b655d97
update: check for missing files with --check (issue3595)
Matt Mackall <mpm@selenic.com>
parents:
14485
diff
changeset
|
21 $ hg update -c |
19801
41abe2e3e3b7
update: standardize error message for dirty update --check
Siddharth Agarwal <sid0@fb.com>
parents:
19799
diff
changeset
|
22 abort: uncommitted changes |
17849
6da47b655d97
update: check for missing files with --check (issue3595)
Matt Mackall <mpm@selenic.com>
parents:
14485
diff
changeset
|
23 [255] |
6da47b655d97
update: check for missing files with --check (issue3595)
Matt Mackall <mpm@selenic.com>
parents:
14485
diff
changeset
|
24 $ hg revert b |
12154
c85e07a2d783
test-merge5: ensure updating to tip across branches is tested
Brodie Rao <brodie@bitheap.org>
parents:
11978
diff
changeset
|
25 $ hg update -c |
c85e07a2d783
test-merge5: ensure updating to tip across branches is tested
Brodie Rao <brodie@bitheap.org>
parents:
11978
diff
changeset
|
26 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
11978
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
27 $ mv a c |
415
c2b9502a4e96
[PATCH] Don't prompt user for keep-vs-delete when the merge is about to be aborted
mpm@selenic.com
parents:
diff
changeset
|
28 |
12155
94ad12aa0530
test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents:
12154
diff
changeset
|
29 Should abort: |
94ad12aa0530
test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents:
12154
diff
changeset
|
30 |
23026
fe80fdf68ba7
test-merge5: remove obsolete '-y' and its motivating comment
Martin von Zweigbergk <martinvonz@gmail.com>
parents:
19801
diff
changeset
|
31 $ hg update 1 |
19799
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
32 abort: uncommitted changes |
ab3e42225dbc
update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents:
19798
diff
changeset
|
33 (commit or update --clean to discard changes) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12155
diff
changeset
|
34 [255] |
11978
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
35 $ mv c a |
12155
94ad12aa0530
test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents:
12154
diff
changeset
|
36 |
94ad12aa0530
test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents:
12154
diff
changeset
|
37 Should succeed: |
94ad12aa0530
test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents:
12154
diff
changeset
|
38 |
23026
fe80fdf68ba7
test-merge5: remove obsolete '-y' and its motivating comment
Martin von Zweigbergk <martinvonz@gmail.com>
parents:
19801
diff
changeset
|
39 $ hg update 1 |
11978
ef4a1ffbf519
tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents:
6350
diff
changeset
|
40 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |