Mercurial > kallithea
changeset 2983:6d7f88566127 beta
Added children function for VCS for mercurial backend
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 04 Nov 2012 14:55:13 +0100 |
parents | 78227b65a358 |
children | 5e1dadbc6f46 |
files | rhodecode/lib/vcs/backends/base.py rhodecode/lib/vcs/backends/hg/changeset.py |
diffstat | 2 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/vcs/backends/base.py Sun Nov 04 14:54:30 2012 +0100 +++ b/rhodecode/lib/vcs/backends/base.py Sun Nov 04 14:55:13 2012 +0100 @@ -395,6 +395,13 @@ raise NotImplementedError @LazyProperty + def children(self): + """ + Returns list of children changesets. + """ + raise NotImplementedError + + @LazyProperty def id(self): """ Returns string identifying this changeset.
--- a/rhodecode/lib/vcs/backends/hg/changeset.py Sun Nov 04 14:54:30 2012 +0100 +++ b/rhodecode/lib/vcs/backends/hg/changeset.py Sun Nov 04 14:55:13 2012 +0100 @@ -95,6 +95,14 @@ return [self.repository.get_changeset(parent.rev()) for parent in self._ctx.parents() if parent.rev() >= 0] + @LazyProperty + def children(self): + """ + Returns list of children changesets. + """ + return [self.repository.get_changeset(child.rev()) + for child in self._ctx.children() if child.rev() >= 0] + def next(self, branch=None): if branch and self.branch != branch: