Skip to content

Commit

Permalink
Fix up some type errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Feb 23, 2015
1 parent c0ef2be commit f860757
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions extras/git-hooks/post-receive
Expand Up @@ -38,23 +38,23 @@ def revs_between(head, ancestors):
yield rev

if not head.id in ancestors:
yield unicode(head.id)
yield head.id


def gather_ancestors(commit, seen=None):
""" Yield all ancestors commits of a given commit. """

seen = seen or []
idx = unicode(commit.id)
idx = commit.id

if not idx in seen:
seen.append(idx)

for parent in commit.parents:
for rev in gather_ancestors(parent, seen=seen):
yield rev.id
for revid in gather_ancestors(parent, seen=seen):
yield revid

yield commit.id
yield idx


def build_stats(commit):
Expand Down Expand Up @@ -97,13 +97,13 @@ for line in lines:

try:
base = repo.revparse_single(base)
ancestors = gather_ancestors(base)
ancestors = list(gather_ancestors(base))
revs = revs_between(head, ancestors)
except KeyError:
revs = [unicode(head.id)]
revs = [head.id]

def _build_commit(rev):
commit = repo.revparse_single(rev)
commit = repo.revparse_single(unicode(rev))

# Tags are a little funny, and vary between versions of pygit2, so we'll
# just ignore them as far as fedmsg is concerned.
Expand All @@ -122,7 +122,7 @@ for line in lines:
files=files,
total=total,
),
rev=rev,
rev=unicode(rev),
path=abspath,
repo=repo_name,
branch=branch,
Expand Down

0 comments on commit f860757

Please sign in to comment.