-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
À§éOc@@s]dZddlmZddlZddlZddlmZeeƒdƒddlm	Z	m
Z
ddlmZddl
mZdd	lmZmZeeedd
„Zd„Zd„Zdd
„Zddd„Zdd„Zd„ZdZd„Zd„Zd„Zyddlm Z Wn0e!k
rXZ"e
j#e"ƒddl$m Z nXdS(s$File annotate based on weave storagei(tabsolute_importN(tlazy_imports9
from bzrlib import (
    patiencediff,
    tsort,
    )
(terrorstosutils(textract_email_address(t_strip_NULL_ghosts(tCURRENT_REVISIONtRevisionc
C@s,|dkr|j}n|dkr0tj}nt|j|ƒƒ}|r[t|||ƒSt|dtƒs÷t	t
ƒ}|jƒ|_y|j
ƒjdƒ|_Wntjk
rÃd|_nXd|_ttjƒdƒ|_tjƒ|_nd}tt|||ƒƒ}	t|	|||ƒdS(s3Annotate file_id in a tree.

    The tree should already be read_locked() when annotate_file_tree is called.

    :param tree: The tree to look for revision numbers and history from.
    :param file_id: The file_id to annotate.
    :param to_file: The file to output the annotation to.
    :param verbose: Show all details rather than truncating to ensure
        reasonable text width.
    :param full: XXXX Not sure what this does.
    :param show_ids: Show revision ids in the annotation output.
    :param branch: Branch to use for revision revno lookups
    tget_revision_idtemails
local usert?iN(tNonetbranchtsyststdouttlistt
annotate_itert_show_id_annotationstgetattrtFalseRRtget_parent_idst
parent_idstget_config_stacktgett	committerRtNoWhoamitmessagetroundttimet	timestampRtlocal_time_offsetttimezonet_expand_annotationst_print_annotations(
ttreetfile_idtto_filetverbosetfulltshow_idsRtannotationstcurrent_revt
annotation((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pytannotate_file_tree4s*
	cC@s­t|ƒdkr#d}}}nBtd„|Dƒƒ}td„|Dƒƒ}td„|Dƒƒ}|s}t|dƒ}nt|dƒ}d}t|ddƒp­tjƒ}xö|D]î\}	}
}}}
|rîd	||	||
|f}n>t|	ƒ|kr|	|d
 d}	nd||	|
d
 f}|jƒdkrM|rM|}ny|j|ƒWn*t	k
rŠ|j|j
|dƒƒnX|jd|
fƒ|}q·WdS(sñPrint annotations to to_file.

    :param to_file: The file to output the annotation to.
    :param verbose: Show all details rather than truncating to ensure
        reasonable text width.
    :param full: XXXX Not sure what this does.
    ics@s|]}t|dƒVqdS(iN(tlen(t.0tx((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>lscs@s|]}t|dƒVqdS(iN(R,(R-R.((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>mscs@s|]}t|dƒVqdS(iN(R,(R-R.((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>nsiittencodings%-*s %-*s %8s it>s
%-*s %-7s itreplaces| %s
N(R,tmaxtminRRRtget_terminal_encodingtlstriptwritetUnicodeEncodeErrortencode(R*R%R$R&tmax_origin_lent
max_revno_lent
max_revid_lentprevannoR0t	revno_strtauthortdate_strtline_rev_idttexttanno((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pyR!as4		
cC@s‚|s
dSd}td„|Dƒƒ}xU|D]M\}}|sK||krT|}nd}|jd|||fƒ|}q-WdS(Ncs@s!|]\}}t|ƒVqdS(N(R,(R-toriginRB((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>“sR/s%*s | %s(RR3R7(R(R$R&tlast_rev_idR:RDRBtthis((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pyRs	
cc@sR|j}|dk	r™|j}|jƒ}td„|j|jƒDƒƒ}t|ƒ}|j||<tj	||ddt
ƒ}td„|Dƒƒ}n|jƒ}d}	td„|Dƒƒ}
i}t
|
krûd|jƒdf|t
<||t
<ng|
D]}|j|ƒr|^q}
|jd„|j|
ƒDƒƒx|D]\}
}|jdƒ}|
|	krƒd\}}}n³|
}	|
|kr§d\}}}ndjd„||
Dƒƒ}||
}|jpÚd
}tjdtj|j|ƒƒ}|jƒd
}yt|ƒ}Wntjk
r5nX||||
|fVqJWdS(s‹Expand a file's annotations into command line UI ready tuples.

    Each tuple includes detailed information, such as the author name, and date
    string for the commit, rather than just the revision id.

    :param annotations: The annotations to expand.
    :param revision_id_to_revno: A map from id to revision numbers.
    :param branch: A locked branch to query for revision details.
    cs@s-|]#\}}|dk	r||fVqdS(N(R(R-tkeytvalue((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>³s	tgenerate_revnocs@s*|] \}}}}}||fVqdS(N((R-tseq_numtrev_idtdepthtrevnotend_of_merge((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>¼scs@s|]\}}|VqdS(N((R-tott((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>Âss%d?ics@s|]}|j|fVqdS(N(trevision_id(R-tr((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>Êss
R/R
t.cs@s|]}t|ƒVqdS(N(tstr(R-ti((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>Õsis%Y%m%dN(R/R/R/(R
R
R
(t
repositoryRRQt	get_graphtdictt
iter_ancestryRRttsortt
merge_sorttTruetget_revision_id_to_revno_maptsetRRMthas_revisiontupdatet
get_revisionstrstriptjoinRRtstrftimetgmtimeRtget_apparent_authorsRRtNoEmailInUsername(R(RR)RVt
last_revisiontgraphtrevision_graphtmerge_sorted_revisionstrevision_id_to_revnotlast_origintrevision_idst	revisionsRORDRBR>R?R@trevttz((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pyR žsZ
			
		


	c@sÆt|ƒdkr4gˆD]}ˆ|f^q}nŽt|ƒdkrbt|dˆˆ|ƒ}n`t|ƒdkr¬t|dˆˆ|ƒ}t|dˆˆ||ƒ}nt|dˆˆ|ƒg}|j‡‡fd†|dDƒƒg}xÍt|ŒD]¿}	td„|	Dƒƒ}
t|
ƒdkrA|j|	dƒqÿ|	dd}t|
ƒdkr}ˆ|
kr}|
jˆƒnt|
ƒdkr«|j|
jƒ|fƒqÿ|jˆ|fƒqÿW|S(sþCreate a new annotated version from new lines and parent annotations.

    :param parents_lines: List of annotated lines for all parents
    :param new_lines: The un-annotated new lines
    :param new_revision_id: The revision-id to associate with new lines
        (will often be CURRENT_REVISION)
    :param left_matching_blocks: a hint about which areas are common
        between the text and its left-hand-parent.  The format is
        the SequenceMatcher.get_matching_blocks format
        (start_left, start_right, length_of_match).
    :param heads_provider: An object which provides a .heads() call to resolve
        if any revision ids are children of others.
        If None, then any ancestry disputes will be resolved with
        new_revision_id
    iiic3@s!|]}t|ˆˆƒVqdS(N(t_reannotate(R-tp(t	new_linestnew_revision_id(s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>scs@s|]\}}|VqdS(N((R-tatl((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pys	<genexpr>	s(	R,Rrt_reannotate_annotatedtextendtzipR^tappendtremovetpop(t
parents_linesRtRut_left_matching_blockstheads_providertlinetlinestleftt
reannotationstannostorigins((RtRus3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pyt
reannotateås6"	

cC@sÆd}|dkrUg|D]\}}|^q}tjd||ƒ}|jƒ}ng}	xd|D]\\}
}}x(|||!D]}
|	j||
fƒqW|	j||
|
|!ƒ||}qbW|	S(Ni(RtpatiencedifftPatienceSequenceMatchertget_matching_blocksR{Ry(tparent_linesRtRutmatching_blockstnew_curRRRwtplain_parent_linestmatcherR‚RUtjtnR((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pyRrs	cC@stjd||ƒ}|jƒS(N(RˆR‰RRŠ(toldtnewR((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pyt_get_matching_blocks)scC@st|ƒdS(s¶Chose an attribution between several possible ones.

    :param annotated_lines: A list of tuples ((file_id, rev_id), line) where
        the lines are identical but the revids different while no parent
        relation exist between them

     :return : The "winning" line. This must be one with a revid that
         guarantees that further criss-cross merges will converge. Failing to
         do so have performance implications.
    i(tsorted(tannotated_lines((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pyt_old_break_annotation_tie0sc
C@sÓ|j}
|j}g|||!D]\}}
|
^q }|||!}t||ƒ}d}xr|D]j\}}}||kr˜|
|||||!ƒnx&t|ƒD]}||||}||||}|d|dkrð||ƒq¥|d|	kr
||ƒq¥|dkr0||	|dfƒq¥|j|d|dfƒ}t|ƒdkr‚|t|ƒjƒ|dfƒq¥t	dkr§|t
||gƒƒq¥|t	||gƒƒq¥W||}qaWdS(sÅFind lines in plain_right_lines that match the existing lines.

    :param output_lines: Append final annotated lines to this list
    :param plain_child_lines: The unannotated new lines for the child text
    :param child_lines: Lines for the child text which have been annotated
        for the left parent

    :param start_child: Position in plain_child_lines and child_lines to start
        the match searching
    :param end_child: Last position in plain_child_lines and child_lines to
        search for a match
    :param right_lines: The annotated lines for the whole text for the right
        parent
    :param start_right: Position in right_lines to start the match
    :param end_right: Last position in right_lines to search for a match
    :param heads_provider: When parents disagree on the lineage of a line, we
        need to check if one side supersedes the other
    :param revision_id: The label to give if a line should be labeled 'tip'
    iiN(RyR{R”txrangeRtheadsR,titertnextt_break_annotation_tieR—(toutput_linestplain_child_linestchild_lineststart_childt	end_childtright_lineststart_rightt	end_rightR€RQt
output_extendt
output_appendRvRwtplain_right_subsettplain_child_subsettmatch_blockstlast_child_idxt	right_idxt	child_idxt	match_lentoffsetRƒtrightR™((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pyt _find_matching_unannotated_linesEs6		&



#c
C@sét|ƒt|ƒkr'tdƒ‚ng}|j}d}d}t||ƒ}	x‘|	D]‰\}
}}||
ks||kr“||||!ƒn%t||||||||
||ƒ
|
|}||}|||||!ƒqXW|S(sMUpdate the annotations for a node based on another parent.

    :param right_parent_lines: A list of annotated lines for the right-hand
        parent.
    :param new_lines: The unannotated new lines.
    :param new_revision_id: The revision_id to attribute to lines which are not
        present in either parent.
    :param annotated_lines: A list of annotated lines. This should be the
        annotation of new_lines based on parents seen so far.
    :param heads_provider: When parents disagree on the lineage of a line, we
        need to check if one side supersedes the other.
    s(mismatched new_lines and annotated_linesi(R,tAssertionErrorRyR”R°(
tright_parent_linesRtRuR–R€R‚tlines_extendtlast_right_idxt
last_left_idxtmatching_left_and_rightR«tleft_idxR­((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pyRx‰s,		

(t	Annotator(%t__doc__t
__future__RR
Rtbzrlib.lazy_importRtglobalstbzrlibRRt
bzrlib.configRtbzrlib.repositoryRtbzrlib.revisionRRRRR+R!RR R‡RrR”RœR—R°Rxtbzrlib._annotator_pyxR¸tImportErrortetfailed_to_load_extensiontbzrlib._annotator_py(((s3/usr/lib/python2.7/dist-packages/bzrlib/annotate.pyt<module>s8	,	.	H2			D	0


Copyright © 2017 || Recoded By Mr.Bumblebee