[Calypso] [PATCH] Don't remove existing entries

Jelmer Vernooij jelmer at jelmer.uk
Sat Oct 22 15:25:26 PDT 2016


Looks good to me. Thanks for fixing this!

jelmer

On Fri, Oct 21, 2016 at 04:16:01PM +0200, Guido Günther wrote:
> Commit e7d713be18f20ef53a6271306baddb88cd68c2e0 switched from glob to
> listdir but listdir returns relative paths while glob uses absolute
> ones. The comparison always failed removing still wanted files.
> ---
>  calypso/webdav.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/calypso/webdav.py b/calypso/webdav.py
> index 0267825..107791a 100644
> --- a/calypso/webdav.py
> +++ b/calypso/webdav.py
> @@ -344,8 +344,8 @@ class Collection(object):
>                  else:
>                      self.insert_directory("/".join([self.urlpath, filename]))
>          for file in self.files:
> -            if not file.path in filenames:
> -                self.log.debug("Removed %s", file.path)
> +            if os.path.basename(file.path) not in filenames:
> +                self.log.debug("Removed %s %s", file.path)
>                  self.remove_file(file.path)
>          h = hashlib.sha1()
>          for item in self.my_items:
> -- 
> 2.9.3
> _______________________________________________
> Calypso mailing list
> Calypso at keithp.com
> http://keithp.com/mailman/listinfo/calypso
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://keithp.com/pipermail/calypso/attachments/20161022/c76ac80b/attachment.sig>


More information about the Calypso mailing list