diff tests/test-wireproto.py @ 41840:d6569f1e9b37

server: allow customizing the default repo filter hgweb has the (undocument) configuration option web.view that allows restricting visible revisions to immutable. This is useful for serving the same storage as publishing and non-publishing repo. Add the new server.view option to serve the same purpose by changing the default behavior of `getdispatchrepo`. Drop the hard-coded 'served' filter in the batch handler of v1 of the wire proto, this is a left-over from the days before `getdispatchrepo` existed. Differential Revision: https://phab.mercurial-scm.org/D5946
author Joerg Sonnenberger <joerg@bec.de>
date Tue, 12 Feb 2019 19:08:17 +0100
parents 32bc3815efae
children 2372284d9457
line wrap: on
line diff
--- a/tests/test-wireproto.py	Sat Mar 02 05:24:35 2019 +0530
+++ b/tests/test-wireproto.py	Tue Feb 12 19:08:17 2019 +0100
@@ -78,6 +78,9 @@
         yield unmangle(f.value)
 
 class serverrepo(object):
+    def __init__(self, ui):
+        self.ui = ui
+
     def greet(self, name):
         return b"Hello, " + name
 
@@ -94,7 +97,7 @@
 
 wireprotov1server.commands[b'greet'] = (greet, b'name')
 
-srv = serverrepo()
+srv = serverrepo(uimod.ui())
 clt = clientpeer(srv, uimod.ui())
 
 def printb(data, end=b'\n'):