]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Delete process_child.
authorDaira Hopwood <daira@jacaranda.org>
Mon, 21 Sep 2015 16:51:44 +0000 (17:51 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Mon, 21 Sep 2015 16:51:44 +0000 (17:51 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/frontends/magic_folder.py

index bb8ef6212ca370cc05dfde9f27883cbb7475bc80..2569bf6d4ef9ac9af268b4f4cbfe5425c8ec4a01 100644 (file)
@@ -244,7 +244,7 @@ class Uploader(QueueMixin):
         for child in children:
             assert isinstance(child, unicode), child
             d.addCallback(lambda ign, child=child: os.path.join(reldir_u, child))
-            d.addCallback(self._process_child)
+            d.addCallback(self._process)
             d.addErrback(log.err)
 
         return d
@@ -257,50 +257,6 @@ class Uploader(QueueMixin):
     def _when_queue_is_empty(self):
         return defer.succeed(None)
 
-    def _process_child(self, relpath_u):
-        precondition(isinstance(relpath_u, unicode), relpath_u)
-
-        abspath_u = self._get_abspath(relpath_u)
-        pathinfo = get_pathinfo(abspath_u)
-
-        if pathinfo.islink:
-            self.warn("WARNING: cannot backup symlink %s" % quote_local_unicode_path(abspath_u))
-            return None
-        elif pathinfo.isdir:
-            # process directories unconditionally
-            self._append_to_deque(relpath_u)
-
-            # recurse on the child directory
-            return self._scan(relpath_u)
-        elif pathinfo.isfile:
-            file_version = self._db.get_local_file_version(relpath_u)
-            if file_version is None:
-                # XXX upload if we didn't record our version in magicfolder db?
-                self._append_to_deque(relpath_u)
-                return None
-            else:
-                d2 = self._get_collective_latest_file(relpath_u)
-                def _got_latest_file((file_node, metadata)):
-                    collective_version = metadata['version']
-                    if collective_version is None:
-                        return None
-                    if file_version > collective_version:
-                        self._append_to_upload_deque(relpath_u)
-                    elif file_version < collective_version: # FIXME Daira thinks this is wrong
-                        # if a collective version of the file is newer than ours
-                        # we must download it and unlink the old file from our upload dirnode
-                        self._append_to_download_deque(relpath_u)
-                        # XXX where should we save the returned deferred?
-                        return self._upload_dirnode.delete(relpath_u, must_be_file=True)
-                    else:
-                        # XXX same version. do nothing.
-                        pass
-                d2.addCallback(_got_latest_file)
-                return d2
-        else:
-            self.warn("WARNING: cannot backup special file %s" % quote_local_unicode_path(abspath_u))
-            return None
-
     def _process(self, relpath_u):
         precondition(isinstance(relpath_u, unicode), relpath_u)