Changeset - 3bfd5852c218
[Not reviewed]
beta
0 4 0
Marcin Kuzminski - 13 years ago 2012-11-14 21:44:47
marcin@python-works.com
implements #649 added two seperate method for author and commiter to VCS changeset class
- switch author for git backed to be the real author not commiter
4 files changed with 36 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/vcs/backends/base.py
Show inline comments
 
@@ -432,6 +432,30 @@ class BaseChangeset(object):
 
        raise NotImplementedError
 

	
 
    @LazyProperty
 
    def commiter(self):
 
        """
 
        Returns Commiter for given commit
 
        """
 

	
 
        raise NotImplementedError
 

	
 
    @LazyProperty
 
    def commiter_name(self):
 
        """
 
        Returns Author name for given commit
 
        """
 

	
 
        return author_name(self.commiter)
 

	
 
    @LazyProperty
 
    def commiter_email(self):
 
        """
 
        Returns Author email address for given commit
 
        """
 

	
 
        return author_email(self.commiter)
 

	
 
    @LazyProperty
 
    def author(self):
 
        """
 
        Returns Author for given commit
rhodecode/lib/vcs/backends/git/changeset.py
Show inline comments
 
@@ -41,6 +41,7 @@ class GitChangeset(BaseChangeset):
 

	
 
        self._tree_id = commit.tree
 
        self._commiter_property = 'committer'
 
        self._author_property = 'author'
 
        self._date_property = 'commit_time'
 
        self._date_tz_property = 'commit_timezone'
 
        self.revision = repository.revisions.index(revision)
 
@@ -51,8 +52,12 @@ class GitChangeset(BaseChangeset):
 
        self._paths = {}
 

	
 
    @LazyProperty
 
    def commiter(self):
 
        return safe_unicode(getattr(self._commit, self._commiter_property))
 

	
 
    @LazyProperty
 
    def author(self):
 
        return safe_unicode(getattr(self._commit, self._commiter_property))
 
        return safe_unicode(getattr(self._commit, self._author_property))
 

	
 
    @LazyProperty
 
    def date(self):
rhodecode/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -44,6 +44,10 @@ class MercurialChangeset(BaseChangeset):
 
        return safe_unicode(self._ctx.description())
 

	
 
    @LazyProperty
 
    def commiter(self):
 
        return safe_unicode(self.auhtor)
 

	
 
    @LazyProperty
 
    def author(self):
 
        return safe_unicode(self._ctx.user())
 

	
rhodecode/lib/vcs/nodes.py
Show inline comments
 
@@ -353,6 +353,7 @@ class FileNode(Node):
 

	
 
    @LazyProperty
 
    def mimetype_main(self):
 
        return ['', '']
 
        return self.mimetype.split('/')[0]
 

	
 
    @LazyProperty
 
@@ -410,6 +411,7 @@ class FileNode(Node):
 
        """
 
        Returns True if file has binary content.
 
        """
 
        return False
 
        _bin = '\0' in self._get_content()
 
        return _bin
 

	
0 comments (0 inline, 0 general)