tag

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagCancel      = 0
	TagSingleton   = 1
	TagPropagating = 2
)

Variables

This section is empty.

Functions

func AddTag

func AddTag(r *repo.Repo, opts TagOpts) (libfossil.FslID, error)

AddTag creates a control artifact that adds or cancels a tag on a target checkin. It stores the artifact as a blob, ensures the tag name exists in the tag table, and inserts/replaces a row in the tagxref table.

func ApplyTag

func ApplyTag(r *repo.Repo, opts ApplyOpts) error

ApplyTag inserts a tagxref row and propagates without creating a control artifact. Used by Crosslink to process existing control artifacts.

func ApplyTagWithTx

func ApplyTagWithTx(q db.Querier, opts ApplyOpts) error

ApplyTagWithTx inserts a tagxref row and propagates using an existing transaction. This avoids the nested-transaction problem when called from within Rebuild's single wrapping transaction. Identical logic to ApplyTag but accepts a db.Querier.

func PropagateAll

func PropagateAll(q db.Querier, rid libfossil.FslID) error

PropagateAll re-propagates all tags from rid to its descendants. Matches Fossil's tag_propagate_all (tag.c:118-135). Singleton tags (type 1) are treated as cancel (type 0) during propagation.

Types

type ApplyOpts

type ApplyOpts struct {
	TargetRID libfossil.FslID // Artifact to tag.
	SrcRID    libfossil.FslID // Control artifact that introduced this tag (0 for inline T-cards).
	TagName   string
	TagType   int // TagCancel, TagSingleton, or TagPropagating.
	Value     string
	MTime     float64 // Julian day.
}

ApplyOpts describes a tag application from an existing control artifact.

type TagOpts

type TagOpts struct {
	TargetRID libfossil.FslID
	TagName   string
	TagType   int // TagCancel, TagSingleton, or TagPropagating
	Value     string
	User      string
	Time      time.Time
}

TagOpts describes a tag operation on a target artifact.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL