feature: agregando descripcion a ejecucion de comandos importantes en new, tag y merge

This commit is contained in:
jt
2025-11-22 12:02:39 -03:00
parent faea8c2d2a
commit 4135a789e3
3 changed files with 21 additions and 17 deletions
+16 -10
View File
@@ -29,25 +29,28 @@ class MergeCommand(Command):
def run_remote(self, remote: str, token: str, base: str, branch: str, target: str):
self.check_pending_changes(True)
Git("switch", target).exec()
Git("pull").exec()
Git("switch", "-").exec()
Git("switch", target).exec(print="Cambiando a rama destino")
Git("pull").exec(print="Obteniendo ultimos cambios del remoto")
Git("switch", "-").exec(print="Volviendo a rama a mergear")
self.check_merge_conflicts(target)
self.show_commits_to_merge(base)
Git("push", remote, branch, set_upstream=True).exec()
if self.confirm(f"¿Crear PR de '{branch}' a '{target}'?"):
Git("push", remote, branch, set_upstream=True).exec(
print="Subiendo rama al remoto para crear PR"
)
self.create_pull_request(token, base, branch, target)
self.create_pull_request(token, base, branch, target)
def run_local(self, base: str, branch: str, target: str):
self.check_pending_changes(False)
self.check_merge_conflicts(target)
self.show_commits_to_merge(base)
if self.confirm(f"Mergear rama '{target}' <= '{branch}'?"):
Git("switch", target).exec()
Git("merge", branch, ff=False).exec()
if self.confirm(f"¿Mergear rama '{branch}' a '{target}'?"):
Git("switch", target).exec(print="Cambiando a rama destino")
Git("merge", branch, ff=False).exec(print="Mergeando")
def check_pending_changes(self, has_remote: bool):
status = Git.status()
@@ -78,10 +81,13 @@ class MergeCommand(Command):
print("- " + commit)
def check_merge_conflicts(self, target: str):
merge_conflicts = Git("merge", target, ff=False, commit=False).code() != 0
merge_conflicts = Git("merge", target, ff=False, commit=False).code(
print="Realizando merge de prueba para verificar conflictos"
)
Git("merge", abort=True).exec(print="Abortando merge de prueba")
if merge_conflicts:
Git("merge", abort=True).exec()
self.error(f"La rama actual tiene conflictos con {target}")
self.info(
f"""Se recomienda mergear {target} a la rama actual, resolver los conflictos localmente, y ejecutar nuevamente este comando"""