changeset 10243:cd3e5c47d663 stable

ui: just return it if it's already a bool
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 13 Jan 2010 11:53:55 +0100
parents ecd0a5c8bbe5
children c4c0502be198 8ebb34b0f6f7
files mercurial/ui.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Wed Jan 13 11:57:32 2010 +0100
+++ b/mercurial/ui.py	Wed Jan 13 11:53:55 2010 +0100
@@ -131,6 +131,8 @@
         v = self.config(section, name, None, untrusted)
         if v is None:
             return default
+        if isinstance(v, bool):
+            return v
         if v.lower() not in _booleans:
             raise error.ConfigError(_("%s.%s not a boolean ('%s')")
                                     % (section, name, v))