annotate tests/test-generaldelta.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 cc0ff93d0c0c
children 049005de325e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19764
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
1 Check whether size of generaldelta revlog is not bigger than its
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
2 regular equivalent. Test would fail if generaldelta was naive
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
3 implementation of parentdelta: third manifest revision would be fully
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
4 inserted due to big distance from its paren revision (zero).
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
5
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
6 $ hg init repo
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
7 $ cd repo
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
8 $ echo foo > foo
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
9 $ echo bar > bar
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
10 $ hg commit -q -Am boo
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
11 $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
12 $ for r in 1 2 3; do
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
13 > echo $r > foo
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
14 > hg commit -q -m $r
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
15 > hg up -q -r 0
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
16 > hg pull . -q -r $r -R ../gdrepo
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
17 > done
19942
2c886dedd902 tests: move generaldelta test to inline python (issue4064)
Matt Mackall <mpm@selenic.com>
parents: 19888
diff changeset
18
19764
e92650e39f1c generaldelta: initialize basecache properly
Wojciech Lopata <lopek@fb.com>
parents:
diff changeset
19 $ cd ..
19942
2c886dedd902 tests: move generaldelta test to inline python (issue4064)
Matt Mackall <mpm@selenic.com>
parents: 19888
diff changeset
20 >>> import os
2c886dedd902 tests: move generaldelta test to inline python (issue4064)
Matt Mackall <mpm@selenic.com>
parents: 19888
diff changeset
21 >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size
2c886dedd902 tests: move generaldelta test to inline python (issue4064)
Matt Mackall <mpm@selenic.com>
parents: 19888
diff changeset
22 >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size
2c886dedd902 tests: move generaldelta test to inline python (issue4064)
Matt Mackall <mpm@selenic.com>
parents: 19888
diff changeset
23 >>> if regsize < gdsize:
2c886dedd902 tests: move generaldelta test to inline python (issue4064)
Matt Mackall <mpm@selenic.com>
parents: 19888
diff changeset
24 ... print 'generaldata increased size of manifest'
23381
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
25
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
26 Verify rev reordering doesnt create invalid bundles (issue4462)
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
27 This requires a commit tree that when pulled will reorder manifest revs such
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
28 that the second manifest to create a file rev will be ordered before the first
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
29 manifest to create that file rev. We also need to do a partial pull to ensure
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
30 reordering happens. At the end we verify the linkrev points at the earliest
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
31 commit.
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
32
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
33 $ hg init server --config format.generaldelta=True
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
34 $ cd server
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
35 $ touch a
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
36 $ hg commit -Aqm a
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
37 $ echo x > x
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
38 $ echo y > y
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
39 $ hg commit -Aqm xy
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
40 $ hg up -q '.^'
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
41 $ echo x > x
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
42 $ echo z > z
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
43 $ hg commit -Aqm xz
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
44 $ hg up -q 1
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
45 $ echo b > b
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
46 $ hg commit -Aqm b
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
47 $ hg merge -q 2
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
48 $ hg commit -Aqm merge
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
49 $ echo c > c
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
50 $ hg commit -Aqm c
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
51 $ hg log -G -T '{rev} {shortest(node)} {desc}'
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
52 @ 5 ebb8 c
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
53 |
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
54 o 4 baf7 merge
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
55 |\
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
56 | o 3 a129 b
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
57 | |
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
58 o | 2 958c xz
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
59 | |
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
60 | o 1 f00c xy
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
61 |/
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
62 o 0 3903 a
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
63
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
64 $ cd ..
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
65 $ hg init client
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
66 $ cd client
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
67 $ hg pull -q ../server -r 4
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
68 $ hg debugindex x
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
69 rev offset length base linkrev nodeid p1 p2
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
70 0 0 3 0 1 1406e7411862 000000000000 000000000000
cc0ff93d0c0c changegroup: fix file linkrevs during reorders (issue4462)
Durham Goode <durham@fb.com>
parents: 19942
diff changeset
71