##// END OF EJS Templates
config: add a function to insert non-file based, but overridable settings...
Matt Harbison -
r44585:e2278581 default
parent child Browse files
Show More
@@ -467,6 +467,25 b' class ui(object):'
467 467 raise
468 468 self.warn(_(b'ignored: %s\n') % stringutil.forcebytestr(inst))
469 469
470 self._applyconfig(cfg, trusted, root)
471
472 def applyconfig(self, configitems, source=b"", root=None):
473 """Add configitems from a non-file source. Unlike with ``setconfig()``,
474 they can be overridden by subsequent config file reads. The items are
475 in the same format as ``configoverride()``, namely a dict of the
476 following structures: {(section, name) : value}
477
478 Typically this is used by extensions that inject themselves into the
479 config file load procedure by monkeypatching ``localrepo.loadhgrc()``.
480 """
481 cfg = config.config()
482
483 for (section, name), value in configitems.items():
484 cfg.set(section, name, value, source)
485
486 self._applyconfig(cfg, True, root)
487
488 def _applyconfig(self, cfg, trusted, root):
470 489 if self.plain():
471 490 for k in (
472 491 b'debug',
General Comments 0
You need to be logged in to leave comments. Login now