Documentation ¶
Overview ¶
gerc - good enough revision control
Index ¶
- func FindRepo(start string) (string, error)
- func Unidiff(name1, date1 string, d1 []byte, name2, date2 string, d2 []byte) string
- func WriteUnidiff(w io.Writer, name1, date1 string, d1 []byte, name2, date2 string, d2 []byte) bool
- type AnnotateArgs
- type Annotation
- type Change
- type ChangesArgs
- type DiffLine
- type FileDataArgs
- type FileNotFoundError
- type FilesArgs
- type ManifestFile
- type Repo
- func (repo *Repo) Annotate(args AnnotateArgs) ([]Annotation, error)
- func (repo *Repo) Close()
- func (repo *Repo) FSPath(filename string) (string, error)
- func (repo *Repo) GetChanges(args ChangesArgs) ([]*Change, error)
- func (repo *Repo) GetFileData(args FileDataArgs) ([]byte, error)
- func (repo *Repo) GetFiles(args FilesArgs) ([]ManifestFile, error)
- func (repo *Repo) GetTags() []Tag
- func (repo *Repo) Root() string
- type Rev
- type RevisionNotFoundError
- type Revlog
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindRepo ¶
Find the root directory for a repository, starting at start.
func Unidiff ¶
Create a unified format diff.
Types ¶
type Annotation ¶
func Annotate ¶
func Annotate(s1 []Annotation, s2 string, a2 string) []Annotation
Take a slice of annotated lines and diff against a new string. Add new annotations for any new lines. Initialize a slice of annotations by starting with nil.
type Change ¶
type Change struct { Linkrev int NodeID [32]byte P1rev int P1node [32]byte P2rev int P2node [32]byte ID []byte User string Date time.Time Tz int64 Files []string Summary string Message []string Tags []string Diff string // contains filtered or unexported fields }
One changelog entry
func (*Change) Print ¶
Format and print one change
type DiffLine ¶
type FileNotFoundError ¶
type FileNotFoundError struct{}
A file could not be found
func (FileNotFoundError) Error ¶
func (e FileNotFoundError) Error() string
type ManifestFile ¶
One file in the manifest
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
A handle to a repository
func Open ¶
Open a repository located at path. This is the directory that contains .hg.
func (*Repo) Annotate ¶
func (repo *Repo) Annotate(args AnnotateArgs) ([]Annotation, error)
Annotate a file
func (*Repo) FSPath ¶
Return an absolute path to a file in the filesystem
func (*Repo) GetChanges ¶
func (repo *Repo) GetChanges(args ChangesArgs) ([]*Change, error)
Get changes from the changelog.
func (*Repo) GetFileData ¶
func (repo *Repo) GetFileData(args FileDataArgs) ([]byte, error)
Get the data for a file.
func (*Repo) GetFiles ¶
func (repo *Repo) GetFiles(args FilesArgs) ([]ManifestFile, error)
Get the files in the manifest.
type Rev ¶
type Rev struct { Offset uint64 Flags uint16 Clen uint32 Ulen uint32 Baserev int // uint32 Linkrev int // uint32 P1rev int // uint32 P2rev int // uint32 NodeID [32]byte // contains filtered or unexported fields }
One revision. This is mostly an internal data structure.
func (*Rev) ChunkData ¶
Get the data for this chunk. It may be a delta.
type RevisionNotFoundError ¶
type RevisionNotFoundError struct{}
A revision could not be found
func (RevisionNotFoundError) Error ¶
func (e RevisionNotFoundError) Error() string
type Revlog ¶
type Revlog struct {
// contains filtered or unexported fields
}
A revlog structure
func (*Revlog) FindLink ¶
Return the index in this revlog for a link.
func (*Revlog) Get ¶
Get one revision from the revlog, by index.
func (*Revlog) GetData ¶
Get the data for an index. This will apply deltas as necessary to reconstruct the data. Returns data, metadata, error.