lista solo repos remotos y descripción en una línea

This commit is contained in:
2026-05-18 10:23:32 +02:00
parent ecb2a0c500
commit b5935f2511
+2 -19
View File
@@ -208,7 +208,6 @@ def normalize_url(url: str) -> str:
def build_entries(remote_repos: list[RemoteRepo], local_index: dict[str, Path]) -> list[RepoEntry]:
entries: list[RepoEntry] = []
matched_paths: set[Path] = set()
for r in remote_repos:
local: Path | None = None
for candidate_url in (r.clone_url, r.ssh_url):
@@ -218,8 +217,6 @@ def build_entries(remote_repos: list[RemoteRepo], local_index: dict[str, Path])
break
if local is None and f"name::{r.name}" in local_index:
local = local_index[f"name::{r.name}"]
if local is not None:
matched_paths.add(local)
entries.append(
RepoEntry(
name=r.name,
@@ -228,21 +225,7 @@ def build_entries(remote_repos: list[RemoteRepo], local_index: dict[str, Path])
local_path=local,
)
)
# Añadir repos locales que NO están en el servidor (por info)
for key, path in local_index.items():
if key.startswith("name::"):
continue
if path in matched_paths:
continue
entries.append(
RepoEntry(
name=path.name,
full_name=path.name,
remote=None,
local_path=path,
)
)
entries.sort(key=lambda e: (e.local_path is None, e.name.lower()))
entries.sort(key=lambda e: (e.local_path is not None, e.name.lower()))
return entries
@@ -259,7 +242,7 @@ def render(entries: list[RepoEntry], cursor: int, base: Path, owner: str, status
table.add_column(" ", width=1, no_wrap=True)
table.add_column("Estado", width=14, no_wrap=True)
table.add_column("Repo", style="bold", no_wrap=True, overflow="ellipsis")
table.add_column("Descripción", overflow="ellipsis", ratio=1)
table.add_column("Descripción", no_wrap=True, overflow="ellipsis", ratio=1)
for i, e in enumerate(entries):
# Cursor