[PATCH 1 of 5] registrar: add base classes to wrap functions, commands, and so on (API)

Yuya Nishihara yuya at tcha.org
Thu Aug 23 08:27:12 EDT 2018


On Wed, 22 Aug 2018 11:21:52 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1534511513 -32400
> #      Fri Aug 17 22:11:53 2018 +0900
> # Node ID f52f112594f5d27067446280a685fba3a9053a13
> # Parent  7a759ad2d06dcf6548a8cc19fcd773eaa943f7ac
> # Available At https://bitbucket.org/foozy/mercurial-wip
> #              hg pull https://bitbucket.org/foozy/mercurial-wip -r f52f112594f5
> # EXP-Topic use-decorator-for-webcommand
> registrar: add base classes to wrap functions, commands, and so on (API)

Just scanned the series quickly, but can't we simply add registrar.webcommand
and extensions.wraptable()?

I see the decorators defined in the registrar module as a sort of DSL or
macro, which is nice if the concept is clear and we have lots of boring
repetition. But monkey-patching isn't that simple. We sometimes have to
conditionalize it for example, and we'll lose the readability provided by
decorator syntax.


More information about the Mercurial-devel mailing list