Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ b2sdk>=0.0.0,<1.0.0

## 1.0.4 (not release yet)

* ???
* Make sync treat hidden files as deleted

## 1.0.2 (2019-10-15)

Expand Down
6 changes: 4 additions & 2 deletions b2sdk/sync/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _should_transfer(self):
"""
Decide whether to transfer the file from the source to the destination.
"""
if self._source_file is None:
if self._source_file is None or self._source_file.latest_version().action == 'hide':
# No source file. Nothing to transfer.
return False
elif self._dest_file is None:
Expand Down Expand Up @@ -292,7 +292,9 @@ class DownAndDeletePolicy(DownPolicy):
def _get_hide_delete_actions(self):
for action in super(DownAndDeletePolicy, self)._get_hide_delete_actions():
yield action
if self._dest_file is not None and self._source_file is None:
if self._dest_file is not None and (
self._source_file is None or self._source_file.latest_version().action == 'hide'
):
# Local files have either 0 or 1 versions. If the file is there,
# it must have exactly 1 version.
yield LocalDeleteAction(self._dest_file.name, self._dest_file.versions[0].id_)
Expand Down
2 changes: 1 addition & 1 deletion b2sdk/v0/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def sync_folders(self, *args, **kwargs):
except InvalidArgument as e:
raise CommandError('--%s %s' % (e.parameter_name, e.message))
except IncompleteSync as e:
raise CommandError(e.message)
raise CommandError(str(e))


def get_synchronizer_from_args(
Expand Down