Implement ui.makefolder and abort repo.makefolder() in dry-run mode

IMAP, Maildir, and LocalStatus abort if in dry-run mode. IMAP and Maildir
will log that they "would have" created a new folder.

This will probably fail later on as we can not cache messagelists on
folder that don't exist, so --dry-run is not yet safe when new folders
have been created.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2011-09-15 15:37:52 +02:00
parent 33f55b5362
commit b6807355b5
5 changed files with 17 additions and 7 deletions

View File

@ -298,6 +298,12 @@ class UIBase(object):
(src_repo, dst_repo))
############################## Folder syncing
def makefolder(self, repo, foldername):
"""Called when a folder is created"""
prefix = "[DRYRUN] " if self.dryrun else ""
self.info("{}Creating folder {}[{}]".format(
prefix, foldername, repo))
def syncingfolder(self, srcrepos, srcfolder, destrepos, destfolder):
"""Called when a folder sync operation is started."""
self.logger.info("Syncing %s: %s -> %s" % (srcfolder,