unlink old version of file from remote tahoe upload dirnode

This commit is contained in:
David Stainton 2015-07-14 13:29:17 -07:00 committed by Daira Hopwood
parent 21da540e5e
commit bdffc3c484

View File

@ -280,15 +280,17 @@ class MagicFolder(service.MultiService):
# XXX upload if we didn't record our version in magicfolder db? # XXX upload if we didn't record our version in magicfolder db?
self._append_to_upload_deque(childpath) self._append_to_upload_deque(childpath)
else: else:
# XXX handle case where we have a lesser version than what is in the collective directory
file_node, metadata = self._get_collective_latest_file(childpath) file_node, metadata = self._get_collective_latest_file(childpath)
if collective_version is None: if collective_version is None:
continue continue
if file_version > collective_version: if file_version > collective_version:
self._append_to_upload_deque(childpath) self._append_to_upload_deque(childpath)
elif file_version < collective_version: elif file_version < collective_version:
# XXX append file to upload queue # if a collective version of the file is newer than ours
pass # we must download it and unlink the old file from our upload dirnode
self._append_to_download_deque(childpath)
# XXX where should we save the returned deferred?
d = self._upload_dirnode.delete(childpath, must_be_file=True)
else: else:
# XXX same version. do nothing. # XXX same version. do nothing.
pass pass