From patchwork Fri Oct 7 15:21:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4, of, 4, v2] revset: build the set from a saner source: the string module From: Augie Fackler X-Patchwork-Id: 16899 Message-Id: <27d370e08f7ed5311a67.1475853702@augie-macbookair2.roam.corp.google.com> To: mercurial-devel@mercurial-scm.org Date: Fri, 07 Oct 2016 11:21:42 -0400 # HG changeset patch # User Martijn Pieters # Date 1475842953 14400 # Fri Oct 07 08:22:33 2016 -0400 # Node ID 27d370e08f7ed5311a6708a69dc86754f31e8228 # Parent 1eeb40b50d3129e5ef6b05709c5a41932a4371fb revset: build the set from a saner source: the string module diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -9,6 +9,7 @@ from __future__ import absolute_import import heapq import re +import string from .i18n import _ from . import ( @@ -173,8 +174,8 @@ elements = { keywords = set(['and', 'or', 'not']) # default set of valid characters for the initial letter of symbols -_syminitletters = set(c for c in [chr(i) for i in xrange(256)] - if c.isalnum() or c in '._@' or ord(c) > 127) +_syminitletters = set(string.ascii_letters + string.digits + u'._@') | set( + map(chr, xrange(128, 256))) # default set of valid characters for non-initial letters of symbols _symletters = _syminitletters | set(u'-/')