
    q&f                     *    d Z ddlmZ dZd Zd Zd Zy)z7Compute a resolution order for an object and its bases
    )absolute_importrestructuredtextc                     i }g }t        |       D ].  }t        |      D ]  }||vsd||<   |j                  d|         0 |S )a  Merge multiple orderings so that within-ordering order is preserved

    Orderings are constrained in such a way that if an object appears
    in two or more orderings, then the suffix that begins with the
    object must be in both orderings.

    For example:

    >>> _mergeOrderings([
    ... ['x', 'y', 'z'],
    ... ['q', 'z'],
    ... [1, 3, 5],
    ... ['z']
    ... ])
    ['x', 'y', 'q', 1, 3, 5, 'z']

       r   )reversedinsert)	orderingsseenresultorderingos        H/usr/lib/python3/dist-packages/mercurial/thirdparty/zope/interface/ro.py_mergeOrderingsr      s[    & DFY' $(# 	$A}Qa#	$$ M    c                 X    | g}d}t        |      D ]  } |dz  }| j                  |||  |S )Nr   r   )iter	__bases__)obr   is      r   _flattenr   2   sB    TF	A6l #	Q llq# Mr   c                 ,    t        t        |       g      S )z/Compute a "resolution order" for an object
    )r   r   )objects    r   ror   @   s     HV,-..r   N)__doc__
__future__r   __docformat__r   r   r    r   r   <module>r      s#    '":/r   