MCPcopy Create free account
hub / github.com/cogentcore/core / diffVCS

Method diffVCS

filetree/vcs.go:223–233  ·  view source on GitHub ↗

diffVCS shows the diffs between two versions of this file, given by the revision specifiers -- if empty, defaults to A = current HEAD, B = current WC file. -1, -2 etc also work as universal ways of specifying prior revisions. Diffs are shown in a DiffEditorDialog.

(rev_a, rev_b string)

Source from the content-addressed store, hash-verified

221// -1, -2 etc also work as universal ways of specifying prior revisions.
222// Diffs are shown in a DiffEditorDialog.
223func (fn *Node) diffVCS(rev_a, rev_b string) error {
224 repo, _ := fn.Repo()
225 if repo == nil {
226 return errors.New("file not in vcs repo: " + string(fn.Filepath))
227 }
228 if fn.Info.VCS == vcs.Untracked {
229 return errors.New("file not in vcs repo: " + string(fn.Filepath))
230 }
231 _, err := texteditor.DiffEditorDialogFromRevs(fn, repo, string(fn.Filepath), fn.Buffer, rev_a, rev_b)
232 return err
233}
234
235// logVCSSelected shows the VCS log of commits for selected files.
236func (fn *Node) logVCSSelected() { //types:add

Callers 1

diffVCSSelectedMethod · 0.80

Calls 3

RepoMethod · 0.95
NewFunction · 0.92
DiffEditorDialogFromRevsFunction · 0.92

Tested by

no test coverage detected