44
55import asyncio
66import contextlib
7- import json
87import logging
98import os
109import pathlib
4241
4342if t .TYPE_CHECKING :
4443 import argparse
45- import pathlib
4644
4745 from libvcs ._internal .types import VCSLiteral
4846 from libvcs .sync .git import GitSync
@@ -114,7 +112,7 @@ def update(self, summary: PlanSummary, processed: int) -> None:
114112 self ._colors .muted (f"✓:{ summary .unchanged } " ),
115113 self ._colors .warning (f"⚠:{ summary .blocked } " ),
116114 self ._colors .error (f"✗:{ summary .errors } " ),
117- )
115+ ),
118116 )
119117 clean_len = _visible_length (line )
120118 padding = max (self ._last_render_len - clean_len , 0 )
@@ -145,7 +143,7 @@ def _get_repo_path(repo: ConfigDict) -> pathlib.Path:
145143 """Return the resolved filesystem path for a repository entry."""
146144 raw_path = repo .get ("path" )
147145 if raw_path is None :
148- return pathlib .Path (). resolve ()
146+ return pathlib .Path . cwd ()
149147 return pathlib .Path (str (raw_path )).expanduser ()
150148
151149
@@ -459,7 +457,7 @@ def _render_plan(
459457 extra_lines .append (f"url: { entry .url } " )
460458 if entry .ahead is not None or entry .behind is not None :
461459 extra_lines .append (
462- f"ahead/behind: { entry .ahead or 0 } /{ entry .behind or 0 } "
460+ f"ahead/behind: { entry .ahead or 0 } /{ entry .behind or 0 } " ,
463461 )
464462 if entry .error :
465463 extra_lines .append (f"error: { entry .error } " )
@@ -502,8 +500,7 @@ def _emit_plan_output(
502500 formatter .emit (plan .summary )
503501 return
504502
505- structured = PlanResult (entries = display_entries , summary = plan .summary )
506- print (json .dumps (structured .to_json_object (), indent = 2 ))
503+ PlanResult (entries = display_entries , summary = plan .summary )
507504
508505
509506def create_sync_subparser (parser : argparse .ArgumentParser ) -> argparse .ArgumentParser :
@@ -679,7 +676,7 @@ def sync(
679676 found_repos ,
680677 config = plan_config ,
681678 progress = progress_printer if progress_enabled else None ,
682- )
679+ ),
683680 )
684681 plan_result .summary .duration_ms = int ((perf_counter () - start_time ) * 1000 )
685682 if progress_enabled :
@@ -711,7 +708,7 @@ def sync(
711708
712709 def silent_progress (output : str , timestamp : datetime ) -> None :
713710 """Suppress progress for machine-readable output."""
714- return None
711+ return
715712
716713 progress_callback = silent_progress
717714
@@ -755,7 +752,8 @@ def silent_progress(output: str, timestamp: datetime) -> None:
755752 formatter .emit (event )
756753 if is_human :
757754 log .info (
758- f"Failed syncing { repo_name } " ,
755+ "Failed syncing %s" ,
756+ repo_name ,
759757 )
760758 if log .isEnabledFor (logging .DEBUG ):
761759 import traceback
@@ -770,7 +768,7 @@ def silent_progress(output: str, timestamp: datetime) -> None:
770768 {
771769 "reason" : "summary" ,
772770 ** summary ,
773- }
771+ },
774772 )
775773 formatter .finalize ()
776774 if parser is not None :
@@ -790,7 +788,7 @@ def silent_progress(output: str, timestamp: datetime) -> None:
790788 {
791789 "reason" : "summary" ,
792790 ** summary ,
793- }
791+ },
794792 )
795793
796794 if formatter .mode == OutputMode .HUMAN :
0 commit comments