コード例 #1
0
ファイル: api.py プロジェクト: nyuhuhuu/trachacks
def normaliseRev(rev):
    """Normalise a Perforce revision and return it as a Trac-compatible rev.

    Basically converts revisions to '@<label/client/date>' or '#<rev>' but
    returns '@<change>' as an integer value.
    """
    from p4trac.repos import NodePath
    rev = NodePath.normaliseRevision(rev)
    if rev is None:
        return rev
    elif rev.startswith(u'@') and rev[1:].isdigit():
        return int(rev[1:])
    else:
        return rev
コード例 #2
0
ファイル: api.py プロジェクト: pombredanne/trachacks
def normaliseRev(rev):
    """Normalise a Perforce revision and return it as a Trac-compatible rev.

    Basically converts revisions to '@<label/client/date>' or '#<rev>' but
    returns '@<change>' as an integer value.
    """
    from p4trac.repos import NodePath
    rev = NodePath.normaliseRevision(rev)
    if rev is None:
        return rev
    elif rev.startswith(u'@') and rev[1:].isdigit():
        return int(rev[1:])
    else:
        return rev