-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
sž`Oc@@s\dZddlmZddlmZmZmZddlm	Z	ddl
mZmZm
Z
defd„ƒYZdefd	„ƒYZd
efd„ƒYZdefd
„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd efd!„ƒYZd"efd#„ƒYZd$efd%„ƒYZd&efd'„ƒYZd(efd)„ƒYZd*efd+„ƒYZ d,efd-„ƒYZ!d.efd/„ƒYZ"d0efd1„ƒYZ#d2efd3„ƒYZ$d4S(5s2Server-side branch related request implmentations.i(tabsolute_import(tbencodeterrorstrevision(t
ControlDir(tFailedSmartServerResponsetSmartServerRequesttSuccessfulSmartServerResponsetSmartServerBranchRequestcB@seZdZd„ZRS(s9Base class for handling common branch request logic.
    cG@sg|j|ƒ}tj|ƒ}|jƒdk	rEtj|jƒ‚n|jdt	ƒ}|j
||ŒS(sfExecute a request for a branch at path.

        All Branch requests take a path to the branch as their first argument.

        If the branch is a branch reference, NotBranchError is raised.

        :param path: The path for the repository as received from the
            client.
        :return: A SmartServerResponse from self.do_with_branch().
        tignore_fallbacksN(ttransport_from_client_pathRtopen_from_transporttget_branch_referencetNoneRtNotBranchErrortbasetopen_branchtTruetdo_with_branch(tselftpathtargst	transportt
controldirtbranch((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pytdo&s(t__name__t
__module__t__doc__R(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR"stSmartServerLockedBranchRequestcB@seZdZd„ZRS(saBase class for handling common branch request logic for requests that
    need a write lock.
    cG@s^|jjd|ƒz6|jd|ƒz|j||ŒSWd|jƒXWd|jjƒXdS(sÿExecute a request for a branch.

        A write lock will be acquired with the given tokens for the branch and
        repository locks.  The lock will be released once the request is
        processed.  The physical lock state won't be changed.
        ttokenN(t
repositoryt
lock_writetdo_with_locked_branchtunlock(RRtbranch_tokent
repo_tokenR((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR>s(RRRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR9stSmartServerBranchBreakLockcB@seZd„ZRS(cC@s|jƒtdƒS(sBreak a branch lock.
        tok(sok(t
break_lockR(RR((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRSs
(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR%QstSmartServerBranchGetConfigFilecB@seZd„ZRS(cC@s@y|jjdƒ}Wntjk
r2d}nXtd|ƒS(sxReturn the content of branch.conf

        The body is not utf8 decoded - its the literal bytestream from disk.
        sbranch.conftR&(sok(tcontrol_transportt	get_bytesRt
NoSuchFileR(RRtcontent((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR\s

(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR(ZstSmartServerBranchPutConfigFilecB@s eZdZd„Zd„ZRS(s>Set the configuration data for a branch.

    New in 2.5.
    cC@s||_||_||_dS(suSet the content of branch.conf.

        The body is not utf8 decoded - its the literal bytestream for disk.
        N(t_brancht
_branch_tokent_repo_tokenR
(RRR#R$((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRns			cC@s||jjjd|jƒzE|jjd|jƒz|jjjd|ƒWd|jjƒXWd|jjjƒXtdƒS(NRsbranch.confR&(sok(	R/RR R1R0R*t	put_bytesR"R(Rt
body_bytes((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pytdo_bodyys(RRRRR4(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR.hs	tSmartServerBranchGetParentcB@seZd„ZRS(cC@s|jƒpd}t|fƒS(sReturn the parent of branch.R)(t_get_parent_locationR(RRtparent((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR‰s(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR5‡stSmartServerBranchGetTagsBytescB@seZd„ZRS(cC@s|jƒ}t|fƒS(s(Return the _get_tags_bytes for a branch.(t_get_tags_bytesR(RRtbytes((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR‘s(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR8stSmartServerBranchSetTagsBytescB@s2eZddd„Zd„Zd„Zd„ZRS(t/cC@s#tj||||ƒt|_dS(N(Rt__init__tFalsetlocked(Rtbacking_transporttroot_client_patht	jail_root((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR=™scC@s#||_|jjƒt|_dS(sACall _set_tags_bytes for a branch.

        New in 1.18.
        N(RR RR?(RR((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR!žs	
cC@s|jj|ƒtdƒS(N((Rt_set_tags_bytesR(RR:((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR4©scC@s3|js
dSztj|ƒSWd|jjƒXdS(N(R?Rtdo_endRR"(R((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRD­s
	N(RRR
R=R!R4RD(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR;—s		tSmartServerBranchHeadsToFetchcB@seZd„ZRS(cC@s.|jƒ\}}tt|ƒt|ƒfƒS(s‡Return the heads-to-fetch for a Branch as two bencoded lists.
        
        See Branch.heads_to_fetch.

        New in 2.4.
        (theads_to_fetchRtlist(RRt
must_fetchtif_present_fetch((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR½s(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRE»st'SmartServerBranchRequestGetStackedOnURLcB@seZd„ZRS(cC@s|jƒ}td|fƒS(NR&(tget_stacked_on_urlR(RRtstacked_on_url((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRËs(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRJÉst!SmartServerRequestRevisionHistorycB@seZd„ZRS(cC@st|jƒz@|jjƒ}dtjf}t|j|jƒ|ƒƒ}Wd|j	ƒXt
ddjt|ƒƒƒS(s£Get the revision history for the branch.

        The revision list is returned as the body content,
        with each revision utf8 encoded and  joined.
        NR&t(sok(
t	lock_readRt	get_graphR
t
_mod_revisiont
NULL_REVISIONRGtiter_lefthand_ancestryt
last_revisionR"Rtjointreversed(RRtgraphtstop_revisionsthistory((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRÒs
	(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRMÐst(SmartServerBranchRequestLastRevisionInfocB@seZd„ZRS(cC@s+|jƒ\}}tdt|ƒ|fƒS(szReturn branch.last_revision_info().

        The revno is encoded in decimal, the revision_id is encoded as utf8.
        R&(tlast_revision_infoRtstr(RRtrevnoRT((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRæs(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRZäst)SmartServerBranchRequestRevisionIdToRevnocB@seZd„ZRS(cC@sTy|j|ƒ}Wn!tjk
r6td|fƒSXtdttt|ƒƒƒS(s‘Return branch.revision_id_to_revno().

        New in 2.5.

        The revno is encoded in decimal, the revision_id is encoded as utf8.
        tNoSuchRevisionR&(sok(trevision_id_to_dotted_revnoRR_RRttupletmapR\(RRtrevidtdotted_revno((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRñs(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR^ïstSmartServerSetTipRequestcB@seZdZd„ZRS(seBase class for handling common branch request logic for requests that
    update the branch tip.
    cG@shy|j||ŒSWnMtjk
rc}|j}t|tƒrS|jdƒ}ntd|fƒSXdS(Nsutf-8tTipChangeRejected(t do_tip_change_with_locked_branchRRftmsgt
isinstancetunicodetencodeR(RRRteRh((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR!s	(RRRR!(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRest'SmartServerBranchRequestSetConfigOptioncB@seZdZd„ZRS(s*Set an option in the branch configuration.cC@s;|sd}n|jƒj|jdƒ||ƒtdƒS(Ntutf8((R
t_get_configt
set_optiontdecodeR(RRtvaluetnametsection((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR!s	"(RRRR!(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRmst+SmartServerBranchRequestSetConfigOptionDictcB@seZdZd„ZRS(sDSet an option in the branch configuration.
    
    New in 2.2.
    cC@s€tj|ƒ}i}x6|jƒD](\}}|jdƒ||jdƒ<q"W|s]d}n|jƒj|||ƒtdƒS(NRn((RtbdecodetitemsRqR
RoRpR(RRt
value_dictRsRtt	utf8_dicttkeyRr((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR!s 	(RRRR!(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRust'SmartServerBranchRequestSetLastRevisioncB@seZd„ZRS(cC@s^|dkr|jd|ƒn5|jj|ƒsAtd|fƒS|j|ddƒtdƒS(Nsnull:iR_R&(sok(tset_last_revision_infoRthas_revisionRtgenerate_revision_historyR
R(RRtnew_last_revision_id((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRg,s
(RRRg(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR{*st)SmartServerBranchRequestSetLastRevisionExcB@seZd„ZRS(cC@sõ|}y·|jƒ\}}|jjƒ}|s8|r’|j|||ƒ}	|	dkrj|rjtdƒS|	dkr’|r’td||fƒSn|j|||fgƒ}
|j|
|ƒWn!tj	k
rátd|fƒSXtd|
|fƒS(s\Set the last revision of the branch.

        New in 1.6.

        :param new_last_revision_id: the revision ID to set as the last
            revision of the branch.
        :param allow_divergence: A flag.  If non-zero, change the revision ID
            even if the new_last_revision_id's ancestry has diverged from the
            current last revision.  If zero, a 'Diverged' error will be
            returned if new_last_revision_id is not a descendant of the current
            last revision.
        :param allow_overwrite_descendant:  A flag.  If zero and
            new_last_revision_id is not a descendant of the current last
            revision, then the last revision will not be changed.  If non-zero
            and there is no divergence, then the last revision is always
            changed.

        :returns: on success, a tuple of ('ok', revno, revision_id), where
            revno and revision_id are the new values of the current last
            revision info.  The revision_id might be different to the
            new_last_revision_id if allow_overwrite_descendant was not set.
        tdivergedtDivergedta_descends_from_bR&R_(R‚(
R[RRPt_revision_relationsRRtfind_distance_to_nullR|RtGhostRevisionsHaveNoRevno(RRRtallow_divergencetallow_overwrite_descendanttdo_not_overwrite_descendantt
last_revnotlast_revRWtrelationt	new_revno((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRg9s(

(RRRg(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR€7st+SmartServerBranchRequestSetLastRevisionInfocB@seZdZd„ZRS(s|Branch.set_last_revision_info.  Sets the revno and the revision ID of
    the specified branch.

    New in bzrlib 1.4.
    cC@sHy|jt|ƒ|ƒWn!tjk
r=td|fƒSXtdƒS(NR_R&(sok(R|tintRR_RR(RRRR((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRgns(RRRRg(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRŽgst)SmartServerBranchRequestSetParentLocationcB@seZdZd„ZRS(shSet the parent location for a branch.
    
    Takes a location to set, which must be utf8 encoded.
    cC@s|j|ƒtdƒS(N((t_set_parent_locationR(RRtlocation((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR!~s
(RRRR!(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRxst!SmartServerBranchRequestLockWritecB@seZddd„ZRS(R)cC@sB|dkrd}n|dkr*d}nyF|jjd|ƒj}z|jd|ƒj}Wd|jjƒXWn†tjk
rtdƒStj	k
r§td	ƒStj
k
rÁtd
ƒStjk
rø}tdt|j
ƒt|jƒfƒSX|dkrd}n
|jjƒ|jƒ|jƒtd||fƒS(NR)RtLockContentiont
TokenMismatchtUnlockableTransportt
LockFailedR&(sLockContention(s
TokenMismatch(sUnlockableTransport(R
RR trepository_tokenR#R"RR”RR•R–R—R\tlocktwhytleave_lock_in_placeR(RRR#R$Rl((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR…s2			


&	


(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR“ƒstSmartServerBranchRequestUnlockcB@seZd„ZRS(cC@sŽy<|jjd|ƒz|jd|ƒWd|jjƒXWntjk
rYtdƒSX|rp|jjƒn|jƒ|jƒtdƒS(NRR•R&(s
TokenMismatch(sok(RR R"RR•Rtdont_leave_lock_in_placeR(RRR#R$((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR¦s

(RRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRœ¤st-SmartServerBranchRequestGetPhysicalLockStatuscB@seZdZd„ZRS(s@Get the physical lock status for a branch.

    New in 2.5.
    cC@s$|jƒrtdƒStdƒSdS(Ntyestno(syes(sno(tget_physical_lock_statusR(RR((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyR¼s
(RRRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyRž¶sN(%Rt
__future__RtbzrlibRRRRQtbzrlib.controldirRtbzrlib.smart.requestRRRRRR%R(R.R5R8R;RERJRMRZR^ReRmRuR{R€RŽRR“RœRž(((s7/usr/lib/python2.7/dist-packages/bzrlib/smart/branch.pyt<module>s6	$

0!

Copyright © 2017 || Recoded By Mr.Bumblebee