Mercurial > hg
annotate tests/test-bundle-type.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 | d54d4de56aa7 |
children | eabe44ec5af5 |
rev | line source |
---|---|
11872
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
1 bundle w/o type option |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
2 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
3 $ hg init t1 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
4 $ hg init t2 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
5 $ cd t1 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
6 $ echo blablablablabla > file.txt |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
7 $ hg ci -Ama |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
8 adding file.txt |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
9 $ hg log | grep summary |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
10 summary: a |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
11 $ hg bundle ../b1 ../t2 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
12 searching for changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
13 1 changesets found |
6570
626cb86a6523
add compression type type parameter to bundle command
Benoit Allard <benoit@aeteurope.nl>
parents:
diff
changeset
|
14 |
11872
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
15 $ cd ../t2 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
16 $ hg pull ../b1 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
17 pulling from ../b1 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
18 requesting all changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
19 adding changesets |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
20 adding manifests |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
21 adding file changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
22 added 1 changesets with 1 changes to 1 files |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
23 (run 'hg update' to get a working copy) |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
24 $ hg up |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
26 $ hg log | grep summary |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
27 summary: a |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
28 $ cd .. |
6570
626cb86a6523
add compression type type parameter to bundle command
Benoit Allard <benoit@aeteurope.nl>
parents:
diff
changeset
|
29 |
11872
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
30 test bundle types |
6570
626cb86a6523
add compression type type parameter to bundle command
Benoit Allard <benoit@aeteurope.nl>
parents:
diff
changeset
|
31 |
11872
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
32 $ for t in "None" "bzip2" "gzip"; do |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
33 > echo % test bundle type $t |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
34 > hg init t$t |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
35 > cd t1 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
36 > hg bundle -t $t ../b$t ../t$t |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
37 > cut -b 1-6 ../b$t | head -n 1 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
38 > cd ../t$t |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
39 > hg pull ../b$t |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
40 > hg up |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
41 > hg log | grep summary |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
42 > cd .. |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
43 > done |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
44 % test bundle type None |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
45 searching for changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
46 1 changesets found |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
47 HG10UN |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
48 pulling from ../bNone |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
49 requesting all changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
50 adding changesets |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
51 adding manifests |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
52 adding file changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
53 added 1 changesets with 1 changes to 1 files |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
54 (run 'hg update' to get a working copy) |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
56 summary: a |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
57 % test bundle type bzip2 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
58 searching for changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
59 1 changesets found |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
60 HG10BZ |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
61 pulling from ../bbzip2 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
62 requesting all changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
63 adding changesets |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
64 adding manifests |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
65 adding file changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
66 added 1 changesets with 1 changes to 1 files |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
67 (run 'hg update' to get a working copy) |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
69 summary: a |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
70 % test bundle type gzip |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
71 searching for changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
72 1 changesets found |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
73 HG10GZ |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
74 pulling from ../bgzip |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
75 requesting all changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
76 adding changesets |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
77 adding manifests |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
78 adding file changes |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
79 added 1 changesets with 1 changes to 1 files |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
80 (run 'hg update' to get a working copy) |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
82 summary: a |
6570
626cb86a6523
add compression type type parameter to bundle command
Benoit Allard <benoit@aeteurope.nl>
parents:
diff
changeset
|
83 |
11872
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
84 test garbage file |
6570
626cb86a6523
add compression type type parameter to bundle command
Benoit Allard <benoit@aeteurope.nl>
parents:
diff
changeset
|
85 |
11872
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
86 $ echo garbage > bgarbage |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
87 $ hg init tgarbage |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
88 $ cd tgarbage |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
89 $ hg pull ../bgarbage |
12044
bcc7139521b7
bundlerepo: remove duplication of bundle decompressors
Matt Mackall <mpm@selenic.com>
parents:
11872
diff
changeset
|
90 abort: ../bgarbage: not a Mercurial bundle |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12044
diff
changeset
|
91 [255] |
11872
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
92 $ cd .. |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
93 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
94 test invalid bundle type |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
95 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
96 $ cd t1 |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
97 $ hg bundle -a -t garbage ../bgarbage |
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
98 abort: unknown bundle type specified with --type |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12044
diff
changeset
|
99 [255] |
11872
bc436a97038b
tests: unify test-bundle-type
Martin Geisler <mg@lazybytes.net>
parents:
7171
diff
changeset
|
100 $ cd .. |