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.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
tests/test-config.t | ||
---|---|---|
478–479 | good catch, it should. (dropped in latest version). |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/ui.py (13 lines) | |||
M | tests/test-config.t (14 lines) |
): | ): | ||||
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?