[Pkg-owncloud-commits] [owncloud-client] 14/47: Also force an update of the etag in case of renames

Sandro Knauß hefee-guest at moszumanska.debian.org
Mon Feb 17 18:06:33 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 bb378902aeaed620b3be719fcca637f7d5ec286b
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu Feb 6 17:16:22 2014 +0100

    Also force an update of the etag in case of renames
    
    Imagine we have a file:
      foo/bar/moo
    if we do     mv 'foo' 'foo2' and that we issue a MOVE on the server
    and will update the entry 'foo' in the database with the new etag
    If we write the etag of foo but not the etag of the sub item, when
    we read from db on the next sync, we will miss them and beleive they
    have been removed on the server
---
 csync/src/csync_update.c          | 3 ++-
 src/mirall/owncloudpropagator.cpp | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/csync/src/csync_update.c b/csync/src/csync_update.c
index f6cecbc..c903371 100644
--- a/csync/src/csync_update.c
+++ b/csync/src/csync_update.c
@@ -620,7 +620,8 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
     }
 
     if (ctx->current_fs && (ctx->current_fs->instruction == CSYNC_INSTRUCTION_EVAL ||
-        ctx->current_fs->instruction == CSYNC_INSTRUCTION_NEW)) {
+            ctx->current_fs->instruction == CSYNC_INSTRUCTION_NEW ||
+            ctx->current_fs->instruction == CSYNC_INSTRUCTION_EVAL_RENAME)) {
         ctx->current_fs->should_update_etag = true;
     }
 
diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp
index 6e9109b..d935c8a 100644
--- a/src/mirall/owncloudpropagator.cpp
+++ b/src/mirall/owncloudpropagator.cpp
@@ -866,7 +866,9 @@ void PropagateLocalRename::start()
     SyncJournalFileRecord record(_item, _propagator->_localDir + _item._renameTarget);
     record._path = _item._renameTarget;
 
-    _propagator->_journal->setFileRecord(record);
+    if (!_item._isDirectory) { // Directory are saved at the end
+        _propagator->_journal->setFileRecord(record);
+    }
     _propagator->_journal->commit("localRename");
 
 

-- 
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