mò óRÅDc@sdkTeeƒdƒdefd„ƒYZdefd„ƒYZdeiefd„ƒYZdeiefd „ƒYZd S( (t*s3cStringIO changelog errno manifest os tempfile utilt appendfilecBs\tZdZd„Zd„Zd„Zd„Zd„Zdd„Zdd „Z d „Z RS( s×implement enough of file protocol to append to revlog file. appended data is written to temp file. reads and seeks span real file and temp file. readers cannot see appended data until writedata called.cCs©|o%||_ti|idƒ|_nAtiddƒ\}|_ti |ƒti|idƒ|_||_ |i ƒ|_ ti|ƒi|_|i|_dS(Nsab+tprefixshg-appendfile-(ttmpnametselftutilt posixfilettmpfpttempfiletmkstemptfdtostclosetfptrealfpttelltoffsettfstattst_sizetrealsizetname(RR RR ((t8/usr/lib/python2.4/site-packages/mercurial/appendfile.pyt__init__$s   cCs'|iiƒ|iti|iƒiS(N(RRtflushRRRR(R((Rtend3s cCs|iS(N(RR(R((RR7scCs|iiƒdS(N(RRR(R((RR:scCs|iiƒ|iiƒdS(N(RRR R(R((RR =s icCs¦|djo ||_nE|djo|i|7_n%|djo|iƒ||_n|i|ijo|ii|iƒn|ii|i|iƒdS(s2virtual file offset spans real file and temp file.iiiN(twhenceRRRRRtseekR(RRR((RRAs    iÿÿÿÿcCsþtiƒ}|i}|i|ijoY|ii|ƒ}|i |ƒ|it |ƒ7_|djo|t |ƒ8}qn|djof||ijo|i i|i|iƒn|i i|ƒ}|i |ƒ|it |ƒ7_n|iƒS(s;only trick here is reads that span real file and temp file.iN(t cStringIOtStringIOR RRt old_offsetRRtreadtcounttstwritetlenRRtgetvalue(RRR R R((RROs       cCs@|iiddƒ|ii|ƒ|i|iiƒ|_dS(sappend to temp file.iiN(RRRR!R RRR(RR ((RR!as( t__name__t __module__t__doc__RRRRR RRR!(((RRs        t appendopenercBs5tZdZd„Zdd„Zd„Zd„ZRS(s2special opener for files that only read or append.cCs||_h|_dS(N(topenerRt realopenerttmpnames(RR(((RRks trcCs´|djpt‚y|i|dƒ}WnAtj o5}|iti jo‚n|i|dƒ}nX|i i |ƒ}t ||ƒ}|djo|i |i |(RR((RtcleanupŽs(R$R%R&RR4R?RA(((RR'hs    tappendchangelogcBstZd„Zd„ZRS(NcCs*ti||ƒtii|||ƒdS(N(R'RRR(t changelogtversion(RR(RD((RR—scCsdS(N((RR ttr((Rtcheckinlinesizešs(R$R%RRF(((RRB–s tappendmanifestcBstZd„Zd„ZRS(NcCs*ti||ƒtii|||ƒdS(N(R'RRR(tmanifestRD(RR(RD((RRžscCsdS(N((RR RE((RRF¡s(R$R%RRF(((RRGs N( t demandloadtglobalstobjectRR'RCRBRHRG(RR'RGRB((Rt?s J.