Documentation
¶
Index ¶
- func ContentHash(d *db.DB) (string, error)
- func Delete(d *db.DB, name string, mtime int64) error
- func EnsureSchema(d *db.DB) error
- func InvalidateHash(d *db.DB) error
- func Read(d *db.DB, name string) ([]byte, int64, string, error)
- func Status(localMtime int64, localHash string, remoteMtime int64, remoteHash string) int
- func Write(d *db.DB, name string, content []byte, mtime int64) error
- type Entry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentHash ¶
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 EnsureSchema ¶
func InvalidateHash ¶
func Status ¶
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)
Types ¶
Click to show internal directories.
Click to hide internal directories.