don't delete messages in local cache in dry-run mode

This makes dry-run consitent when called more than once.

Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/370
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht
2016-08-08 15:29:18 +02:00
parent f634546980
commit 6b313aabd3
2 changed files with 15 additions and 15 deletions

View File

@ -24,6 +24,7 @@ import six
from .Base import BaseFolder
class DatabaseFileLock(object):
"""Lock at database file level."""
@ -125,7 +126,7 @@ class LocalStatusSQLiteFolder(BaseFolder):
self.__upgrade_db(version)
def purge(self):
"""Remove any pre-existing database."""
"""Remove any pre-existing database. Do not call in dry-run mode."""
try:
os.unlink(self.filename)
@ -328,7 +329,7 @@ class LocalStatusSQLiteFolder(BaseFolder):
# We cannot assign a uid.
return uid
if self.uidexists(uid): # already have it
if self.uidexists(uid): # Already have it.
self.savemessageflags(uid, flags)
return uid