uv

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentHash

func ContentHash(d *db.DB) (string, error)

ContentHash computes the SHA1 catalog hash matching Fossil's unversioned_content_hash(). Always SHA1, even in SHA3 repos. Format: "name YYYY-MM-DD HH:MM:SS hash\n" per file, sorted by name.

func Delete

func Delete(d *db.DB, name string, mtime int64) error

func EnsureSchema

func EnsureSchema(d *db.DB) error

func InvalidateHash

func InvalidateHash(d *db.DB) error

func Read

func Read(d *db.DB, name string) ([]byte, int64, string, error)

func Status

func Status(localMtime int64, localHash string, remoteMtime int64, remoteHash string) int

Status compares a local unversioned file against a remote one and returns an action code. Exact port of Fossil's unversioned_status().

localMtime==0 means no local row (returns 0). localHash="" with localMtime>0 means tombstone (participates in mtime comparison). "-" means deletion marker in either position.

Return codes:

0 = not present locally (pull)
1 = different hash, remote newer or tiebreaker (pull)
2 = same hash, remote mtime older (pull mtime only)
3 = identical (no action)
4 = same hash, remote mtime newer (push mtime only)
5 = different hash, local newer or tiebreaker (push)

func Write

func Write(d *db.DB, name string, content []byte, mtime int64) error

Types

type Entry

type Entry struct {
	Name  string
	MTime int64  // seconds since 1970
	Hash  string // "" for tombstone (NULL in DB)
	Size  int    // uncompressed size
}

Entry represents a row in the unversioned table.

func List

func List(d *db.DB) ([]Entry, error)

Jump to

Keyboard shortcuts

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