Mercurial > hg
annotate tests/test-push-r.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 | f2719b387380 |
children | 24ea47037186 |
rev | line source |
---|---|
12279 | 1 $ hg init test |
2 $ cd test | |
16350
4f795f5fbb0b
tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14117
diff
changeset
|
3 $ hg unbundle "$TESTDIR/bundles/remote.hg" |
14117
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
4 adding changesets |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
5 adding manifests |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
6 adding file changes |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
7 added 9 changesets with 7 changes to 4 files (+1 heads) |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
8 (run 'hg heads' to see heads, 'hg merge' to merge) |
07708f4171f1
tests: create a bundle to bootstrap tests using a remote repository
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12279
diff
changeset
|
9 $ hg up tip |
12279 | 10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
11 $ cd .. | |
1781
284fc722c342
add an optional argument to push only the specified revisions (push -r)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
12 |
12279 | 13 $ for i in 0 1 2 3 4 5 6 7 8; do |
14 > echo | |
15 > mkdir test-"$i" | |
16 > hg --cwd test-"$i" init | |
17 > hg -R test push -r "$i" test-"$i" | |
18 > cd test-"$i" | |
19 > hg verify | |
20 > cd .. | |
21 > done | |
22 | |
23 pushing to test-0 | |
24 searching for changes | |
25 adding changesets | |
26 adding manifests | |
27 adding file changes | |
28 added 1 changesets with 1 changes to 1 files | |
29 checking changesets | |
30 checking manifests | |
31 crosschecking files in changesets and manifests | |
32 checking files | |
33 1 files, 1 changesets, 1 total revisions | |
34 | |
35 pushing to test-1 | |
36 searching for changes | |
37 adding changesets | |
38 adding manifests | |
39 adding file changes | |
40 added 2 changesets with 2 changes to 1 files | |
41 checking changesets | |
42 checking manifests | |
43 crosschecking files in changesets and manifests | |
44 checking files | |
45 1 files, 2 changesets, 2 total revisions | |
46 | |
47 pushing to test-2 | |
48 searching for changes | |
49 adding changesets | |
50 adding manifests | |
51 adding file changes | |
52 added 3 changesets with 3 changes to 1 files | |
53 checking changesets | |
54 checking manifests | |
55 crosschecking files in changesets and manifests | |
56 checking files | |
57 1 files, 3 changesets, 3 total revisions | |
58 | |
59 pushing to test-3 | |
60 searching for changes | |
61 adding changesets | |
62 adding manifests | |
63 adding file changes | |
64 added 4 changesets with 4 changes to 1 files | |
65 checking changesets | |
66 checking manifests | |
67 crosschecking files in changesets and manifests | |
68 checking files | |
69 1 files, 4 changesets, 4 total revisions | |
70 | |
71 pushing to test-4 | |
72 searching for changes | |
73 adding changesets | |
74 adding manifests | |
75 adding file changes | |
76 added 2 changesets with 2 changes to 1 files | |
77 checking changesets | |
78 checking manifests | |
79 crosschecking files in changesets and manifests | |
80 checking files | |
81 1 files, 2 changesets, 2 total revisions | |
82 | |
83 pushing to test-5 | |
84 searching for changes | |
85 adding changesets | |
86 adding manifests | |
87 adding file changes | |
88 added 3 changesets with 3 changes to 1 files | |
89 checking changesets | |
90 checking manifests | |
91 crosschecking files in changesets and manifests | |
92 checking files | |
93 1 files, 3 changesets, 3 total revisions | |
94 | |
95 pushing to test-6 | |
96 searching for changes | |
97 adding changesets | |
98 adding manifests | |
99 adding file changes | |
100 added 4 changesets with 5 changes to 2 files | |
101 checking changesets | |
102 checking manifests | |
103 crosschecking files in changesets and manifests | |
104 checking files | |
105 2 files, 4 changesets, 5 total revisions | |
106 | |
107 pushing to test-7 | |
108 searching for changes | |
109 adding changesets | |
110 adding manifests | |
111 adding file changes | |
112 added 5 changesets with 6 changes to 3 files | |
113 checking changesets | |
114 checking manifests | |
115 crosschecking files in changesets and manifests | |
116 checking files | |
117 3 files, 5 changesets, 6 total revisions | |
118 | |
119 pushing to test-8 | |
120 searching for changes | |
121 adding changesets | |
122 adding manifests | |
123 adding file changes | |
124 added 5 changesets with 5 changes to 2 files | |
125 checking changesets | |
126 checking manifests | |
127 crosschecking files in changesets and manifests | |
128 checking files | |
129 2 files, 5 changesets, 5 total revisions | |
130 | |
131 $ cd test-8 | |
132 | |
133 $ hg pull ../test-7 | |
134 pulling from ../test-7 | |
135 searching for changes | |
136 adding changesets | |
137 adding manifests | |
138 adding file changes | |
139 added 4 changesets with 2 changes to 3 files (+1 heads) | |
140 (run 'hg heads' to see heads, 'hg merge' to merge) | |
141 | |
142 $ hg verify | |
143 checking changesets | |
144 checking manifests | |
145 crosschecking files in changesets and manifests | |
146 checking files | |
147 4 files, 9 changesets, 7 total revisions | |
148 | |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16350
diff
changeset
|
149 $ cd .. |