##// END OF EJS Templates
path-permissions: Throw RepositoryRequirementError is hgacl cannot be read
idlsoft -
r2622:e5345aa5 default
parent child Browse files
Show More
@@ -35,7 +35,7 b' from rhodecode.lib.datelib import ('
35 date_to_timestamp_plus_offset, utcdate_fromtimestamp, makedate,
35 date_to_timestamp_plus_offset, utcdate_fromtimestamp, makedate,
36 date_astimestamp)
36 date_astimestamp)
37 from rhodecode.lib.utils import safe_unicode, safe_str
37 from rhodecode.lib.utils import safe_unicode, safe_str
38 from rhodecode.lib.vcs import connection
38 from rhodecode.lib.vcs import connection, exceptions
39 from rhodecode.lib.vcs.backends.base import (
39 from rhodecode.lib.vcs.backends.base import (
40 BaseRepository, CollectionGenerator, Config, MergeResponse,
40 BaseRepository, CollectionGenerator, Config, MergeResponse,
41 MergeFailureReason, Reference, BasePathPermissionChecker)
41 MergeFailureReason, Reference, BasePathPermissionChecker)
@@ -894,6 +894,7 b' class MercurialRepository(BaseRepository'
894 def get_path_permissions(self, username):
894 def get_path_permissions(self, username):
895 hgacl_file = self.path + '/.hg/hgacl'
895 hgacl_file = self.path + '/.hg/hgacl'
896 if os.path.exists(hgacl_file):
896 if os.path.exists(hgacl_file):
897 try:
897 hgacl = ConfigParser.RawConfigParser()
898 hgacl = ConfigParser.RawConfigParser()
898 hgacl.read(hgacl_file)
899 hgacl.read(hgacl_file)
899 def read_patterns(suffix):
900 def read_patterns(suffix):
@@ -916,6 +917,8 b' class MercurialRepository(BaseRepository'
916 includes = read_patterns('.includes')
917 includes = read_patterns('.includes')
917 excludes = read_patterns('.excludes')
918 excludes = read_patterns('.excludes')
918 return BasePathPermissionChecker.create_from_patterns(includes, excludes)
919 return BasePathPermissionChecker.create_from_patterns(includes, excludes)
920 except BaseException as e:
921 raise exceptions.RepositoryRequirementError('Cannot read ACL settings for {}: {}'.format(self.name, e))
919 else:
922 else:
920 return None
923 return None
921
924
General Comments 0
You need to be logged in to leave comments. Login now