ó ŸçƒQc@s“ddlmZmZmZmZddlmZddlZddlZddl Z d„Z d„Z dd„Z d„Zd„Zd „ZdS( iÿÿÿÿ(tnullidtbinthextshort(t_Nc Cs‚t|ƒt|ƒko#dkns4tdƒ‚t||ƒ\}}}}|dk r| sht‚t|d||ƒdStƒ}d} xÎt|ƒD]À} | |jjksÉtdt | ƒƒ‚|j | ƒ} | r›| |kr›|j | ƒ| s|j dd| ƒ} n| j | ƒ} t ||| jƒjƒ| ƒ} t| d||ƒq›q›W|r~t|||||ƒndS(sDFind global tags in repo by reading .hgtags from every head that has a distinct version of it, using a cache to avoid excess work. Updates the dicts alltags, tagtypes in place: alltags maps tag name to (node, hist) pair (see _readtags() below), and tagtypes maps tag name to tag type ("global" in this case).is'findglobaltags() should be called firsttglobalNs tag cache returned bogus head %ss.hgtagstfileid(tlentAssertionErrort _readtagcachetNonet _updatetagstsettreversedt changelogtnodemapRtgettaddtfilectxt _readtagstdatat splitlinest_writetagcache( tuitrepotalltagsttagtypestheadsttagfnodet cachetagst shouldwritetseentfctxtheadtfnodetfiletags((s2/sys/lib/python2.7/site-packages/mercurial/tags.pytfindglobaltagss,+     !cCs€y|jjdƒ}Wn,tk rD}|jtjkr@‚ndSXt|||jƒddtjƒ}t |d||ƒdS(s6Read local tags in repo. Update alltags and tagtypes.t localtagsNtrecodetlocal( topenertreadtIOErrorterrnotENOENTRRtencodingt fromlocalR (RRRRRtinstR#((s2/sys/lib/python2.7/site-packages/mercurial/tags.pyt readlocaltags<s c s-i}d‰‡‡‡fd†}x|D]ý}ˆd7‰|sDq(ny|jddƒ\}} Wn$tk r†|tdƒƒq(nX| jƒ} |r¨|| ƒ} nyt|ƒ} Wn(tk râ|tdƒ|ƒq(nXg} | |kr|| \} } | j| ƒn| | f|| tnodehisttanodetahisttbnodetbhistRA((s2/sys/lib/python2.7/site-packages/mercurial/tags.pyR ss    $  ,cCs‘y"|jddƒ}t|ƒ}Wntk r;d }nXg}g}i}|r$y”x|D]…}|dkrtPn|jƒ}|jt|dƒƒt|dƒ}|j|ƒt|ƒdkr^t|dƒ} | ||tclosetFalseRRtfiletTrueR R tfilenodeterrort LookupError(RRt cachefilet cachelinest cacherevst cacheheadst cachefnodeR<theadnodeR"ttipnodettiprevttagst repoheadsR!tnewheadstcctx((s2/sys/lib/python2.7/site-packages/mercurial/tags.pyR •sb         &     c Csœy|jdddtƒ}Wnttfk r6dSX|jƒ}xÝ|D]Õ}||jjksxtdt|ƒƒ‚||ksštdt|ƒƒ‚|t ks²tdƒ‚|jj |ƒ}|j |ƒ} | r|j d|t |ƒt | ƒfƒqJ|j d|t |ƒfƒqJW|j d ƒx=|jƒD]/\} \} } |j d t | ƒ| fƒq=Wy|jƒWnttfk r—nXdS( Ns cache/tagstwt atomictemps1trying to write non-existent node %s to tag caches(trying to write non-head %s to tag caches#trying to write nullid to tag caches %d %s %s s%d %s s s%s %s (R(RRtOSErrorR*RRRRRRtrevRtwriteRRBRO( RRRRRRVt realheadsR!ReR"R>tnodeR@((s2/sys/lib/python2.7/site-packages/mercurial/tags.pyRs0   )! !(RhRRRRti18nRR-RTR+R$R0R RR R R(((s2/sys/lib/python2.7/site-packages/mercurial/tags.pyt s"    )  ' " m