diff 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
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Wed Dec 29 14:19:31 2010 -0600
+++ b/mercurial/hgweb/hgwebdir_mod.py	Wed Dec 29 15:23:16 2010 -0600
@@ -64,6 +64,8 @@
 
         if not isinstance(self.conf, (dict, list, tuple)):
             map = {'paths': 'hgweb-paths'}
+            if not os.path.exists(self.conf):
+                raise util.Abort(_('config file %s not found!') % self.conf)
             u.readconfig(self.conf, remap=map, trust=True)
             paths = u.configitems('hgweb-paths')
         elif isinstance(self.conf, (list, tuple)):