-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyc

ó
Ì\,Tc@s
ddlmZddlmZmZddlmZmZmZm	Z	ddl
Z
defd„ƒYZd„Z
d„Zd	„Zddd
„Zd„Zd„Zd
„Zd„Zd„Zd„Zdddd„Zd„Zd„Zd„Zd„Zd„ZdS(iÿÿÿÿ(t_(thextbin(tencodingterrortutiltobsoleteNtbmstorecBs eZdZd„Zd„ZRS(sÞStorage for bookmarks.

    This object should do all bookmark reads and writes, so that it's
    fairly simple to replace the storage underlying bookmarks without
    having to clone the logic surrounding bookmarks.

    This particular bmstore implementation stores bookmarks as
    {hash}\s{name}
 (the same format as localtags) in
    .hg/bookmarks. The mapping is stored as {name: nodeid}.

    This class does NOT handle the "current" bookmark state at this
    time.
    cCsÿtj|ƒ||_y·x°|jdƒD]Ÿ}|jƒ}|sGq)nd|krs|jjtdƒ|ƒq)n|jddƒ\}}t	j
|ƒ}y|jj|ƒ||<Wq)t
k
rÇq)Xq)WWn+tk
rú}|jtjkrû‚qûnXdS(Nt	bookmarkst s$malformed line in .hg/bookmarks: %r
i(tdictt__init__t_repotvfststriptuitwarnRtsplitRttolocalt	changelogtlookuptLookupErrortIOErrorterrnotENOENT(tselftrepotlinetshatrefspectinst((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyRs(
	
cCs×|j}|j|kr%t|ƒn|jƒ}z”|jdddtƒ}x@|jƒD]2\}}|jdt|ƒt	j
|ƒfƒqYW|jƒy|jj
ddƒWntk
rÃnXWd|jƒXdS(s
Write bookmarks

        Write the given bookmark => hash dictionary to the .hg/bookmarks file
        in a format equal to those of localtags.

        We also store a backup of the previous state in undo.bookmarks that
        can be copied back on rollback.
        Rtwt
atomictemps%s %s
s
00changelog.iN(Rt_bookmarkcurrenttunsetcurrenttwlockR
tTruet	iteritemstwriteRRt	fromlocaltclosetsvfstutimetNonetOSErrortrelease(RRR#tfiletnametnode((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyR&2s		
*

(t__name__t
__module__t__doc__RR&(((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyR
s
	cCs¤d}y|jdƒ}Wn,tk
rG}|jtjkrC‚ndSXzJtj|jƒpcdgdƒ}|dksˆ||jkr‘d}nWd|j	ƒX|S(sÆGet the current bookmark

    If we use gittish branches we have a current bookmark that
    we are on. This function returns the name of the bookmark. It
    is stored in .hg/bookmarks.current
    sbookmarks.currenttiN(
R+topenerRRRRRt	readlinest
_bookmarksR((RtmarkR.R((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pytreadcurrentPs"
cCsž||jkr"td|ƒ‚n|j}||kr;dS|jƒ}z<|jdddtƒ}|jtj|ƒƒ|j	ƒWd|j
ƒX||_dS(sµSet the name of the bookmark that we are currently on

    Set the name of the bookmark that we are on (hg update <bookmark>).
    The name is recorded in .hg/bookmarks.current
    sbookmark %s does not exist!Nsbookmarks.currentRR (R7tAssertionErrorR!R#R5R$R&RR'R(R-(RR8tcurrentR#R.((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyt
setcurrentgs	cCsm|jƒ}zOy|jjdƒd|_Wn+tk
rY}|jtjkrZ‚qZnXWd|jƒXdS(Nsbookmarks.current(	R#R
tunlinkR+R!R,RRR-(RR#R((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyR"}s
cCsg|s|j}n|sDg|djƒD]}|jƒ^q)}n|j}||kof|||kS(s£Tell whether the current bookmark is also active

    I.e., the bookmark listed in .hg/bookmarks.current also points to a
    parent of the working directory.
    N(R!R+tparentsR0R7(RR8R>tptmarks((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyt	iscurrent‰s,	cCsvyt|||j|ƒƒSWnRtjk
rq|dkrUt|||jdƒƒStjtdƒ|ƒ‚nXdS(Ntdefaultttipsbranch %s not found(tupdatet	branchtipRtRepoLookupErrorRRtAbortR(Rtoldnodet	curbranch((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pytupdatecurrentbookmark–scCs¼t}|j}g|D]8}|jddƒd|jddƒdkr|^q}xa|D]Y}|dks[d|krq[n|r[|||kr[||kr´||=t}q´q[q[W|S(sDelete divergent versions of bm on nodes in deletefrom.

    Return True if at least one bookmark was deleted, False otherwise.t@ii(tFalseR7RR$(Rt
deletefromtbmtdeletedR@tbt	divergentR8((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pytdeletedivergentŸs	E
cCsmd}|dkrc|j}t|ƒr:|djƒ}qc|rc|jtdƒ|ƒ|}qcn||fS(sƒReturn a tuple (targetrev, movemarkfrom) indicating the rev to
    check out and where to move the active bookmark from, if needed.t.supdating to active bookmark %s
N(R+R!RAR0tstatusR(RRtcheckouttmovemarkfromtcurmark((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pytcalculateupdate°s	cCsK|}|j}t}|j}|s(tS|||kr||}g|D]<}|jddƒd|jddƒdkrI||^qI}	|jj|jƒgƒ}
g|	D]0}|jƒ|
ksÑ||kr­|jƒ^q­}t|||||ƒr|jƒ||<t	}qnt
|||ƒr4t	}n|rG|jƒn|S(NRKii(R7RLR!RRt	ancestorstrevR0t	validdestR$RRR&(RR>R0RMR@RDtcurtnewRPtdivstanc((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyRD½s(		

<=	
cCst|diƒ}i}|jj}xT|jƒD]F\}}||ƒr1d|ksd|jdƒr1t|ƒ||<q1q1W|S(NR7RK(tgetattrRthasnodeR%tendswithR(RR@tdRatktv((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyt
listbookmarksÖs'cCs•|jƒ}zw|j}t|j|dƒƒ|kr:tS|dkrP||=n$||kr`tS||jƒ||<|jƒtSWd|jƒXdS(NR4(	R#R7RtgetRLR0R&R$R-(RtkeytoldR]RR@((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pytpushbookmarkãs	

cCsž|sd„}n|s$d„}n|r9t|ƒ}ngt|ƒ}t|ƒ}||A}xB||@D]6}	|||	ƒ|||	ƒkrf|j|	ƒqfqfWgggggggf}
|
dj}|
dj}|
dj}
|
dj}|
dj}|
dj}|
d	j}xt|ƒD]s}	|	|krw|	|kra||	d
|||	ƒfƒq–||	d
d
fƒq#|	|kr£||	|||	ƒd
fƒq#|||	ƒ}|||	ƒ}||krƒ||krƒ||}||}|jƒ|jƒkrEt|||ƒr/||	||fƒq€||	||fƒq–t|||ƒrm|
|	||fƒq–||	||fƒq#||	||fƒq#W|
S(s›Compare bookmarks between srcmarks and dstmarks

    This returns tuple "(addsrc, adddst, advsrc, advdst, diverge,
    differ, invalid)", each are list of bookmarks below:

    :addsrc:  added on src side (removed on dst side, perhaps)
    :adddst:  added on dst side (removed on src side, perhaps)
    :advsrc:  advanced on src side
    :advdst:  advanced on dst side
    :diverge: diverge
    :differ:  changed, but changeset referred on src is unknown on dst
    :invalid: unknown on both side

    Each elements of lists in result tuple is tuple "(bookmark name,
    changeset ID on source side, changeset ID on destination
    side)". Each changeset IDs are 40 hexadecimal digit string or
    None.

    Changeset IDs of tuples in "addsrc", "adddst", "differ" or
     "invalid" list may be unknown for repo.

    This function expects that "srcmarks" and "dstmarks" return
    changeset ID in 40 hexadecimal digit string for specified
    bookmark. If not so (e.g. bmstore "repo._bookmarks" returning
    binary value), "srchex" or "dsthex" should be specified to convert
    into such form.

    If "targets" is specified, only bookmarks listed in it are
    examined.
    cSs|S(N((tx((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyt<lambda>scSs|S(N((Rk((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyRlsiiiiiiiN(tsettaddtappendtsortedR+RZR[(Rtsrcmarkstdstmarkstsrchextdsthexttargetstbsett
srcmarksett
dstmarksetRPtresultstaddsrctadddsttadvsrctadvdsttdivergetdiffertinvalidtscidtdcidtsctxtdctx((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pytcompareôsR 
 






  

cCs’|dkrd}nx7tddƒD]&}d||f}||kr%Pq%q%Wx<|jdƒD]+\}}||kr_d||f}q_q_W|S(NRKR4iids%s@%dtpathss%s@%s(trangetconfigitems(RRPtpatht
localmarksRktnR?tu((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyt_divergeJs	cCs“|jdƒ|j}t|||dtƒ\}}}}}	}
}g}xR|D]J\}
}}||krP|j|
t|ƒ|jtdƒ|
fƒqPqPWxC|D];\}
}}|j|
t|ƒ|jtdƒ|
fƒq¥Wx^|	D]V\}
}}t||
||ƒ}|j|t|ƒ|j	tdƒ|
|ffƒqëW|rx4t
|ƒD]&\}
}}}|||
<||ƒqXW|jƒndS(Nschecking for updated bookmarks
Rtsadding remote bookmark %s
supdating bookmark %s
s#divergent bookmark %s stored as %s
(tdebugR7R…RRoRRTRRRRpR&(RRtremotemarksR‰RŠRzR{R|R}R~RR€tchangedRPRR‚tdbR0twritertmsg((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pytupdatefromremoteYs(
	-
csRt||jˆjdƒdtd|ƒ\}}}}}}	}
|
rs|
d\}}}
ˆjtdƒ|ƒdS‡‡fd†}d}xot|||||	ƒD]Q\}}}
ˆjtdƒ|ƒ|
dkrãd	}
n||||
|ƒ7}q¨WxD|D]<\}}}
ˆjtd
ƒ|ƒ||||
d	ƒ7}qW|rNdSdS(NRRsRuis>bookmark %s does not exist on the local or remote repository!
ics=ˆjd|||ƒ}|s9ˆjtdƒ|ƒdSdS(NRsupdating bookmark %s failed!
ii(tpushkeyRR(RPRiR]tr(tremoteR(s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pytpush{s
sexporting bookmark %s
R4sdeleting remote bookmark %s
i(	R…R7tlistkeysRRRRpRTR+(RRR—RuRzR{R|R}R~RR€RPRR‚R˜tfailed((R—Rs7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pytpushtoremoteqs&$,	cCsÃ|jtdƒƒ|jdƒ}|jdƒ}tt|ƒt|ƒƒ}xF|D]>}|jrm||px||d }|jd||fƒqTWt|ƒdkr¿|jtdƒƒdSdS(Ns searching for changed bookmarks
Ris   %-25s %s
isno changed bookmarks found
i(RTRR™RpRmt	debugflagR&tlen(RtdsttsrctsmarkstdmarkstdiffRdR8((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyR¢s
!cCse|jƒ}||krtS|s&tS|jrT|jƒtj||jƒgƒkS|j|ƒSdS(s?Is the new bookmark destination a valid update from the old oneN(t
unfilteredRLR$tobsstoreR0Rt
foregroundt
descendant(RRiR]((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyR[Ÿs	%(tmercurial.i18nRtmercurial.nodeRRt	mercurialRRRRRR
RR9R<R"R+RARJRRRXRDRfRjR…RR”R›R¢R[(((s7/usr/lib/python2.7/dist-packages/mercurial/bookmarks.pyt<module>s("C			
				
		
	U				

Copyright © 2017 || Recoded By Mr.Bumblebee