From patchwork Mon Feb 12 20:03:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2190: narrowspec: document constraints when validating patterns From: phabricator X-Patchwork-Id: 27684 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 12 Feb 2018 20:03:31 +0000 durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2190 AFFECTED FILES hgext/narrow/narrowspec.py CHANGE DETAILS To: durin42, #hg-reviewers Cc: mercurial-devel diff --git a/hgext/narrow/narrowspec.py b/hgext/narrow/narrowspec.py --- a/hgext/narrow/narrowspec.py +++ b/hgext/narrow/narrowspec.py @@ -83,7 +83,11 @@ return len((s + 'x').splitlines()) def _validatepattern(pat): - """Validates the pattern and aborts if it is invalid.""" + """Validates the pattern and aborts if it is invalid. + + Patterns are stored in the narrowspec as newline-separated + POSIX-style bytestring paths. There's no escaping. + """ # We use newlines as separators in the narrowspec file, so don't allow them # in patterns.