Patchwork [4,of,9] config: use util.re.compile instead of util.compilere

login
register
mail settings
Submitter Siddharth Agarwal
Date July 15, 2014, 11:15 p.m.
Message ID <77c9787ec0c3e41fe96c.1405466126@dev1738.prn1.facebook.com>
Download mbox | patch
Permalink /patch/5174/
State Accepted
Commit fc04fdb2b349c15c87a9e8df15a3ffaaf96a387e
Headers show

Comments

Siddharth Agarwal - July 15, 2014, 11:15 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1405461058 25200
#      Tue Jul 15 14:50:58 2014 -0700
# Node ID 77c9787ec0c3e41fe96c7e63d70187d6558f60dd
# Parent  3acefc9f215f34f9a7684da38b7452afe0781d2d
config: use util.re.compile instead of util.compilere

Patch

diff --git a/mercurial/config.py b/mercurial/config.py
--- a/mercurial/config.py
+++ b/mercurial/config.py
@@ -80,13 +80,13 @@ 
             self._source.pop((section, item), None)
 
     def parse(self, src, data, sections=None, remap=None, include=None):
-        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*$')
+        sectionre = util.re.compile(r'\[([^\[]+)\]')
+        itemre = util.re.compile(r'([^=\s][^=]*?)\s*=\s*(.*\S|)')
+        contre = util.re.compile(r'\s+(\S|\S.*\S)\s*$')
+        emptyre = util.re.compile(r'(;|#|\s*$)')
+        commentre = util.re.compile(r'(;|#)')
+        unsetre = util.re.compile(r'%unset\s+(\S+)')
+        includere = util.re.compile(r'%include\s+(\S|\S.*\S)\s*$')
         section = ""
         item = None
         line = 0