Commit 6da63769 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Fix computation of debian-branch

Debian branch should always be named from the original branch, because
version should be corrected correctly. e.g. if making a package for
release-X, debian branch should be debian-release-X, and the
debian-release-X branch should point to debian-develop.
parent 6e9193cb
......@@ -114,14 +114,21 @@ def get_debian_branch(branch):
"""Find the corresponding debian- branch"""
if branch == "master":
return "debian"
# Check if debian-branch exists (local or origin)
deb_branch = "debian-" + branch
if _get_branch(deb_branch) or _get_branch("origin/" + deb_branch):
# Check if debian-branch exists (local or origin)
if _get_branch(deb_branch):
return deb_branch
branch_type = BRANCH_TYPES[get_branch_type(branch)]
deb_branch = branch_type.debian_branch
if _get_branch(deb_branch) or _get_branch("origin/" + deb_branch):
# If not try the default debian branch
default_branch = branch_type.debian_branch
if _get_branch(default_branch):
repo = get_repository()
repo.git.branch(deb_branch, default_branch)
print "Created branch '%s' from '%s'" % (deb_branch, default_branch)
return deb_branch
# If not try the debian branch
repo.git.branch(deb_branch, default_branch)
print "Created branch '%s' from 'debian'" % deb_branch
return "debian"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment