@staticmethod
def parse_revision(string):
    """Parse a revision |string| such as "r300"."""
    if not string.startswith('r'):
        raise ValueError('invalid revision: ' + string)
    string = string[1:]
    return int(string)
