bugfix: uso distintos target branches para obtener env y type de ramas dev y release
This commit is contained in:
@@ -232,6 +232,8 @@ def merge_command():
|
|||||||
return
|
return
|
||||||
|
|
||||||
(target, _) = get_branch_env_and_type(branch)
|
(target, _) = get_branch_env_and_type(branch)
|
||||||
|
print_info("target branch: " + target)
|
||||||
|
return
|
||||||
status = Git.status()
|
status = Git.status()
|
||||||
remote = Git.flow_config("flow.remote").firstline()
|
remote = Git.flow_config("flow.remote").firstline()
|
||||||
|
|
||||||
@@ -316,13 +318,7 @@ def parse_url(url: str) -> list[str]:
|
|||||||
|
|
||||||
def get_branch_env_and_type(branch: str) -> tuple[str, str]:
|
def get_branch_env_and_type(branch: str) -> tuple[str, str]:
|
||||||
components = branch.split("/")
|
components = branch.split("/")
|
||||||
target_branches = (
|
target_branches = Git.flow_config("flow.branches").firstline().split(" ")
|
||||||
Git.flow_config("flow.branches")
|
|
||||||
.firstline() # dev test main
|
|
||||||
.split(" ") # [dev, test, main]
|
|
||||||
[1:] # [test, main] (dev no deberia ser un release)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if len(components) == 2:
|
if len(components) == 2:
|
||||||
if components[0] not in BRANCH_TYPES:
|
if components[0] not in BRANCH_TYPES:
|
||||||
@@ -330,6 +326,8 @@ def get_branch_env_and_type(branch: str) -> tuple[str, str]:
|
|||||||
|
|
||||||
return (target_branches[0], components[0])
|
return (target_branches[0], components[0])
|
||||||
elif len(components) == 4:
|
elif len(components) == 4:
|
||||||
|
target_branches = target_branches[1:]
|
||||||
|
|
||||||
if (
|
if (
|
||||||
components[0] != "release"
|
components[0] != "release"
|
||||||
or components[1] not in target_branches
|
or components[1] not in target_branches
|
||||||
|
|||||||
Reference in New Issue
Block a user