comparison rhodecode/lib/vcs/backends/git/changeset.py @ 3077:6d599a3c0d67 beta

implemented children for git changesets
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 08 Dec 2012 01:41:34 +0100
parents 79c5967a1e5c
children e67b2ef07a8e
comparison
equal deleted inserted replaced
3076:5deb16cd2802 3077:6d599a3c0d67
177 """ 177 """
178 Returns list of parents changesets. 178 Returns list of parents changesets.
179 """ 179 """
180 return [self.repository.get_changeset(parent) 180 return [self.repository.get_changeset(parent)
181 for parent in self._commit.parents] 181 for parent in self._commit.parents]
182
183 @LazyProperty
184 def children(self):
185 """
186 Returns list of children changesets.
187 """
188 so, se = self.repository.run_git_command(
189 "rev-list --all --children | grep '^%s'" % self.raw_id
190 )
191
192 children = []
193 for l in so.splitlines():
194 childs = l.split(' ')[1:]
195 children.extend(childs)
196 return [self.repository.get_changeset(cs) for cs in children]
182 197
183 def next(self, branch=None): 198 def next(self, branch=None):
184 199
185 if branch and self.branch != branch: 200 if branch and self.branch != branch:
186 raise VCSError('Branch option used on changeset not belonging ' 201 raise VCSError('Branch option used on changeset not belonging '