]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
WIP fixes for delete
authormeejah <meejah@meejah.ca>
Mon, 26 Oct 2015 14:55:50 +0000 (08:55 -0600)
committermeejah <meejah@meejah.ca>
Mon, 26 Oct 2015 14:55:50 +0000 (08:55 -0600)
src/allmydata/frontends/magic_folder.py
src/allmydata/test/test_magic_folder.py

index 2121356ab103d728d84cfc34b0f03dfe56bc3290..3006ce679f8c3c2fdd0c07070b33fcef0639850b 100644 (file)
@@ -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
index 6fa3338073ef651b4e4d0addbae79a06193fcb1a..bd7cfbb5531b3914a917bdf291403e3fd6cb03fa 100644 (file)
@@ -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')