Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 45904:e5a0efd26f7a
config: clean up message about ignored untrusted config
The error message relied on Python's default formatting of arguments
to an Exception's constructor. Let's try to make it a little more
readable for users.
Differential Revision: https://phab.mercurial-scm.org/D9352
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 20 Nov 2020 10:31:56 -0800 |
parents | ac362d5a7893 |
children | 9dc1351d0b5f |
comparison
equal
deleted
inserted
replaced
45903:c9b14c56fc2b | 45904:e5a0efd26f7a |
---|---|
467 try: | 467 try: |
468 cfg.read(filename, fp, sections=sections, remap=remap) | 468 cfg.read(filename, fp, sections=sections, remap=remap) |
469 except error.ParseError as inst: | 469 except error.ParseError as inst: |
470 if trusted: | 470 if trusted: |
471 raise | 471 raise |
472 self.warn(_(b'ignored: %s\n') % stringutil.forcebytestr(inst)) | 472 self.warn( |
473 _(b'ignored %s: %s\n') % (inst.location, inst.message) | |
474 ) | |
473 | 475 |
474 self._applyconfig(cfg, trusted, root) | 476 self._applyconfig(cfg, trusted, root) |
475 | 477 |
476 def applyconfig(self, configitems, source=b"", root=None): | 478 def applyconfig(self, configitems, source=b"", root=None): |
477 """Add configitems from a non-file source. Unlike with ``setconfig()``, | 479 """Add configitems from a non-file source. Unlike with ``setconfig()``, |