Future proof path permissions for Mercurial 5.0

This commit is contained in:
Sandu Turcan 2019-04-30 14:36:46 -04:00
parent 337f4d617c
commit f3b08aa126

View file

@ -897,11 +897,15 @@ class MercurialRepository(BaseRepository):
def read_patterns(suffix):
svalue = None
try:
svalue = hgacl.get('narrowhgacl', username + suffix)
except configparser.NoOptionError:
for section, option in [
('narrowacl', username + suffix),
('narrowacl', 'default' + suffix),
('narrowhgacl', username + suffix),
('narrowhgacl', 'default' + suffix)
]:
try:
svalue = hgacl.get('narrowhgacl', 'default' + suffix)
svalue = hgacl.get(section, option)
break # stop at the first value we find
except configparser.NoOptionError:
pass
if not svalue: