@classmethod
def rev_parse(cls, git, revision):
    """Parse revision string."""
    start, is_range, stop = revision.partition('..')
    if not is_range:
        start, stop = None, start
    elif not stop:
        stop = 'HEAD'
    return cls(start=git.rev_parse(start) if start else None, stop=git.
        rev_parse(stop))
