�
n� @s|ddklZddkZddkZddkZddkZddkZdefd��YZde fd��YZ
dS(i�(t_NtsortdictcBsYeZdZd d�Zd�Zd�Zd�Zd�Zd�Z d�Z
d�ZRS(
sa simple sorted dictionarycCs%g|_|o|i|�ndS(N(t_listtupdate(tselftdata((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyt__init__s cCs
t|�S(N(R(R((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pytcopyscCsH||jo|ii|�n|ii|�ti|||�dS(N(Rtremovetappendtdictt__setitem__(Rtkeytval((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyRs
cCs
|ii�S(N(Rt__iter__(R((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyRscCs#x|D]}||||<qWdS(N((Rtsrctk((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyRscCsti|�g|_dS(N(R
tclearR(R((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyRs
cCs,g}|iD]}||||fq~S(N(R(Rt_[1]R((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pytitems!scCs$ti||�|ii|�dS(N(R
t__delitem__RR(RR((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyR#sN(t__name__t
__module__t__doc__tNoneRRRRRRRR(((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyRs tconfigcBs�eZdd�Zd�Zd�Zd�Zd�Zd�Zdd�Z d�Z
d�Zd �Zd
�Z
dd�Zd
�Zdddd�Zdddd�ZRS(cCs^h|_h|_|oAx(|iD]}||i�|i|<q#W|ii�|_ndS(N(t_datat_sourceR(RRR((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyR(s
cCs
t|�S(N(R(R((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyR/scCs
||ijS(N(R(Rtsection((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyt__contains__1scCs|ii|h�S(N(Rtget(RR((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyt__getitem__3sccs x|i�D]}|Vq
WdS(N(tsections(Rtd((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyR5s
cCsdxJ|D]B}||jot�|i|<n|i|i|i|�qW|ii|i�dS(N(RRRR(RRts((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyR8s
cCs|ii|h�i||�S(N(RR(RRtitemtdefault((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyR>scCs[y7|i||}|i||�}||||fSWntj
o||fSnXdS(s�return a tuple allowing restore to reinstall a previous valuesi
The main reason we need it is because it handle the "no data" case.
N(RtsourcetKeyError(RRR#tvalueR%((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pytbackupAscCs|ii||fd�S(Nt(RR(RRR#((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyR%MscCst|ii��S(N(tsortedRtkeys(R((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyR OscCs|ii|h�i�S(N(RRR(RR((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyRQsR)cCsI||jot�|i|<n||i||<||i||f<dS(N(RRR(RRR#R'R%((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pytsetSs
cCs�t|�djo:|\}}}}||i||<||i||f<nH|\}}||ijo|i||=n|ii||fd�dS(s$restore data returned by self.backupiN(tlenRRtpopR(RRRR#R'R%((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pytrestoreYscCs�tid�}tid�}tid�}tid�} tid�}
tid�}tid�}d}
d}d }t}xk|it�D]Z}|d
7}|d
jo|id�o|d}n|o�|
i|�oq�n|i|�}|oe|o|
|joq�n|i|
|�d
|i d
�}|i
|
||d||f�q�nd}t}n|i|�}|o�ti|i d
��}t
ii|�}t
iit
ii||��}|o|y||d|d|�WqYtj
oO}|itijo3titd�||ifd||f��qUqYXq�q�n| i|�oq�n|i|�}|oT|i d
�}
|o|i|
|
�}
n|
|jot�|i|
<q�q�n|i|�}|o`|i d
�}t}|o|
|joq�n|i
|
||i d�d||f�q�n|i|�}|o\|i d
�}|o|
|joq�n|i|
|�dj o|i|
|=q�q�nti|i�d||f��q�WdS(Ns\[([^\[]+)\]s([^=\s][^=]*?)\s*=\s*(.*\S|)s\s+(\S|\S.*\S)\s*$s
(;|#|\s*$)s(;|#)s%unset\s+(\S+)s%include\s+(\S|\S.*\S)\s*$R)iisis
s%s:%dtremapR scannot include %s (%s)s%s:%si(tretcompileRtFalset
splitlinestTruet
startswithtmatchRtgroupR,tutilt
expandpathtostpathtdirnametnormpathtjointIOErrorterrnotENOENTterrort
ParseErrorRtstrerrorRRtrstrip(RRRR R0tincludet sectionretitemretcontretemptyret commentretunsetret includereRR#tlinetconttltmtvtinctbasetinsttname((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pytparsegs�
#
!
)cCs@|pti|�}n|i||i�|||i�dS(N(R9t posixfileRXtread(RR<tfpR R0((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyRZ�sN(RRRRRRRRRRR(R%R RR,R/RXRZ(((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pyR's I(ti18nRRCR9R1R;RAR
RtobjectR(((s?/sys/lib/python/lib/python2.5/site-packages/mercurial/config.pys<module>s$
|