Implements optional git-based version control for information spaces: - HistoryConfig model for configuring history tracking - Commit, Branch, HistoryEntry, DiffResult models - IHistoryBackend and IHistoryQuery interfaces - GitHistoryBackend using git CLI for version control - GitHistoryEventHandler for event-driven auto-commits - HistoryEventCoordinator for managing space history - HistoryQueryService for high-level history queries - Automatic commits on DOCUMENT_ADDED/REMOVED/CONTENT_CHANGED events - Support for: * Commit log with pagination and filtering * Diff between versions * File content at specific versions * Branch creation and switching * Version restoration * Uncommitted changes detection - 43 comprehensive unit tests with git availability checks Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
44 lines
896 B
Python
44 lines
896 B
Python
"""
|
|
History tracking module for Information Spaces.
|
|
|
|
Provides optional git-based version control for space content,
|
|
enabling commit history, diffs, and version restoration.
|
|
"""
|
|
|
|
from .models import (
|
|
Commit,
|
|
Branch,
|
|
HistoryEntry,
|
|
DiffResult,
|
|
DiffLine,
|
|
DiffType,
|
|
HistoryConfig,
|
|
)
|
|
from .interfaces import (
|
|
IHistoryBackend,
|
|
IHistoryQuery,
|
|
)
|
|
from .git_backend import GitHistoryBackend, GitError
|
|
from .events import GitHistoryEventHandler, HistoryEventCoordinator
|
|
from .queries import HistoryQueryService
|
|
|
|
__all__ = [
|
|
# Models
|
|
"Commit",
|
|
"Branch",
|
|
"HistoryEntry",
|
|
"DiffResult",
|
|
"DiffLine",
|
|
"DiffType",
|
|
"HistoryConfig",
|
|
# Interfaces
|
|
"IHistoryBackend",
|
|
"IHistoryQuery",
|
|
# Implementations
|
|
"GitHistoryBackend",
|
|
"GitError",
|
|
"GitHistoryEventHandler",
|
|
"HistoryEventCoordinator",
|
|
"HistoryQueryService",
|
|
]
|