Changeset - b6b3c6dc49aa
[Not reviewed]
default
0 1 0
Mads Kiilerich - 7 years ago 2018-08-05 23:16:23
mads@kiilerich.com
hg: don't use custom diff arguments when generating diffstats for rss feed

With Mercurial 4.7, it is no longer possible to pass arguments like `git=True`
to `ctx.diff()`.

This will change the reported data slightly, but the difference isn't
important. Also, the code should be refactored to do something similar to what
we do in other places.
1 file changed with 3 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -211,16 +211,15 @@ class MercurialChangeset(BaseChangeset):
 
                raise ChangesetDoesNotExistError
 
            cs = cs.repository.get_changeset(prev_rev)
 

	
 
            if not branch or branch == cs.branch:
 
                return cs
 

	
 
    def diff(self, ignore_whitespace=True, context=3):
 
        return ''.join(self._ctx.diff(git=True,
 
                                      ignore_whitespace=ignore_whitespace,
 
                                      context=context))
 
    def diff(self):
 
        # Only used for feed diffstat
 
        return ''.join(self._ctx.diff())
 

	
 
    def _fix_path(self, path):
 
        """
 
        Paths are stored without trailing slash so we need to get rid off it if
 
        needed. Also mercurial keeps filenodes as str so we need to decode
 
        from unicode to str
0 comments (0 inline, 0 general)