aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-vcs/src/downloader/mod.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-10 00:32:08 +0900
committernsfisis <nsfisis@gmail.com>2026-05-10 00:32:08 +0900
commit8cc1ba8a02c0318b65658f1634de378c780392b9 (patch)
treefdd5cb61e488018891a486b25991b87c84220bb8 /crates/mozart-vcs/src/downloader/mod.rs
parent72b2e877c01e67ba7edd37e34ac2eadb7a1c62c4 (diff)
downloadphp-mozart-8cc1ba8a02c0318b65658f1634de378c780392b9.tar.gz
php-mozart-8cc1ba8a02c0318b65658f1634de378c780392b9.tar.zst
php-mozart-8cc1ba8a02c0318b65658f1634de378c780392b9.zip
refactor(workspace): consolidate crates into mozart-core
Merged mozart-archiver, mozart-autoload, mozart-registry, mozart-sat-resolver, and mozart-vcs into mozart-core to align the source layout with Composer's structure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart-vcs/src/downloader/mod.rs')
-rw-r--r--crates/mozart-vcs/src/downloader/mod.rs56
1 files changed, 0 insertions, 56 deletions
diff --git a/crates/mozart-vcs/src/downloader/mod.rs b/crates/mozart-vcs/src/downloader/mod.rs
deleted file mode 100644
index 352f330..0000000
--- a/crates/mozart-vcs/src/downloader/mod.rs
+++ /dev/null
@@ -1,56 +0,0 @@
-pub mod git;
-pub mod hg;
-pub mod svn;
-
-use std::path::Path;
-
-use anyhow::Result;
-
-/// The VCS downloader interface.
-///
-/// Corresponds to Composer's `VcsDownloader` hierarchy.
-pub trait VcsDownloader {
- /// Prepare for installation (e.g., sync mirror cache).
- fn download(&self, url: &str, reference: &str, target: &Path) -> Result<()>;
-
- /// Install (clone/checkout) the source to the target directory.
- fn install(&self, url: &str, reference: &str, target: &Path) -> Result<()>;
-
- /// Update the source at target to a new reference.
- fn update(&self, url: &str, old_ref: &str, new_ref: &str, target: &Path) -> Result<()>;
-
- /// Remove the source from the target directory.
- fn remove(&self, target: &Path) -> Result<()>;
-
- /// Detect local changes in the working copy.
- /// Returns `None` if clean, `Some(diff)` if modified.
- /// Mirrors `Composer\Downloader\ChangeReportInterface::getLocalChanges`.
- fn get_local_changes(&self, target: &Path) -> Result<Option<String>>;
-
- /// Detect commits present locally but not on the tracking remote.
- /// Returns `None` if there are no unpushed commits or the concept does
- /// not apply (only `GitDownloader` implements this in Composer's
- /// `DvcsDownloaderInterface`).
- fn unpushed_changes(&self, _target: &Path) -> Result<Option<String>> {
- Ok(None)
- }
-
- /// Resolve the working copy's current VCS reference (e.g. commit hash).
- /// Returns `None` if no reference can be determined. Mirrors
- /// `Composer\Downloader\VcsCapableDownloaderInterface::getVcsReference`.
- fn vcs_reference(&self, _target: &Path) -> Result<Option<String>> {
- Ok(None)
- }
-
- /// Get commit log between two references.
- fn commit_logs(&self, from: &str, to: &str, target: &Path) -> Result<String>;
-
- /// instanceof ChangeReportInterface
- fn is_change_report(&self) -> bool;
-
- /// instanceof VcsCapableDownloaderInterface
- fn is_vcs_capable_downloader(&self) -> bool;
-
- /// instanceof DvcsDownloaderInterface
- fn is_dvcs_downloader(&self) -> bool;
-}