tests/test-extension.t
changeset 39730 65b39c556c6d
parent 39725 be396c86f98e
child 39931 0d703063d0c8
equal deleted inserted replaced
39729:56cb053a71ed 39730:65b39c556c6d
   103   > def extsetup():
   103   > def extsetup():
   104   >     print("3) %s extsetup" % name)
   104   >     print("3) %s extsetup" % name)
   105   > def reposetup(ui, repo):
   105   > def reposetup(ui, repo):
   106   >    print("4) %s reposetup" % name)
   106   >    print("4) %s reposetup" % name)
   107   > 
   107   > 
       
   108   > bytesname = name.encode('utf-8')
   108   > # custom predicate to check registration of functions at loading
   109   > # custom predicate to check registration of functions at loading
   109   > from mercurial import (
   110   > from mercurial import (
   110   >     registrar,
   111   >     registrar,
   111   >     smartset,
   112   >     smartset,
   112   > )
   113   > )
   113   > revsetpredicate = registrar.revsetpredicate()
   114   > revsetpredicate = registrar.revsetpredicate()
   114   > @revsetpredicate(name, safe=True) # safe=True for query via hgweb
   115   > @revsetpredicate(bytesname, safe=True) # safe=True for query via hgweb
   115   > def custompredicate(repo, subset, x):
   116   > def custompredicate(repo, subset, x):
   116   >     return smartset.baseset([r for r in subset if r in {0}])
   117   >     return smartset.baseset([r for r in subset if r in {0}])
   117   > EOF
   118   > EOF
   118 
   119 
   119   $ cp foo.py bar.py
   120   $ cp foo.py bar.py