Mercurial > hg-stable
changeset 16944:5d3d77b3c512
config: use util.compilere to compile regexps
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 01 Jun 2012 15:26:46 -0700 |
parents | 8d08a28aa63e |
children | 989f1e4f74c6 |
files | mercurial/config.py |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/config.py Fri Jun 01 15:26:20 2012 -0700 +++ b/mercurial/config.py Fri Jun 01 15:26:46 2012 -0700 @@ -7,7 +7,7 @@ from i18n import _ import error, util -import re, os, errno +import os, errno class sortdict(dict): 'a simple sorted dictionary' @@ -105,13 +105,13 @@ self._source.pop((section, item), None) def parse(self, src, data, sections=None, remap=None, include=None): - sectionre = re.compile(r'\[([^\[]+)\]') - itemre = re.compile(r'([^=\s][^=]*?)\s*=\s*(.*\S|)') - contre = re.compile(r'\s+(\S|\S.*\S)\s*$') - emptyre = re.compile(r'(;|#|\s*$)') - commentre = re.compile(r'(;|#)') - unsetre = re.compile(r'%unset\s+(\S+)') - includere = re.compile(r'%include\s+(\S|\S.*\S)\s*$') + sectionre = util.compilere(r'\[([^\[]+)\]') + itemre = util.compilere(r'([^=\s][^=]*?)\s*=\s*(.*\S|)') + contre = util.compilere(r'\s+(\S|\S.*\S)\s*$') + emptyre = util.compilere(r'(;|#|\s*$)') + commentre = util.compilere(r'(;|#)') + unsetre = util.compilere(r'%unset\s+(\S+)') + includere = util.compilere(r'%include\s+(\S|\S.*\S)\s*$') section = "" item = None line = 0