Fix manual run under bitbucket repos with many tags/branches

Fixes #1766

Depends on merging of https://github.com/coreos/py-bitbucket/pull/3 and then a regeneration of the requirements.txt
This commit is contained in:
Joseph Schorr 2016-08-25 18:23:33 -04:00
parent 08e9a39099
commit 406cd942d2

View file

@ -513,19 +513,19 @@ class BitbucketBuildTrigger(BuildTriggerHandler):
def get_branch_sha(branch_name):
# Lookup the commit SHA for the branch.
(result, data, _) = repository.get_branches()
if not result or not branch_name in data:
(result, data, _) = repository.get_branch(branch_name)
if not result:
raise TriggerStartException('Could not find branch commit SHA')
return data[branch_name]['node']
return data['target']['hash']
def get_tag_sha(tag_name):
# Lookup the commit SHA for the tag.
(result, data, _) = repository.get_tags()
if not result or not tag_name in data:
(result, data, _) = repository.get_tag(tag_name)
if not result:
raise TriggerStartException('Could not find tag commit SHA')
return data[tag_name]['node']
return data['target']['hash']
def lookup_author(email_address):
(result, data, _) = bitbucket_client.accounts().get_profile(email_address)