diff mercurial/wireprotov2server.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 e82288a9556c
children da643cadec90
line wrap: on
line diff
--- a/mercurial/wireprotov2server.py	Sat Mar 02 05:24:35 2019 +0530
+++ b/mercurial/wireprotov2server.py	Tue Feb 12 19:08:17 2019 +0100
@@ -342,7 +342,8 @@
                                      action)
 
 def getdispatchrepo(repo, proto, command):
-    return repo.filtered('served')
+    viewconfig = repo.ui.config('server', 'view')
+    return repo.filtered(viewconfig)
 
 def dispatch(repo, proto, command, redirect):
     """Run a wire protocol command.