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:
@ -67,10 +67,11 @@ class LocalStatusRepository(BaseRepository):
|
||||
|
||||
Empty Folder for plain backend. NoOp for sqlite backend as those
|
||||
are created on demand."""
|
||||
# Invalidate the cache.
|
||||
self._folders = None
|
||||
if self._backend == 'sqlite':
|
||||
return
|
||||
return # noop for sqlite which creates on-demand
|
||||
|
||||
if self.account.dryrun:
|
||||
return # bail out in dry-run mode
|
||||
|
||||
filename = self.getfolderfilename(foldername)
|
||||
file = open(filename + ".tmp", "wt")
|
||||
|
Reference in New Issue
Block a user