sapling/mercurial
Siddharth Agarwal 5c1db53305 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.
2015-03-29 19:47:16 -07:00
..
default.d merge-tools: configuration for Beyond Compare on OS X 2015-02-27 21:42:58 +01:00
help subrepo: add basic support to hgsubrepo for the files command 2015-03-18 23:03:41 -04:00
hgweb hgweb: replace 'ctx._repo' with 'ctx.repo()' 2015-03-12 23:15:06 -04:00
httpclient style: kill ersatz if-else ternary operators 2015-03-13 17:00:06 -04:00
pure manifest: move pure parsing code out of pure 2015-03-06 17:00:42 -06:00
templates merge with stable 2015-03-31 08:31:42 -05:00
__init__.py Add back links from file revisions to changeset revisions 2005-05-03 13:16:10 -08:00
ancestor.py ancestor: add a way to remove ancestors of bases from a given set 2014-11-14 19:40:30 -08:00
archival.py archive: change the default prefix to '' from None 2015-02-15 17:21:48 -05:00
base85.c base85: cast Py_ssize_t values to int (issue3481) 2012-06-04 16:59:34 +02:00
bdiff.c bdiff: avoid a memory error on malloc failure 2013-10-30 16:03:42 -05:00
bookmarks.py bookmarks: rewrite comparing bookmarks in commands.summary() by compare() 2015-03-19 23:36:06 +09:00
branchmap.py revbranchcache: write cache even during read operations 2015-02-24 18:43:31 -08:00
bundle2.py bundle2: fix parttype enforcement 2015-01-17 18:08:47 -08:00
bundlerepo.py style: kill ersatz if-else ternary operators 2015-03-13 17:00:06 -04:00
byterange.py style: kill ersatz if-else ternary operators 2015-03-13 17:00:06 -04:00
changegroup.py changegroup.getsubset: support multiple versions 2015-01-15 15:55:13 -08:00
changelog.py changelog: use headrevsfiltered 2014-10-26 12:14:12 +01:00
cmdutil.py log: prefer 'wctx' over 'pctx' for working context 2015-03-18 21:44:25 -07:00
commands.py commands.debugrevlog: report max chain length 2015-03-28 12:58:44 -07:00
commandserver.py cmdserver: include pid of server handling requests in hello message 2014-10-18 12:24:50 +09:00
config.py ui: move samplehgrcs from config 2014-09-11 12:26:12 -05:00
context.py committablefilectx: override linkrev() to point to the associated changectx 2015-03-19 23:31:53 +09:00
copies.py mergecopies: reuse ancestry context when traversing file history (issue4537) 2015-03-20 00:30:35 -07:00
crecord.py record_curses: fix ui bug for newly added file 2015-03-27 14:11:13 -07:00
dagparser.py en-us: labeled 2012-08-17 13:58:18 -07:00
dagutil.py style: kill ersatz if-else ternary operators 2015-03-13 17:00:06 -04:00
demandimport.py demandimport: blacklist distutils.msvc9compiler (issue4475) 2014-12-22 17:27:31 -05:00
diffhelpers.c diffhelpers: fix botched return statement from e48d70075d8a 2015-01-28 13:34:20 -05:00
dirs.c dirs.addpath: rework algorithm to search forward 2015-03-27 01:03:06 -07:00
dirstate.py dirstate.walk: use the file foldmap to normalize 2015-03-29 19:47:16 -07:00
discovery.py style: kill ersatz if-else ternary operators 2015-03-13 17:00:06 -04:00
dispatch.py ssl: set explicit symbol "!" to web.cacerts to disable SSL verification (BC) 2015-03-04 23:27:04 +09:00
dummycert.pem ssl: on OS X, use a dummy cert to trick Python/OpenSSL to use system CA certs 2014-09-26 02:19:48 +02:00
encoding.py encoding: add hfsignoreclean to clean out HFS-ignored characters 2014-12-16 13:06:41 -05:00
error.py error: add a new UnknownIdentifier error type 2015-01-26 14:31:01 -05:00
exchange.py discovery: properly exclude locally known but filtered heads 2015-01-30 21:11:02 +00:00
exewrapper.c exewrapper: adapt for legacy HackableMercurial 2012-08-07 11:04:41 +02:00
extensions.py extensions: indicate loaded for an immediately called afterload callback 2015-02-21 00:40:18 -05:00
fancyopts.py fancyopts: restore use of callable() since it was readded in Python 3.2 2014-06-23 09:24:16 -04:00
filelog.py revlog: addgroup checks if incoming deltas add censored revs, sets flag bit 2015-01-14 15:16:08 -05:00
filemerge.py help.merge-tools: do not double document merge tools 2015-02-09 23:07:39 -08:00
fileset.py fileset: add a fileset for portable filenames 2015-03-19 21:26:18 -07:00
formatter.py formatter: convert None to json null 2014-09-17 22:34:34 +09:00
graphmod.py spelling: fixes from proofreading of spell checker issues 2015-01-18 02:38:57 +01:00
hbisect.py localrepo: remove all external users of localrepo.opener 2015-01-15 23:17:12 +01:00
help.py help.merge-tools: do not double document merge tools 2015-02-09 23:07:39 -08:00
hg.py clone: add progress support to hardlink clones (issue3059) 2015-03-13 18:28:11 -04:00
hook.py merge with stable 2014-12-01 19:34:11 -06:00
httpconnection.py httpconnection: properly inject ssl_wrap_socket into httpclient (issue4038) 2013-09-20 09:16:07 -04:00
httppeer.py changegroup.writebundle: provide ui 2015-01-15 14:39:41 -08:00
i18n.py i18n: cache the result of every gettext call 2014-10-17 13:52:10 -04:00
ignore.py ignore: process hgignore files in deterministic order 2012-12-17 15:57:02 -08:00
keepalive.py util: move md5 back next to sha1 and allow to call it without an argument 2014-09-24 16:00:47 +09:00
localrepo.py manifestv2: add (unused) config option 2015-03-27 16:19:44 -07:00
lock.py lock: while releasing, unlink lockfile even if the release function throws 2014-10-16 19:15:51 -07:00
lsprof.py profiling: replace '+' markup of nested lines with indentation 2013-02-08 22:54:48 +01:00
lsprofcalltree.py drop unused imports 2009-05-14 15:35:46 +02:00
mail.py mail: actually use the verifycert config value 2014-11-05 18:31:39 +00:00
manifest.c manifest: move C bool polyfill into util.h 2015-03-25 14:16:10 -05:00
manifest.py manifestv2: implement slow readdelta() without revdiff 2015-03-27 20:41:30 -07:00
match.py match: remove unused assignment of ctx 2015-01-17 12:39:44 +09:00
mdiff.py mdiff: add helper for making deltas which replace the full text of a revision 2015-01-21 16:35:09 -05:00
merge.py subrepo: add bailifchanged to centralize raising Abort if subrepo is dirty 2015-03-25 13:55:35 +09:00
minirst.py help: show all nested subsections of a section with hg help foo.section 2014-10-06 07:35:53 -04:00
mpatch.c mpatch: rewrite pointer overflow checks 2013-12-11 18:33:42 -06:00
namespaces.py spelling: fixes from proofreading of spell checker issues 2015-01-18 02:38:57 +01:00
node.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
obsolete.py obsolete: avoid infinite loop from obs-cycle in divergence (issue4126) 2015-03-19 13:00:44 -07:00
osutil.c osutil: mark end of string with null char, not 0 2015-03-25 16:21:58 -07:00
parser.py parser: allow passing a lookup function to a tokenizer 2014-03-18 17:17:23 -05:00
parsers.c parsers.c: avoid implicit conversion loses integer warnings 2015-03-29 19:06:23 +02:00
patch.py diff: use binary diff when copy source is binary 2015-01-17 15:03:41 -08:00
pathencode.c pathencode: eliminate signed integer warnings 2014-02-19 13:11:24 -08:00
pathutil.py merge with stable 2014-12-18 16:41:59 -06:00
peer.py peer: delete double definition of method peer 2012-07-28 22:36:22 +02:00
phases.py phases: add killswitch for native implementation 2015-03-30 12:57:55 -07:00
posix.py shellquote: fix missing quotes for empty string 2015-02-11 19:57:07 +09:00
pushkey.py obsolete: add exchange option 2014-10-14 13:26:01 -07:00
pvec.py pvec: replace 'ctx._repo' with 'ctx.repo()' 2015-03-12 23:18:20 -04:00
py3kcompat.py py3kcompat: drop unused export 2014-05-13 15:22:36 -05:00
repair.py repair._bundle: fix traceback for bad config value 2015-01-21 15:54:52 -08:00
repoview.py repoview: invalidate cached changelog if _delayed changes (issue4549) 2015-03-01 23:20:02 -06:00
revlog.py revlog: make converting from inline to non-line work after a strip 2015-03-25 15:58:31 -04:00
revset.py revset: add hook after tree parsing 2015-03-24 14:24:55 -07:00
scmposix.py config: don't read the same config file twice 2014-09-04 21:36:35 +02:00
scmutil.py matcher: make e.g. 'relpath:.' lead to fast paths 2014-11-19 15:56:58 -08:00
scmwindows.py config: don't read the same config file twice 2014-09-04 21:36:35 +02:00
setdiscovery.py setdiscovery: remove '_setupsample' function 2015-01-06 17:19:21 -08:00
similar.py cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
simplemerge.py simplemerge: remove dead code 2014-08-07 12:51:45 -04:00
sshpeer.py sshpeer: more thorough shell quoting 2014-12-29 14:27:02 -06:00
sshserver.py changegroup: rename bundle-related functions and classes 2014-09-02 12:11:36 +02:00
sslutil.py ssl: load CA certificates from system's store by default on Python 2.7.9 2015-02-26 22:54:13 +09:00
statichttprepo.py revbranchcache: move cache writing to the transaction finalizer 2015-02-10 20:06:12 -08:00
store.py store: drop unused existing list 2014-04-03 12:59:12 -05:00
strutil.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
subrepo.py subrepo: add bailifchanged to centralize raising Abort if subrepo is dirty 2015-03-25 13:55:35 +09:00
tagmerge.py spelling: fixes from proofreading of spell checker issues 2014-04-17 22:47:38 +02:00
tags.py tags: remove scary message about corrupt tags cache 2015-03-31 08:04:42 -05:00
templatefilters.py templatefilters.json: stabilize output 2014-12-31 13:48:55 -08:00
templatekw.py templater: replace 'ctx._repo' with 'ctx.repo()' 2015-03-12 23:11:15 -04:00
templater.py templater: replace 'ctx._repo' with 'ctx.repo()' 2015-03-12 23:11:15 -04:00
transaction.py transaction: add a validation stage 2015-03-09 22:43:36 -07:00
treediscovery.py discovery: stop using nodemap for membership testing 2013-11-15 23:28:43 -05:00
ui.py ui: represent paths as classes 2015-02-07 12:42:10 -08:00
unionrepo.py revlog: add "iscensored()" to revlog public API 2015-01-23 17:01:39 -05:00
url.py https: support tls sni (server name indication) for https urls (issue3090) 2015-01-12 18:01:20 -07:00
util.h phase: compute phases in C 2015-03-24 11:00:09 -07:00
util.py util: add progress callback support to copyfiles 2015-03-19 10:24:22 -04:00
verify.py verify: add a note about a paleo-bug 2015-03-27 15:13:21 -05:00
win32.py win32: add comment about WinError 2015-03-28 11:19:34 +01:00
windows.py merge with stable 2015-02-27 17:46:03 -06:00
wireproto.py localrepo: remove all external users of localrepo.sopener 2015-01-11 00:25:54 +01:00
worker.py cleanup: avoid _ for local unused tmp variables - that is reserved for i18n 2014-08-15 16:20:47 +02:00