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.
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'.
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.
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.
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.
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)
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 30 Dec 2015 17:15:10 -0700] rev 27582
hgweb: support rendering a sub-topic
If the requested topic contains a "." we assume a sub-topic is
requested and display it.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 30 Dec 2015 17:34:51 -0700] rev 27581
hgweb: support rendering sub-topic indexes
If the requested topic name is the name of a sub-topic, we now render
an index of topics within that sub-topic.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 30 Dec 2015 17:26:33 -0700] rev 27580
templates: support linking to main help page
Currently, the "helptopics" template assumes it is only used as the
main index and therefore doesn't hyperlink "help" in the navigation
list. Sub-topics will introduce an additional consumer of this
template. So teach the template to hyperlink the "help" navigation
entry when necessary.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 30 Dec 2015 17:01:28 -0700] rev 27579
templates: differentiate between partial and full topic name
In order to support sub-topics, we need to support linking to a full
topic name while displaying the base topic name. Change the {helpentry}
template to grab the display name from an optional seperate variable
(which will be defined in a future patch).