From e2086c426ceb9d121c922265a8122a673890f889 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 15 Dec 2016 18:37:11 +0100 Subject: calcurse-caldav: Use right diffs when synchronizing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some parameters where swapped accidentally when reworking the diff computation in c8d3d87 (calcurse-caldav: Compute diffs before synchronizing, 2016-12-13) such that the synchronization functions were working with incorrect diffs since that commit. Exchange the parameters again to fix this. Reported-by: Guillaume Laurès Signed-off-by: Lukas Fleischer --- contrib/caldav/calcurse-caldav.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'contrib') diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py index 7f662c0..5c028bf 100755 --- a/contrib/caldav/calcurse-caldav.py +++ b/contrib/caldav/calcurse-caldav.py @@ -530,10 +530,6 @@ try: etagdict = get_etags(conn) # Compute object diffs. - objhashes = calcurse_hashset() - new = objhashes - set([entry[1] for entry in syncdb.values()]) - gone = set([entry[1] for entry in syncdb.values()]) - objhashes - missing = set() modified = set() for href in set(etagdict.keys()): @@ -543,17 +539,21 @@ try: modified.add(href) orphan = set(syncdb.keys()) - set(etagdict.keys()) + objhashes = calcurse_hashset() + new = objhashes - set([entry[1] for entry in syncdb.values()]) + gone = set([entry[1] for entry in syncdb.values()]) - objhashes + # Retrieve new objects from the server. - local_new = pull_objects(new, conn, syncdb, etagdict) + local_new = pull_objects(missing, modified, conn, syncdb, etagdict) # Delete local items that no longer exist on the server. - local_del = remove_local_objects(gone, conn, syncdb, etagdict) + local_del = remove_local_objects(orphan, conn, syncdb, etagdict) # Push new objects to the server. - remote_new = push_objects(missing, modified, conn, syncdb, etagdict) + remote_new = push_objects(new, conn, syncdb, etagdict) # Remove items from the server if they no longer exist locally. - remote_del = remove_remote_objects(orphan, conn, syncdb, etagdict) + remote_del = remove_remote_objects(gone, conn, syncdb, etagdict) # Write the synchronization database. save_syncdb(syncdbfn, syncdb) -- cgit v1.2.3