-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
®¦&Oc@@s¾dZddlmZddlZddlmZmZmZddlm	Z	ddl
mZd„Zd„Z
d	ejfd
„ƒYZdefd„ƒYZd
jd„Zed„ZdS(s'Merge logic for changelog_merge plugin.i(tabsolute_importN(tdebugtmergeturlutils(tMerge3(tmuttercC@sg}xw|D]o}|ddkr6|j|gƒq
y|d}Wn(tk
rn|jgƒ|d}nX|j|ƒq
Wtt|ƒS(s–Return a list of changelog entries.

    :param lines: lines of a changelog file.
    :returns: list of entries.  Each entry is a tuple of lines.
    it s	s
iÿÿÿÿ(Rs	s
(tappendt
IndexErrortmapttuple(tlinestentriestlinetentry((sR/usr/lib/python2.7/dist-packages/bzrlib/plugins/changelog_merge/changelog_merge.pytchangelog_entries s


cc@s+x$|D]}x|D]}|VqWqWdS(s5Turn a list of entries into a flat iterable of lines.N((RRR
((sR/usr/lib/python2.7/dist-packages/bzrlib/plugins/changelog_merge/changelog_merge.pytentries_to_lines6s

tChangeLogMergercB@s&eZdZdZd„Zd„ZRS(s!Merge GNU-format ChangeLog files.t	changelogcC@stj|j|jƒƒS(sÁCalculate the path to the file in a tree.

        This is overridden to return just the basename, rather than full path,
        so that e.g. if the config says ``changelog_merge_files = ChangeLog``,
        then all ChangeLog files in the tree will match (not just one in the
        root of the tree).
        
        :param params: A MergeHookParams describing the file to merge
        :param tree: a Tree, e.g. self.merger.this_tree.
        (Rtbasenametid2pathtfile_id(tselftparamsttree((sR/usr/lib/python2.7/dist-packages/bzrlib/plugins/changelog_merge/changelog_merge.pytget_filepathBscC@sht|jƒ}t|jƒ}t|jƒ}yt|||ƒ}Wntk
rWdSXdt|ƒfS(sŠMerge changelog changes.

         * new entries from other will float to the top
         * edits to older entries are preserved
        tnot_applicabletsuccessN(RN(Rt
this_linestother_linest
base_linest
merge_entriest
EntryConflicttNoneR(RRtthis_entriest
other_entriestbase_entriestresult_entries((sR/usr/lib/python2.7/dist-packages/bzrlib/plugins/changelog_merge/changelog_merge.pyt
merge_textOs
(t__name__t
__module__t__doc__tname_prefixRR&(((sR/usr/lib/python2.7/dist-packages/bzrlib/plugins/changelog_merge/changelog_merge.pyR=s	
R cB@seZRS((R'R((((sR/usr/lib/python2.7/dist-packages/bzrlib/plugins/changelog_merge/changelog_merge.pyR cstcC@sJt||ƒ}t||ƒ}t|ƒ}t|ƒ}g}tjƒ}d}	xìtr<d}
|	}xf|D]^}|j|ƒxH|D]@}
|j|
ƒ|jƒ}||kr„||
f}
|}q„q„WqjW|
dk	r8|j	|
dƒ}|j	|
dƒ}|j
||||fƒ||=||=||=||=qQPqQW|||fS(sÆDefault implementation of guess_edits param of merge_entries.

    This algorithm does O(N^2 * logN) SequenceMatcher.ratio() calls, which is
    pretty bad, but it shouldn't be used very often.
    gš™™™™™é?iiN(R	tlisttdifflibtSequenceMatchertTrueR!tset_seq1tset_seq2tratiotindexR(tnew_entriestdeleted_entriestentry_as_strtdeleted_entries_as_strstnew_entries_as_strst
result_newtresult_deletedtresult_editstsmtCUTOFFtbestt
best_scoretnew_entry_as_strtold_entry_as_strtscoret	del_indext	new_index((sR/usr/lib/python2.7/dist-packages/bzrlib/plugins/changelog_merge/changelog_merge.pytdefault_guess_editsgs6	



cC@s%t|||dtƒ}g}t}xú|jƒD]ì}dtjkrVtd|ƒn|d}|dkr|\}	}
}}g|D]}
|
|
kr…|
^q…}g|
D]}
|
|krª|
^qª}|rï|rï|||ƒ\}}}ng}dtjkr;td|ƒtd|ƒtd|ƒtd	|ƒng|D]}
|
|krB|
^qB}xN|D]F\}}y|j|ƒ}Wntk
r¢tƒ‚nX|||<qgWdtjkrÐtd
|ƒn|rã||}n
|j	|ƒ|j	|ƒn|d}|j	|ƒt
}q1W|S(s5Merge changelog given base, this, and other versions.t
allow_objectstchangelog_mergesmerge group:
%ritconflicts
at_top: %rsnew_in_other: %rsdeleted_in_other: %rsedits_in_other: %rsupdated_this: %ri(RR/tmerge_groupsRtdebug_flagsRR3t
ValueErrorR textendtFalse(R$R"R#tguess_editstm3R%tat_toptgroupt
group_kindt_tbasetthistotherRtnew_in_othertdeleted_in_othertedits_in_othertupdated_thist	old_entryt	new_entryR3R((sR/usr/lib/python2.7/dist-packages/bzrlib/plugins/changelog_merge/changelog_merge.pyR‘sJ
%%


%






(R)t
__future__RR-tbzrlibRRRt
bzrlib.merge3Rtbzrlib.traceRRRtConfigurableFileMergerRt	ExceptionR tjoinRER(((sR/usr/lib/python2.7/dist-packages/bzrlib/plugins/changelog_merge/changelog_merge.pyt<module>s		&+

Copyright © 2017 || Recoded By Mr.Bumblebee