From 1c58ebe3484fa72e541acba14ff5498df63c77a7 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Mon, 19 Sep 2011 21:25:50 +0200 Subject: [PATCH] Do not create folder on REMOTE if it would fall in REMOTE's folderfilter Previously, we only checked if a LOCAL folder falls under the local repositories folderfilter rule when deciding whether a folder should be created on REMOTE. However, we also do not want to create the folder on REMOTE if it would fall under a folderfilter rule there. This patch prevents us from doing so. Signed-off-by: Sebastian Spaeth --- offlineimap/repository/Base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/offlineimap/repository/Base.py b/offlineimap/repository/Base.py index b5e91d8..a08ef32 100644 --- a/offlineimap/repository/Base.py +++ b/offlineimap/repository/Base.py @@ -177,6 +177,13 @@ class BaseRepository(object, CustomConfig.ConfigHelperMixin): dst_repo.getsep(), src_repo.getsep()) folder = self.getfolder(newsrc_name) + # would src repo filter out the new folder name? In this + # case don't create it on it: + if not self.folderfilter(newsrc_name): + self.ui.debug('', "Not creating folder '%s' (repository '%s" + "') as it would be filtered out on that repository." % + (newsrc_name, self)) + continue newdst_name = folder.getvisiblename().replace( src_repo.getsep(), dst_repo.getsep()) if dst_name != newdst_name: