Changeset - 14a6e9ffd9c8
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-05-10 23:13:04
marcin@python-works.com
fixed issue with web-editor that didn't preserve executable bit
after editing files
2 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/vcs/nodes.py
Show inline comments
 
@@ -415,12 +415,13 @@ class FileNode(Node):
 

	
 
    @LazyProperty
 
    def extension(self):
 
        """Returns filenode extension"""
 
        return self.name.split('.')[-1]
 

	
 
    @property
 
    def is_executable(self):
 
        """
 
        Returns ``True`` if file has executable flag turned on.
 
        """
 
        return bool(self.mode & stat.S_IXUSR)
 

	
rhodecode/model/scm.py
Show inline comments
 
@@ -514,15 +514,15 @@ class ScmModel(BaseModel):
 
        content = safe_str(content)
 
        path = safe_str(f_path)
 
        # 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,
 
        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)
 

	
 
        self.mark_for_invalidation(repo_name)
 
        self._handle_push(repo,
 
                          username=user.username,
0 comments (0 inline, 0 general)