'Symlink project\'s versions
Link from $WEB_ROOT/<project>/<language>/<version>/ ->
HOME/user_builds/<project>/rtd-builds/<version>'

def symlink_versions(self):

    versions = set()
    version_dir = os.path.join(self.WEB_ROOT, self.project.slug, self.project.language)
    version_queryset = self.get_version_queryset()
    if version_queryset.count():
        if (not os.path.exists(version_dir)):
            safe_makedirs(version_dir)
    for version in version_queryset:
        self._log((u'Symlinking    Version:    %s' % version))
        symlink = os.path.join(version_dir, version.slug)
        docs_dir = os.path.join(settings.DOCROOT, self.project.slug, 'rtd-builds', version.slug)
        run('ln    -nsf    {0}    {1}'.format(docs_dir, symlink))
        versions.add(version.slug)
    if os.path.exists(version_dir):
        for old_ver in os.listdir(version_dir):
            if (old_ver not in versions):
                os.unlink(os.path.join(version_dir, old_ver))
