From: meejah Date: Mon, 26 Oct 2015 14:55:50 +0000 (-0600) Subject: WIP fixes for delete X-Git-Url: https://git.rkrishnan.org/cyclelanguage?a=commitdiff_plain;h=f8bdfa01f1e71524ce97b5f10ff6ab4bce0fa470;p=tahoe-lafs%2Ftahoe-lafs.git WIP fixes for delete --- diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index 2121356a..3006ce67 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -320,7 +320,10 @@ class Uploader(QueueMixin): last_downloaded_uri = self._db.get_last_downloaded_uri(relpath_u) current_version = self._db.get_local_file_version(relpath_u) - if current_version is None: + if not self._db.is_new_file(pathinfo, relpath_u): + self._log("ignoring {}".format(relpath_u)) + return + elif current_version is None: new_version = 0 else: new_version = current_version + 1 diff --git a/src/allmydata/test/test_magic_folder.py b/src/allmydata/test/test_magic_folder.py index 6fa33380..bd7cfbb5 100644 --- a/src/allmydata/test/test_magic_folder.py +++ b/src/allmydata/test/test_magic_folder.py @@ -364,6 +364,7 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual 1 ) + print("BOB DELETE") # now bob deletes it (bob should upload, alice download) bob_proc = self.bob_magicfolder.uploader.set_hook('processed') alice_proc = self.alice_magicfolder.downloader.set_hook('processed') @@ -383,6 +384,7 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual yield self._check_version_in_dmd(self.alice_magicfolder, u"blam", 1) yield self._check_version_in_local_db(self.alice_magicfolder, u"blam", 1) + print("ALICE RESTORE") # now alice restores it (alice should upload, bob download) alice_proc = self.alice_magicfolder.uploader.set_hook('processed') bob_proc = self.bob_magicfolder.downloader.set_hook('processed')