Revert restoreatime patch

This commit is contained in:
John Goerzen 2006-05-04 09:05:46 +01:00
parent 91d7ecfc68
commit 5a6b2a1ebd
4 changed files with 1 additions and 37 deletions

View File

@ -188,15 +188,6 @@ localfolders = ~/Test
sep = .
# Some users on *nix platforms may not want the atime (last access
# time) to be modified by OfflineIMAP. In these cases, they would
# want to set restoreatime to yes. OfflineIMAP will make an effort
# to not touch the atime if you do that.
#
# In most cases, the default of no should be sufficient.
restoreatime = no
[Repository RemoteExample]
# And this is the remote repository. For now, we only support IMAP here.

View File

@ -154,12 +154,6 @@ class AccountSynchronizationMixin:
class SyncableAccount(Account, AccountSynchronizationMixin):
pass
from stat import *
def reset_time(folder, atime, mtime):
t = atime, mtime
os.utime(folder, t)
def syncfolder(accountname, remoterepos, remotefolder, localrepos,
statusrepos):
global mailboxes
@ -169,9 +163,6 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos,
localfolder = localrepos.\
getfolder(remotefolder.getvisiblename().\
replace(remoterepos.getsep(), localrepos.getsep()))
if localrepos.getrestoreatime():
cur_atime = os.stat(localfolder.getfullname() + "/cur")[ST_ATIME]
new_atime = os.stat(localfolder.getfullname() + "/new")[ST_ATIME]
# Write the mailboxes
mbnames.add(accountname, localfolder.getvisiblename())
# Load local folder
@ -200,20 +191,10 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos,
if not localfolder.isuidvalidityok():
ui.validityproblem(localfolder, localfolder.getsaveduidvalidity(),
localfolder.getuidvalidity())
if localrepos.getrestoreatime():
reset_time(localfolder.getfullname() + "/new", new_atime, \
os.stat(localfolder.getfullname() + "/new")[ST_MTIME])
reset_time(localfolder.getfullname() + "/cur", new_atime, \
os.stat(localfolder.getfullname() + "/cur")[ST_MTIME])
return
if not remotefolder.isuidvalidityok():
ui.validityproblem(remotefolder, remotefolder.getsaveduidvalidity(),
remotefolder.getuidvalidity())
if localrepos.getrestoreatime():
reset_time(localfolder.getfullname() + "/new", new_atime, \
os.stat(localfolder.getfullname() + "/new")[ST_MTIME])
reset_time(localfolder.getfullname() + "/cur", new_atime, \
os.stat(localfolder.getfullname() + "/cur")[ST_MTIME])
return
else:
localfolder.saveuidvalidity()
@ -249,9 +230,4 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos,
ui.syncingmessages(localrepos, localfolder, statusrepos, statusfolder)
localfolder.syncmessagesto(statusfolder)
statusfolder.save()
if localrepos.getrestoreatime():
reset_time(localfolder.getfullname() + "/new", new_atime, \
os.stat(localfolder.getfullname() + "/new")[ST_MTIME])
reset_time(localfolder.getfullname() + "/cur", new_atime, \
os.stat(localfolder.getfullname() + "/cur")[ST_MTIME])

View File

@ -1,5 +1,5 @@
# Base repository support
# Copyright (C) 2002, 2003 John Goerzen
# Copyright (C) 2002, 2003, 2006 John Goerzen
# <jgoerzen@complete.org>
#
# This program is free software; you can redistribute it and/or modify

View File

@ -33,9 +33,6 @@ class MaildirRepository(BaseRepository):
self.ui = UIBase.getglobalui()
self.debug("MaildirRepository initialized, sep is " + repr(self.getsep()))
def getrestoreatime(self):
return self.getconfboolean('restoreatime', 0)
def getlocalroot(self):
return os.path.expanduser(self.getconf('localfolders'))