\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlZddlZddlmZddlmZm Z m Z m Z m Z ddl mZmZmZe jZdefdYZdefd YZd Zed eed Zd efdYZdeedZdZdS(i(tabsolute_importN(t_(tencodingterrorthooktpycompattutil(tdateutiltprocutilt stringutiltlogentrycB@s eZdZdZdZRS(sClass logentry has the following attributes: .author - author name as CVS knows it .branch - name of branch this revision is on .branches - revision tuple of branches starting at this revision .comment - commit message .commitid - CVS commitid or None .date - the commit date as a (time, tz) tuple .dead - true if file revision is dead .file - Name of file .lines - a tuple (+lines, -lines) or None .parent - Previous revision of this entry .rcs - name of file as returned from CVS .revision - revision number as tuple .tags - list of tags on the file .synthetic - is this a synthetic "file ... added on ..." revision? .mergepoint - the branch that has been merged from (if present in rlog output) or None .branchpoints - the branches that start at the current entry or empty cK@st|_|jj|dS(N(tFalset synthetict__dict__tupdate(tselftentries((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyt__init__1s c@s?fdtjD}dtjdj|fS(Nc3@s&|]}d|j|fVqdS(s%s=%rN(R (t.0tk(R(s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pys 6ss%s(%s)s, (tsortedR ttypet__name__tjoin(Rtitems((Rs9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyt__repr__5s(Rt __module__t__doc__RR(((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyR s tlogerrorcB@seZRS((RR(((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyR9scC@s_|jd}|djd}d}|dkr=|}n|d|djd|}|S(s^Return the repository path from a CVS path. >>> getrepopath(b'/foo/bar') '/foo/bar' >>> getrepopath(b'c:/foo/bar') '/foo/bar' >>> getrepopath(b':pserver:10/foo/bar') '/foo/bar' >>> getrepopath(b':pserver:10c:/foo/bar') '/foo/bar' >>> getrepopath(b':pserver:/foo/bar') '/foo/bar' >>> getrepopath(b':pserver:c:/foo/bar') '/foo/bar' >>> getrepopath(b':pserver:truc@foo.bar:/foo/bar') '/foo/bar' >>> getrepopath(b':pserver:truc@foo.bar:c:/foo/bar') '/foo/bar' >>> getrepopath(b'user@server/path/to/repository') '/path/to/repository' t:it@it/(tsplittfind(tcvspathtpartst atpositiontstarttrepopath((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyt getrepopath<s  tc>@sifd}|jtdg}tjd}tjd}tjd} tjd} tjd} tjd} tjd } tjd }tjd }tjd }tjd }tjd}tjd}d}|dckryIttjjdddj j }|}|dkrKd}nWn#t k rqt tdnX|r|j tj r|tj7}ny.ttjjdddj j }Wqt k rqXn|stjjdd}ng}dc}|rtjjd}tjj|sDtj|n|jd|dg}g|D]'}|rddjtjd|^qd}tjj|djg|D]}|r|^q}n|dkry|jtd|tjt|d}xa|D]Y}tj|doItj|d oItj|d!s|jtd"g}PqqW|jtd#t|Wn*tk r}|jtd$|nX|r|d%j}t j!|d&}qnd'd(g}|r\|j"d)|tj#t$|}|j d*s7|d*7}n|rS|tj#|}q\|}n|j"d+d,g||r|j"d-|n|j"|i}i}i}d.} t%}!g|D]}"t&j'|"^q}|jtd/d0j||j(d1|||ft&j)d0j|d}#tj*|#j+}$xP t,r|$}%|%dkrcPntj*|#j+}$|%j d2r|%d% }%n| d.kr|j-|%}&|&rg|&j.d3}'i}|r[tj#|'d4 }(|(j/|r|(t|}(n|(j/d*r!|(d3}(n|(j/d5r=|(d6}(n|(j0d7d*}(d8} qGnd3} qGn|j-|%}&|&rt |&j.d3n| j-|%}&|&rt |&j.d8n| j-|%r t |%q n| d3kr| j-|%}&tj#|&j.d3}(d8} n| d8krK| j-|%r i}d9} q n| d9kr{| j-|%}&|&rHg|&j.d8jdD]})t1|)^q}*t|*}+|+d9kr|+d8d.kr|*d4d.kr|*d4 |*d%}*nt2|*}*|*|krg||*t2g|&j.d3jdD]})t1|)^qd?gd@dcd dcd!dcdt4}d6} n| d6kr| |j-|%}&|&j.d3},|,d8d*kr dA|,},nt|,jd9kr |,dB},nt j5|,dCdDdEg|_||&j.d8|_6|&j.d9j7dFk|_8|&j.d:rn |&j.d6rM t1|&j.d:t1|&j.d6f|_9q t1|&j.d:d.f|_9n9|&j.d6r d.t1|&j.d6f|_9n dc|_9|&j.dGr |&j.dH|_:n|&j.dIrj |&j.dJjd}-t|-d8kr dK|_;qj dj|-d4 dL|-d4g}-g|D]}.||.|-kr8 |.^q8 }/|/d.|_;ng|_<dG} n| dGkr` |j-|%}0|0r g|0j.d3jdMD]:})t2g|)j jdD]}1t1|1^q ^q |_=dH} q |j-|%r/ |j-|$r/ d:} t,}!q |j-|%rM d.} t,}!q |j<j"|%n| dHkr |j-|%r |$}2|2j d2r |2d% }2n|j-|2r d:} t,}!q |j<j"|%q |j-|%r d.} t,}!q |j<j"|%n|!ry |j8ry |j>d%d3kry t|j<d3kry |j-|j<d.ry |j(dN|j?|j<d.ft,|_@n|!rGt%}!tAg|j|j>gD]})||)^q |_B|d2j|j<|_<t|j>}+|+d9kr(|+d8d.kr(|j|j>d% dcgd.|_Cn dc|_Ct4}3x|jDD]\}4}5t2g|5jdD]}6t1|6^qf}7t|7d8krqGn|7d4d.kr|7d%d8d.kr|7d4 |j>kr|3jE|4qqG|7ddkrG|7|j=kr|3jE|4qqGqGW|3|_F|j"||j?||j?j0d7d*d% }4|j>|8|j?|4fd% }4|8j|j?|4fdc}|dckru|j>d4 }n||_K|j>|8|j?|4f|;jIfnPWqtRk rqtSk r.}=tTjU|=d_td`qXqWtTjUtda|:|;j>|;jIfd_td`qwWntVjV|dcdbt,d+||S(esCollect the CVS rlogc@sj||S(s#return a shared version of a string(t setdefault(ts(t_scache(s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pytscacheisscollecting CVS rlog sRCS file: (.+)$scvs \[r?log aborted\]: (.+)$scvs (r?log|server): (.+) $s>(Cannot access.+CVSROOT)|(can't create temporary directory.+)$sWorking file: (.+)$ssymbolic names:s (.+): ([\d.]+)$s----------------------------$sN=============================================================================$s(revision ([\d.]+)(\s+locked by:\s+.+;)?$sdate:\s+(.+);\s+author:\s+(.+);\s+state:\s+(.+?);(\s+lines:\s+(\+\d+)?\s+(-\d+)?;)?(\s+commitid:\s+([^;]+);)?(.*mergepoint:\s+([^;]+);)?sbranches: (.+);$s+file [^/]+ was (initially )?added on branchR(tCVSt Repositorytrbt.snot a CVS sandboxtRoottCVSROOTs ~/.hg.cvspsRtcachet-s\w+Rsreading cvs log cache %s t branchpointstcommitidt mergepointsignoring old cache scache has %d log entries serror reading cache: %r is%Y/%m/%d %H:%M:%S %1%2tcvss-qs-d%sRtlogtrlogs-d>%sis running %s t sprefix=%r directory=%r root=%r s iisAttic/is/Attic/iiiitrcstfiletrevisiontbranchestparentt19s UTCs%y/%m/%d %H:%M:%Ss%Y/%m/%d %H:%M:%Ss%Y-%m-%d %H:%M:%Stdeadiii i tHEADt0t;s#found synthetic revision in %s: %r ids%d %siPtkeycS@s|j|jfS(N(R<R>(tx((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pytscS@s|j|jfS(N(R<R>(RG((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyRHscS@s|jS(N(tdate(RG((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyRHss>log cache overlaps with new log entries, re-run without cache.swriting cvs log cache %s twbs%d log entries tconvertscvsps.logencodingcS@sdjtjtj|S(NR0(RRtmaplisttbytestr(tr((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pytrevstrssutf-8stranscoding by %s: %s of %s thints-check convert.cvsps.logencoding configurations6no encoding can transcode CVS log message for %s of %stcvslogN(iii(WtstatusRtretcompiletNonetopentostpathRtreadtstriptIOErrorRtendswithRtossepRtenvirontgett expandusertexiststmkdirR tfindalltnotetpickletloadRt safehasattrtlent ExceptionRIRtdatestrtappendtnormpathR'R Rt shellquotetdebugtpopent fromnativeeoltreadlinetTruetmatchtgroupt startswithtreplacetintttupleR tsett parsedatetauthortlowerRBtlinesR6R7tcommentR?R>R<R Rttagstbrancht iteritemstaddR5R tellipsisR=tsortR@tdumpt configlisttdecodetsysstrtencodet debugflagtUnicodeDecodeErrort LookupErrorRtAbortR(>tuit directorytrootR:R3R,R9tre_00tre_01tre_02tre_03tre_10tre_20tre_30tre_31tre_32tre_50tre_60tre_70t file_added_retprefixtoldlogRItcachedirt cachefileR*tetcmdtpRt branchmaptrcsmaptstatetstoretargtpfptpeektlineRsR<tfilenameRGtrevtrevntdtmyrevtbR?tmtytcpeekR5RR>titrevpartstversionst encodingsROtentryR~tinst((R+s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyt createlogcsL *   .  4 .  !     "            1 ,         1      0!!  !)   Y           7&  .$   (                  t changesetcB@s eZdZdZdZRS(sClass changeset has the following attributes: .id - integer identifying this changeset (list index) .author - author name as CVS knows it .branch - name of branch this changeset is on, or None .comment - commit message .commitid - CVS commitid or None .date - the commit date as a (time,tz) tuple .entries - list of logentry objects in this changeset .parents - list of one or two parent changesets .tags - list of tags on this changeset .synthetic - from synthetic revision "file ... added on branch ..." .mergepoint- the branch that has been merged from or None .branchpoints- the branches that start at the current entry or empty cK@s&d|_t|_|jj|dS(N(RUtidR R R R(RR((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyR(s  c@s?fdtjD}dtjdj|fS(Nc3@s&|]}d|j|fVqdS(s%s=%rN(R (RR(R(s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pys .ss%s(%s)s, (RR RRR(RR((Rs9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyR-s(RRRRR(((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyRs i<c@s|jtdix\|D]T}|jr |jkrQ|j|jR<R_RUR@RRhR=R5(RRNRtleRRStc(todd(s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pytcscmps8 $D$c3@s%|]}|kr|VqdS(N((Rttag(Rt globaltags(s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pys ss{{mergetobranch ([-\w]+)}}s{{mergefrombranch ([-\w]+)}}RCsBwarning: CVS commit message references non-existent branch %r: %s s&convert-repo: CVS merge from branch %sRtparentsis)changeset %d is both before and after %d s%d changeset entries t cvschangesetst changesetsN(.RRRR6RIRRRyRUt enumerateR5R~R{RR=RR7RkRhtreprR RRRR t functoolst cmp_to_keyRRRRSRTR<R>RtxrangeRtsearchRttKeyErrortwarnRMtgroupstinsertRRRr(RR9tfuzzt mergefromtmergetoRRtfilesRttRRRRRR?RtfRt candidateRtccRRN((RRRRs9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pytcreatechangeset1s  ' !$  &# ,    0   &                   %           c O@s&tj|}|dr"d}n|dr5d}nd }|d}yc|rg}xP|D])}|t||d|dd|7}q[Wnt|d|dd|}Wn%tk r}|jd|d SXt|||d }~t|} i} i} x|D]} |d r| j| kru| j ru| j d j ru|| j d j d j| j d j f| | j|rp| |\}}|jd!|p[d|| |fq3W|r|jd"dj|qn|jd#|jd$| j|jd%x| jD]}|j}|j|d&r|t|d&}n|jd'|d(jg|jD]}d|^q$p@d)d(jg|jD]}d|^qPdd*g|jfqW|jd+n|r| r|d d| j ks|d | jkrt} qnt|d kr| r|d d| j ks|d | jkrPqqqWd S(,sRead CVS rlog for current directory or named path in repository, and convert the log to changesets based on matching commit log entries and dates. t new_cachetwritet update_cacheRt revisionsRR3s%r NRt ancestorsiiR?RCs--------------------- s PatchSet %d s Date: %s s%Y/%m/%d %H:%M:%S %1%2s Author: %s s Branch: %s s Tag%s: %s R(R*t,s(none)sBranchpoints: %s s, Rs Parents: %s s%ds Parent: %d s%s:%d:%dsAncestors: %s sLog: s%s s Members: Rs %s:%s->%s%s R0tINITIALs(DEAD)s (Rt byteskwargsRURRRRRhRRRRRjRIR{RRR5RRkR~RR=RuR@R>RBR (RtargstoptsR3RR9RRRtoffR?RtcsRRRNRRtfnRG((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyt debugcvspsas      *    (#  %   1   (     ,&  (t __future__RRRWRStmercurial.i18nRt mercurialRRRRRtmercurial.utilsRRR RetobjectR RiRR'RURrRRRR(((s9/usr/lib64/python2.7/site-packages/hgext/convert/cvsps.pyts    (  '1