🎨 数据快照对比加入时间标识 https://github.com/siyuan-note/siyuan/issues/6899

This commit is contained in:
Liang Ding 2022-12-21 15:03:49 +08:00
parent 6fa661982d
commit 42c09e2fad
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 70 additions and 8 deletions

View file

@ -128,10 +128,12 @@ func OpenRepoSnapshotDoc(fileID string) (id, rootID, content string, isLargeDoc
}
type LeftRightDiff struct {
AddsLeft []*DiffFile `json:"addsLeft"`
UpdatesLeft []*DiffFile `json:"updatesLeft"`
UpdatesRight []*DiffFile `json:"updatesRight"`
RemovesRight []*DiffFile `json:"removesRight"`
LeftIndex *entity.Index `json:"leftIndex"`
RightIndex *entity.Index `json:"rightIndex"`
AddsLeft []*DiffFile `json:"addsLeft"`
UpdatesLeft []*DiffFile `json:"updatesLeft"`
UpdatesRight []*DiffFile `json:"updatesRight"`
RemovesRight []*DiffFile `json:"removesRight"`
}
type DiffFile struct {
@ -155,7 +157,13 @@ func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
return
}
ret = &LeftRightDiff{}
diff.LeftIndex.Files = nil
diff.RightIndex.Files = nil
ret = &LeftRightDiff{
LeftIndex: diff.LeftIndex,
RightIndex: diff.RightIndex,
}
luteEngine := NewLute()
for _, addLeft := range diff.AddsLeft {
title, err := parseTitleInSnapshot(addLeft.ID, repo, luteEngine)