Revision 6da63769 devflow/utils.py
b/devflow/utils.py | ||
---|---|---|
114 | 114 |
"""Find the corresponding debian- branch""" |
115 | 115 |
if branch == "master": |
116 | 116 |
return "debian" |
117 |
# Check if debian-branch exists (local or origin) |
|
118 | 117 |
deb_branch = "debian-" + branch |
119 |
if _get_branch(deb_branch) or _get_branch("origin/" + deb_branch): |
|
118 |
# Check if debian-branch exists (local or origin) |
|
119 |
if _get_branch(deb_branch): |
|
120 | 120 |
return deb_branch |
121 | 121 |
branch_type = BRANCH_TYPES[get_branch_type(branch)] |
122 |
deb_branch = branch_type.debian_branch |
|
123 |
if _get_branch(deb_branch) or _get_branch("origin/" + deb_branch): |
|
122 |
# If not try the default debian branch |
|
123 |
default_branch = branch_type.debian_branch |
|
124 |
if _get_branch(default_branch): |
|
125 |
repo = get_repository() |
|
126 |
repo.git.branch(deb_branch, default_branch) |
|
127 |
print "Created branch '%s' from '%s'" % (deb_branch, default_branch) |
|
124 | 128 |
return deb_branch |
129 |
# If not try the debian branch |
|
130 |
repo.git.branch(deb_branch, default_branch) |
|
131 |
print "Created branch '%s' from 'debian'" % deb_branch |
|
125 | 132 |
return "debian" |
126 | 133 |
|
127 | 134 |
|
Also available in: Unified diff