diff mercurial/narrowspec.py @ 39811:ae20f52437e9

wireprotov2: advertise recognized path filter prefixes While the wire protocol doesn't yet support it, we'll eventually have commands that accept narrow patterns to specify the set of files relevant to a command. For security and performance reasons, only specific filter types are allowed. This commit teaches the server to advertise the set of allowed filter types. By doing so, clients can e.g. validate user-specified patterns against the server's abilities without having to send a command to retrieve data. Having the data in the capabilities data structure will also serve as a check against unwanted BC. Differential Revision: https://phab.mercurial-scm.org/D4616
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 17 Sep 2018 09:49:28 -0700
parents c8ea5c7ec99d
children efd0f79246e3
line wrap: on
line diff
--- a/mercurial/narrowspec.py	Thu Aug 30 17:43:47 2018 -0700
+++ b/mercurial/narrowspec.py	Mon Sep 17 09:49:28 2018 -0700
@@ -23,7 +23,9 @@
 # Pattern prefixes that are allowed in narrow patterns. This list MUST
 # only contain patterns that are fast and safe to evaluate. Keep in mind
 # that patterns are supplied by clients and executed on remote servers
-# as part of wire protocol commands.
+# as part of wire protocol commands. That means that changes to this
+# data structure influence the wire protocol and should not be taken
+# lightly - especially removals.
 VALID_PREFIXES = (
     b'path:',
     b'rootfilesin:',