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

Method LogVCS

filetree/vcs.go:250–268  ·  view source on GitHub ↗

LogVCS shows the VCS log of commits for this file, optionally with a since date qualifier: If since is non-empty, it should be a date-like expression that the VCS will understand, such as 1/1/2020, yesterday, last year, etc. SVN only understands a number as a maximum number of items to return. If a

(allFiles bool, since string)

Source from the content-addressed store, hash-verified

248// this one.
249// Returns the Log and also shows it in a VCSLog which supports further actions.
250func (fn *Node) LogVCS(allFiles bool, since string) (vcs.Log, error) {
251 repo, _ := fn.Repo()
252 if repo == nil {
253 return nil, errors.New("file not in vcs repo: " + string(fn.Filepath))
254 }
255 if fn.Info.VCS == vcs.Untracked {
256 return nil, errors.New("file not in vcs repo: " + string(fn.Filepath))
257 }
258 fnm := string(fn.Filepath)
259 if allFiles {
260 fnm = ""
261 }
262 lg, err := repo.Log(fnm, since)
263 if err != nil {
264 return lg, err
265 }
266 vcsLogDialog(nil, repo, lg, fnm, since)
267 return lg, nil
268}
269
270// blameVCSSelected shows the VCS blame report for this file, reporting for each line
271// the revision and author of the last change.

Callers 1

logVCSSelectedMethod · 0.80

Calls 4

RepoMethod · 0.95
NewFunction · 0.92
vcsLogDialogFunction · 0.85
LogMethod · 0.65

Tested by

no test coverage detected