Mercurial > kallithea
changeset 3004:3bfd5852c218 beta
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
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 14 Nov 2012 21:44:47 +0100 |
parents | adf8ee7b8f2a |
children | 7f520c24686c |
files | rhodecode/lib/vcs/backends/base.py rhodecode/lib/vcs/backends/git/changeset.py rhodecode/lib/vcs/backends/hg/changeset.py rhodecode/lib/vcs/nodes.py |
diffstat | 4 files changed, 36 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/vcs/backends/base.py Tue Nov 13 23:52:14 2012 +0100 +++ b/rhodecode/lib/vcs/backends/base.py Wed Nov 14 21:44:47 2012 +0100 @@ -432,6 +432,30 @@ 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
--- a/rhodecode/lib/vcs/backends/git/changeset.py Tue Nov 13 23:52:14 2012 +0100 +++ b/rhodecode/lib/vcs/backends/git/changeset.py Wed Nov 14 21:44:47 2012 +0100 @@ -41,6 +41,7 @@ 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 @@ 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):
--- a/rhodecode/lib/vcs/backends/hg/changeset.py Tue Nov 13 23:52:14 2012 +0100 +++ b/rhodecode/lib/vcs/backends/hg/changeset.py Wed Nov 14 21:44:47 2012 +0100 @@ -44,6 +44,10 @@ 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())
--- a/rhodecode/lib/vcs/nodes.py Tue Nov 13 23:52:14 2012 +0100 +++ b/rhodecode/lib/vcs/nodes.py Wed Nov 14 21:44:47 2012 +0100 @@ -353,6 +353,7 @@ @LazyProperty def mimetype_main(self): + return ['', ''] return self.mimetype.split('/')[0] @LazyProperty @@ -410,6 +411,7 @@ """ Returns True if file has binary content. """ + return False _bin = '\0' in self._get_content() return _bin