Mon, 21 Dec 2015 16:27:16 -0800 dirstate: add a C implementation for nonnormalentries
Laurent Charignon <lcharignon@fb.com> [Mon, 21 Dec 2015 16:27:16 -0800] rev 27592
dirstate: add a C implementation for nonnormalentries Before this patch, there was only a python version of nonnormalentries. On mozilla-central we have a 10x win by putting this function in C: % python -m timeit -s \ 'from mercurial import hg, ui, parsers; \ repo = hg.repository(ui.ui(), "mozilla-central"); \ m = repo.dirstate._map' \ 'parsers.nonnormalentries(m)' 100 loops, best of 3: 3.15 msec per loop The python implementation runs in 31ms, a similar test gives: 10 loops, best of 3: 31.7 msec per loop On our big repos, the win is still of 10x with the python implementation running in 350ms and the C implementation running in 30ms.
Mon, 21 Dec 2015 16:26:44 -0800 dirstate: add test for non-normal set consistency
Laurent Charignon <lcharignon@fb.com> [Mon, 21 Dec 2015 16:26:44 -0800] rev 27591
dirstate: add test for non-normal set consistency This adds a test extension to check that the non-normal set contains the expected entries. It wraps several methods of the dirstate to check that the non-normal set has the correct values before and after the call. The extension lives in contrib so that paranoid developers can easily enable it to make sure that the non-normal set is consistent across more complex operations than the included tests.
Fri, 01 Jan 2016 23:40:54 +0100 dirstate: add code to update the non-normal set
Laurent Charignon <lcharignon@fb.com> [Fri, 01 Jan 2016 23:40:54 +0100] rev 27590
dirstate: add code to update the non-normal set Before this patch, we were only populating the non-normal set when parsing or packing the dirstate. This was not enough to keep the non-normal set up to date at all time as we don't write and read the dirstate whenever a change happens. This patch solves this issue by updating the non-normal set when it should be updated. note: pack_dirstate changes the dmap and we have it keep it unchanged for retrocompatibility so we are forced to recompute the non-normal set after calling it.
Wed, 23 Dec 2015 13:13:22 -0800 dirstate: attach the nonnormalset to a propertycache
Laurent Charignon <lcharignon@fb.com> [Wed, 23 Dec 2015 13:13:22 -0800] rev 27589
dirstate: attach the nonnormalset to a propertycache This patch attaches the nonnormalset to a property cache so that we build it only when needed.
Mon, 21 Dec 2015 16:22:43 -0800 dirstate: add a function to compute non-normal entries from the dmap
Laurent Charignon <lcharignon@fb.com> [Mon, 21 Dec 2015 16:22:43 -0800] rev 27588
dirstate: add a function to compute non-normal entries from the dmap This patch adds a new python function in the dirstate to compute the set of non-normal files from the dmap. These files are useful to compute the repository status.
Tue, 29 Dec 2015 23:58:30 +0900 revset: use decorator to mark a predicate as safe
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 29 Dec 2015 23:58:30 +0900] rev 27587
revset: use decorator to mark a predicate as safe Using decorator can localize changes for adding (or removing) a "safe" revset predicate function in source code. To avoid accidentaly treating unsuitable predicates as safe, this patch uses False as default value of "safe" argument. This forces safe predicates to be decorated with explicit 'safe=True'.
Tue, 29 Dec 2015 23:58:30 +0900 revset: use delayregistrar to register predicate in extension easily
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 29 Dec 2015 23:58:30 +0900] rev 27586
revset: use delayregistrar to register predicate in extension easily Previous patch introduced 'revset.predicate' decorator to register revset predicate function easily. But it shouldn't be used in extension directly, because it registers specified function immediately. Registration itself can't be restored, even if extension loading fails after that. Therefore, registration should be delayed until 'uisetup()' or so. This patch uses 'extpredicate' decorator derived from 'delayregistrar' to register predicate in extension easily. This patch also tests whether 'registrar.delayregistrar' avoids function registration if 'setup()' isn't invoked on it, because 'extpredicate' is the first user of it.
Tue, 29 Dec 2015 23:58:30 +0900 registrar: add delayregistrar class to register function in extensions
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 29 Dec 2015 23:58:30 +0900] rev 27585
registrar: add delayregistrar class to register function in extensions 'delayregistrar' delays actual registration of function until 'setup()' invocation on it.
Tue, 29 Dec 2015 23:58:30 +0900 revset: use decorator to register a function as revset predicate
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 29 Dec 2015 23:58:30 +0900] rev 27584
revset: use decorator to register a function as revset predicate Using decorator can localize changes for adding (or removing) a revset predicate function in source code. It is also useful to pick predicates up for specific purpose. For example, subsequent patch marks predicates as "safe" by decorator. This patch defines 'parsefuncdecl()' in 'funcregistrar' class, because this implementation can be uesd by other decorator class for fileset predicate and template function.
Tue, 29 Dec 2015 23:58:30 +0900 registrar: add funcregistrar class to register function for specific purpose
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 29 Dec 2015 23:58:30 +0900] rev 27583
registrar: add funcregistrar class to register function for specific purpose This class centralizes the common logic to register function for specific purpose like below: - template keyword, filter and function - revset predicate - fileset predicate - webcommand 'funcregistrar' also formats help document of the function with the 'decl'(aration) specified at the construction. This can avoid (1) redundancy between 'decl' and help document, and (2) accidental typo of help document. For example, 'foo' should appear twice like below, if without such formatting: @keyword('foo') def foo(....): """:foo: Explanation of keyword foo ...""" Almost all cases needs very simple document formatting like below: - "``DECL``\n EXPLANATION" - ":DECL: EXPLANATION" But webcommand needs a little complicated formatting like: /PATH/SPEC ---------- EXPLANATION .... To make minirst recognize the section header, hyphen line should be as long as "/PATH/SPEC". It should be arranged by program. Implementing 'formatdoc()' in derived class can support complicated formatting in the latter case. But it seems redundant for simple one in the former case. Therefore, 'funcregistrar' does: - invoke 'self.formatdoc', if it is callable (for the latter case) - use it as the format string, otherwise (for the former case)
(0) -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip