comparison mercurial/ui.py @ 34858:85a2db47ad50

configitems: adds a developer warning when accessing undeclared configuration Now that all known options are declared, we setup a warning to make sure it will stay this way. We disable the warning in two tests checking other behavior with random options.
author Boris Feld <boris.feld@octobus.net>
date Mon, 16 Oct 2017 17:41:27 +0200
parents 9f2891fb426c
children e9f320a40b44
comparison
equal deleted inserted replaced
34857:84c6b9384d6a 34858:85a2db47ad50
475 item = self._knownconfig.get(section, {}).get(name) 475 item = self._knownconfig.get(section, {}).get(name)
476 alternates = [(section, name)] 476 alternates = [(section, name)]
477 477
478 if item is not None: 478 if item is not None:
479 alternates.extend(item.alias) 479 alternates.extend(item.alias)
480 else:
481 msg = ("accessing unregistered config item: '%s.%s'")
482 msg %= (section, name)
483 self.develwarn(msg, 2, 'warn-config-unknown')
480 484
481 if default is _unset: 485 if default is _unset:
482 if item is None: 486 if item is None:
483 value = default 487 value = default
484 elif item.default is configitems.dynamicdefault: 488 elif item.default is configitems.dynamicdefault: