changeset 6198:89a548ea164b

utils: when building a Mercurial ui object with configuration, don't use 'None' for NULL values If Ui had an entry with ui_section='extensions', ui_key='largefiles', ui_value=NULL it would be passed to Mercurial as if the .ini file had [extensions] largefiles = None and it would fail to load the largefiles extension because it couldn't find './None/'. Note: get_current_revision might currently mask this problem. It will not get the Ui from the database and will thus read a normal .ini file from the system and (if configured) read the largefiles extension from the default location. That will make the largefiles extension available for later largefiles imports even if they specify the bogus path. As f8a714c2c5a1 noted in a FIXME: ui_value should perhaps not be nullable. For now, just handle NULL in extension configuration.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 12 Sep 2016 17:41:19 +0200
parents 9a523af15c9f
children 07893d0f34fd
files kallithea/lib/utils.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/utils.py	Mon Sep 12 17:41:19 2016 +0200
+++ b/kallithea/lib/utils.py	Mon Sep 12 17:41:19 2016 +0200
@@ -358,8 +358,8 @@
         hg_ui = ret
         for ui_ in hg_ui:
             if ui_.ui_active:
-                ui_val = safe_str(ui_.ui_value)
-                log.debug('settings ui from db: [%s] %s=%s', ui_.ui_section,
+                ui_val = '' if ui_.ui_value is None else safe_str(ui_.ui_value)
+                log.debug('settings ui from db: [%s] %s=%r', ui_.ui_section,
                           ui_.ui_key, ui_val)
                 baseui.setconfig(safe_str(ui_.ui_section), safe_str(ui_.ui_key),
                                  ui_val)