-=[ Mr. Bumblebee ]=-
_Indonesia_
ó
Ì\,Tc @ s d d l m Z m Z m Z m Z d d l Z d d l Z d d l Z d „ Z d „ Z i d d 6d d 6d d 6d d 6Z d „ Z d
e
f d „ ƒ YZ d S( iÿÿÿÿ( t bint hext nullidt nullrevNc C s) d } | j r% d | | j f } n | S( s7 name of a branchcache file for a given repo or repoviews
cache/branch2s %s-%s( t
filtername( t repot filename( ( s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pyt _filename
s c C sS y8 | j t | ƒ ƒ } | j ƒ j d ƒ } | j ƒ Wn t t f k
rR d SXyw| j d ƒ j d d ƒ } | d \ } } t | ƒ t
| ƒ } } d } t | ƒ d k rÅ t | d ƒ } n t d | d | d | ƒ } | j
| ƒ sþ t d ƒ ‚ n xÈ | D]À } | sqn | j d d ƒ \ } }
} |
d k rMt d
ƒ ‚ n t j | j ƒ ƒ } | | k rt d | ƒ ‚ n t | ƒ } | j | g ƒ j | ƒ |
d k r| j j | ƒ qqWWn‚ t k
rà‚ no t k
rN} | j j rEd
}
| j d k r$|
d | j 7}
n |
d 7}
| j j |
| ƒ n d } n X| S( Ns
i t i t tipnodet tiprevt filteredhashs tip differst ocs invalid branch states node %s does not existt cs invalid branchheads caches (%s)s : %s
( t openerR t readt splitt closet IOErrort OSErrort Nonet popR t intt lent branchcachet validfort
ValueErrort encodingt tolocalt stript
setdefaultt appendt _closednodest addt KeyboardInterruptt Exceptiont uit debugflagR t debug( R t ft linest cachekeyt lastt lrevR t partialt lt nodet statet labelt instt msg( ( s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pyR sR
t visiblet servedt immutablet basec sQ | j } | j } | j j | ƒ ‰ g } ˆ d k sF ˆ j | ƒ rÜ t | ƒ ‰ ˆ d k rÜ t j | ƒ } | d k r… t ƒ ‰ qÙ | j | ƒ } | j
ƒ j ƒ ‰ | j j | j } | j
‡ f d † | Dƒ ƒ qÜ n | j
| j d ˆ j d ƒ ƒ | r"ˆ j | | ƒ ˆ j | ƒ n ˆ j | ƒ s=t | ƒ ‚ ˆ | j | j <d S( Nc 3 s$ | ] } | ˆ j k r | Vq d S( N( R
( t .0t r( R, ( s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pys <genexpr>^ s t starti ( t changelogR t
_branchcachest getR R R t subsettableR t filteredt branchmapt copyt filteredrevst extendt revsR
t updatet writet AssertionError( R t clR RC t
subsetnamet subsett extrarevs( ( R, s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pyt updatecacheN s( # R c B sz e Z d Z d e e d d d „ Z d „ Z d „ Z d „ Z d „ Z
e d „ Z d „ Z
d „ Z d „ Z d
„ Z RS(
s/ A dict like object that hold branches heads cache.
This cache is used to avoid costly computations to determine all the
branch heads of a repo.
The cache is serialized on disk in the following format:
<tip hex node> <tip rev number> [optional filtered repo hex hash]
<branch head hex node> <open/closed state> <branch name>
<branch head hex node> <open/closed state> <branch name>
...
The first line is used to check if the cache is still valid. If the
branch cache is for a filtered repo view, an optional third hash is
included that hashes the hashes of all filtered revisions.
The open/closed state is represented by a single letter 'o' or 'c'.
This field can be used to avoid changelog reads when determining if a
branch head closes a branch or not.
c C sY t t | ƒ j | ƒ | | _ | | _ | | _ | d k rL t ƒ | _ n | | _ d S( N( t superR t __init__R R
R R t setR ( t selft entriesR R
R t closednodes( ( s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pyRM | s c s‚ | j } | j s d Sd } t ‡ f d † | j Dƒ ƒ } | r~ t j ƒ } x | D] } | j d | ƒ qT W| j ƒ } n | S( sB build hash of revision filtered in the current cache
Tracking tipnode and tiprev is not enough to ensure validity of the
cache as they do not help to distinct cache that ignored various
revision bellow tiprev.
To detect such difference, we build a cache of all ignored revisions.
c 3 s$ | ] } | ˆ j k r | Vq d S( N( R
( R7 R8 ( RO ( s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pys <genexpr>— s s %s;N( R: RA R t sortedt utilt sha1RD t digest( RO R RG t keyRC t st rev( ( RO s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pyt
_hashfilteredŠ s
c C sQ y8 | j | j j | j ƒ k o6 | j | j | ƒ k SWn t k
rL t SXd S( s¹ Is the cache content valid regarding a repo
- False when cached tipnode is unknown or if we detect a strip.
- True when cache is up to date or a subset of current repo.N( R R: R. R
R RY t
IndexErrort False( RO R ( ( s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pyR Ÿ s
c C sP | d } t } x3 t | ƒ D]% } | | j k r | } t } Pq q W| | f S( sh Return tuple with last open head in heads and false,
otherwise return last closed head and true.iÿÿÿÿ( t Truet reversedR R[ ( RO t headst tipt closedt h( ( s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pyt
_branchtipª s
c C s | j | | ƒ d S( s“ Return the tipmost open head on branch head, otherwise return the
tipmost closed head on branch.
Raise KeyError for unknown branch.i ( Rb ( RO t branch( ( s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pyt branchtip¶ s c C s? | | } | s; g | D] } | | j k r | ^ q } n | S( N( R ( RO Rc R` R^ Ra ( ( s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pyt branchheads¼ s
+c c s9 x2 | j ƒ D]$ \ } } | | f | j | ƒ Vq
Wd S( N( t iteritemsRb ( RO t bnR^ ( ( s7 /usr/lib/python2.7/dist-packages/mercurial/branchmap.pyt iterbranches s c C s"