Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Fixed edge case where local/remote wiki is deleted and re-added, caus…
Browse files Browse the repository at this point in the history
…ing the synced version to be higher than actual version. Such cases will be marked as conflict.
  • Loading branch information
Ivan Choo committed Apr 18, 2012
1 parent 1ca27e6 commit 2c27480
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wikisync/model.py
Expand Up @@ -62,6 +62,11 @@ def replace(self, *args, **kwargs):
status = "modified"
elif rv == srv and lv == slv:
status = "synced"
elif rv < srv or lv < slv:
# edge case, local wiki or remote wiki was deleted
# and re-added, causing the synced version to be higher
# we mark the status as conflict and prompt user to resolve it
status = "conflict"
return o.status == status and o or o._replace(status=status)

def validate(self):
Expand Down

0 comments on commit 2c27480

Please sign in to comment.