🎨 Files rolled back from file history are no longer overwritten by data sync Fix https://github.com/siyuan-note/siyuan/issues/8014

This commit is contained in:
Liang Ding 2023-04-17 12:51:46 +08:00
parent 1cc838950a
commit 6c131e4d52
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 12 additions and 12 deletions

View file

@ -235,7 +235,7 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
return
}
if err = filelock.Copy(srcPath, destPath); nil != err {
if err = filelock.CopyNewtimes(srcPath, destPath); nil != err {
return
}
@ -273,7 +273,7 @@ func RollbackAssetsHistory(historyPath string) (err error) {
from := historyPath
to := filepath.Join(util.DataDir, "assets", filepath.Base(historyPath))
if err = filelock.Copy(from, to); nil != err {
if err = filelock.CopyNewtimes(from, to); nil != err {
logging.LogErrorf("copy file [%s] to [%s] failed: %s", from, to, err)
return
}
@ -290,7 +290,7 @@ func RollbackNotebookHistory(historyPath string) (err error) {
from := historyPath
to := filepath.Join(util.DataDir, filepath.Base(historyPath))
if err = filelock.Copy(from, to); nil != err {
if err = filelock.CopyNewtimes(from, to); nil != err {
logging.LogErrorf("copy file [%s] to [%s] failed: %s", from, to, err)
return
}