increase snyc_conflict counter only after conflict renaming, to make sure the counter is correct when pull is aborted

Fri, 12 Apr 2019 11:13:16 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 12 Apr 2019 11:13:16 +0200
changeset 566
9a88920b15d8
parent 565
26898e00ddff
child 567
b0ce8b27978b

increase snyc_conflict counter only after conflict renaming, to make sure the counter is correct when pull is aborted

dav/sync.c file | annotate | diff | comparison | revisions
--- a/dav/sync.c	Fri Apr 12 11:06:04 2019 +0200
+++ b/dav/sync.c	Fri Apr 12 11:13:16 2019 +0200
@@ -695,6 +695,10 @@
         }
     }
     
+    //
+    // BEGIN PULL
+    //
+    
     // the first thing we need are all directories to put the files in
     UCX_FOREACH(elm, res_mkdir) {
         DavResource *res = elm->data;
@@ -710,7 +714,6 @@
     // we need a map for all conflicts for fast lookups
     UcxMap *conflicts = ucx_map_new(ucx_list_size(res_conflict)+16);
     UCX_FOREACH(elm, res_conflict) {
-        sync_conflict++;
         DavResource *res = elm->data;
         ucx_map_cstr_put(conflicts, res->path, res);
     }
@@ -727,6 +730,7 @@
         DavBool issplit = dav_get_property_ns(res, DAV_NS, "split") ? 1 : 0;  
         if(ucx_map_cstr_get(conflicts, res->path)) {
             rename_conflict_file(dir, db, res->path, issplit);
+            sync_conflict++;
         }
         
         // download the resource

mercurial