Siddharth Agarwal <sid0@fb.com> [Sun, 29 Mar 2015 19:47:16 -0700] rev 24541
dirstate.walk: use the file foldmap to normalize
Computing the set of directories in the dirstate is expensive. It turns out
that it isn't necessary for operations like 'hg status' at all.
Why? Consider the file 'foo/bar' on disk, which is represented in the dirstate
as 'FOO/BAR'.
On 'hg status', we'd walk down the directory tree, coming across 'foo' first.
Before: we'd normalize 'foo' to 'FOO', then add 'FOO' to our visited stack.
We'd then visit 'FOO', finding the file 'bar'. We'd normalize 'FOO/bar' to
'FOO/BAR', then add it to the results dict.
After: we wouldn't normalize 'foo' at all. We'd add it to our visited stack,
then visit 'foo', finding the file 'bar'. We'd normalize 'foo/bar' to
'FOO/BAR', then add it to the results dict.
So whether we normalize intermediate directories or not actually makes no
difference in most cases.
The only case where normalization matters at all is if a file is replaced with
a directory with the same case-folded name. In that case we can do a relatively
cheap file normalization instead and still get away with not computing the set
of directories.
This is a nice boost in status performance. On OS X with case-insensitive HFS+,
for a large repo with over 200,000 files, this brings down 'hg status' from
4.00 seconds to 3.62.
Siddharth Agarwal <sid0@fb.com> [Sun, 29 Mar 2015 19:42:49 -0700] rev 24540
dirstate: split the foldmap into separate ones for files and directories
Computing the set of directories in the dirstate can be pretty expensive. For
'hg status' without arguments, it turns out we actually never need to figure
out the right case for directories in the foldmap. (An upcoming patch explains
why.)
This patch splits up the directory and file maps into separate ones, allowing
for the subsequent optimization in status.
Siddharth Agarwal <sid0@fb.com> [Sat, 28 Mar 2015 18:53:54 -0700] rev 24539
dirstate: introduce function to normalize just filenames
This will be used in upcoming patches to stop generating the set of directories
in many common cases.
Siddharth Agarwal <sid0@fb.com> [Sun, 29 Mar 2015 19:23:05 -0700] rev 24538
dirstate: factor out code to discover normalized path
In upcoming patches we're going to reuse this code. The storemap is currently
always the foldmap, but will vary in future patches.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 31 Mar 2015 11:11:39 -0400] rev 24537
dirstate: don't require exact case when adding dirs on icasefs (
issue4578)
We don't require it when adding files on a case insensitive filesystem, so don't
require it to add directories for consistency.
The problem with the previous code was that _walkexplicit() was only returning
the normalized directory. The file(s) in the directory are then appended, and
passed to the matcher. But if the user asks for 'capsdir1/capsdir', the matcher
will not accept 'CapsDir1/CapsDir/AbC.txt', and the name is dropped. Matching
based on the non-normalized name is required.
If not normalizing, skip the extra string building for efficiency. '.' is
replaced with '' so that the path being tested when no file is specified, isn't
prefixed with './' (and therefore fail the match).
Nathan Goldbaum <ngoldbau@ucsc.edu> [Tue, 31 Mar 2015 11:58:14 -0700] rev 24536
filemerge: clean up language in mergemarkertemplate help
Matt Harbison <matt_harbison@yahoo.com> [Tue, 31 Mar 2015 14:27:45 -0400] rev 24535
color: fix crash in cmd.exe
When 'term' is None because it isn't in the environment, don't iterate over it.
Unfortunately, unsetting $TERM or exporting it as '' doesn't work in the tests,
so there's no way to simulate cmd.exe in the test suite.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 18 Mar 2015 21:44:25 -0700] rev 24534
log: prefer 'wctx' over 'pctx' for working context
Matt Mackall <mpm@selenic.com> [Tue, 31 Mar 2015 08:31:42 -0500] rev 24533
merge with stable
Matt Mackall <mpm@selenic.com> [Tue, 31 Mar 2015 08:04:42 -0500] rev 24532
tags: remove scary message about corrupt tags cache
Caches should be transparent. If a cache is damaged, it should
silently be rebuilt, much like if it were invalid. No one seems to
have ever hit this in the wild.