summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2016-12-15 18:37:11 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2016-12-15 18:41:24 +0100
commite2086c426ceb9d121c922265a8122a673890f889 (patch)
tree523d4ac29159ce131c6fcc2953bd55d312477152 /contrib
parent6a80e156dd2838f39c3874a4c72f6a533d9f816e (diff)
downloadcalcurse-e2086c426ceb9d121c922265a8122a673890f889.tar.gz
calcurse-e2086c426ceb9d121c922265a8122a673890f889.zip
calcurse-caldav: Use right diffs when synchronizing
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 <guillaume@lauresfamily.fr> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/caldav/calcurse-caldav.py16
1 files changed, 8 insertions, 8 deletions
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)