comparison mercurial/hgweb/hgwebdir_mod.py @ 13214:5bcb6c9d16db stable

hgweb: abort if config file isn't found
author Matt Mackall <mpm@selenic.com>
date Wed, 29 Dec 2010 15:23:16 -0600
parents 86888ae9ce90
children f947d9a4c45c
comparison
equal deleted inserted replaced
13212:5d0a30fad7de 13214:5bcb6c9d16db
62 u.setconfig('ui', 'report_untrusted', 'off') 62 u.setconfig('ui', 'report_untrusted', 'off')
63 u.setconfig('ui', 'interactive', 'off') 63 u.setconfig('ui', 'interactive', 'off')
64 64
65 if not isinstance(self.conf, (dict, list, tuple)): 65 if not isinstance(self.conf, (dict, list, tuple)):
66 map = {'paths': 'hgweb-paths'} 66 map = {'paths': 'hgweb-paths'}
67 if not os.path.exists(self.conf):
68 raise util.Abort(_('config file %s not found!') % self.conf)
67 u.readconfig(self.conf, remap=map, trust=True) 69 u.readconfig(self.conf, remap=map, trust=True)
68 paths = u.configitems('hgweb-paths') 70 paths = u.configitems('hgweb-paths')
69 elif isinstance(self.conf, (list, tuple)): 71 elif isinstance(self.conf, (list, tuple)):
70 paths = self.conf 72 paths = self.conf
71 elif isinstance(self.conf, dict): 73 elif isinstance(self.conf, dict):