Synchronize newly created folders both ways

This involves several changes at different places:

- syncfoldersto() takes statusfolder as an argument, and returns the
  list of new folders and the list of folders that should be ingnored,
  typically those that were deleted. Warns the user about folders that
  are present only on one side and are not synced.

- syncfoldersto() is called both ways, and on folder creation
  forgetfolders() is used to rebuild the list and take the new creation
  into account. Probably not the most efficient, since it involves
  talking to the IMAP server again, but it will rarely be used anyway.

- Locally created folders are treated separately in the synchronization,
  namely the local messages are uploaded and then the normal sync still
  occurs. If the same folder is created on both sides and contains
  messages on both sides, a two-way sync occurs.
This commit is contained in:
Vincent Beffara
2007-09-02 01:43:15 +01:00
parent ac7c5a47ef
commit b925fd1296
3 changed files with 39 additions and 4 deletions

View File

@ -197,7 +197,7 @@ class UIBase:
def syncfolders(s, srcrepos, destrepos):
if s.verbose >= 0:
s._msg("Copying folder structure from %s to %s" % \
s._msg("Copying folder structure between %s and %s" % \
(s.getnicename(srcrepos), s.getnicename(destrepos)))
############################## Folder syncing
@ -218,6 +218,10 @@ class UIBase:
(folder.getname(), folder.getrepository().getname(),
folder.getsaveduidvalidity(), folder.getuidvalidity()))
def ignorefolder(s, foldername, here, there):
s.warn("Folder %s disappeared from %s; skipping it" % \
(foldername, there.getname()))
def loadmessagelist(s, repos, folder):
if s.verbose > 0:
s._msg("Loading message list for %s[%s]" % (s.getnicename(repos),