[Pkg-owncloud-commits] [owncloud-client] 56/69: Never overwrite the mtime from the local file system in the db when updating the metadata

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Nov 7 19:41:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit b70ecc3dd3c2a65c67602f2d3c971e5f3fe6434d
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu Nov 6 14:54:59 2014 +0100

    Never overwrite the mtime from the local file system in the db when updating the metadata
    
    Attempt to fix #2431
---
 src/mirall/syncengine.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/mirall/syncengine.cpp b/src/mirall/syncengine.cpp
index 43e4a7a..ece2e7c 100644
--- a/src/mirall/syncengine.cpp
+++ b/src/mirall/syncengine.cpp
@@ -411,12 +411,17 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
     switch(file->instruction) {
     case CSYNC_INSTRUCTION_NONE:
         if (remote && item._should_update_etag && !item._isDirectory && item._instruction == CSYNC_INSTRUCTION_NONE) {
-            // Update the database now already  (new fileid or etag or remotePerm)
-            // Those are files that were detected as "resolved conflict".
+            // Update the database now already:  New fileid or Etag or RemotePerm
+            // Or for files that were detected as "resolved conflict".
             // They should have been a conflict because they both were new, or both
             // had their local mtime or remote etag modified, but the size and mtime
             // is the same on the server.  This typically happen when the database is removed.
             // Nothing will be done for those file, but we still need to update the database.
+
+            // Even if the mtime is different on the server, we always want to keep the mtime from
+            // the file system in the DB, this is to avoid spurious upload on the next sync
+            item._modtime = file->other.modtime;
+
             _journal->setFileRecord(SyncJournalFileRecord(item, _localPath + item._file));
             item._should_update_etag = false;
         }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list