IMAP: don't try to create empty folders
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
7790a6ae6c
commit
9486a0dab3
@ -189,11 +189,12 @@ class BaseRepository(CustomConfig.ConfigHelperMixin, object):
|
|||||||
dst_hash[folder.getvisiblename().replace(
|
dst_hash[folder.getvisiblename().replace(
|
||||||
dst_repo.getsep(), src_repo.getsep())] = folder
|
dst_repo.getsep(), src_repo.getsep())] = folder
|
||||||
|
|
||||||
# Find new folders on src_repo.
|
# Find and create new folders on src_repo.
|
||||||
for src_name_t, src_folder in src_hash.iteritems():
|
for src_name_t, src_folder in src_hash.iteritems():
|
||||||
# Don't create on dst_repo, if it is readonly
|
# Don't create on dst_repo, if it is readonly
|
||||||
if not dst_repo.get_create_folders():
|
if not dst_repo.get_create_folders():
|
||||||
break
|
break
|
||||||
|
|
||||||
if src_folder.sync_this and not src_name_t in dst_folders:
|
if src_folder.sync_this and not src_name_t in dst_folders:
|
||||||
try:
|
try:
|
||||||
dst_repo.makefolder(src_name_t)
|
dst_repo.makefolder(src_name_t)
|
||||||
@ -205,7 +206,7 @@ class BaseRepository(CustomConfig.ConfigHelperMixin, object):
|
|||||||
raise
|
raise
|
||||||
status_repo.makefolder(src_name_t.replace(dst_repo.getsep(),
|
status_repo.makefolder(src_name_t.replace(dst_repo.getsep(),
|
||||||
status_repo.getsep()))
|
status_repo.getsep()))
|
||||||
# Find new folders on dst_repo.
|
# Find and create new folders on dst_repo.
|
||||||
for dst_name_t, dst_folder in dst_hash.iteritems():
|
for dst_name_t, dst_folder in dst_hash.iteritems():
|
||||||
if not src_repo.get_create_folders():
|
if not src_repo.get_create_folders():
|
||||||
# Don't create missing folder on readonly repo.
|
# Don't create missing folder on readonly repo.
|
||||||
|
@ -457,9 +457,12 @@ class IMAPRepository(BaseRepository):
|
|||||||
|
|
||||||
:param foldername: Full path of the folder to be created."""
|
:param foldername: Full path of the folder to be created."""
|
||||||
|
|
||||||
|
if foldername is '':
|
||||||
|
return
|
||||||
|
|
||||||
if self.getreference():
|
if self.getreference():
|
||||||
foldername = self.getreference() + self.getsep() + foldername
|
foldername = self.getreference() + self.getsep() + foldername
|
||||||
if not foldername: # Create top level folder as folder separator
|
if not foldername: # Create top level folder as folder separator.
|
||||||
foldername = self.getsep()
|
foldername = self.getsep()
|
||||||
self.ui.makefolder(self, foldername)
|
self.ui.makefolder(self, foldername)
|
||||||
if self.account.dryrun:
|
if self.account.dryrun:
|
||||||
|
Loading…
Reference in New Issue
Block a user