\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z m Z mZmZmZddlmZejZejZdZdefdYZddddd Zd Zd Zd efd YZdedZdefdYZ dZ!defdYZ"defdYZ#defdYZ$defdYZ%de&fdYZ'dZ(dS(i(tabsolute_importN(t_(tencodingterrortphasestpycompattutil(tprocutilcC@s|dkrdS|jdS(Ntlatin1(tNonetencode(td((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt _encodeornone s t_shlexpy3proxycB@sAeZdZdZdZedZedZRS(cC@s ||_dS(N(t_l(tselftl((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt__init__'scC@sd|jDS(Ncs@s|]}t|VqdS(N(R (t.0tv((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pys +s(R(R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt__iter__*scC@st|jjS(N(R Rt get_token(R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyR-scC@s|jjpdS(Ns (Rtinfile(R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyR0scC@s |jjS(N(Rtlineno(R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyR4s(t__name__t __module__RRRtpropertyRR(((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyR %s    cC@s7|dkr?tjr-t|ddd}qxt|d}n9|dk r]tjdntjrx|jd}ntj|d|dt}|dk rt|_ tjr|j |jd7_ q|j |7_ n|dk r tjr|j |jd7_ q |j |7_ ntjr3t |S|S(NtrRRs/shlexer only accepts data or filepath, not bothRtposix( R Rtispy3topenRtProgrammingErrortdecodetshlextTruetwhitespace_splitt whitespacet wordcharsR (tdatatfilepathR%R$R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytshlexer8s,            cC@s"d}tj|}||S(NcS@s?tj|}g|D]}|jd^q}dj|S(Nit(tbase64t encodestringt splitlinestjoin(tstlinesR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt encodeargUs#(tpickletdumps(targsR0R.((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt encodeargsTs cC@stj|}tj|S(N(R*t decodestringR1tloads(R.((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt decodeargs]st MissingToolcB@seZRS((RR(((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyR8ascC@sP|p |}tj|sL|r-tj}nt}|td|ndS(Nscannot find required "%s" tool(RtfindexeRtAbortR8R(texetnametaborttexc((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt checktoolds   tNoRepocB@seZRS((RR(((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyR@mstSKIPtcommitcB@s)eZddddeejddZRS(c C@s|p d|_|pd|_||_||_| p9g|_||_||_|pZi|_||_| |_ | |_ dS(Ntunknowns0 0( tauthortdatetdesctparentst optparentstbranchtrevtextratsortkeytsaverevtphase( RRDRERFRGRIRJRKRLRMRNRH((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRss      N(RRR R"RtdraftR(((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRBrstconverter_sourcecB@seZdZdddZddZdZdZdZdZ dZ d Z d Z d Z d Zd ZddZdZdZdZdZdZdZddZRS(sConversion source interfacecC@s1||_||_||_||_d|_dS(smInitialize conversion source (or raise NoRepo("message") exception if path is not a valid repository)sutf-8N(tuitpathtrevstrepotypeR(RRQRTRRRS((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRs     t splicemapcC@s8tjd|s4tjtd||fndS(s fails if revstr is not a 40 byte hex. mercurial and git both uses such format for their revision numbering s[0-9a-fA-F]{40,40}$s.%s entry %s is not a valid revision identifierN(tretmatchRR:R(Rtrevstrtmapname((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytcheckhexformatscC@sdS(N((R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytbeforescC@sdS(N((R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytafterscC@stS(sReturns true if the given targetfile belongs to the source repo. This is useful when only a subdirectory of the target belongs to the source repo.(R"(Rttargetfilename((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyttargetfilebelongstosourcescC@sdS(s*set the map of already-converted revisionsN((Rtrevmap((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt setrevmapscC@s tdS(s(Return a list of this repository's headsN(tNotImplementedError(R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytgetheadsscC@s tdS(sReturn a pair (data, mode) where data is the file content as a string and mode one of '', 'x' or 'l'. rev is the identifier returned by a previous call to getchanges(). Data is None if file is missing/deleted in rev. N(Ra(RR<RJ((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytgetfilescC@s tdS(sDReturns a tuple of (files, copies, cleanp2). files is a sorted list of (filename, id) tuples for all files changed between version and its first parent returned by getcommit(). If full, all files in that revision is returned. id is the source revision id of the file. copies is a dictionary of dest: source cleanp2 is the set of files filenames that are clean against p2. (Files that are clean against p1 are already not in files (unless full). This makes it possible to handle p2 clean files similarly.) N(Ra(Rtversiontfull((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt getchangesscC@s tdS(s$Return the commit object for versionN(Ra(RRd((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt getcommitscC@sdS(sWReturn the number of commits in this source. If unknown, return None. N(R (R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt numcommitsscC@s tdS(sdReturn the tags as a dictionary of name: revision Tag names must be UTF-8 strings. N(Ra(R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytgettagsscC@s|s|jpd}nt|tjr7|jdSy#|jtj|jdSWn^tk ry|jdjdSWqtk r|jtj|djdSXnXdS(Nsutf-8slatin-1treplace(Rt isinstanceRtunicodeR R tsysstrt UnicodeError(RR.R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytrecodes #  cC@s tdS(sJReturn the files changed by rev compared to parent[i]. i is an index selecting one of the parents of rev. The return value should be the list of files that are different in rev and this parent. If rev has no parents, i is None. This function is only needed to support --filemap N(Ra(RRJti((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytgetchangedfiless cC@sdS(s5Notify the source that a revision has been converted.N((RRJtsinkrev((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt convertedscC@stS(sReturn true if this source has a meaningful, native revision order. For instance, Mercurial revisions are store sequentially while there is no such global ordering with Darcs. (tFalse(R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pythasnativeorderscC@stS(s@Return true if this source has ability to close branch. (Rt(R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pythasnativeclosescC@sdS(sIf rev is a meaningful revision reference in source, return the referenced identifier in the same format used by getcommit(). return None otherwise. N(R (RRJ((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt lookuprevscC@siS(spReturn the bookmarks as a dictionary of name: revision Bookmark names are to be UTF-8 strings. ((R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt getbookmarksscC@stS(srevstr is a string that describes a revision in the given source control system. Return true if revstr has correct format. (R"(RRXRY((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytcheckrevformatsN(RRt__doc__R RRZR[R\R^R`RbRcRfRgRhRiRoRqRsRuRvRwRxRy(((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRPs*                 tconverter_sinkcB@szeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d ZRS( s"Conversion sink (target) interfacecC@s(||_||_g|_||_dS(sInitialize conversion sink (or raise NoRepo("message") exception if path is not a valid repository) created is a list of paths to remove if a fatal error occurs laterN(RQRRtcreatedRT(RRQRTRR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRs   cC@s tdS(sPath to a file that will contain lines source_rev_id sink_rev_id mapping equivalent revision identifiers for each system.N(Ra(R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt revmapfile#scC@sdS(sPath to a file that will contain lines srcauthor=dstauthor mapping equivalent authors identifiers for each system.N(R (R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt authorfile)sc C@s tdS(sCreate a revision with all changed files listed in 'files' and having listed parents. 'commit' is a commit object containing at a minimum the author, date, and message for this changeset. 'files' is a list of (path, version) tuples, 'copies' is a dictionary mapping destinations to sources, 'source' is the source repository, and 'revmap' is a mapfile of source revisions to converted revisions. Only getfile() and lookuprev() should be called on 'source'. 'full' means that 'files' is complete and all other files should be removed. 'cleanp2' is a set of the filenames that are unchanged from p2 (only in the common merge case where there two parents). Note that the sink repository is not told to update itself to a particular revision (or even what that revision would be) before it receives the file data. N(Ra( RtfilestcopiesRGRBtsourceR_Retcleanp2((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt putcommit/scC@s tdS(sPut tags into sink. tags: {tagname: sink_rev_id, ...} where tagname is an UTF-8 string. Return a pair (tag_revision, tag_parent_revision), or (None, None) if nothing was changed. N(Ra(Rttags((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytputtagsCscC@sdS(sSet the current branch name. Called before the first putcommit on the branch. branch: branch name for subsequent commits pbranches: (converted parent revision, parent branch) tuplesN((RRIt pbranches((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt setbranchLscC@sdS(s;Tell the destination that we're using a filemap Some converter_sources (svn in particular) can claim that a file was changed in a revision, even if there was no change. This method tells the destination that we're using a filemap and that it should filter empty revisions. N((Rtactive((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytsetfilemapmodeRscC@sdS(N((R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyR[[scC@sdS(N((R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyR\^scC@sdS(sPut bookmarks into sink. bookmarks: {bookmarkname: sink_rev_id, ...} where bookmarkname is an UTF-8 string. N((Rt bookmarks((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt putbookmarksascC@s tdS(sPReturn False if a rev mentioned in a filemap is known to not be present.N(Ra(RRJ((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pythascommitfrommaphscC@s tdS(sThis method is for the special needs for splicemap handling and not for general use. Returns True if the sink contains rev, aborts on some special cases.N(Ra(RRJ((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pythascommitforsplicemapms(RRRzRR}R~RRRRR[R\RRR(((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyR{s        t commandlinecB@seZdZdZdZdZdZdZdZdZ dZ d Z d d Z d Z d ZedZdZdZRS(cC@s||_||_dS(N(RQtcommand(RRQR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRts cC@sdS(N((R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytprerunxscC@sdS(N((R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytpostrun{scO@s:tj|}|j|gt|}x|jD]\}}t|dkrg|jd|n|jd|jddy>t|dkr|jd|n|dcd|7t (Rt byteskwargsRtlistt iteritemstlentappendRjt TypeErrorRt shellquoteRQt debugflagtbytestrtostdevnullR-(RtcmdR3tkwargstcmdlinetkRtarg((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt_cmdline~s" " cO@sd}|j||||S(Nc S@s:tjtj|dtdddtjdtj}|S(Ntshelltbufsizeit close_fdststdout(t subprocesstPopenRt tonativestrR"tclosefdstPIPE(Rtp((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytpopens    (t_dorun(RRR3RR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt_runs cO@s|jtj|||S(N(RRtpopen2(RRR3R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt_run2scO@s|jtj|||S(N(RRtpopen3(RRR3R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt_run3scO@sV|j|||}|jjd|f|jz||SWd|jXdS(Ns running: %s (RRQtdebugRR(RtopenfuncRR3RR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRs  cO@sB|j|||}|jd}|jj|||jfS(Ni(Rt communicateRQRt returncode(RRR3RRtoutput((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytrunscO@sT|j|||}|jj}|j|jjdj|||jfS(NR)(RRt readlinestwaitRQRR-R(RRR3RRR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytrunliness  R)cC@sn|rj|r<|jjtd|j|jj|ntj|}tjd|j|fndS(Ns %s error: s%s %s(RQtwarnRRRt explainexitRR:(RtstatusRtmsg((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt checkexits cO@s/|j|||\}}|j|||S(N(RR(RRR3RRR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytrun0scO@s8|j|||\}}|j|dj||S(NR)(RRR-(RRR3RRR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt runlines0scC@s?d}ytjd}Wnttfk r2nX|ddS(Nit SC_ARG_MAXii(RtsysconftAttributeErrort ValueError(Rtargmax((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRs  c o@st|j|||}|j|}d}g}xn|D]f} t| d} || |ksst|dkr|j| || 7}q;|V| g}| }q;W|r|VndS(Nii(RRRR( RtarglistRR3Rtcmdlentlimittnumbytestfltfntb((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyt_limit_arglists  "    cO@sDx=|j||||D]#}|j|t|||qWdS(N(RRR(RRRR3RR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytxargss(RRRRRRRRRRRRRRRt propertycacheRRR(((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRss             tmapfilecB@s,eZdZdZdZdZRS(cC@sEtt|j||_||_d|_g|_|jdS(N( tsuperRRRQRRR tfptordert_read(RRQRR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRs     cC@s6|js dSyt|jd}Wn,tk rQ}|jtjkrMndSXxttj|D]\}}|jdj }|sqhny|j dd\}}Wn7t k rt j td|j|dfnX||kr |jj|ntt|j||qhW|jdS(NtrbiRis/syntax error in %s(%d): key/value pair expected(RRRtIOErrorterrnotENOENTt enumerateRtiterfileR,trstriptrsplitRRR:RRRRRt __setitem__tclose(RRterrRptlinetkeytvalue((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRs, "   cC@s|jdkroyt|jd|_Wqotk rk}tjtd|jtj |j fqoXn|jj t j d||f|jjtt|j||dS(Ntabscould not open map file %r: %ss%s %s (RR RRRRRR:RRt strtolocaltstrerrortwriteRt tonativeeoltflushRRR(RRRR((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRs &# cC@s&|jr"|jjd|_ndS(N(RRR (R((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRs  (RRRRRR(((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyRs   cC@s@tjj|tjj|}|jd|j}||fS(s?Like dateutil.makedate() but for time t instead of current timeiQ(tdatetimetutcfromtimestampt fromtimestamptdaystseconds(tttdeltattz((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pytmakedatetimestamp$s()t __future__RR*RRRRVR!Rtmercurial.i18nRt mercurialRRRRRtmercurial.utilsRR1RR tobjectR R R(R4R7t ExceptionR8R"R?R@tSKIPREVRBRPR{RtdictRR(((s:/usr/lib64/python2.7/site-packages/hgext/convert/common.pyts6       (     ^~3