def import_vcsrepo_content(cnx, repohdlr, commitevery=10, raise_on_error=False
    ):
    """synchronize content of given vcs repository"""
    vcsrepo = repohdlr.entity
    try:
        repohdlr.import_content(commitevery)
        cnx.commit()
    except Exception:
        if raise_on_error:
            raise
        try:
            title = vcsrepo.dc_title()
        except Exception:
            title = str(vcsrepo)
        repohdlr.exception('error while importing content for vcs repo %s',
            title)
        cnx.rollback()
