diff --git a/rhodecode/model/scm.py b/rhodecode/model/scm.py --- a/rhodecode/model/scm.py +++ b/rhodecode/model/scm.py @@ -35,7 +35,7 @@ from rhodecode.lib.vcs.nodes import File from rhodecode import BACKENDS from rhodecode.lib import helpers as h -from rhodecode.lib.utils2 import safe_str +from rhodecode.lib.utils2 import safe_str, safe_unicode from rhodecode.lib.auth import HasRepoPermissionAny, HasReposGroupPermissionAny from rhodecode.lib.utils import get_repos as get_filesystem_repos, make_ui, \ action_logger, EmptyChangeset, REMOVED_REPO_PAT @@ -369,14 +369,16 @@ class ScmModel(BaseModel): # decoding here will force that we have proper encoded values # in any other case this will throw exceptions and deny commit content = safe_str(content) - message = safe_str(message) path = safe_str(f_path) - author = safe_str(author) + # message and author needs to be unicode + # proper backend should then translate that into required type + message = safe_unicode(message) + author = safe_unicode(author) m = IMC(repo) m.change(FileNode(path, content)) tip = m.commit(message=message, - author=author, - parents=[cs], branch=cs.branch) + author=author, + parents=[cs], branch=cs.branch) new_cs = tip.short_id action = 'push_local:%s' % new_cs @@ -403,21 +405,21 @@ class ScmModel(BaseModel): type(content) )) - message = safe_str(message) + message = safe_unicode(message) + author = safe_unicode(author) path = safe_str(f_path) - author = safe_str(author) m = IMC(repo) if isinstance(cs, EmptyChangeset): - # Emptychangeset means we we're editing empty repository + # EmptyChangeset means we we're editing empty repository parents = None else: parents = [cs] m.add(FileNode(path, content=content)) tip = m.commit(message=message, - author=author, - parents=parents, branch=cs.branch) + author=author, + parents=parents, branch=cs.branch) new_cs = tip.short_id action = 'push_local:%s' % new_cs