comparison mercurial/config.py @ 14486:4e3eda05189b

config: ignore include errors for nonexistent files
author Matt Mackall <mpm@selenic.com>
date Tue, 31 May 2011 16:00:39 -0500
parents 53db4e2026ab
children fdcdb221a922
comparison
equal deleted inserted replaced
14485:610873cf064a 14486:4e3eda05189b
5 # This software may be used and distributed according to the terms of the 5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version. 6 # GNU General Public License version 2 or any later version.
7 7
8 from i18n import _ 8 from i18n import _
9 import error, util 9 import error, util
10 import re, os 10 import re, os, errno
11 11
12 class sortdict(dict): 12 class sortdict(dict):
13 'a simple sorted dictionary' 13 'a simple sorted dictionary'
14 def __init__(self, data=None): 14 def __init__(self, data=None):
15 self._list = [] 15 self._list = []
101 inc = os.path.normpath(os.path.join(base, inc)) 101 inc = os.path.normpath(os.path.join(base, inc))
102 if include: 102 if include:
103 try: 103 try:
104 include(inc, remap=remap, sections=sections) 104 include(inc, remap=remap, sections=sections)
105 except IOError, inst: 105 except IOError, inst:
106 raise error.ParseError(_("cannot include %s (%s)") 106 if inst.errno != errno.ENOENT:
107 % (inc, inst.strerror), 107 raise error.ParseError(_("cannot include %s (%s)")
108 "%s:%s" % (src, line)) 108 % (inc, inst.strerror),
109 "%s:%s" % (src, line))
109 continue 110 continue
110 if emptyre.match(l): 111 if emptyre.match(l):
111 continue 112 continue
112 m = sectionre.match(l) 113 m = sectionre.match(l)
113 if m: 114 if m: