'Update the checkout of the repo to make sure it\'s the latest.
This also syncs versions in the DB.
:param build_env: Build environment'

def setup_vcs(self):

    self.setup_env.update_build(state=BUILD_STATE_CLONING)
    self._log(msg='Updating    docs    from    VCS')
    try:
        update_imported_docs(self.version.pk)
        commit = self.project.vcs_repo(self.version.slug).commit
        if commit:
            self.build['commit'] = commit
    except ProjectImportError as e:
        log.error(LOG_TEMPLATE.format(project=self.project.slug, version=self.version.slug, msg=str(e)), exc_info=True)
        raise BuildEnvironmentError(('Failed    to    import    project:    %s' % e), status_code=404)
