class FileSnapshot:
def __init__(
self,
project_dir: str,
snapshot_dir: Optional[str] = None
):
"""Initialize snapshot manager for a project."""
def track(self, message: Optional[str] = None) -> SnapshotInfo:
"""Track current file state, returns snapshot info."""
def diff(
self,
from_hash: str,
to_hash: Optional[str] = None
) -> List[FileDiff]:
"""Get file differences between snapshots."""
def restore(
self,
commit_hash: str,
files: Optional[List[str]] = None
) -> bool:
"""Restore files to a snapshot state."""
def list_snapshots(self, limit: int = 50) -> List[SnapshotInfo]:
"""List recent snapshots."""
def get_current_hash(self) -> Optional[str]:
"""Get current HEAD commit hash."""
def cleanup(self) -> bool:
"""Remove the shadow repository."""