Skip to content
This repository has been archived by the owner on Jul 23, 2018. It is now read-only.

Commit

Permalink
bugfix: calculate changed files from the merge base, not the target
Browse files Browse the repository at this point in the history
branch

Also disable extraneous debug statements

Fixes #6
  • Loading branch information
Michel Alexandre Salim committed Aug 21, 2015
1 parent dc6ce1c commit 2bffd71
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions request_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
"--no-commit-id",
"--name-only",
"-r")
git_merge_base = sh.Command._create('git').bake("merge-base")


def list_changed_files(start, end=None):
commit_range = start
if end:
commit_range = git_merge_base(start, end).split()[0]
commit_range += "..%s" % (end,)
else:
commit_range = start
return git_diff(commit_range).split()


Expand Down Expand Up @@ -80,11 +83,9 @@ def get_commit_owners(start, end=None):
"subscribers": set()
}
for f in list_changed_files(start, end):
print("file: " + f)
cur_owners = get_owners(f)
if cur_owners:
owners = merge_owners(owners, cur_owners)
print("owners found")
return owners


Expand Down

0 comments on commit 2bffd71

Please sign in to comment.