feat(storage): add VersionedStorage interface with history/diff/branch operations
Extends Storage interface with Dolt-specific version control capabilities: - New VersionedStorage interface in storage/versioned.go with: - History queries: History(), AsOf(), Diff() - Branch operations: Branch(), Merge(), CurrentBranch(), ListBranches() - Commit operations: Commit(), GetCurrentCommit() - Conflict resolution: GetConflicts(), ResolveConflicts() - Helper types: HistoryEntry, DiffEntry, Conflict - DoltStore implements VersionedStorage interface - New CLI commands: - bd history <id> - Show issue version history - bd diff <from> <to> - Show changes between commits/branches - bd branch [name] - List or create branches - bd vc merge <branch> - Merge branch to current - bd vc commit -m <msg> - Create a commit - bd vc status - Show current branch/commit - Added --as-of flag to bd show for time-travel queries - IsVersioned() helper for graceful SQLite backend detection Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
gastown/crew/dennis
parent
a7cd9136d8
commit
94581ab233
24
internal/storage/dolt/versioned_test.go
Normal file
24
internal/storage/dolt/versioned_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package dolt
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/steveyegge/beads/internal/storage"
|
||||
)
|
||||
|
||||
// TestDoltStoreImplementsVersionedStorage verifies DoltStore implements VersionedStorage.
|
||||
// This is a compile-time check.
|
||||
func TestDoltStoreImplementsVersionedStorage(t *testing.T) {
|
||||
// The var _ declaration in versioned.go already ensures this at compile time.
|
||||
// This test just documents the expectation.
|
||||
|
||||
var _ storage.VersionedStorage = (*DoltStore)(nil)
|
||||
}
|
||||
|
||||
// TestVersionedStorageMethodsExist ensures all required methods are defined.
|
||||
// This is mostly a documentation test since Go's type system enforces this.
|
||||
func TestVersionedStorageMethodsExist(t *testing.T) {
|
||||
// If DoltStore doesn't implement all VersionedStorage methods,
|
||||
// this file won't compile. This test exists for documentation.
|
||||
t.Log("DoltStore implements all VersionedStorage methods")
|
||||
}
|
||||
Reference in New Issue
Block a user