Пример #1
0
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
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
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
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
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