Compare commits

..
9 Commits
3 changed files with 43 additions and 19 deletions
+21
View File
@@ -1,3 +1,24 @@
## v1.7.2 - 2025-12-11
- **bugfix**: al hacer un release, cambio a la rama grupo si esta disponible [[jteran](mailto:jteran@renatre.org.ar)] (44b8efd)
---
## v1.7.1 - 2025-12-11
- **bugfix**: cambio la forma en la que se obtiene el first fork point entre 2 ramas [[jteran](mailto:jteran@renatre.org.ar)] (7b4fb34)
---
## v1.7.0 - 2025-12-11
- **feature**: muestro el listado de commits a pasar al siguiente entorno en release [[jteran](mailto:jteran@renatre.org.ar)] (2e65cb7)
---
## v1.6.4 - 2025-12-10 ## v1.6.4 - 2025-12-10
- **bugfix**: cambio la lista de commits a mostrar en el merge [[jteran](mailto:jteran@renatre.org.ar)] (4e089dc) - **bugfix**: cambio la lista de commits a mostrar en el merge [[jteran](mailto:jteran@renatre.org.ar)] (4e089dc)
+18 -9
View File
@@ -43,23 +43,32 @@ class ReleaseCommand(Command):
else f"release/{next_env}/{branch}" else f"release/{next_env}/{branch}"
) )
base = Git.get_first_fork_point(branch, env)
commits = Git("log", base + ".." , format="%s").lines()
if not commits:
raise GitFlowError("No hay cambios a mergear.")
print("Cambios a pasar al proximo entorno:")
for commit in commits:
print("- " + commit)
group = args.group group = args.group
if not group and self.confirm("¿Desea agrupar este release con otra rama?", False): if not group:
group = self.choice("Grupo release: ", Git.get_branches("release/" + next_env + "/")) if self.confirm("¿Desea agrupar este release con otra rama?", False):
else: group = self.choice("Grupo release: ", Git.get_branches("release/" + next_env + "/"))
group = next_env else:
group = next_env
if has_remote: if has_remote:
Git("switch", group).exec(print="Cambiando a la rama objetivo") Git("switch", group).exec(print="Cambiando a la rama objetivo")
Git("pull").exec(print="Sincronizando cambios la rama objetivo") Git("pull").exec(print="Sincronizando cambios la rama objetivo")
Git("switch", "-").exec(print="Volviendo a la rama original") Git("switch", "-").exec(print="Volviendo a la rama original")
base = Git.get_first_fork_point(branch, env) if len(commits) > 1 and self.confirm(
commits = int(Git("rev-list", base + "..", count=True).firstline()) f"¿Desea reemplazar los {len(commits)} commits de la rama por uno solo?",
if commits > 1 and self.confirm(
f"¿Desea reemplazar los {commits} commits de la rama por uno solo?",
False False
): ):
self.info("Debe ingresar el mensaje del commit a crear.") self.info("Debe ingresar el mensaje del commit a crear.")
+4 -10
View File
@@ -63,19 +63,13 @@ class Git:
@staticmethod @staticmethod
def get_first_fork_point(branch: str, env: str): def get_first_fork_point(branch: str, env: str):
boundary_commits = list( # Lista de commits alcanzables por el entorno (por ejemplo, dev),
filter( env_commits = Git("rev-list", env + "..." + branch, first_parent=True).lines()
lambda c: c.startswith("-"), # boundary commits
Git(
"rev-list", env + "..." + branch, topo_order=True, boundary=True
).lines(),
)
)
if not boundary_commits: if not env_commits:
raise RuntimeError("No se encontro un commit base para realizar el rebase.") raise RuntimeError("No se encontro un commit base para realizar el rebase.")
return boundary_commits[-1].removeprefix("-") return Git("show", env_commits[-1] + "^", patch=False, format="%h").firstline()
@staticmethod @staticmethod
def _get_references(kind: str): def _get_references(kind: str):