Exemple #1
0
def getcommitlogs(rev, startrev, update=False):
    logs = []

    if rev.branch.project.repo_type == 'S':
        from subversion import getlogs, updaterepo
    elif rev.branch.project.repo_type == 'M':
        from mercurial import getlogs, updaterepo
    elif rev.branch.project.repo_type == 'G':
        from git import getlogs, updaterepo
    elif rev.branch.project.repo_type == 'H':
        from github import getlogs, updaterepo
    else:
        if rev.branch.project.repo_type not in ("N", ""):
            logger.warning("Don't know how to retrieve logs from %s project",
                           rev.branch.project.get_repo_type_display())
        return logs

    if update:
        updaterepo(rev.branch.project)

    logs = getlogs(rev, startrev)

    # Remove last log because the startrev log shouldn't be shown
    if len(logs) > 1 and logs[-1].get('commitid') == startrev.commitid:
        logs.pop()

    return logs
Exemple #2
0
def getcommitlogs(rev, startrev, update=False):
    logs = []

    if rev.branch.project.repo_type == 'S':
        from subversion import getlogs, updaterepo
    elif rev.branch.project.repo_type == 'M':
        from mercurial import getlogs, updaterepo
    elif rev.branch.project.repo_type == 'G':
        from git import getlogs, updaterepo
    elif rev.branch.project.repo_type == 'H':
        from github import getlogs, updaterepo
    else:
        if rev.branch.project.repo_type not in ("N", ""):
            logger.warning("Don't know how to retrieve logs from %s project",
                           rev.branch.project.get_repo_type_display())
        return logs

    if update:
        updaterepo(rev.branch.project)

    logs = getlogs(rev, startrev)

    # Remove last log because the startrev log shouldn't be shown
    if len(logs) > 1 and logs[-1].get('commitid') == startrev.commitid:
        logs.pop()

    return logs
def getcommitlogs(rev, startrev, update=False):
    logs = []    
    if rev.project.repo_type == 'N' or rev.project.repo_path == "":
        #Don't fetch logs
        pass
    else:
        if rev.project.repo_type == 'S':
            from subversion import getlogs, updaterepo
        elif rev.project.repo_type == 'M':
            from mercurial import getlogs, updaterepo
        
        if update:
            resp = updaterepo(rev.project.repo_path)
            if resp.get('error'):
                return resp
        logs = getlogs(rev, startrev)
    
    return logs
Exemple #4
0
def getcommitlogs(rev, startrev, update=False):
    logs = []    
    if rev.project.repo_type == 'N' or rev.project.repo_path == "":
        #Don't fetch logs
        pass
    else:
        if rev.project.repo_type == 'S':
            from subversion import getlogs, updaterepo
        elif rev.project.repo_type == 'M':
            from mercurial import getlogs, updaterepo
        
        if update:
            resp = updaterepo(rev.project.repo_path)
            if resp.get('error'):
                return resp
        logs = getlogs(rev, startrev)
        # Remove last log because the startrev log shouldn't be shown
        if len(logs) > 1 and logs[-1].get('commitid') == startrev.commitid:
            logs.pop()
    return logs