diff --git a/rhodecode/lib/vcs/backends/git/changeset.py b/rhodecode/lib/vcs/backends/git/changeset.py --- a/rhodecode/lib/vcs/backends/git/changeset.py +++ b/rhodecode/lib/vcs/backends/git/changeset.py @@ -189,13 +189,15 @@ class GitChangeset(BaseChangeset): """ rev_filter = _git_path = settings.GIT_REV_FILTER so, se = self.repository.run_git_command( - "rev-list %s --children | grep '^%s'" % (rev_filter, self.raw_id) + "rev-list %s --children" % (rev_filter) ) children = [] + pat = re.compile(r'^%s' % self.raw_id) for l in so.splitlines(): - childs = l.split(' ')[1:] - children.extend(childs) + if pat.match(l): + childs = l.split(' ')[1:] + children.extend(childs) return [self.repository.get_changeset(cs) for cs in children] def next(self, branch=None): @@ -294,17 +296,15 @@ class GitChangeset(BaseChangeset): f_path = safe_str(path) if limit: - cmd = 'log -n %s --pretty="format: %%H" -s -p %s -- "%s"' % ( - safe_int(limit, 0), cs_id, f_path - ) + cmd = 'log -n %s --pretty="format: %%H" -s %s -- "%s"' % ( + safe_int(limit, 0), cs_id, f_path) else: - cmd = 'log --pretty="format: %%H" -s -p %s -- "%s"' % ( - cs_id, f_path - ) + cmd = 'log --pretty="format: %%H" -s %s -- "%s"' % ( + cs_id, f_path) so, se = self.repository.run_git_command(cmd) ids = re.findall(r'[0-9a-fA-F]{40}', so) - return [self.repository.get_changeset(id) for id in ids] + return [self.repository.get_changeset(sha) for sha in ids] def get_file_history_2(self, path): """ @@ -385,7 +385,7 @@ class GitChangeset(BaseChangeset): raise VCSError('You need to pass in a valid stream for filling' ' with archival data') popen = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True, - cwd=self.repository.path) + cwd=self.repository.path) buffer_size = 1024 * 8 chunk = popen.stdout.read(buffer_size)