コード例 #1
0
ファイル: __init__.py プロジェクト: Pi3R1k/seahub
def calc_file_last_modified(repo_id, file_path, file_path_hash, file_id):
    """Calculate file last modification time, and save to db.
    """
    try:
        # get the lastest one file revision
        commits = seafserv_threaded_rpc.list_file_revisions(repo_id, file_path, 1, -1)
    except SearpcError, e:
        return '', 0
コード例 #2
0
ファイル: __init__.py プロジェクト: bearstech/seahub
def get_file_contributors_from_revisions(repo_id, file_path):
    """Inspect the file history and get a list of users who have modified the
    it.

    """
    commits = []
    try:
        commits = seafserv_threaded_rpc.list_file_revisions(repo_id, file_path, -1, -1)
    except SearpcError, e:
        return [], 0, ''
コード例 #3
0
ファイル: __init__.py プロジェクト: viktorlindgren/seahub
def get_file_contributors_from_revisions(repo_id, file_path):
    """Inspect the file history and get a list of users who have modified the
    it.

    """
    commits = []
    try:
        commits = seafserv_threaded_rpc.list_file_revisions(
            repo_id, file_path, -1, -1)
    except SearpcError, e:
        return [], 0, ''
コード例 #4
0
ファイル: utils.py プロジェクト: strogo/seahub
def get_file_contributors_from_revisions(repo_id, file_path):
    """Inspect the file history and get a list of users who have modified the
    it.

    """
    commits = []
    try:
        commits = seafserv_threaded_rpc.list_file_revisions(repo_id, file_path, -1)
    except SearpcError:
        return []

    # Commits are already sorted by date, so the user list is also sorted.
    users = [ commit.creator_name for commit in commits if commit.creator_name ]

    # Remove duplicate elements in a list
    ret = []
    for user in users:
        if user not in ret:
            ret.append(user)

    return ret, commits[0].ctime, commits[0].id
コード例 #5
0
ファイル: __init__.py プロジェクト: bearstech/seahub
def calc_file_last_modified(repo_id, file_path, file_path_hash, file_id):
    try:
        # get the lastest one file revision
        commits = seafserv_threaded_rpc.list_file_revisions(repo_id, file_path, 1, -1)
    except SearpcError, e:
        return '', 0