diff mercurial/dispatch.py @ 28394:dcb4209bd30d

revset: replace extpredicate by revsetpredicate of registrar This patch consists of changes below (these can't be applied separately). - replace revset.extpredicate by registrar.revsetpredicate in extensions - remove setup() on an instance named as revsetpredicate in uisetup()/extsetup() of each extensions registrar.revsetpredicate doesn't have setup() API. - put new entry for revsetpredicate into extraloaders in dispatch This causes implicit loading predicate functions at loading extension. This loading mechanism requires that an extension has an instance named as revsetpredicate, and this is reason why largefiles/__init__.py is also changed in this patch. Before this patch, test-revset.t tests that all decorated revset predicates are loaded by explicit setup() at once ("all or nothing"). Now, test-revset.t tests that any revset predicate isn't loaded at failure of loading extension, because loading itself is executed by dispatch and it can't be controlled on extension side.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 08 Mar 2016 23:04:53 +0900
parents 73905484ef70
children 4eb5496c2bd4
line wrap: on
line diff
--- a/mercurial/dispatch.py	Tue Mar 08 23:04:53 2016 +0900
+++ b/mercurial/dispatch.py	Tue Mar 08 23:04:53 2016 +0900
@@ -33,6 +33,7 @@
     fancyopts,
     hg,
     hook,
+    revset,
     ui as uimod,
     util,
 )
@@ -752,6 +753,7 @@
 #   extraobj) arguments
 extraloaders = [
     ('cmdtable', commands, 'loadcmdtable'),
+    ('revsetpredicate', revset, 'loadpredicate'),
 ]
 
 def _dispatch(req):