Patchwork [1,of,2] narrowspec: remove parseserverpatterns() which isn't used anymore

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 12, 2018, 1:31 p.m.
Message ID <c8ea5c7ec99d1ca4f349.1536759073@mimosa>
Download mbox | patch
Permalink /patch/34537/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 12, 2018, 1:31 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1536758143 -32400
#      Wed Sep 12 22:15:43 2018 +0900
# Node ID c8ea5c7ec99d1ca4f349025c236c768081dd5084
# Parent  cb675e95a2c2d6b248a9deb459aa7e75edb649a7
narrowspec: remove parseserverpatterns() which isn't used anymore

Follows up 10a8472f6662, "narrow: drop support for remote expansion."
Pulkit Goyal - Sept. 12, 2018, 1:44 p.m.
On Wed, Sep 12, 2018 at 4:32 PM Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1536758143 -32400
> #      Wed Sep 12 22:15:43 2018 +0900
> # Node ID c8ea5c7ec99d1ca4f349025c236c768081dd5084
> # Parent  cb675e95a2c2d6b248a9deb459aa7e75edb649a7
> narrowspec: remove parseserverpatterns() which isn't used anymore
>
> Follows up 10a8472f6662, "narrow: drop support for remote expansion."
>

Queued this series, many thanks!

Patch

diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -29,27 +29,6 @@  VALID_PREFIXES = (
     b'rootfilesin:',
 )
 
-def parseserverpatterns(text):
-    """Parses the narrowspec format that's returned by the server."""
-    includepats = set()
-    excludepats = set()
-
-    # We get one entry per line, in the format "<key> <value>".
-    # It's OK for value to contain other spaces.
-    for kp in (l.split(' ', 1) for l in text.splitlines()):
-        if len(kp) != 2:
-            raise error.Abort(_('Invalid narrowspec pattern line: "%s"') % kp)
-        key = kp[0]
-        pat = kp[1]
-        if key == 'include':
-            includepats.add(pat)
-        elif key == 'exclude':
-            excludepats.add(pat)
-        else:
-            raise error.Abort(_('Invalid key "%s" in server response') % key)
-
-    return includepats, excludepats
-
 def normalizesplitpattern(kind, pat):
     """Returns the normalized version of a pattern and kind.