docs: def mergetree(src, dst, condition=None, copyfn=mergecopy, srcbase=None):
      """
      Recursively merge a directory tree using mergecopy().
      """
      src = fsencoding(src)
      dst = fsencoding(dst)
      if srcbase is None:
          srcbase = src
      names = map(fsencoding, os.listdir(src))
      try:
          os.makedirs(dst)
      except OSError:
          pass
      errors = []
      for name in names:
          srcname = os.path.join(src, name)
          dstname = os.path.join(dst, name)
          if condition is not None and not condition(srcname):
              continue
          try:
              if os.path.islink(srcname):
                  # XXX: This is naive at best, should check srcbase(?)
                  realsrc = os.readlink(srcname)
                  os.symlink(realsrc, dstname)
              elif os.path.isdir(srcname):
                  mergetree(srcname, dstname,
                      condition=condition, copyfn=copyfn, srcbase=srcbase)
              else:
                  copyfn(srcname, dstname)
          except (IOError, os.error), why:
              errors.append((srcname, dstname, why))
      if errors:
          raise IOError(errors)