Changeset - 79ca7a9fdb6e
[Not reviewed]
default
0 1 0
Mads Kiilerich (mads) - 6 years ago 2019-12-26 06:02:37
mads@kiilerich.com
Grafted from: 489e8ae6cd7c
vcs: refactor processing of run_git_command output for GitChangeset.children
1 file changed with 6 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/git/changeset.py
Show inline comments
 
@@ -194,20 +194,18 @@ class GitChangeset(BaseChangeset):
 
        Returns list of children changesets.
 
        """
 
        rev_filter = settings.GIT_REV_FILTER
 
        so, se = self.repository.run_git_command(
 
            ['rev-list', rev_filter, '--children']
 
        )
 

	
 
        children = []
 
        pat = re.compile(r'^%s' % self.raw_id)
 
        for l in so.splitlines():
 
            if pat.match(l):
 
                childs = l.split(' ')[1:]
 
                children.extend(childs)
 
        return [self.repository.get_changeset(cs) for cs in children]
 
        return [
 
            self.repository.get_changeset(cs)
 
            for parts in (l.split(' ') for l in so.splitlines())
 
            if parts[0] == self.raw_id
 
            for cs in parts[1:]
 
        ]
 

	
 
    def next(self, branch=None):
 
        if branch and self.branch != branch:
 
            raise VCSError('Branch option used on changeset not belonging '
 
                           'to that branch')
 

	
0 comments (0 inline, 0 general)