A higher priority alias will now take precedence over lower priority ones.
This was a requirements step before using alias more widely, especially to
rename existing and established config option.
Alphare | |
pulkit |
hg-reviewers |
A higher priority alias will now take precedence over lower priority ones.
This was a requirements step before using alias more widely, especially to
rename existing and established config option.
No Linters Available |
No Unit Test Coverage |
tests/test-config.t | ||
---|---|---|
476–477 | good catch, it should. (dropped in latest version). |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/ui.py (13 lines) | |||
M | tests/test-config.t (14 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
c12f4b8492fe | bb2b36f19ece | Pierre-Yves David | Jan 29 2021, 6:17 AM |
): | ): | ||||
msg = ( | msg = ( | ||||
b"specifying a mismatched default value for a registered " | b"specifying a mismatched default value for a registered " | ||||
b"config item: '%s.%s' '%s'" | b"config item: '%s.%s' '%s'" | ||||
) | ) | ||||
msg %= (section, name, pycompat.bytestr(default)) | msg %= (section, name, pycompat.bytestr(default)) | ||||
self.develwarn(msg, 2, b'warn-config-default') | self.develwarn(msg, 2, b'warn-config-default') | ||||
candidates = [] | |||||
config = self._data(untrusted) | |||||
for s, n in alternates: | for s, n in alternates: | ||||
candidate = self._data(untrusted).get(s, n, None) | candidate = config.get(s, n, None) | ||||
if candidate is not None: | if candidate is not None: | ||||
value = candidate | candidates.append((s, n, candidate)) | ||||
break | if candidates: | ||||
def level(x): | |||||
return config.level(x[0], x[1]) | |||||
value = max(candidates, key=level)[2] | |||||
if self.debugflag and not untrusted and self._reportuntrusted: | if self.debugflag and not untrusted and self._reportuntrusted: | ||||
for s, n in alternates: | for s, n in alternates: | ||||
uvalue = self._ucfg.get(s, n) | uvalue = self._ucfg.get(s, n) | ||||
if uvalue is not None and uvalue != value: | if uvalue is not None and uvalue != value: | ||||
self.debug( | self.debug( | ||||
b"ignoring untrusted configuration option " | b"ignoring untrusted configuration option " | ||||
b"%s.%s = %s\n" % (s, n, uvalue) | b"%s.%s = %s\n" % (s, n, uvalue) |
Should this comment be dropped now?