mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Generate file history before converting doc to heading/moving blocks https://github.com/siyuan-note/siyuan/issues/14359
This commit is contained in:
parent
b3dbcec3cc
commit
79bf9a7b61
1 changed files with 7 additions and 2 deletions
|
|
@ -239,7 +239,7 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
|
|||
var destPath, parentHPath string
|
||||
rootID := util.GetTreeID(historyPath)
|
||||
workingDoc := treenode.GetBlockTree(rootID)
|
||||
if nil != workingDoc {
|
||||
if nil != workingDoc && "d" == workingDoc.Type {
|
||||
if err = filelock.Remove(filepath.Join(util.DataDir, boxID, workingDoc.Path)); err != nil {
|
||||
return
|
||||
}
|
||||
|
|
@ -304,7 +304,12 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
|
|||
}
|
||||
}
|
||||
for _, nodeID := range duplicatedIDs {
|
||||
treenode.ResetNodeID(nodes[nodeID])
|
||||
node := nodes[nodeID]
|
||||
treenode.ResetNodeID(node)
|
||||
if ast.NodeDocument == node.Type {
|
||||
tree.ID = node.ID
|
||||
tree.Path = tree.Path[:strings.LastIndex(tree.Path, "/")] + "/" + node.ID + ".sy"
|
||||
}
|
||||
}
|
||||
|
||||
// 仅重新索引该文档,不进行全量索引
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue