Mon, 15 May 2017 13:29:18 -0700 test-hardlink: do not test .hg/cache/checklink
Jun Wu <quark@fb.com> [Mon, 15 May 2017 13:29:18 -0700] rev 32295
test-hardlink: do not test .hg/cache/checklink Linux and BSD have different behavior on "os.link(src, dst)" where "src" is a symlink. That causes test difference. According to POSIX [1]: If path1 names a symbolic link, it is implementation-defined whether link() follows the symbolic link, or creates a new link to the symbolic link itself. So both behaviors are correct. This patch removes the trouble maker "checklink" to make the test pass on both platforms. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html
Mon, 15 May 2017 13:25:59 -0700 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com> [Mon, 15 May 2017 13:25:59 -0700] rev 32294
test-hardlinks: unify two test files into one The "whitelisted" test could be unified using "#if"s.
Mon, 15 May 2017 14:08:02 -0400 style: ban [ foo == bar] bashism in tests
Augie Fackler <augie@google.com> [Mon, 15 May 2017 14:08:02 -0400] rev 32293
style: ban [ foo == bar] bashism in tests
Sat, 13 May 2017 16:26:43 -0700 changelog: load pending file directly
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 13 May 2017 16:26:43 -0700] rev 32292
changelog: load pending file directly When changelogs are written, a copy of the index (or inline revlog) may be written to an 00changelog.i.a file to facilitate hooks and other processes having access to the pending data before it is finalized. The way it works today, the localrepo class loads the changelog like normal. Then, if it detects a pending transaction, it asks the changelog class to load a pending changelog. The changelog class looks for a 00changelog.i.a file. If it exists, it is loaded and internal data structures on the new revlog class are copied to the original instance. The existing mechanism is inefficient because it loads 2 revlog files. The index, node map, and chunk cache for 00changelog.i are thrown away and replaced by those for 00changelog.i.a. The existing mechanism is also brittle because it is a layering violation to access the data structures being accessed. For example, the code copies the "chunk cache" because for inline revlogs this cache contains the raw revision chunks and allows the original changelog/revlog instance to access revision data for these pending revisions. This whole behavior of course relies on the revlog constructor reading the entirety of an inline revlog into memory and caching it. That's why it is brittle. (I discovered all this as part of modifying behavior of the chunk cache.) This patch streamlines the loading of a pending 00changelog.i.a revlog by doing it directly in the changelog constructor if told to do so. When this code path is active, we no longer load the 00changelog.i file at all. The only negative outcome I see from this change is if loading 00changelog.i was somehow facilitating a role. But I can't imagine what that would be because we throw away its data (the index data structures are replaced and inline revision data is replaced via the chunk cache) and since 00changelog.i.a is a copy of 00changelog.i, file content should be identical, so there should be no meaninful file integrity checking at play. I think this was all just sub-optimal code.
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -4 +4 +10 +30 +100 +300 +1000 +3000 +10000 tip