Mercurial > hg
annotate tests/test-update-reverse.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 | cb15835456cb |
children | bd625cd4e5e7 |
rev | line source |
---|---|
12279 | 1 $ hg init |
2 | |
3 $ touch a | |
4 $ hg add a | |
5 $ hg commit -m "Added a" | |
1236
67a28636ea64
Fix bug with co -C across branches, update tests
mpm@selenic.com
parents:
diff
changeset
|
6 |
12279 | 7 $ touch main |
8 $ hg add main | |
9 $ hg commit -m "Added main" | |
10 $ hg checkout 0 | |
11 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1236
67a28636ea64
Fix bug with co -C across branches, update tests
mpm@selenic.com
parents:
diff
changeset
|
12 |
12279 | 13 'main' should be gone: |
14 | |
15 $ ls | |
16 a | |
1236
67a28636ea64
Fix bug with co -C across branches, update tests
mpm@selenic.com
parents:
diff
changeset
|
17 |
12279 | 18 $ touch side1 |
19 $ hg add side1 | |
20 $ hg commit -m "Added side1" | |
21 created new head | |
22 $ touch side2 | |
23 $ hg add side2 | |
24 $ hg commit -m "Added side2" | |
1236
67a28636ea64
Fix bug with co -C across branches, update tests
mpm@selenic.com
parents:
diff
changeset
|
25 |
12279 | 26 $ hg log |
27 changeset: 3:91ebc10ed028 | |
28 tag: tip | |
29 user: test | |
30 date: Thu Jan 01 00:00:00 1970 +0000 | |
31 summary: Added side2 | |
32 | |
33 changeset: 2:b932d7dbb1e1 | |
34 parent: 0:c2eda428b523 | |
35 user: test | |
36 date: Thu Jan 01 00:00:00 1970 +0000 | |
37 summary: Added side1 | |
38 | |
39 changeset: 1:71a760306caf | |
40 user: test | |
41 date: Thu Jan 01 00:00:00 1970 +0000 | |
42 summary: Added main | |
43 | |
44 changeset: 0:c2eda428b523 | |
45 user: test | |
46 date: Thu Jan 01 00:00:00 1970 +0000 | |
47 summary: Added a | |
48 | |
1236
67a28636ea64
Fix bug with co -C across branches, update tests
mpm@selenic.com
parents:
diff
changeset
|
49 |
12279 | 50 $ hg heads |
51 changeset: 3:91ebc10ed028 | |
52 tag: tip | |
53 user: test | |
54 date: Thu Jan 01 00:00:00 1970 +0000 | |
55 summary: Added side2 | |
56 | |
57 changeset: 1:71a760306caf | |
58 user: test | |
59 date: Thu Jan 01 00:00:00 1970 +0000 | |
60 summary: Added main | |
61 | |
62 $ ls | |
63 a | |
64 side1 | |
65 side2 | |
1236
67a28636ea64
Fix bug with co -C across branches, update tests
mpm@selenic.com
parents:
diff
changeset
|
66 |
12279 | 67 $ hg update --debug -C 1 |
68 resolving manifests | |
18605
bcf29565d89f
manifestmerge: pass in branchmerge and force separately
Siddharth Agarwal <sid0@fb.com>
parents:
18360
diff
changeset
|
69 branchmerge: False, force: True, partial: False |
15625
efdcce3fd2d5
merge: make debug output easier to read
Martin Geisler <mg@aragost.com>
parents:
12279
diff
changeset
|
70 ancestor: 91ebc10ed028+, local: 91ebc10ed028+, remote: 71a760306caf |
18360
760c0d67ce5e
merge: process files in sorted order
Mads Kiilerich <mads@kiilerich.com>
parents:
15625
diff
changeset
|
71 side1: other deleted -> r |
21391
cb15835456cb
merge: change debug logging - test output changes but no real changes
Mads Kiilerich <madski@unity3d.com>
parents:
19095
diff
changeset
|
72 removing side1 |
12279 | 73 side2: other deleted -> r |
18631
e2dc5397bc82
tests: update test output (will be folded into parent)
Bryan O'Sullivan <bryano@fb.com>
parents:
18605
diff
changeset
|
74 removing side2 |
19095
5cc71484ee9c
merge: increase safety of parallel updating/removing on icasefs
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18634
diff
changeset
|
75 updating: side2 2/3 files (66.67%) |
21391
cb15835456cb
merge: change debug logging - test output changes but no real changes
Mads Kiilerich <madski@unity3d.com>
parents:
19095
diff
changeset
|
76 main: remote created -> g |
18631
e2dc5397bc82
tests: update test output (will be folded into parent)
Bryan O'Sullivan <bryano@fb.com>
parents:
18605
diff
changeset
|
77 getting main |
12279 | 78 updating: main 3/3 files (100.00%) |
79 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1236
67a28636ea64
Fix bug with co -C across branches, update tests
mpm@selenic.com
parents:
diff
changeset
|
80 |
12279 | 81 $ ls |
82 a | |
83 main | |
1236
67a28636ea64
Fix bug with co -C across branches, update tests
mpm@selenic.com
parents:
diff
changeset
|
84 |