-=[ Mr. Bumblebee ]=-
_Indonesia_

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

σ
„s…Pc@@s‚ddlmZddlmZmZddlmZeeƒdƒdejfd„ƒYZ	de
fd„ƒYZd	„Zd
S(i(tabsolute_import(terrorsthooks(tlazy_imports¬
import webbrowser

from bzrlib import (
    msgeditor,
    )
from bzrlib.i18n import gettext
from bzrlib.plugins.launchpad import (
    lp_api,
    lp_registration,
    )
tProposeMergeHookscB@seZdZd„ZRS(s)Hooks for proposing a merge on Launchpad.cC@s@tjj|ddƒ|jddd	ƒ|jddd
ƒdS(Ns#bzrlib.plugins.launchpad.lp_proposesProposer.hookstget_prerequisites6Return the prerequisite branch for proposing as merge.iitmerge_proposal_bodys6Return an initial body for the merge proposal message.(ii(ii(RtHookst__init__tadd_hook(tself((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pyR)s	
	(t__name__t
__module__t__doc__R(((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pyR&stProposercB@skeZeƒZeed	d„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd„Z
d„ZRS(
c	
C@s||_|rd}	nd}	tjd|	ƒ}
tj|
ƒ|_tjj|j|ƒ|_|dkr~|jj
ƒ|_ntjj|j|ƒ|_||_|gkrΊg|_
n2g|D]"\}}|jj||f^qΑ|_
||_||_dS(s΅Constructor.

        :param tree: The working tree for the source branch.
        :param source_branch: The branch to propose for merging.
        :param target_branch: The branch to merge into.
        :param message: The commit message to use.  (May be None.)
        :param reviews: A list of tuples of reviewer, review type.
        :param staging: If True, propose the merge against staging instead of
            production.
        :param approve: If True, mark the new proposal as approved immediately.
            This is useful when a project permits some things to be approved
            by the submitter (e.g. merges between release and deployment
            branches).
        tstagingt
productiontlp_instanceN(ttreetlp_registrationtLaunchpadServicetlp_apitlogint	launchpadtLaunchpadBranchtfrom_bzrt
source_branchtNonet
get_targett
target_branchtcommit_messagetreviewstpeopletapprovetfixes(
R
RRRtmessageRRR!R"Rtservicetreviewertreview_type((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pyR6s&					/	cC@s0d|jjjg}|jd|jjjƒ|dk	rV|jd|jjƒnxJ|jD]?}d|dj|djf}|jd||dfƒq`W|jj	j
ƒz8|jj	j
ƒz|jƒ}Wd|jj	jƒXWd|jj	jƒXt
jd	j|ƒd
|ƒ}|jƒjdƒS(s5Determine the initial comment for the merge proposal.sSource: %s
sTarget: %s
sPrereq: %s
s%s (%s)isReviewer: %s, type "%s"
iNtt
start_messagesutf-8(Rtlptbzr_identitytappendRRRtdisplay_nametnametbzrt	lock_readtget_initial_bodytunlockt	msgeditortedit_commit_messagetjointstriptencode(R
tprerequisite_branchtinfotrdatat
uniquenametbodytinitial_comment((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pytget_comment_s"	c@so‡fd†}dˆjjj}d}x@ˆjdD]1}|iˆjd6|d6|d6|d6ƒ}q6W|S(	s]Get a body for the proposal for the user to modify.

        :return: a str or None.
        c@s@ˆjjˆjƒ}ˆjjjƒ}t||ƒ}t|ƒS(N(Rt
find_lca_treeRR.t
basis_treetmodified_filestlist(tlca_treetsource_treetfiles(R
(sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pytlist_modified_fileszs
	s!bzr+ssh://bazaar.launchpad.net/%sRRRtmodified_files_callbacktold_bodyN(RR)tunique_nameRRR(R
REt
target_locR;thook((R
sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pyR0us
cC@s6|jj}|jƒz|jƒSWd|jƒXdS(s)Get the revision ID of the source branch.N(RR.R/t
last_revisionR1(R
R((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pytget_source_revidŒs

cC@s£|jjj|jjjkr0tjdƒ‚nxl|jjjD][}|jdkr[q@n|jj|jjjkr@tjtdƒt	j
|ƒƒ‚q@q@WdS(s&Check that the submission is sensible.s-Source and target branches must be different.tMergedtRejecteds,There is already a branch merge proposal: %sN(RMRN(RR)t	self_linkRRtBzrCommandErrortlanding_targetstqueue_statustgettextRt
canonical_url(R
tmp((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pytcheck_proposal•s	cC@sY|jd}d}x?|D]7}|i|jd6|jd6|jd6|d6ƒ}qW|S(NRRRRR7(RRRRR(R
RR7RJ((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pyt_get_prerequisite_branch’s




cO@s“ddlm}y|||ŽSWnk|jk
rŽ}g}x7|jjƒD]&}|jdƒrePn|j|ƒqLWtdj|ƒƒ‚nXdS(sMake a call to the webservice, wrapping failures.
        
        :param call: The call to make.
        :param *args: *args for the call.
        :param **kwargs: **kwargs for the call.
        :return: The result of calling call(*args, *kwargs).
        i(Rs"Traceback (most recent call last):R'N(	tlazr.restfulclientRt	HTTPErrortcontentt
splitlinest
startswithR+t	ExceptionR4(R
tcalltargstkwargstrestful_errorsteterror_linestline((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pytcall_webservice­scC@sN|jƒ}|j|jddddddƒ|j|jddd	|ƒdS(
NtvoteuApprovetsubjectR'RZu/Rubberstamp! Proposer approves of own proposal.tstatusuApprovedtrevid(RLRet
createCommentt	setStatus(R
RURi((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pytapprove_proposalΐs	c	C@sk|jƒ}|d
kr!d
}n|j}|jƒ|jjƒg}g}x4|jD])\}}|j|ƒ|j|jƒqWW|j|ƒ}|j	|jjj
d|jjd|d|d|jd|d|ƒ}|j
rρ|j|ƒn|jrQ|jjdƒr|jd|_n|j	|jjjd	|jjt|jƒƒntjtj|ƒƒd
S(sPerform the submission.RR7R<Rt	reviewerstreview_typesslp:itbugN(RWRR)t	update_lpRRR+ROR=RetcreateMergeProposalRRR!RlR"R\tlinkBugRtbugstintt
webbrowsertopenRRT(	R
R7tprereqRmRnR%R&R<RU((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pytcreate_proposalΙs8		


			N(RRRRtFalseRRR=R0RLRVRWReRlRx(((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pyR2s	(					
				c	c@sbx[|j|ƒD]J\}\}}}}}}\}	}
}|r|
dkrt|ƒVqqWdS(s>Return a list of paths in the new tree with modified contents.tfileN(titer_changeststr(told_treetnew_treetftoptpathtctvtptntoktkRb((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pyR@κs	1N(
t
__future__RtbzrlibRRtbzrlib.lazy_importRtglobalsRRtobjectRR@(((sG/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_propose.pyt<module>s	Έ

Copyright © 2017 || Recoded By Mr.Bumblebee