# HG changeset patch # User Marcin Kuzminski # Date 2013-05-10 23:13:04 # Node ID 14a6e9ffd9c8af65662822340150b18aff0c7686 # Parent 42981614c6249ff192204dccd44b46b701d79222 fixed issue with web-editor that didn't preserve executable bit after editing files diff --git a/rhodecode/lib/vcs/nodes.py b/rhodecode/lib/vcs/nodes.py --- a/rhodecode/lib/vcs/nodes.py +++ b/rhodecode/lib/vcs/nodes.py @@ -418,6 +418,7 @@ class FileNode(Node): """Returns filenode extension""" return self.name.split('.')[-1] + @property def is_executable(self): """ Returns ``True`` if file has executable flag turned on. diff --git a/rhodecode/model/scm.py b/rhodecode/model/scm.py --- a/rhodecode/model/scm.py +++ b/rhodecode/model/scm.py @@ -517,9 +517,9 @@ class ScmModel(BaseModel): # 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, + imc = IMC(repo) + imc.change(FileNode(path, content, mode=cs.get_file_mode(f_path))) + tip = imc.commit(message=message, author=author, parents=[cs], branch=cs.branch)