code: def merge_tree(
              self, dst, symlinks=False,
              *,
              update=False,
              copy_function=shutil.copy2,
              ignore=lambda dir, contents: []):
          
          dst = self._next_class(dst)
          dst.makedirs_p()
  
          if update:
              warnings.warn(
                  "Update is deprecated; "
                  "use copy_function=only_newer(shutil.copy2)",
                  DeprecationWarning,
                  stacklevel=2,
              )
              copy_function = only_newer(copy_function)
  
          sources = self.listdir()
          _ignored = ignore(self, [item.name for item in sources])
  
          def ignored(item):
              return item.name in _ignored
  
          for source in itertools.filterfalse(ignored, sources):
              dest = dst / source.name
              if symlinks and source.islink():
                  target = source.readlink()
                  target.symlink(dest)
              elif source.isdir():
                  source.merge_tree(
                      dest,
                      symlinks=symlinks,
                      update=update,
                      copy_function=copy_function,
                      ignore=ignore,
                  )
              else:
                  copy_function(source, dest)
  
          self.copystat(dst)
docs: Copy entire contents of self to dst, overwriting existing
          contents in dst with those in self.
  
          Pass ``symlinks=True`` to copy symbolic links as links.
  
          Accepts a ``copy_function``, similar to copytree.
  
          To avoid overwriting newer files, supply a copy function
          wrapped in ``only_newer``. For example::
  
              src.merge_tree(dst, copy_function=only_newer(shutil.copy2))