FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 26 Jun 2017 03:47:11 +0900] rev 33071
keyword: wrap functions only once at loading keyword extension
Before this patch, some functions are wrapped in reposetup(), but this
causes redundant nested wrapping, if two ore more repositories enable
keyword extension (e.g. hgweb serves multiple repositories).
Now, there is no need to define these wrapper functions in
reposetup(), because previous patches made them not directly refer to
kwtemplater instanciated in reposetup().
This patch factors these wrapper functions out from reposetup(), and
uses them to wrap functions only at once at loading keyword extension.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 26 Jun 2017 03:46:17 +0900] rev 33070
keyword: use _keywordkwt of repository instead of kwtools['templater']
Now, kwtemplater instance can be obtained via _keywordkwt property of
repository.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 26 Jun 2017 03:44:50 +0900] rev 33069
keyword: obtain kwtemplater instance via repository at runtime
Wrapper functions of keyword extension are defined in reposetup(),
because they refer to kwtemplater instantiated in reposetup().
This patch makes them obtain kwtemplater instance via repository at
runtime. For reviewability, this patch focuses on wrapper functions,
which handle generator.
This is a part of preparations for defining them statically.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 26 Jun 2017 03:43:47 +0900] rev 33068
keyword: obtain kwtemplater instance via repository at runtime
Wrapper functions of keyword extension are defined in reposetup(),
because they refer to kwtemplater instantiated in reposetup().
This patch makes them obtain kwtemplater instance via repository at
runtime.
This is a part of preparations for defining them statically.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 26 Jun 2017 03:42:17 +0900] rev 33067
keyword: make wrapped repository and kwtemplater refer to each other
Wrapper functions of keyword extension are defined in reposetup(),
because they refer to kwtemplater instantiated in reposetup().
But these functions can be defined statically, if kwtemplater can be
obtained via repository at runtime.
This is a part of preparations for defining them statically.
To avoid cyclic reference, this patch makes kwtemplater use weakref to
refer related repository instance.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 26 Jun 2017 03:40:57 +0900] rev 33066
keyword: add test for keyword expansion at serving multiple repositories
This is safety for subsequent (and future) patches, which change
function wrapping.