Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Liang Ding0603ed365624
diff --git a/kernel/model/repository.go b/kernel/model/repository.go
index ca96ff0856..0fddbda555 100644
--- a/kernel/model/repository.go
+++ b/kernel/model/repository.go
@@ -128,12 +128,12 @@ func OpenRepoSnapshotDoc(fileID string) (id, rootID, content string, isLargeDoc
}
type LeftRightDiff struct {
- 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"`
+ LeftIndex *DiffIndex `json:"leftIndex"`
+ RightIndex *DiffIndex `json:"rightIndex"`
+ AddsLeft []*DiffFile `json:"addsLeft"`
+ UpdatesLeft []*DiffFile `json:"updatesLeft"`
+ UpdatesRight []*DiffFile `json:"updatesRight"`
+ RemovesRight []*DiffFile `json:"removesRight"`
}
type DiffFile struct {
@@ -141,6 +141,11 @@ type DiffFile struct {
Title string `json:"title"`
}
+type DiffIndex struct {
+ ID string `json:"id"`
+ Created int64 `json:"created"`
+}
+
func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
if 1 > len(Conf.Repo.Key) {
err = errors.New(Conf.Language(26))
@@ -157,12 +162,15 @@ func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
return
}
- diff.LeftIndex.Files = nil
- diff.RightIndex.Files = nil
-
ret = &LeftRightDiff{
- LeftIndex: diff.LeftIndex,
- RightIndex: diff.RightIndex,
+ LeftIndex: &DiffIndex{
+ ID: diff.LeftIndex.ID,
+ Created: diff.LeftIndex.Created,
+ },
+ RightIndex: &DiffIndex{
+ ID: diff.RightIndex.ID,
+ Created: diff.RightIndex.Created,
+ },
}
luteEngine := NewLute()
for _, addLeft := range diff.AddsLeft {