-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/hgext/convert/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/hgext/convert/common.pyc


l\c@sNddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZe	jZdZ
dZdefdYZdeddZd	efd
YZdZdefd
YZdefdYZdefdYZdefdYZdefdYZdZdS(iN(tutil(t_cCs"d}tj|}||S(NcSs?tj|}g|D]}|jd^q}dj|S(Nit(tbase64tencodestringt
splitlinestjoin(tstlinestl((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt	encodeargs#(tpickletdumps(targsR
R((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt
encodeargss	cCstj|}tj|S(N(RtdecodestringRtloads(R((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt
decodeargsstMissingToolcBseZRS((t__name__t
__module__(((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyRscCsg|p	|}tj|sc|r*tjp-t}|td||rVtd|pYdndS(Nscannot find required "%s" tools  (try installing the %s package)R(RtfindexetAbortRR(texetnametaborttdebnametexc((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt	checktools
tNoRepocBseZRS((RR(((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyR&stSKIPtcommitcBseZddiddZRS(c		CsX|p	d|_|pd|_||_||_||_||_||_||_dS(Ntunknowns0 0(tauthortdatetdesctparentstbranchtrevtextratsortkey(	tselfR!R"R#R$R%R&R'R(((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt__init__,s					N(RRtNoneR*(((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyR+stconverter_sourcecBseZdZdddZddZdZdZdZdZ	dZ
d	Zd
ZdZ
ddZd
ZdZdZdZdZdZddZRS(sConversion source interfacecCs(||_||_||_d|_dS(smInitialize conversion source (or raise NoRepo("message")
        exception if path is not a valid repository)sutf-8N(tuitpathR&tencoding(R)R-R.R&((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyR*:s			t	splicemapcCs8tjd|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(tretmatchRRR(R)trevstrtmapname((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytcheckhexformatCscCsdS(N((R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytbeforeKscCsdS(N((R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytafterNscCsdS(s*set the map of already-converted revisionsN((R)trevmap((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt	setrevmapQscCs
tdS(s(Return a list of this repository's headsN(tNotImplementedError(R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytgetheadsUscCs
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(). Raise
        IOError to indicate that name was deleted in rev.
        N(R:(R)RR&((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytgetfileYscCs
tdS(s#Returns a tuple of (files, copies).

        files is a sorted list of (filename, id) tuples for all files
        changed between version and its first parent returned by
        getcommit(). id is the source revision id of the file.

        copies is a dictionary of dest: source
        N(R:(R)tversion((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt
getchangesas	cCs
tdS(s$Return the commit object for versionN(R:(R)R=((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt	getcommitlscCs
tdS(sdReturn the tags as a dictionary of name: revision

        Tag names must be UTF-8 strings.
        N(R:(R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytgettagspscCs|s|jpd}nt|tr4|jdSy|j|jdSWnUtk
ry|jdjdSWqtk
r|j|djdSXnXdS(Nsutf-8slatin-1treplace(R/t
isinstancetunicodetencodetdecodetUnicodeError(R)RR/((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytrecodews


cCs
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(R:(R)R&ti((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytgetchangedfilesscCsdS(s5Notify the source that a revision has been converted.N((R)R&tsinkrev((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt	convertedscCstS(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)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pythasnativeorderscCstS(s@Return true if this source has ability to close branch.
        (RL(R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pythasnativeclosescCsdS(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+(R)R&((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt	lookuprevscCsiS(spReturn the bookmarks as a dictionary of name: revision

        Bookmark names are to be UTF-8 strings.
        ((R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytgetbookmarksscCstS(srevstr is a string that describes a revision in the given
           source control system.  Return true if revstr has correct
           format.
        (tTrue(R)R3R4((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytcheckrevformatsN(RRt__doc__R+R*R5R6R7R9R;R<R>R?R@RGRIRKRMRNRORPRR(((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyR,7s&										
					tconverter_sinkcBszeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZRS(
s"Conversion sink (target) interfacecCs||_||_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(R-R.tcreated(R)R-R.((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyR*s		cCs
tdS(sPath to a file that will contain lines
        source_rev_id sink_rev_id
        mapping equivalent revision identifiers for each system.N(R:(R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt
revmapfilescCsdS(sPath to a file that will contain lines
        srcauthor=dstauthor
        mapping equivalent authors identifiers for each system.N(R+(R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt
authorfilescCs
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'.

        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(R:(R)tfilestcopiesR$RtsourceR8((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt	putcommitscCs
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(R:(R)ttags((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytputtagsscCsdS(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((R)R%t	pbranches((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt	setbranchscCsdS(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((R)tactive((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytsetfilemapmodescCsdS(N((R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyR6scCsdS(N((R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyR7scCsdS(sPut bookmarks into sink.

        bookmarks: {bookmarkname: sink_rev_id, ...}
        where bookmarkname is an UTF-8 string.
        N((R)t	bookmarks((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytputbookmarksscCs
tdS(sPReturn False if a rev mentioned in a filemap is known to not be
        present.N(R:(R)R&((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pythascommitfrommapscCs
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(R:(R)R&((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pythascommitforsplicemap
s(RRRSR*RVRWR[R]R_RaR6R7RcRdRe(((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyRTs	
							
				tcommandlinecBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
dZdZ
d
ZedZdZdZRS(cCs||_||_dS(N(R-tcommand(R)R-Rg((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyR*s	cCsdS(N((R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytprerunscCsdS(N((R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytpostrunscOs"|j|gt|}x|jD]\}}t|dkrX|jd|n|jd|jddy>t|dkr|jd|n|dcd|7<Wq&tk
rq&Xq&Wg|D]}tj|^q}|j	j
s|dtjg7}nd	j
|}|S(
Nit-s--RRit=s2>t (Rgtlistt	iteritemstlentappendRAt	TypeErrorRt
shellquoteR-t	debugflagtostdevnullR(R)tcmdR
tkwargstcmdlinetktvtarg((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt_cmdlines 
"cOsd}|j||||S(Nc
Ss1tj|dtdddtjdtj}|S(Ntshelltbufsizeit	close_fdststdout(t
subprocesstPopenRQRtclosefdstPIPE(Rxtp((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytpopen3s	(t_dorun(R)RvR
RwR((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt_run2s	cOs|jtj|||S(N(RRtpopen2(R)RvR
Rw((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt_run2:scOs|jtj|||S(N(RRtpopen3(R)RvR
Rw((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt_run3=scOsV|j|||}|jjd|f|jz||SWd|jXdS(Nsrunning: %s
(R|R-tdebugRhRi(R)topenfuncRvR
RwRx((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyR@s
cOsB|j|||}|jd}|jj|||jfS(Ni(RtcommunicateR-Rt
returncode(R)RvR
RwRtoutput((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytrunIscOsT|j|||}|jj}|j|jjdj|||jfS(NR(RRt	readlinestwaitR-RRR(R)RvR
RwRR((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytrunlinesOs

RcCsr|rn|r<|jjtd|j|jj|ntj|d}tjd|j|fndS(Ns
%s error:
is%s %s(R-twarnRRgRtexplainexitR(R)tstatusRtmsg((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt	checkexitVscOs/|j|||\}}|j|||S(N(RR(R)RvR
RwRR((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytrun0^scOs8|j|||\}}|j|dj||S(NR(RRR(R)RvR
RwRR((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt	runlines0cscCs?d}ytjd}Wnttfk
r2nX|ddS(Nit
SC_ARG_MAXii(RttsysconftAttributeErrort
ValueError(R)targmax((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyRhs	cost|j|||}|j|}d}g}xn|D]f}	t|	d}
||
|ksst|dkr|j|	||
7}q;|V|	g}|
}q;W|r|VndS(Nii(RoR|RRp(R)targlistRvR
Rwtcmdlentlimittbytestfltfntb((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt_limit_arglistzs

"

	
cOsDx=|j||||D]#}|j|t|||qWdS(N(RRRm(R)RRvR
RwR	((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytxargss(RRR*RhRiR|RRRRRRRRRt
propertycacheRRR(((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyRfs 														tmapfilecBs,eZdZdZdZdZRS(cCsEtt|j||_||_d|_g|_|jdS(N(	tsuperRR*R-R.R+tfptordert_read(R)R-R.((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyR*s				cCs-|js
dSyt|jd}Wn,tk
rQ}|jtjkrMndSXxt|D]\}}|jdj}|sq_ny|jdd\}}Wn7t	k
rt
jtd|j|dfnX||kr|j
j|ntt|j||q_W|jdS(NtriRlis/syntax error in %s(%d): key/value pair expected(R.topentIOErrorterrnotENOENTt	enumerateRtrstriptrsplitRRRRRRpRRt__setitem__tclose(R)RterrRHtlinetkeytvalue((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyRs,	
	cCs|jdkrfyt|jd|_Wqftk
rb}tjtd|j|jfqfXn|jj	d||f|jj
tt|j
||dS(Ntascould not open map file %r: %ss%s %s
(RR+RR.RRRRtstrerrortwritetflushRRR(R)RRR((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyRs
cCs&|jr"|jjd|_ndS(N(RRR+(R)((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyRs	
(RRR*RRR(((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyRs			cCs@tjj|tjj|}|jd|j}||fS(s;Like util.makedate() but for time t instead of current timeiQ(tdatetimetutcfromtimestampt
fromtimestamptdaystseconds(tttdeltattz((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pytmakedatetimestamps(RRRRtRR1tcPickleRt	mercurialRtmercurial.i18nRRRRt	ExceptionRR+RQRRtSKIPREVtobjectRR,RTRftdictRR(((s8/usr/lib/python2.7/dist-packages/hgext/convert/common.pyt<module>s H				\|2

Copyright © 2017 || Recoded By Mr.Bumblebee