-=[ Mr. Bumblebee ]=-
_Indonesia_
ó
î:ïNc @@ sÄ d Z d d l m Z d d l Z d d l Z d d l Z d d l m Z d d l m Z e j
e j d ƒ j d „ Z
d „ Z d „ Z d
„ Z d d i d „ Z d „ Z d
„ Z d „ Z d S( s4 Python implementations of Dirstate Helper functions.i ( t absolute_importN( t errors( t DirStates >6Lc C@ sU | | | j d @t | j ƒ d @t | j ƒ d @| j d @| j d @| j ƒ ƒ d S( s Convert stat values into a packed representation
Not all of the fields from the stat included are strictly needed, and by
just encoding the mtime and mode a slight speed increase could be gained.
However, using the pyrex version instead is a bigger win.
Iÿÿÿÿ iÿÿÿÿ( t st_sizet intt st_mtimet st_ctimet st_devt st_inot st_mode( t stt _b64t _pack( ( s? /usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt pack_stat s c
C@ sX t j d t j | ƒ ƒ \ } } } } } } t d | d | d | d | d | d | ƒ S( s{ Turn a packed_stat back into the stat fields.
This is meant as a debugging tool, should not be used in real code.
s >6LR R R R R R ( t structt unpackt binasciit
a2b_base64t dict( t packed_statR R R R R R ( ( s? /usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt _unpack_stat, s -c C@ si t | ƒ } d } xP | | k rd | | d } | | } t | | ƒ d k r[ | d } q | } q W| S( sh Return the index where to insert path into paths.
This uses the dirblock sorting. So all children in a directory come before
the children of children. For example::
a/
b/
c
d/
e
b-c
d-e
a-a
a=c
Will be sorted as::
a
a-a
a=c
a/b
a/b-c
a/d
a/d-e
a/b/c
a/d/e
:param paths: A list of paths to search through
:param path: A single path to insert
:return: An offset where 'path' can be inserted.
:seealso: bisect.bisect_left
i i i ( t lent _cmp_path_by_dirblock( t pathst patht hit lot midt cur( ( s? /usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt _bisect_path_left7 s !
c C@ si t | ƒ } d } xP | | k rd | | d } | | } t | | ƒ d k rW | } q | d } q W| S( sŠ Return the index where to insert path into paths.
This uses a path-wise comparison so we get::
a
a-b
a=b
a/b
Rather than::
a
a-b
a/b
a=b
:param paths: A list of paths to search through
:param path: A single path to insert
:return: An offset where 'path' can be inserted.
:seealso: bisect.bisect_right
i i i ( R R ( R R R R R R ( ( s? /usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt _bisect_path_righte s
c C@ sã | d k r t | ƒ } n y | | } Wn* t k
rU | j d ƒ } | | | <n Xx† | | k rÞ | | d } | | d } y | | } Wn* t k
r» | j d ƒ } | | | <n X| | k rÕ | d } qY | } qY W| S( sR Return the index where to insert dirname into the dirblocks.
The return value idx is such that all directories blocks in dirblock[:idx]
have names < dirname, and all blocks in dirblock[idx:] have names >=
dirname.
Optional args lo (default 0) and hi (default len(dirblocks)) bound the
slice of a to be searched.
t /i i i N( t NoneR t KeyErrort split( t dirblockst dirnameR R t cachet
dirname_splitR R t cur_split( ( s? /usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt bisect_dirblock„ s&