Documentation
¶
Index ¶
- func AfterDephantomize(r *repo.Repo, rid libfossil.FslID)
- func Checkin(r *repo.Repo, opts CheckinOpts) (manifestRid libfossil.FslID, manifestUUID string, err error)
- func Crosslink(r *repo.Repo) (int, error)
- func CrosslinkCluster(q db.Querier, rid libfossil.FslID, d *deck.Deck) error
- func FileAt(r *repo.Repo, checkinRID libfossil.FslID, path string) (libfossil.FslID, bool)
- func GetManifest(r *repo.Repo, rid libfossil.FslID) (result *deck.Deck, err error)
- type CheckinOpts
- type File
- type FileAction
- type FileEntry
- type FileHistoryOpts
- type FileVersion
- type LogEntry
- type LogOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterDephantomize ¶
AfterDephantomize crosslinks a formerly-phantom blob and any dependents. Matches Fossil's after_dephantomize (content.c:389-456).
func Crosslink ¶
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 ¶
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.
Types ¶
type CheckinOpts ¶
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 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.