Merge "Update behavior of commits not upstreamed to include pure deletions" am: 97bd347fcf

am: 64a6611cd4

Change-Id: I95b4ed47ab4f671a05803e398bc234d1bf9d6b9e
This commit is contained in:
Scott Lobdell
2018-04-19 14:06:14 -07:00
committed by android-build-merger

View File

@@ -100,26 +100,11 @@ def find(upstream, downstream, working_dir):
A set of downstream commits missing upstream.
"""
commits_not_upstreamed = set()
revlist_output = git(['-C', working_dir, 'rev-list', '--no-merges',
'%s..%s' % (upstream, downstream)])
downstream_only_commits = set(revlist_output.splitlines())
insertion_commits = set()
# If there are no downstream-only commits there's no point in
# futher filtering
if downstream_only_commits:
insertion_commits = find_insertion_commits(upstream, downstream,
working_dir)
# The commits that are only downstream and are visible in 'git blame' are the
# ones that insert lines in the diff between upstream and downstream.
commits_not_upstreamed.update(
downstream_only_commits.intersection(insertion_commits))
# TODO(diegowilson) add commits that deleted lines
return commits_not_upstreamed
# TODO(slobdell b/78283222) resolve commits not upstreamed that are purely reverts
return downstream_only_commits
def main():