Skip to content

Commit

Permalink
git: Handle "Based-on:"
Browse files Browse the repository at this point in the history
Signed-off-by: Fam Zheng <famz@redhat.com>
  • Loading branch information
Fam Zheng committed Aug 7, 2017
1 parent 57bd978 commit 5e461e7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mods/git.py
Expand Up @@ -151,6 +151,19 @@ def prepare_series_hook(self, request, series, response):
for prop in ["git.push_to", "git.public_repo", "git.url_template"]:
if po.get_property(prop):
response[prop] = po.get_property(prop)
for tag in series.get_property("tags", []):
if not tag.startswith("Based-on:"):
continue
base_id = tag[len("Based-on:"):].strip()
base = Message.objects.series_heads().\
filter(project=po, message_id=base_id).first()
if not base:
break
if not base.get_property("git.repo"):
break
response["git.repo"] = base.get_property("git.repo")
response["git.base"] = base.get_property("git.tag")
break

def _poll_project(self, po):
repo, branch = self._get_project_repo_and_branch(po)
Expand Down

0 comments on commit 5e461e7

Please sign in to comment.