[Pkg-owncloud-commits] [owncloud-client] 290/498: Rename should_update_etag to should_update_metadata

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:59 UTC 2015


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 45180a024d5029482316b095219398f4913b74eb
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu Jul 9 15:05:37 2015 +0200

    Rename should_update_etag to should_update_metadata
    
    This should avoid some confusion
---
 csync/src/csync.c                  |  2 +-
 csync/src/csync.h                  |  2 +-
 csync/src/csync_private.h          |  3 ++-
 csync/src/csync_reconcile.c        | 10 +++++-----
 csync/src/csync_update.c           |  6 +++---
 src/libsync/owncloudpropagator.cpp |  4 ++--
 src/libsync/propagatorjobs.cpp     |  2 +-
 src/libsync/syncengine.cpp         | 14 +++++++-------
 src/libsync/syncfileitem.h         |  4 ++--
 9 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/csync/src/csync.c b/csync/src/csync.c
index 5f72079..095809a 100644
--- a/csync/src/csync.c
+++ b/csync/src/csync.c
@@ -434,7 +434,7 @@ static int _csync_treewalk_visitor(void *obj, void *data) {
       trav.inode        = cur->inode;
 
       trav.error_status = cur->error_status;
-      trav.should_update_etag = cur->should_update_etag;
+      trav.should_update_metadata = cur->should_update_metadata;
 
       if( other_node ) {
           csync_file_stat_t *other_stat = (csync_file_stat_t*)other_node->data;
diff --git a/csync/src/csync.h b/csync/src/csync.h
index 449cef9..d710c17 100644
--- a/csync/src/csync.h
+++ b/csync/src/csync.h
@@ -247,7 +247,7 @@ struct csync_tree_walk_file_s {
     enum csync_instructions_e instruction;
 
     /* For directories: If the etag has been updated and need to be writen on the db */
-    int         should_update_etag;
+    int         should_update_metadata;
 
     const char *rename_path;
     const char *etag;
diff --git a/csync/src/csync_private.h b/csync/src/csync_private.h
index 16edd4f..973437b 100644
--- a/csync/src/csync_private.h
+++ b/csync/src/csync_private.h
@@ -185,7 +185,8 @@ struct csync_file_stat_s {
   mode_t mode;      /* u32 */
   int type;         /* u32 */
   int child_modified;/*bool*/
-  int should_update_etag; /*bool */
+  int should_update_metadata; /*bool: specify that the etag, or the remote perm or fileid has
+                                changed and need to be updated on the db even for INSTRUCTION_NONE */
   int has_ignored_files; /*bool: specify that a directory, or child directory contains ignored files */
 
   char *destpath;   /* for renames */
diff --git a/csync/src/csync_reconcile.c b/csync/src/csync_reconcile.c
index 8b557d0..b4256b3 100644
--- a/csync/src/csync_reconcile.c
+++ b/csync/src/csync_reconcile.c
@@ -185,7 +185,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
                         // For new directories we always want to update the etag once
                         // the directory has been propagated. Otherwise the directory
                         // could appear locally without being added to the database.
-                        cur->should_update_etag = true;
+                        cur->should_update_metadata = true;
                     }
                 } else if (other->instruction == CSYNC_INSTRUCTION_NONE
                            || cur->type == CSYNC_FTW_TYPE_DIR) {
@@ -195,7 +195,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
                         csync_vio_set_file_id( other->file_id, cur->file_id );
                     }
                     other->inode = cur->inode;
-                    other->should_update_etag = true;
+                    other->should_update_metadata = true;
                     cur->instruction = CSYNC_INSTRUCTION_NONE;
                 } else if (other->instruction == CSYNC_INSTRUCTION_REMOVE) {
                     other->instruction = CSYNC_INSTRUCTION_RENAME;
@@ -205,7 +205,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
                         csync_vio_set_file_id( other->file_id, cur->file_id );
                     }
                     other->inode = cur->inode;
-                    other->should_update_etag = true;
+                    other->should_update_metadata = true;
                     cur->instruction = CSYNC_INSTRUCTION_NONE;
                 } else if (other->instruction == CSYNC_INSTRUCTION_NEW) {
                     CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "OOOO=> NEW detected in other tree!");
@@ -268,9 +268,9 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
 
                     /* update DB with new etag from remote */
                     if (ctx->current == LOCAL_REPLICA) {
-                        other->should_update_etag = true;
+                        other->should_update_metadata = true;
                     } else {
-                        cur->should_update_etag = true;
+                        cur->should_update_metadata = true;
                     }
                 } else if(ctx->current == REMOTE_REPLICA) {
                         cur->instruction = CSYNC_INSTRUCTION_CONFLICT;
diff --git a/csync/src/csync_update.c b/csync/src/csync_update.c
index 3815251..4274467 100644
--- a/csync/src/csync_update.c
+++ b/csync/src/csync_update.c
@@ -314,7 +314,7 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
         if (metadata_differ) {
             /* file id or permissions has changed. Which means we need to update them in the DB. */
             CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Need to update metadata for: %s", path);
-            st->should_update_etag = true;
+            st->should_update_metadata = true;
         }
         st->instruction = CSYNC_INSTRUCTION_NONE;
     } else {
@@ -802,7 +802,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
           && ctx->current_fs->instruction == CSYNC_INSTRUCTION_EVAL) {
         ctx->current_fs->instruction = CSYNC_INSTRUCTION_NONE;
         if (ctx->current == REMOTE_REPLICA) {
-          ctx->current_fs->should_update_etag = true;
+          ctx->current_fs->should_update_metadata = true;
         }
       }
 
@@ -820,7 +820,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
     if (flag == CSYNC_FTW_FLAG_DIR && ctx->current_fs
         && (ctx->current_fs->instruction == CSYNC_INSTRUCTION_EVAL ||
             ctx->current_fs->instruction == CSYNC_INSTRUCTION_NEW)) {
-        ctx->current_fs->should_update_etag = true;
+        ctx->current_fs->should_update_metadata = true;
     }
 
     ctx->current_fs = previous_fs;
diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp
index 1d8d121..9876f35 100644
--- a/src/libsync/owncloudpropagator.cpp
+++ b/src/libsync/owncloudpropagator.cpp
@@ -332,7 +332,7 @@ void OwncloudPropagator::start(const SyncFileItemVector& items)
                 // NOTE: Currently this means that we don't update those etag at all in this sync,
                 //       but it should not be a problem, they will be updated in the next sync.
                 for (int i = 0; i < directories.size(); ++i) {
-                    directories[i].second->_item->_should_update_etag = false;
+                    directories[i].second->_item->_should_update_metadata = false;
                 }
             } else {
                 PropagateDirectory* currentDirJob = directories.top().second;
@@ -636,7 +636,7 @@ void PropagateDirectory::finalize()
             _item->_file = _item->_renameTarget;
         }
 
-        if (_item->_should_update_etag && _item->_instruction != CSYNC_INSTRUCTION_REMOVE) {
+        if (_item->_should_update_metadata && _item->_instruction != CSYNC_INSTRUCTION_REMOVE) {
             if (PropagateRemoteMkdir* mkdir = qobject_cast<PropagateRemoteMkdir*>(_firstJob.data())) {
                 // special case from MKDIR, get the fileId from the job there
                 if (_item->_fileId.isEmpty() && !mkdir->_item->_fileId.isEmpty()) {
diff --git a/src/libsync/propagatorjobs.cpp b/src/libsync/propagatorjobs.cpp
index c5042f8..4cb7872 100644
--- a/src/libsync/propagatorjobs.cpp
+++ b/src/libsync/propagatorjobs.cpp
@@ -127,7 +127,7 @@ void PropagateLocalMkdir::start()
     }
 
     // Insert the directory into the database. The correct etag will be set later,
-    // once all contents have been propagated, because should_update_etag is true.
+    // once all contents have been propagated, because should_update_metadata is true.
     // Adding an entry with a dummy etag to the database still makes sense here
     // so the database is aware that this folder exists even if the sync is aborted
     // before the correct etag is stored.
diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp
index 0a56baf..a821872 100644
--- a/src/libsync/syncengine.cpp
+++ b/src/libsync/syncengine.cpp
@@ -348,7 +348,7 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
     if (file->remotePerm && file->remotePerm[0]) {
         item->_remotePerm = QByteArray(file->remotePerm);
     }
-    item->_should_update_etag = item->_should_update_etag || file->should_update_etag;
+    item->_should_update_metadata = item->_should_update_metadata || file->should_update_metadata;
 
     // record the seen files to be able to clean the journal later
     _seenFiles.insert(item->_file);
@@ -428,7 +428,7 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
     int re = 0;
     switch(file->instruction) {
     case CSYNC_INSTRUCTION_NONE:
-        if (remote && item->_should_update_etag && !item->_isDirectory && item->_instruction == CSYNC_INSTRUCTION_NONE) {
+        if (remote && item->_should_update_metadata && !item->_isDirectory && item->_instruction == CSYNC_INSTRUCTION_NONE) {
             // 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
@@ -441,9 +441,9 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
             item->_modtime = file->other.modtime;
 
             _journal->setFileRecord(SyncJournalFileRecord(*item, _localPath + item->_file));
-            item->_should_update_etag = false;
+            item->_should_update_metadata = false;
         }
-        if (item->_isDirectory && (remote || file->should_update_etag)) {
+        if (item->_isDirectory && (remote || file->should_update_metadata)) {
             // Because we want still to update etags of directories
             dir = SyncFileItem::None;
         } else {
@@ -975,7 +975,7 @@ void SyncEngine::checkForPermission()
                     break;
                 } if (!(*it)->_isDirectory && !perms.contains("W")) {
                     qDebug() << "checkForPermission: RESTORING" << (*it)->_file;
-                    (*it)->_should_update_etag = true;
+                    (*it)->_should_update_metadata = true;
                     (*it)->_instruction = CSYNC_INSTRUCTION_CONFLICT;
                     (*it)->_direction = SyncFileItem::Down;
                     (*it)->_isRestoration = true;
@@ -997,7 +997,7 @@ void SyncEngine::checkForPermission()
                 }
                 if (!perms.contains("D")) {
                     qDebug() << "checkForPermission: RESTORING" << (*it)->_file;
-                    (*it)->_should_update_etag = true;
+                    (*it)->_should_update_metadata = true;
                     (*it)->_instruction = CSYNC_INSTRUCTION_NEW;
                     (*it)->_direction = SyncFileItem::Down;
                     (*it)->_isRestoration = true;
@@ -1016,7 +1016,7 @@ void SyncEngine::checkForPermission()
                             }
 
                             qDebug() << "checkForPermission: RESTORING" << (*it)->_file;
-                            (*it)->_should_update_etag = true;
+                            (*it)->_should_update_metadata = true;
 
                             (*it)->_instruction = CSYNC_INSTRUCTION_NEW;
                             (*it)->_direction = SyncFileItem::Down;
diff --git a/src/libsync/syncfileitem.h b/src/libsync/syncfileitem.h
index 33e5be1..0f4c401 100644
--- a/src/libsync/syncfileitem.h
+++ b/src/libsync/syncfileitem.h
@@ -65,7 +65,7 @@ public:
 
     SyncFileItem() : _type(UnknownType),  _direction(None), _isDirectory(false),
         _hasBlacklistEntry(false), _status(NoStatus),
-        _isRestoration(false), _should_update_etag(false),
+        _isRestoration(false), _should_update_metadata(false),
         _httpErrorCode(0), _requestDuration(0), _affectedItems(1),
         _instruction(CSYNC_INSTRUCTION_NONE), _modtime(0), _size(0), _inode(0)
     {
@@ -139,7 +139,7 @@ public:
     // Variables usefull to report to the user
     Status               _status BITFIELD(4);
     bool                 _isRestoration BITFIELD(1); // The original operation was forbidden, and this is a restoration
-    bool                 _should_update_etag BITFIELD(1);
+    bool                 _should_update_metadata BITFIELD(1);
     quint16              _httpErrorCode;
     QString              _errorString; // Contains a string only in case of error
     QByteArray           _responseTimeStamp;

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