Simple file versioning (fixes #218)

This commit is contained in:
Jakob Borg
2014-05-25 20:49:08 +02:00
parent dd971b56e5
commit 3d055bbb79
17 changed files with 350 additions and 120 deletions

View File

@@ -17,6 +17,7 @@ import (
"github.com/calmh/syncthing/config"
"github.com/calmh/syncthing/files"
"github.com/calmh/syncthing/lamport"
"github.com/calmh/syncthing/osutil"
"github.com/calmh/syncthing/protocol"
"github.com/calmh/syncthing/scanner"
)
@@ -716,7 +717,7 @@ func (m *Model) saveIndex(repo string, dir string, fs []protocol.FileInfo) {
gzw.Close()
idxf.Close()
Rename(name+".tmp", name)
osutil.Rename(name+".tmp", name)
}
func (m *Model) loadIndex(repo string, dir string) []protocol.FileInfo {