[PATCH 01 of 22 hgweb-help] webcommands: define web commands using a decorator

Gregory Szorc gregory.szorc at gmail.com
Sat Feb 7 19:05:15 CST 2015


On Sat, Feb 7, 2015 at 3:00 PM, Sean Farley <sean.michael.farley at gmail.com>
wrote:

>
> Martin von Zweigbergk writes:
>
> > On Fri Feb 06 2015 at 11:16:48 PM Gregory Szorc <gregory.szorc at gmail.com
> >
> > wrote:
> >
> >> # HG changeset patch
> >> # User Gregory Szorc <gregory.szorc at gmail.com>
> >> # Date 1423278377 28800
> >> #      Fri Feb 06 19:06:17 2015 -0800
> >> # Node ID a54bf6a609310887f4fa824579b9db3e29b3e550
> >> # Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4
> >> webcommands: define web commands using a decorator
> >>
> >> Other parts of Mercurial have evolved to use decorators to declare
> >> commands or handlers. This patch gives the same treatment to web
> >> commands.
> >>
> >> diff --git a/mercurial/hgweb/webcommands.py
> b/mercurial/hgweb/webcommands.
> >> py
> >> --- a/mercurial/hgweb/webcommands.py
> >> +++ b/mercurial/hgweb/webcommands.py
> >> @@ -21,20 +21,38 @@ from mercurial import revset
> >>
> >>  # __all__ is populated with the allowed commands. Be sure to add to it
> if
> >>  # you're adding a new command, or the new command won't work.
> >>
> >
> > Remove the second sentence?
>
> I think the second sentence is ok? The first six patches of this series
> look good to me also.
>

Well, the comment isn't totally accurate post decorator. This reminds me, I
need to follow this up with a patch to change dispatch from getattr(mod,
command) to looking in webcommands.commands instead. __all__ is a bit hacky
and now redundant.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150207/4dd0e72f/attachment.html>


More information about the Mercurial-devel mailing list