D4283: webcommands: fix `@webcommand` decorator

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Wed Aug 15 20:22:49 EDT 2018


indygreg added a comment.


  This seems like a strict improvement.
  
  But the proper way to register web commands from extensions would be to go through the `registrar` API and have the extension loader look for a well-named symbol in each extension module that is loaded and hgweb would consult the registrar for active commands. In theory, this will only activate web commands on repositories that have an extension loaded.
  
  Search for `templatefilter` in `mercurial/extensions.py` for an example of how all this works.
  
  Would you be willing to try that approach? It doesn't have to be perfect. But we are moving to the registrar for extensions wishing to install well-defined things. And web commands fit that bill.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4283

To: sheehan, #hg-reviewers
Cc: indygreg, mercurial-devel


More information about the Mercurial-devel mailing list