Determine folder syncing on Folder initialization

Rather than later when retrieving them by IMAP, we determine the
"sync_this" value of a folder on Folder() initialization.

This also fixes a bug where folder structure was not propagated when
a folder was filtered out but included in the folderincludes list.

Patch by Dave, split and modified slightly by Sebastian

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Dave Abrahams
2012-09-01 02:30:46 +02:00
committed by Sebastian Spaeth
parent e7ca5b25cb
commit e94642bb4d
3 changed files with 15 additions and 8 deletions

View File

@ -287,11 +287,6 @@ class IMAPRepository(BaseRepository):
foldername = imaputil.dequote(name)
retval.append(self.getfoldertype()(self.imapserver, foldername,
self))
# filter out the folder?
if not self.folderfilter(foldername):
self.ui.debug('imap', "Filtering out '%s'[%s] due to folderfilt"
"er" % (foldername, self))
retval[-1].sync_this = False
# Add all folderincludes
if len(self.folderincludes):
imapobj = self.imapserver.acquireconnection()