no-delete-local patch for offlineimap

Nicolas Sebrecht nicolas.s-dev at laposte.net
Thu May 28 00:28:04 BST 2015


On Wed, May 27, 2015 at 09:12:21AM -0700, Edward Z. Yang wrote:

> Was listening along. I noticed that the patch that was submitted
> here is old.  Here's a newer version of it which I'm currently running:
> https://github.com/ezyang/offlineimap/commit/06428af0adf74d25011a42ebd97b39f930769b58
> but I have not really cleaned it up for submission.

I understood the previous patch was not meant for inclusion. BTW, it
should be straightforward to get this patch in once polished.

@Petr: I'm open to help you to continue the submission process with the
next round if you aim to help.

> In any case, here are the comments that still apply

Great!

> The reason is syncmessagesto gets called twice: once from local to
> status, and once from remote to status.  These need to be treated
> differently, since no-delete-local is an asymmetric option.  The
> alternate choice is to test dstfolder against...  something to
> distinguish these two cases.

Right.

> BTW, I definitely DO want local deletes to synchronize to the remote.

Yes.

> > >          This function checks and protects us from action in ryrun mode.
> > >          """
> > > +        # This is functionally equivalent to having an empty deletelist
> > > +        # in the case of not always_sync_deletes and no-delete-local turned on; the
> > > +        # only difference is that in this regime we eagerly clear out
> > > +        # "stale" entries from statusfolder, i.e. ones that are not
> > > +        # present in the local or destination folder, whereas if we were
> > > +        # to skip this the entries hang around until a not always_sync_deletes
> > > +        # run.
> > > +        sync_deletes = always_sync_deletes or not self.config.getdefaultboolean("Account " + self.accountname, "no-delete-local", False)
> > 
> > So, this is where we read this configuration option. Why here?
> 
> Where else?

Oops, forgot to remove this comment. I've read more context code later,
sorry. While on it I'd just nitpick about the long line. ,-)

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list