if lastSync = 0, make sure we force in the right direction

This commit is contained in:
Damien Elmes 2011-01-13 05:23:41 +09:00
parent 78a276afe7
commit 0543df9bea

View file

@ -187,13 +187,16 @@ sync was aborted. Please report this error.""")
self.deck = None self.deck = None
try: try:
self.deck = DeckStorage.Deck(path) self.deck = DeckStorage.Deck(path)
if not self.deck.lastSync:
self.conflictResolution = "keepLocal"
client = SyncClient(self.deck) client = SyncClient(self.deck)
client.setServer(proxy) client.setServer(proxy)
# need to do anything? # need to do anything?
start = time.time() start = time.time()
if client.prepareSync(proxy.timediff): if client.prepareSync(proxy.timediff):
if self.deck.lastSync <= 0:
if client.remoteTime > client.localTime:
self.conflictResolution = "keepRemote"
else:
self.conflictResolution = "keepLocal"
changes = True changes = True
# summary # summary
if not self.conflictResolution and not self.onlyMerge: if not self.conflictResolution and not self.onlyMerge: