관리-도구
편집 파일: revision.cpython-37.pyc
B �M!V'u � @ s� d dl Z d dlZddlmZ d dlmZ ddlmZ e �d�ZG dd� de �Z G dd � d e �ZG d d� de �ZG dd � d e �Z G dd� de�ZG dd� de�Zdd� ZdS )� N� )�util)�compatz(?:(.+?)@)?(\w+)?((?:\+|-)\d+)c @ s e Zd ZdS )� RevisionErrorN)�__name__� __module__�__qualname__� r r �H/opt/alt/python37/lib/python3.7/site-packages/alembic/script/revision.pyr s r c s e Zd Z� fdd�Z� ZS )�RangeNotAncestorErrorc s0 || _ || _tt| ��d|pd|p$df � d S )Nz-Revision %s is not an ancestor of revision %s�base)�lower�upper�superr �__init__)�selfr r )� __class__r r r s zRangeNotAncestorError.__init__)r r r r � __classcell__r r )r r r s r c s e Zd Z� fdd�Z� ZS )� MultipleHeadsc s. || _ || _tt| ��d|d�|�f � d S )Nz6Multiple heads are present for given argument '%s'; %sz, )�heads�argumentr r r �join)r r r )r r r r s zMultipleHeads.__init__)r r r r r r r )r r r s r c s e Zd Z� fdd�Z� ZS )�ResolutionErrorc s t t| ��|� || _d S )N)r r r r )r �messager )r r r r $ s zResolutionError.__init__)r r r r r r r )r r r # s r c @ s e Zd ZdZdd� Zejdd� �Zejdd� �Zejdd � �Z ejd d� �Z ejdd � �Zdd� Zd7dd�Z dd� Zd8dd�Zd9dd�Zdd� Zdd� Zdd � Zd!d"� Zd:d#d$�Zd;d%d&�Zd<d'd(�Zd)d*� Zd+d,� Zd=d-d.�Zd>d/d0�Zd?d1d2�Zd@d3d4�ZdAd5d6�ZdS )B�RevisionMapz�Maintains a map of :class:`.Revision` objects. :class:`.RevisionMap` is used by :class:`.ScriptDirectory` to maintain and traverse the collection of :class:`.Script` objects, which are themselves instances of :class:`.Revision`. c C s || _ dS )a Construct a new :class:`.RevisionMap`. :param generator: a zero-arg callable that will generate an iterable of :class:`.Revision` instances to be used. These are typically :class:`.Script` subclasses within regular Alembic use. N)� _generator)r � generatorr r r r 2 s zRevisionMap.__init__c C s | j | jS )z�All "head" revisions as strings. This is normally a tuple of length one, unless unmerged branches are present. :return: a tuple of string revision numbers. )� _revision_mapr )r r r r r <