Patchwork [4,of,4] revset: build the set from a saner source: the string module

login
register
mail settings
Submitter Augie Fackler
Date Oct. 7, 2016, 12:50 p.m.
Message ID <0c69350d0f87d3c65aa4.1475844648@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/16888/
State Superseded
Headers show

Comments

Augie Fackler - Oct. 7, 2016, 12:50 p.m.
# HG changeset patch
# User Martijn Pieters <mj@zopatista.com>
# Date 1475842953 14400
#      Fri Oct 07 08:22:33 2016 -0400
# Node ID 0c69350d0f87d3c65aa45998b24abdaf37a1772f
# Parent  24645da251e8646510978321adfa03bc47952709
revset: build the set from a saner source: the string module

Patch

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,7 @@  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'._@')
 
 # default set of valid characters for non-initial letters of symbols
 _symletters = _syminitletters | set('-/')