Mercurial > kallithea
changeset 8425:79ce82bdb06e stable
feeds: fix failure getting feed for Git repos (Issue #372)
GitChangeset.diff() did
return ''.join(self.repository.get_diff(...))
even though get_diff returned a string. It worked, but was unnecessary and
inefficient.
That fails in py3: get_diff returns bytes ... and iterating doesn't give
characters but integers and we would get:
TypeError: sequence item 0: expected a bytes-like object, int found
Fixed by dropping the unnecessary iteration and joining.
This function is only used for feeds statistics.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sun, 10 May 2020 20:04:17 +0200 |
parents | db9718bde286 |
children | 16389bb32f39 |
files | kallithea/lib/vcs/backends/git/changeset.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/lib/vcs/backends/git/changeset.py Sat May 09 02:49:13 2020 +0200 +++ b/kallithea/lib/vcs/backends/git/changeset.py Sun May 10 20:04:17 2020 +0200 @@ -231,9 +231,9 @@ # Only used to feed diffstat rev1 = self.parents[0] if self.parents else self.repository.EMPTY_CHANGESET rev2 = self - return b''.join(self.repository.get_diff(rev1, rev2, + return self.repository.get_diff(rev1, rev2, ignore_whitespace=ignore_whitespace, - context=context)) + context=context) def get_file_mode(self, path): """