def get_digits(revision):
    """
    Return a tuple of the first integer characters of a revision (which
    may be empty) and the remainder.
    """
    if not revision:
        return 0, ''
    for i, char in enumerate(revision):
        if not char.isdigit():
            if i == 0:
                return 0, revision
            return int(revision[0:i]), revision[i:]
    return int(revision), ''
