# HG changeset patch # User Sandu Turcan # Date 2019-04-30 18:36:46 # Node ID 01e4dac7c538c648f298e04b34b25656b53be3b4 # Parent a7895869c3b92f329b9f24368c0ffd3ff6d7afb3 Future proof path permissions for Mercurial 5.0 diff --git a/rhodecode/lib/vcs/backends/hg/repository.py b/rhodecode/lib/vcs/backends/hg/repository.py --- a/rhodecode/lib/vcs/backends/hg/repository.py +++ b/rhodecode/lib/vcs/backends/hg/repository.py @@ -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: