Infrastructure for notifying LocalStatus of local mailbox creations

This will let us delete LocalStatus caches when we create a local
mailbox

refs deb#459985, refs #19
This commit is contained in:
John Goerzen 2008-03-02 22:17:45 -06:00
parent 81b86fb74c
commit 73485475e9
2 changed files with 8 additions and 3 deletions

View File

@ -145,7 +145,7 @@ class AccountSynchronizationMixin:
localrepos = self.localrepos
statusrepos = self.statusrepos
self.ui.syncfolders(remoterepos, localrepos)
remoterepos.syncfoldersto(localrepos)
remoterepos.syncfoldersto(localrepos, [statusrepos])
folderthreads = []
for remotefolder in remoterepos.getfolders():

View File

@ -125,9 +125,12 @@ class BaseRepository(CustomConfig.ConfigHelperMixin):
def getfolder(self, foldername):
raise NotImplementedError
def syncfoldersto(self, dest):
def syncfoldersto(self, dest, copyfolders):
"""Syncs the folders in this repository to those in dest.
It does NOT sync the contents of those folders."""
It does NOT sync the contents of those folders.
For every time dest.makefolder() is called, also call makefolder()
on each folder in copyfolders."""
src = self
srcfolders = src.getfolders()
destfolders = dest.getfolders()
@ -150,6 +153,8 @@ class BaseRepository(CustomConfig.ConfigHelperMixin):
for key in srchash.keys():
if not key in desthash:
dest.makefolder(key)
for copyfolder in copyfolders:
copyfolder.makefolder(key)
#
# Find deleted folders.