-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyc

ó
î:ïNc@@sÄdZddlmZddlZddlZddlZddlmZddlm	Z	ej
ejdƒjd„Z
d„Zd	„Zd
„Zddid„Zd„Zd
„Zd„ZdS(s4Python implementations of Dirstate Helper functions.i(tabsolute_importN(terrors(tDirStates>6LcC@sU|||jd@t|jƒd@t|jƒd@|jd@|jd@|jƒƒd S(sConvert 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ÿÿÿÿ(tst_sizetinttst_mtimetst_ctimetst_devtst_inotst_mode(tstt_b64t_pack((s?/usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt	pack_stats c
C@sXtjdtj|ƒƒ\}}}}}}td|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>6LRRRRRR	(tstructtunpacktbinasciit
a2b_base64tdict(tpacked_statRRRRRR	((s?/usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt_unpack_stat,s-cC@sit|ƒ}d}xP||krd||d}||}t||ƒdkr[|d}q|}qW|S(shReturn 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
    iii(tlent_cmp_path_by_dirblock(tpathstpaththitlotmidtcur((s?/usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt_bisect_path_left7s!


cC@sit|ƒ}d}xP||krd||d}||}t||ƒdkrW|}q|d}qW|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
    iii(RR(RRRRRR((s?/usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt_bisect_path_rightes
	c	C@sã|dkrt|ƒ}ny||}Wn*tk
rU|jdƒ}|||<nXx†||krÞ||d}||d}y||}Wn*tk
r»|jdƒ}|||<nX||krÕ|d}qY|}qYW|S(sRReturn 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/iiiN(tNoneRtKeyErrortsplit(	t	dirblockstdirnameRRtcachet
dirname_splitRRt	cur_split((s?/usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pytbisect_dirblock„s&




cC@s{t|tƒs.tdt|ƒ|fƒ‚nt|tƒs\tdt|ƒ|fƒ‚nt|jdƒ|jdƒƒS(s%Compare two paths directory by directory.

    This is equivalent to doing::

       cmp(path1.split('/'), path2.split('/'))

    The idea is that you should compare path components separately. This
    differs from plain ``cmp(path1, path2)`` for paths like ``'a-b'`` and
    ``a/b``. "a-b" comes after "a" but would come before "a/b" lexically.

    :param path1: first path
    :param path2: second path
    :return: negative number if ``path1`` comes first,
        0 if paths are equal,
        and positive number if ``path2`` sorts first
    s*'path1' must be a plain string, not %s: %rs*'path2' must be a plain string, not %s: %rR(t
isinstancetstrt	TypeErrorttypetcmpR"(tpath1tpath2((s?/usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pytcmp_by_dirs£scC@sÃt|tƒs.tdt|ƒ|fƒ‚nt|tƒs\tdt|ƒ|fƒ‚ntjj|ƒ\}}|jdƒ|f}tjj|ƒ\}}|jdƒ|f}t||ƒS(sÚCompare two paths based on what directory they are in.

    This generates a sort order, such that all children of a directory are
    sorted together, and grandchildren are in the same order as the
    children appear. But all grandchildren come after all children.

    :param path1: first path
    :param path2: the second path
    :return: negative number if ``path1`` comes first,
        0 if paths are equal
        and a positive number if ``path2`` sorts first
    s*'path1' must be a plain string, not %s: %rs*'path2' must be a plain string, not %s: %rR(R)R*R+R,tosRR"R-(R.R/tdirname1t	basename1tkey1tdirname2t	basename2tkey2((s?/usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyR½s
cC@sÛ|jj|jƒ|jjƒ}|jdƒ}|jƒ}|dkretj|d|fƒ‚nd}|jƒ}d|}|j	ƒ}||j
}t|ƒ}	|	||kråtj|d|	||||j
|fƒ‚n|dkr|t}
t
|ƒj}xt|ƒD]
}|ƒqWdgfdgfg|_|jdd}
d}|
j}x
t|j
ƒD]ü}|ƒ}|ƒ}|ƒ}||krÊg}
|}|jj||
fƒ|
j}n|||f|ƒ|ƒ|
|ƒƒ|ƒdk|ƒf|ƒ|ƒ|
|ƒƒ|ƒdk|ƒfgf}|ƒ}|dkratd	|ƒ‚n||ƒqoW|jƒnO|jƒ}gt||	|ƒD]}|||||!ƒ^q›}|j|ƒtj|_d
S(s,Read in the dirblocks for the given DirState object.

    This is tightly bound to the DirState internal representation. It should be
    thought of as a member function, which is only separated out so that we can
    re-write it in pyrex.

    :param state: A DirState object.
    :return: None
    ttstrailing garbage: %risGfield count incorrect %s != %s, entry_size=%s, num_entries=%s fields=%ritys
s trailing garbage in dirstate: %rN(t_state_filetseekt_end_of_headertreadR"tpopRtDirstateCorruptt_num_present_parentst_fields_per_entryt_num_entriesRRtitertnexttxranget
_dirblockstappendt
ValueErrort"_split_root_dirblock_into_contentst_get_fields_to_entryt_entries_to_current_stateRtIN_MEMORY_UNMODIFIEDt_dirblock_state(tstatettexttfieldsttrailingRtnum_present_parentst
tree_countt
entry_sizetexpected_field_counttfield_countt_intREtxt
current_blocktcurrent_dirnametappend_entrytcountR$tnametfile_idtentrytfields_to_entrytpostentries((s?/usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt_read_dirblocks×sr
	

	
						
3
(t__doc__t
__future__RRR1RtbzrlibRtbzrlib.dirstateRt
b2a_base64tStructtpackR
RRRR R(R0RRd(((s?/usr/lib/python2.7/dist-packages/bzrlib/_dirstate_helpers_py.pyt<module>s
		.			

Copyright © 2017 || Recoded By Mr.Bumblebee