³ò ö$•Jc@sNdZddklZddklZlZlZlZddkl Z l Z l Z l Z l Z ddkZd„Zd„Zd„Zd „Zddeedd „Zd „Zd d „Zd„Zd„Zd„Zheddeedƒfdddedƒfddeedƒfdddedƒfgedƒfd hash values. The parsed dictionary is cached until a write() operation is done. t bookmarkst i(t _bookmarkstopenertstriptsplittlookup(trepotlinetshatrefspec((s"/sys/lib/python/hgext/bookmarks.pytparse$s    cCsätii|idƒƒo&ti|idƒ|idƒƒnt|ƒ|jot|dƒn|i ƒ}z`|i dddt ƒ}x7|i ƒD])\}}|i dt|ƒ|fƒqšW|iƒWd|iƒ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. R sundo.bookmarkstwt atomictemps%s %s N(tostpathtexiststjoinRtcopyfiletcurrentt setcurrenttNonetwlockR tTruet iteritemstwriteRtrenametrelease(RtrefsR tfileRtnode((s"/sys/lib/python/hgext/bookmarks.pyR#8s &  !cCs’|io |iSnd}tii|idƒƒoN|idƒ}|iƒpdgd}|djo d}n|iƒn||_|S(sÈGet the current bookmark If we use gittishsh 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( t_bookmarkcurrentRRRRRR t readlinestclose(RtmarkR'((s"/sys/lib/python/hgext/bookmarks.pyRNs     cCsçt|ƒ|jodSnt|ƒ}|oH||jo;t|ƒo.|t|ƒ|idƒiƒjodSn||jo d}n|iƒ}z3|idddtƒ}|i|ƒ|iƒWd|i ƒ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 ). The name is recorded in .hg/bookmarks.current Nt.R)sbookmarks.currentRR( RRt changectxR(R R R!R#R$R%R*(RR-R&R R'((s"/sys/lib/python/hgext/bookmarks.pyRbs 3     c Cs±|iotpt}t|ƒ}|idƒiƒ} |oÈ||jotitdƒƒ‚n||jo!| otitdƒƒ‚n|djotitdƒƒ‚n||||<||=t |ƒ|jot ||ƒnt ||ƒdSn|oŒ|djotitdƒƒ‚n||jotitdƒƒ‚n|t |ƒjot |dƒn||=t ||ƒdSn|djod|jotitdƒƒ‚n|i ƒ}||jo!| otitdƒƒ‚n||iƒjp||iiƒjo!| otitd ƒƒ‚n|o|i|ƒ||s*"(     L   T