Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoPath = errors.New("no path found")
ErrNoPath is returned when no path exists between the two nodes.
Functions ¶
func NameChanges ¶ added in v0.14.0
NameChanges is fossil's find_filename_changes (src/path.c) with revOK set, as its update calls it: the files renamed between check-ins from and to, old name to new name. The path is the one path_shortest finds over primary links: up from from through primary parents to the nearest ancestor of to, then down through primary children. A rename on the way up is taken backwards; a file deleted on the way drops out. With no path between them there are no renames.
Types ¶
type NameChange ¶ added in v0.15.0
type NameChange struct {
From, To string
}
NameChange is one file renamed between two check-ins: its name in the first and its name in the second.
func FilenameChanges ¶ added in v0.15.0
FilenameChanges is fossil's find_filename_changes (src/path.c): the files renamed between check-ins from and to, in the order fossil lists them, the most recently followed first. Without revOK the path only goes down primary links, as find_filename_changes' one-way path_shortest does, so from must be a primary ancestor of to or there are no changes; with it the path is NameChanges'.
type PathNode ¶
PathNode represents a single node in a path through the plink DAG.
func Shortest ¶
func Shortest(db *sql.DB, from, to libfossil.FslID, directOnly bool, skip map[libfossil.FslID]bool) ([]PathNode, error)
Shortest finds the shortest path from `from` to `to` in the plink DAG using BFS. If directOnly is true, only primary parent edges (isprim=1) are traversed. Nodes in the skip set are not visited.