diff --git a/head/ChangeLog b/head/ChangeLog index e133fff..9e02402 100644 --- a/head/ChangeLog +++ b/head/ChangeLog @@ -1,3 +1,22 @@ +2002-06-24 09:58 jgoerzen + + * debian/changelog, offlineimap/version.py: Preparation for 1.0.2 + +2002-06-24 09:54 jgoerzen + + * offlineimap/folder/LocalStatus.py: Fixed save() such that it will + be atomic. If the program crashes while writing, it is guaranteed + to have either a complete copy of the old or the new data. + +2002-06-22 21:37 jgoerzen + + * TODO: Added. + +2002-06-21 22:04 jgoerzen + + * ChangeLog, debian/changelog, offlineimap/version.py: Final prep + for 1.0.1 + 2002-06-21 22:03 jgoerzen * offlineimap.py, offlineimap/folder/IMAP.py: Fixed a bug with diff --git a/head/debian/changelog b/head/debian/changelog index e7820c1..22473cb 100644 --- a/head/debian/changelog +++ b/head/debian/changelog @@ -1,3 +1,11 @@ +offlineimap (1.0.2) unstable; urgency=low + + * Made sure that LocalStatus does writing atomically. If the program + is interrupted during save(), there will always be a complete copy of + either the old or the new data. + + -- John Goerzen Mon, 24 Jun 2002 09:57:28 -0500 + offlineimap (1.0.1) unstable; urgency=low * Fixed a bug with writing messages to some IMAP servers. Turns diff --git a/head/offlineimap/folder/LocalStatus.py b/head/offlineimap/folder/LocalStatus.py index b8f4784..3e4439d 100644 --- a/head/offlineimap/folder/LocalStatus.py +++ b/head/offlineimap/folder/LocalStatus.py @@ -61,7 +61,7 @@ class LocalStatusFolder(BaseFolder): file.close() def save(self): - file = open(self.filename, "wt") + file = open(self.filename + ".tmp", "wt") file.write(magicline + "\n") for msg in self.messagelist.values(): flags = msg['flags'] @@ -69,6 +69,7 @@ class LocalStatusFolder(BaseFolder): flags = ''.join(flags) file.write("%s:%s\n" % (msg['uid'], flags)) file.close() + os.rename(self.filename + ".tmp", self.filename) def getmessagelist(self): return self.messagelist diff --git a/head/offlineimap/version.py b/head/offlineimap/version.py index 8596401..a129306 100644 --- a/head/offlineimap/version.py +++ b/head/offlineimap/version.py @@ -1,5 +1,5 @@ productname = 'OfflineIMAP' -versionstr = "1.0.1" +versionstr = "1.0.2" versionlist = versionstr.split(".") major = versionlist[0]