From cd2ab8353d6108938379173e58d5b242ff6a72c9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 3 Sep 2008 09:49:12 +0200 Subject: [PATCH] Add some documentation for the merge algorithm. --- src/csync_reconcile.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/csync_reconcile.c b/src/csync_reconcile.c index 5e65460a3..3821ab089 100644 --- a/src/csync_reconcile.c +++ b/src/csync_reconcile.c @@ -27,6 +27,19 @@ #define CSYNC_LOG_CATEGORY_NAME "csync.reconciler" #include "csync_log.h" +/* + * We merge replicas at the file level. The merged replica contains the + * superset of files that are on the local machine and server copies of + * the replica. In the case where the same file is in both the local + * and server copy, the file that was modified most recently is used. + * This means that new files are not deleted, and updated versions of + * existing files are not overwritten. + * + * When a file is updated, the merge algorithm compares the destination + * file with the the source file. If the destination file is newer + * (timestamp is newer), it is not overwritten. If both files, on the + * source and the destination, have been changed, the newer file wins. + */ static int _csync_merge_algorithm_visitor(void *obj, void *data) { csync_file_stat_t *cur = NULL; csync_file_stat_t *other = NULL;