Changeset - 2978928a95ea
[Not reviewed]
default
0 1 0
Sean Farley - 11 years ago 2014-07-15 04:52:46
sean.michael.farley@gmail.com
changeset: add successors method for hg backend
1 file changed with 11 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -16,6 +16,7 @@ from kallithea.lib.vcs.utils.lazy import
 
from kallithea.lib.vcs.utils.paths import get_dirs_for_path
 
from kallithea.lib.vcs.utils.hgcompat import archival, hex
 

	
 
from mercurial import obsolete
 

	
 
class MercurialChangeset(BaseChangeset):
 
    """
 
@@ -47,6 +48,16 @@ class MercurialChangeset(BaseChangeset):
 
        return  self._ctx.obsolete()
 

	
 
    @LazyProperty
 
    def successors(self):
 
        successors = obsolete.successorssets(self._ctx._repo, self._ctx.node())
 
        if successors:
 
            # flatten the list here handles both divergent (len > 1)
 
            # and the usual case (len = 1)
 
            successors = [hex(n)[:12] for sub in successors for n in sub if n != self._ctx.node()]
 

	
 
        return successors
 

	
 
    @LazyProperty
 
    def bookmarks(self):
 
        return map(safe_unicode, self._ctx.bookmarks())
 

	
0 comments (0 inline, 0 general)