Changeset - 0c58b6dc5512
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 11 years ago 2015-05-04 18:47:16
thomas.de.schampheleire@gmail.com
hg: show code function in diffs

Just like already done for git diffs, show the function containing the
change in the hunk header of a diff, if available:

@@ -19,7 +19,7 @@ int func(void)

instead of

@@ -19,7 +19,7 @@
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/repository.py
Show inline comments
 
@@ -255,24 +255,25 @@ class MercurialRepository(BaseRepository
 
        # Check if given revisions are present at repository (may raise
 
        # ChangesetDoesNotExistError)
 
        if rev1 != self.EMPTY_CHANGESET:
 
            self.get_changeset(rev1)
 
        self.get_changeset(rev2)
 
        if path:
 
            file_filter = match(self.path, '', [path])
 
        else:
 
            file_filter = None
 

	
 
        return ''.join(patch.diff(self._repo, rev1, rev2, match=file_filter,
 
                          opts=diffopts(git=True,
 
                                        showfunc=True,
 
                                        ignorews=ignore_whitespace,
 
                                        context=context)))
 

	
 
    @classmethod
 
    def _check_url(cls, url, repoui=None):
 
        """
 
        Function will check given url and try to verify if it's a valid
 
        link. Sometimes it may happened that mercurial will issue basic
 
        auth request that can cause whole API to hang when used from python
 
        or other external calls.
 

	
 
        On failures it'll raise urllib2.HTTPError, exception is also thrown
0 comments (0 inline, 0 general)