mercurial/wireproto.py
changeset 29590 84c1a5942f1d
parent 29341 0d83ad967bf8
child 29706 7f6130c7ffe1
--- a/mercurial/wireproto.py	Thu Jul 14 19:16:46 2016 -0700
+++ b/mercurial/wireproto.py	Fri Jul 15 13:41:34 2016 -0700
@@ -536,8 +536,17 @@
     def __init__(self, message):
         self.message = message
 
+def getdispatchrepo(repo, proto, command):
+    """Obtain the repo used for processing wire protocol commands.
+
+    The intent of this function is to serve as a monkeypatch point for
+    extensions that need commands to operate on different repo views under
+    specialized circumstances.
+    """
+    return repo.filtered('served')
+
 def dispatch(repo, proto, command):
-    repo = repo.filtered("served")
+    repo = getdispatchrepo(repo, proto, command)
     func, spec = commands[command]
     args = proto.getargs(spec)
     return func(repo, proto, *args)