fix(encoding for file): fixed support of non utf-8 files in all backends

This commit is contained in:
RhodeCode Admin 2024-11-27 19:35:02 +01:00
parent f687bfc994
commit d08633d220
42 changed files with 2001 additions and 1973 deletions

View file

@ -19,6 +19,7 @@
import pytest
from rhodecode.lib.str_utils import safe_str
from rhodecode.model.db import User, ChangesetComment
from rhodecode.model.meta import Session
from rhodecode.model.comment import CommentsModel
@ -36,7 +37,7 @@ def make_repo_comments_factory(request):
commit = repo.scm_instance()[0]
commit_id = commit.raw_id
file_0 = commit.affected_files[0]
file_0 = safe_str(commit.affected_files[0])
comments = []
# general

View file

@ -317,8 +317,7 @@ def get_repo_changeset(request, apiuser, repoid, revision,
','.join(_changes_details_types)))
vcs_repo = repo.scm_instance()
pre_load = ['author', 'branch', 'date', 'message', 'parents',
'status', '_commit', '_file_paths']
pre_load = ['author', 'branch', 'date', 'message', 'parents', 'status', '_commit']
try:
commit = repo.get_commit(commit_id=revision, pre_load=pre_load)
@ -376,8 +375,7 @@ def get_repo_changesets(request, apiuser, repoid, start_rev, limit,
','.join(_changes_details_types)))
limit = int(limit)
pre_load = ['author', 'branch', 'date', 'message', 'parents',
'status', '_commit', '_file_paths']
pre_load = ['author', 'branch', 'date', 'message', 'parents', 'status', '_commit']
vcs_repo = repo.scm_instance()
# SVN needs a special case to distinguish its index and commit id