def get_digits(revision_str):
    """Return a tuple of the first integer characters of a revision (which
    may be empty) and the remains."""
    # If the string is empty, return (0,'')
    if not revision_str:
        return 0, ''
    # get the index of the first non-digit
    for i, char in enumerate(revision_str):
        if not char.isdigit():
            if i == 0:
                return 0, revision_str
            return int(revision_str[0:i]), revision_str[i:]
    # string is entirely digits
    return int(revision_str), ''