pulli 0.2.8__tar.gz → 0.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pulli-0.2.8 → pulli-0.2.9}/PKG-INFO +1 -1
- {pulli-0.2.8 → pulli-0.2.9}/src/pulli/__init__.py +1 -1
- {pulli-0.2.8 → pulli-0.2.9}/src/pulli/tree.py +18 -8
- {pulli-0.2.8 → pulli-0.2.9}/.gitignore +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/LICENSE +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/README.md +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/pyproject.toml +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/scripts/release.sh +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/src/pulli/cli.py +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/src/pulli/discovery.py +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/src/pulli/pull.py +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/src/pulli/spinner.py +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/src/pulli/status.py +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/src/pulli/update.py +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/tests/test_pulli.py +0 -0
- {pulli-0.2.8 → pulli-0.2.9}/uv.lock +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""pulli — discover git repos under a root and report their status."""
|
|
2
|
-
__version__ = "0.2.
|
|
2
|
+
__version__ = "0.2.9"
|
|
@@ -166,15 +166,25 @@ def _ahead_behind(node: RepoNode, C=lambda s, *c: s) -> str:
|
|
|
166
166
|
if not node.upstream:
|
|
167
167
|
return "· ·"
|
|
168
168
|
behind, ahead = node.behind or 0, node.ahead or 0
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
# the same color makes the rest of the line render differently. Bold
|
|
172
|
-
# alone is enough emphasis there.
|
|
173
|
-
b = C(f"↓{behind}", _BOLD) if behind else f"↓{behind}"
|
|
174
|
-
a = C(f"↑{ahead}", _BOLD) if ahead else f"↑{ahead}"
|
|
169
|
+
b = C(f"↓{behind}", _CYAN, _BOLD) if behind else f"↓{behind}"
|
|
170
|
+
a = C(f"↑{ahead}", _CYAN, _BOLD) if ahead else f"↑{ahead}"
|
|
175
171
|
return f"{b} {a}"
|
|
176
172
|
|
|
177
173
|
|
|
174
|
+
def _highlight_line(line: str) -> str:
|
|
175
|
+
"""Cyan-wrap a whole line, surviving nested SGR resets.
|
|
176
|
+
|
|
177
|
+
Inner resets (e.g. the count's own cyan+bold) would end the outer cyan
|
|
178
|
+
mid-line and make the line render two-tone; re-apply the cyan after
|
|
179
|
+
each reset so the line stays one color throughout. Returns the input
|
|
180
|
+
unchanged when it carries no ANSI codes (color off) — nothing to
|
|
181
|
+
highlight then.
|
|
182
|
+
"""
|
|
183
|
+
if "\x1b[" not in line:
|
|
184
|
+
return line
|
|
185
|
+
return _CYAN + line.replace(_RESET, _RESET + _CYAN) + _RESET
|
|
186
|
+
|
|
187
|
+
|
|
178
188
|
def _repo_tail_parts(node: RepoNode, C) -> list[str]:
|
|
179
189
|
"""The status columns for a repo node, as a list of aligned-able parts.
|
|
180
190
|
|
|
@@ -341,7 +351,7 @@ def _build_flat_lines(
|
|
|
341
351
|
# it — so the whole line is highlighted (cyan) instead of just the
|
|
342
352
|
# count. Everything up to date stays quiet: no news takes no color.
|
|
343
353
|
if n.behind and not n.error:
|
|
344
|
-
line =
|
|
354
|
+
line = _highlight_line(line)
|
|
345
355
|
lines.append(line)
|
|
346
356
|
repo_line[id(n)] = len(lines) - 1
|
|
347
357
|
repo_base[id(n)] = padded
|
|
@@ -469,7 +479,7 @@ class LiveTree:
|
|
|
469
479
|
# Same highlight rule as _build_flat_lines: the whole line goes
|
|
470
480
|
# cyan when the repo is behind — that is the actionable state.
|
|
471
481
|
if self._flat and node.behind and not node.error:
|
|
472
|
-
text =
|
|
482
|
+
text = _highlight_line(text)
|
|
473
483
|
text = _clip_ansi(text, self._width)
|
|
474
484
|
with self._lock:
|
|
475
485
|
self._rewrite(i, text)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|