manifest

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterDephantomize

func AfterDephantomize(r *repo.Repo, rid libfossil.FslID)

AfterDephantomize crosslinks a formerly-phantom blob and any dependents. Matches Fossil's after_dephantomize (content.c:389-456).

func Checkin

func Checkin(r *repo.Repo, opts CheckinOpts) (manifestRid libfossil.FslID, manifestUUID string, err error)
func Crosslink(r *repo.Repo) (int, error)

Crosslink scans all blobs not yet crosslinked in event/tagxref/forumpost/attachment tables, parses them as manifests, and populates cross-reference tables (event/plink/leaf/mlink/tagxref). This is the Go equivalent of Fossil's manifest_crosslink.

func CrosslinkCluster

func CrosslinkCluster(q db.Querier, rid libfossil.FslID, d *deck.Deck) error

CrosslinkCluster processes a cluster artifact: applies the cluster singleton tag (tagid=7), removes clustered blobs from unclustered, and creates phantoms for any referenced UUIDs not yet in the blob table.

func FileAt

func FileAt(r *repo.Repo, checkinRID libfossil.FslID, path string) (libfossil.FslID, bool)

FileAt returns the file blob RID for a given filename at a specific checkin. Returns 0, false if the file does not exist in that checkin. This is a convenience wrapper for diff-between-versions use cases.

func GetManifest

func GetManifest(r *repo.Repo, rid libfossil.FslID) (result *deck.Deck, err error)

Types

type CheckinOpts

type CheckinOpts struct {
	Files        []File
	Comment      string
	User         string
	Parent       libfossil.FslID
	MergeParents []libfossil.FslID // additional parents beyond Parent (for merge commits)
	Delta        bool
	Time         time.Time
	Tags         []deck.TagCard
}

type File

type File struct {
	Name    string
	Content []byte
	Perm    string
}

type FileAction

type FileAction int

FileAction describes what happened to a file in a given checkin.

const (
	FileAdded    FileAction = iota // file first appears (no parent file blob)
	FileModified                   // file content changed from parent
	FileDeleted                    // file removed (fid = 0)
	FileRenamed                    // filename changed (pfnid != fnid)
)

func (FileAction) String

func (a FileAction) String() string

type FileEntry

type FileEntry struct {
	Name string
	UUID string
	Perm string
}

func ListFiles

func ListFiles(r *repo.Repo, rid libfossil.FslID) ([]FileEntry, error)

type FileHistoryOpts

type FileHistoryOpts struct {
	// Path is the filename to trace (required).
	Path string
	// Limit caps the number of results (0 = unlimited).
	Limit int
}

FileHistoryOpts controls the file history query.

type FileVersion

type FileVersion struct {
	CheckinRID  libfossil.FslID // rid of the checkin manifest
	CheckinUUID string          // UUID of the checkin
	FileRID     libfossil.FslID // rid of the file blob (0 if deleted)
	FileUUID    string          // UUID of the file blob ("" if deleted)
	Action      FileAction
	User        string
	Comment     string
	Date        time.Time
	PrevName    string // non-empty if renamed (previous filename)
}

FileVersion represents one entry in a file's history across checkins.

func FileHistory

func FileHistory(r *repo.Repo, opts FileHistoryOpts) ([]FileVersion, error)

FileHistory returns the change history of a file across checkins, ordered by date descending (most recent first). It queries the mlink table directly, which is populated during crosslink/rebuild.

Each returned FileVersion represents a checkin where the file was added, modified, deleted, or renamed.

type LogEntry

type LogEntry struct {
	RID     libfossil.FslID
	UUID    string
	Comment string
	User    string
	Time    time.Time
	Parents []string
}

func Log

func Log(r *repo.Repo, opts LogOpts) ([]LogEntry, error)

type LogOpts

type LogOpts struct {
	Start libfossil.FslID
	Limit int
}

Jump to

Keyboard shortcuts

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