Documentation
¶
Overview ¶
Package merge defines merge transaction lifecycle operations.
Index ¶
- Variables
- type ObjectID
- type PreviewBinding
- type Service
- func (s Service) Abort(target, transactionID string) error
- func (s Service) ApplyClean(source, target, transactionID string, binding PreviewBinding) (ObjectID, error)
- func (s Service) ApplyConflicted(source, target, transactionID string, binding PreviewBinding) error
- func (s Service) ApplyPreview(source, target, transactionID string, previewID ObjectID, ...) (ObjectID, error)
- func (s Service) Conflicts(target, transactionID string) (repository.MergeTransactionStatus, error)
- func (s Service) Finalize(target, transactionID string) (ObjectID, error)
- func (s Service) Preview(source, target string) (repository.MergePreview, error)
- func (s Service) Resolve(target, transactionID string, stagedSnapshot ObjectID) error
- func (s Service) ResolveConflicts(request repository.ResolveConflictedMergeRequest) error
- func (s Service) Restage(target, transactionID string) error
- type Store
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMissingPreviewBinding reports an incomplete preview binding. ErrMissingPreviewBinding = repository.ErrMissingMergePreviewBinding // ErrMissingTransactionID reports an empty merge transaction ID. ErrMissingTransactionID = repository.ErrMissingMergeTransactionID // ErrStalePreview reports a preview whose branch state has changed. ErrStalePreview = repository.ErrStaleMergePreview // ErrConflicted reports a merge requiring resolution. ErrConflicted = repository.ErrMergeConflicted // ErrLeaseHeldByOther reports a target transaction owned by another caller. ErrLeaseHeldByOther = repository.ErrMergeLeaseHeldByOther // ErrOperationNotOwner reports an operation from a non-owning transaction. ErrOperationNotOwner = repository.ErrMergeOperationNotOwner // ErrNotInProgress reports a missing merge transaction. ErrNotInProgress = repository.ErrMergeNotInProgress // ErrResolutionIncomplete reports finalization before required resolution steps. ErrResolutionIncomplete = repository.ErrMergeResolutionIncomplete // ErrStagedSnapshotMissing reports an unknown resolution snapshot. ErrStagedSnapshotMissing = repository.ErrMergeStagedSnapshotMissing // ErrTargetLeaseHeld reports a branch mutation blocked by a merge lease. ErrTargetLeaseHeld = repository.ErrMergeTargetLeaseHeld )
Functions ¶
This section is empty.
Types ¶
type ObjectID ¶
type ObjectID = repository.ObjectID
ObjectID is the durable identifier used by repository merge operations.
type PreviewBinding ¶
type PreviewBinding struct {
// MergeBase is the common ancestor used to create the preview.
MergeBase ObjectID
// SourceCommit is the source head inspected by the preview.
SourceCommit ObjectID
// TargetCommit is the target head inspected by the preview.
TargetCommit ObjectID
}
PreviewBinding pins the commits inspected by a merge preview.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service coordinates merge transaction lifecycle requests.
func NewService ¶
NewService returns a merge lifecycle service backed by store.
func (Service) ApplyClean ¶
func (s Service) ApplyClean(source, target, transactionID string, binding PreviewBinding) (ObjectID, error)
ApplyClean validates and applies a clean preview-bound merge.
func (Service) ApplyConflicted ¶
func (s Service) ApplyConflicted(source, target, transactionID string, binding PreviewBinding) error
ApplyConflicted records a conflicted preview-bound merge transaction.
func (Service) ApplyPreview ¶
func (s Service) ApplyPreview(source, target, transactionID string, previewID ObjectID, author, message string) (ObjectID, error)
ApplyPreview applies a reviewed clean preview using caller commit metadata.
func (Service) Conflicts ¶
func (s Service) Conflicts(target, transactionID string) (repository.MergeTransactionStatus, error)
Conflicts returns the persisted conflicted preview and current resolution state.
func (Service) Preview ¶
func (s Service) Preview(source, target string) (repository.MergePreview, error)
Preview computes a deterministic merge preview without changing branch refs.
func (Service) ResolveConflicts ¶
func (s Service) ResolveConflicts(request repository.ResolveConflictedMergeRequest) error
ResolveConflicts records a complete, validated conflict resolution.
type Store ¶
type Store interface {
// PreviewMerge computes an immutable three-way merge without moving refs.
PreviewMerge(string, string) (repository.MergePreview, error)
// ApplyMergePreview recomputes and applies an exact clean preview.
ApplyMergePreview(string, string, string, repository.ObjectID, string, string) (repository.ObjectID, error)
// ApplyCleanBoundMerge validates a preview binding and commits a clean merge.
ApplyCleanBoundMerge(string, string, string, repository.MergePreviewBinding) (repository.ObjectID, error)
// ApplyConflictedBoundMerge records a conflicted merge transaction.
ApplyConflictedBoundMerge(string, string, string, repository.MergePreviewBinding) error
// InspectMergeTransaction returns the persisted conflicted preview to its owner.
InspectMergeTransaction(string, string) (repository.MergeTransactionStatus, error)
// ResolveConflictedMerge records a complete, validated conflict resolution.
ResolveConflictedMerge(repository.ResolveConflictedMergeRequest) error
// ResolveMergeTransaction records an owning transaction's resolution snapshot.
ResolveMergeTransaction(string, string, repository.ObjectID) error
// RestageMergeTransaction records that an owning transaction was restaged.
RestageMergeTransaction(string, string) error
// FinalizeMergeTransaction commits and removes a completed transaction.
FinalizeMergeTransaction(string, string) (repository.ObjectID, error)
// AbortMergeTransaction removes an owning transaction.
AbortMergeTransaction(string, string) error
}
Store is the durable repository contract required by merge lifecycle operations. Repository owns atomic mutation and recovery; this package owns the merge-facing operation boundary.