MCPcopy Create free account
hub / github.com/alibaba/open-code-review / loadSummaryFromFile

Function loadSummaryFromFile

internal/session/list.go:167–183  ·  view source on GitHub ↗
(path, sessionID, repoDir string)

Source from the content-addressed store, hash-verified

165}
166
167func loadSummaryFromFile(path, sessionID, repoDir string) (*Summary, error) {
168 summary := &Summary{
169 SessionID: sessionID,
170 FilePath: path,
171 RepoDir: repoDir,
172 Aborted: true,
173 }
174 if err := walkSessionFile(path, func(rec summaryRecord) {
175 applyRecordToSummary(summary, rec)
176 }); err != nil {
177 return nil, err
178 }
179 if summary.SessionID == "" {
180 summary.SessionID = sessionID
181 }
182 return summary, nil
183}
184
185func walkSessionFile(path string, apply func(summaryRecord)) error {
186 f, err := os.Open(path)

Callers 2

ListSessionsFunction · 0.85
LoadSummaryFunction · 0.85

Calls 2

walkSessionFileFunction · 0.85
applyRecordToSummaryFunction · 0.85

Tested by

no test coverage detected