-=[ Mr. Bumblebee ]=-
_Indonesia_

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


\,Tc@sdZddlmZddlmZmZmZmZmZddlm	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZiZejeZdZejdZdZd	efd
YZdZdefd
YZdZdZedejddejeddZdZ edgedde!dZ"dZ#dZ$dZ%dZ&dS(s<commands to interactively select changes for commit/qrefreshi(t_(tcmdutiltcommandst
extensionsthgtpatch(tutilNtinternals'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)c#sXtj|fd}x3trSj}|s=Pn|jds[|jdrd}|||}j}|jdrj}|||g7}n
j|d|fVq!|ddkrd	||d
fVq!|ddkrd||d
fVq!tj|}|rEd|jfVq!d|fVq!WdS(slike patch.iterhunks, but yield different events

    - ('file',    [header_lines + fromfile + tofile])
    - ('context', [context_lines])
    - ('hunk',    [hunk_lines])
    - ('range',   (-start,len, +start,len, proc))
    csZ|g}xJtrUj}|s(Pn||rD|j|qj|PqW|S(sscan lr while predicate holds(tTruetreadlinetappendtpush(tfirsttptlinestline(tlr(s0/usr/lib/python2.7/dist-packages/hgext/record.pyt	scanwhiles		
s
diff --git a/sdiff -r cSs'|jdd}|p&|ddkS(Niis---tdiff(s---sdiff(tsplittNone(Rts((s0/usr/lib/python2.7/dist-packages/hgext/record.pyt	notheader2ss---tfileit tcontextcSs|ddkS(Nis \((tl((s0/usr/lib/python2.7/dist-packages/hgext/record.pyt<lambda>>ss-+thunkcSs|ddkS(Nis-+\((R((s0/usr/lib/python2.7/dist-packages/hgext/record.pyR@strangetotherN(	Rt
linereaderRR	t
startswithRtlines_retmatchtgroups(tfpRRRtheadertfromfilettofiletm((Rs0/usr/lib/python2.7/dist-packages/hgext/record.pyt	scanpatchs.		
R%cBseZdZejdZejdZejdZejdZejdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZRS(sIpatch header

    XXX shouldn't we move this to mercurial/patch.py ?
    sdiff --git a/(.*) b/(.*)$sdiff -r .* (.*)$s (?:index|new file|deleted file) s(?:new file|deleted file) s"(?:index|new|deleted|copy|rename) cCs||_g|_dS(N(R%thunks(tselfR%((s0/usr/lib/python2.7/dist-packages/hgext/record.pyt__init__Ss	cCstjd|jDS(Ncss|]}|jdVqdS(sindex N(R (t.0th((s0/usr/lib/python2.7/dist-packages/hgext/record.pys	<genexpr>Xs(RtanyR%(R+((s0/usr/lib/python2.7/dist-packages/hgext/record.pytbinaryWsc
Csx|jD]}|jdr6|jtdPn|jj|r{|j||jrw|jtdnPn|jdr|jtdt|jt	g|jD]}t
|j|j^qfPn|j|q
WdS(Nsindex s-this modifies a binary file (all or nothing)
sthis is a binary file
s---s%d hunks, %d lines changed
(
R%R twriteRt	pretty_reR"R0tlenR*tsumtmaxtaddedtremoved(R+R$R.((s0/usr/lib/python2.7/dist-packages/hgext/record.pytprettyZs
6cCs|jdj|jdS(Nt(R1tjoinR%(R+R$((s0/usr/lib/python2.7/dist-packages/hgext/record.pyR1kscs tjfdjDS(Nc3s!|]}jj|VqdS(N(tallhunks_reR"(R-R.(R+(s0/usr/lib/python2.7/dist-packages/hgext/record.pys	<genexpr>os(RR/R%(R+((R+s0/usr/lib/python2.7/dist-packages/hgext/record.pytallhunksnscCso|jj|jd}|rN|j\}}||krD|gS||gS|jj|jdjSdS(Ni(t
diffgit_reR"R%R#tdiff_re(R+R"R&R'((s0/usr/lib/python2.7/dist-packages/hgext/record.pytfilesqs
cCs|jdS(Ni(R?(R+((s0/usr/lib/python2.7/dist-packages/hgext/record.pytfilename{scCs ddjtt|jS(Ns<header %s>R(R:tmaptreprR?(R+((s0/usr/lib/python2.7/dist-packages/hgext/record.pyt__repr__~scs tjfdjDS(Nc3s!|]}jj|VqdS(N(t
special_reR"(R-R.(R+(s0/usr/lib/python2.7/dist-packages/hgext/record.pys	<genexpr>s(RR/R%(R+((R+s0/usr/lib/python2.7/dist-packages/hgext/record.pytspecials(t__name__t
__module__t__doc__tretcompileR=R>R;R2RDR,R0R8R1R<R?R@RCRE(((s0/usr/lib/python2.7/dist-packages/hgext/record.pyR%Hs						
		cCshtg|D]}|ddkr
|^q
}tg|D]}|ddkr9|^q9}||fS(shunk -> (n+,n-)it+t-(R3(RR.taddtrem((s0/usr/lib/python2.7/dist-packages/hgext/record.pytcountchangess//RcBs>eZdZdZdZdZeZdZdZRS(sBpatch hunk

    XXX shouldn't we merge this with patch.hunk ?
    ic	sfd}|_|||\__|||\__|_|_tj\__	dS(NcsDt|j}tr:|dkr:|||j fS||fS(Ni(R3t
maxcontexttFalse(tnumberRtdelta(R+(s0/usr/lib/python2.7/dist-packages/hgext/record.pyttrimcontexts(
R%tfromlinetbeforettolinetaftertprocRROR6R7(	R+R%RURWRYRVRRXRT((R+s0/usr/lib/python2.7/dist-packages/hgext/record.pyR,s			cCst|jt|j}|jrE|jddkrE|d8}n||j}||j}|jd|j||j||jod|jf|jdj	|j|j
|jdS(Nis\ No newline at end of file
is@@ -%d,%d +%d,%d @@%s
RR9(R3RVRXR7R6R1RURWRYR:R(R+R$RStfromlenttolen((s0/usr/lib/python2.7/dist-packages/hgext/record.pyR1s


	cCs
|jjS(N(R%R@(R+((s0/usr/lib/python2.7/dist-packages/hgext/record.pyR@scCsd|j|jfS(Ns<hunk %r@%d>(R@RU(R+((s0/usr/lib/python2.7/dist-packages/hgext/record.pyRCs(	RFRGRHRPR,R1R8R@RC(((s0/usr/lib/python2.7/dist-packages/hgext/record.pyRs			cCsdtfdY}|}d}xit|D][\}}y|j||||Wn*tk
rtjd||fnX|}q2W|jS(s&patch -> [] of headers -> [] of hunks tparsercBseZdZdZdZdZdZdZdZdZ	iied6ed	6ed
6ed6d	6ied	6ed
6ed6ed6d6ied6ed	6ed6d
6ied6ed
6d6ied6d6Z
RS(
spatch parsing state machinecSsLd|_d|_d|_d|_g|_g|_g|_g|_dS(NiR9(	RURWRYRR%RRVRtheaders(R+((s0/usr/lib/python2.7/dist-packages/hgext/record.pyR,s							cSs@|\}}}}}t||_t||_||_dS(N(tintRURWRY(R+tlimitst	fromstarttfromendttostartttoendRY((s0/usr/lib/python2.7/dist-packages/hgext/record.pytaddrangescSs|jrt|j|j|j|j|j|j|}|jjj||jt|j|j	7_|jt|j|j
7_g|_g|_d|_n||_dS(NR9(RR%RURWRYRVR*R
R3R7R6R(R+RR.((s0/usr/lib/python2.7/dist-packages/hgext/record.pyt
addcontexts			cSs.|jr!|j|_g|_n||_dS(N(RRVR(R+R((s0/usr/lib/python2.7/dist-packages/hgext/record.pytaddhunks	cSs6|jgt|}|jj|||_dS(N(ReR%R]R
(R+thdrR.((s0/usr/lib/python2.7/dist-packages/hgext/record.pytnewfiles
cSsdS(N((R+R((s0/usr/lib/python2.7/dist-packages/hgext/record.pytaddotherscSs|jg|jS(N(ReR](R+((s0/usr/lib/python2.7/dist-packages/hgext/record.pytfinisheds
RRRRR(RFRGRHR,RdReRfRhRiRjttransitions(((s0/usr/lib/python2.7/dist-packages/hgext/record.pyR\s.	
						



Rsunhandled transition: %s -> %s(tobjectR)RktKeyErrorRt
PatchErrorRj(R$R\R
tstatetnewstatetdata((s0/usr/lib/python2.7/dist-packages/hgext/record.pyt
parsepatchsB	
	
cs(fd}t}i}d\}}dtd|D}}x|D]}	|t|	j7}d}d}
dj|	j}||krqNn|j||dkr|	jnt	dt	djd|	j
D}||||d\}
}}}|
sqNn|	g||	j<|	jrZ||	jc|	j7<qNnxt
|	jD]n\}}|dkr|dkr|jn|dkrt	d	|j}n6|t|	j|}t	d
|||jf}|||||\}
}}}|
ra|
rGtj|}|j|
7_n||jj|qj|dk	rxh|D]I}x@|jD]5}|
r|j|
7_n||jj|qWqtWqj|
|j|j7}
qjWqNWtg|jD].}	|	djst|	dkr|	^qgS(
s:Interactively filter patch chunks into applied-only chunksc
sd}|dk	r"||||fS|dk	r>||||fSxGtrtd}jd||f}jd|dkrx>j|dD])\}}jd||jfqWqAn|dkrt}	n|dkrt}	n|dkr|dkr4jtd	jdqAn|jj	rijtd
jdqAndtd}
t
jd
ddddt\}}d}
z/tj
|d}|jj||j||jdjg|
jD]}d|^q|jj}tjd||fdijd6dtjdtddjt|}tj}
x-|D]%}|jds|
j|qqW|j|
jdt|
}Wdtj|~
Xt}	n|dkrt}	}no|dkr!t}	}nV|dkr:t}	}n=|d krSt}	}n$|d!krwtjtd"n|	|||fSWdS(#sprompt query, and process base inputs

        - y/n for the rest of file
        - y/n for the rest
        - ? (help)
        - q (quit)

        Return True/False and possibly updated skipfile and skipall.
        s4[Ynesfdaq?]$$ &Yes, record this change$$ &No, skip this change$$ &Edit this change manually$$ &Skip remaining changes to this file$$ Record remaining changes to this &file$$ &Done, skip remaining changes and files$$ Record &all changes to all remaining files$$ &Quit, recording no changes$$ &? (display help)s%s %ss
iis%s - %s
iis cannot edit patch for whole files!cannot edit patch for binary files---s
To remove '-' lines, make them ' ' lines (context).
To remove '+' lines, delete them.
Lines starting with # will be removed from the patch.

If the patch applies cleanly, the edited hunk will immediately be
added to the record list. If it does not apply cleanly, a rejects
file will be generated: you can use that when you try again. If
all lines of the hunk are removed, then the edit is aborted and
the hunk is left unchanged.
tprefixs
hg-editor-tsuffixs.diffttexttws# s%s "%s"tenvirontHGUSERtonerrt	errprefixsedit failedtoutt#Niiiiis	user quit(RRRtpromptchoiceR1textractchoicestlowerRQR%R0ttempfiletmkstemptostfdopenR:t
splitlinestcloset	geteditorRtsystemtusernametAborttfouttopent	cStringIOtStringIOR tseekRrtunlink(tskipfiletskipalltquerytchunkt
newpatchestrespstrtctttrettphelptpatchfdtpatchfnt	ncpatchfptftiteditortpatchfpR(tui(s0/usr/lib/python2.7/dist-packages/hgext/record.pytprompts
	

 !		




3





	



icss|]}t|jVqdS(N(R3R*(R-R.((s0/usr/lib/python2.7/dist-packages/hgext/record.pys	<genexpr>msiR9sexamine changes to %s?s and css|]}d|VqdS(s'%s'N((R-R((s0/usr/lib/python2.7/dist-packages/hgext/record.pys	<genexpr>yssrecord this change to '%s'?srecord change %d/%d to '%s'?N(NN(tsetRR4R3R*R:R%RMR8RR?R@R<t	enumeratetcopyRWR
R7R6t
itervaluesRE(RR]RtseentappliedRRtposttotalR.t	fixoffsetRgtmsgRtnpRRtidxRtnewpatchtnewhunk((Rs0/usr/lib/python2.7/dist-packages/hgext/record.pytfilterpatchs`e	

	&!
"trecords
^commit|ciishg record [OPTION]... [FILE]...cOs#t||tjdt||dS(sDinteractively select changes to commit

    If a list of files is omitted, all changes reported by :hg:`status`
    will be candidates for recording.

    See :hg:`help dates` for a list of formats valid for -d/--date.

    You will be prompted for whether to record changes to each
    modified file, and for files with multiple changes, for each
    change to use. For each query, the following responses are
    possible::

      y - record this change
      n - skip this change
      e - edit this change manually

      s - skip remaining changes to this file
      f - record remaining changes to this file

      d - done, skip remaining changes and files
      a - record all changes to all remaining files
      q - quit, recording no changes

      ? - display help

    This command is not available when committing a merge.tcommitN(tdorecordRRRQ(Rtrepotpatstopts((s0/usr/lib/python2.7/dist-packages/hgext/record.pyRs cs[|ds|||||Stjdfd}t|||dt||dS(Ntinteractivetmqcsj|||dS(N(trefresh(RRRR(R(s0/usr/lib/python2.7/dist-packages/hgext/record.pyt
committomqstqrefresh(RtfindRR(torigfnRRRRR((Rs0/usr/lib/python2.7/dist-packages/hgext/record.pyRs

tqrecords&hg qrecord [OPTION]... PATCH [FILE]...t	inferrepocs~ytjdWn&tk
r;tjtdnX|jjfd}t|||dt	||dS(svinteractively record a new patch

    See :hg:`help qnew` & :hg:`help record` for more information and
    usage.
    Rs'mq' extension not loadedcs't|d<j||||dS(Nt	checkname(RQtnew(RRRR(RR(s0/usr/lib/python2.7/dist-packages/hgext/record.pyRs
tqnewN(
RRRmRRRRtcheckpatchnameRRQ(RRRRRR((RRs0/usr/lib/python2.7/dist-packages/hgext/record.pyRs
cOs6|dr t|||||S||||||S(NR(R(RRRRtargsR((s0/usr/lib/python2.7/dist-packages/hgext/record.pyRs
c
s|js(tjtd|n|jdsD|jnfd}d}|j}	tj|d|zt	j
|||||SWd|	|_XdS(Ns)running non-interactively, use %s insteadtusercstj|dtt|djdk}|rMtjtdn|j	d|d }|j
}t|d<t|d<tj|d|}tj
|d	|d|}tj}	|	jd
j||	jdyt|t|	}Wn/tjk
r,}
tjtd|
nX~	t}x?|D]7}y|jt|jWq@tk
rvq@Xq@W|d|d|d
}
g|
D]}||kr|^q}|s|j	tddSt|d}r|
}n%g|D]}||kr|^q}i|rx|jd}ytj|Wqxtk
rt}
|
jtjkruquqxXnzx|D]}tj d|j!dddd|\}}tj"||j#d||ftj$|j%||t&j'|j%||||<qWtj}	x0|D](}|j(kr-|j|	q-q-W|	j)}|	jdrt*j+||j,j-fdn|ry@|j#d|j#|	j.tj/|||	dddWqtjk
r}
tjt0|
qXn~	g|D]}|j%|^q!}||||dSWdyxpj1D]b\}}|j#d||ftj$||j%|t&j'||j%|tj2|qgW|rtj3|nWntk
rnXXdS(s%This is generic record driver.

        Its job is to interactively filter local changes, and
        accordingly prepare working directory into a state in which the
        job can be delegated to a non-interactive commit command such as
        'commit' or 'qrefresh'.

        After the actual job is done by non-interactive command, the
        working directory is restored to its original state.

        In the end we'll record interesting changes, and everything else
        will be left in place, so the user can continue working.
        Ris9cannot partially commit a merge (use "hg commit" instead)R"itnodatestgitRtchangesR9iserror parsing patch: %sisno changes to record
srecord-backupsRst/Rt.tdirsbackup %r as %r
cs
|kS(N((tkey(tbackups(s0/usr/lib/python2.7/dist-packages/hgext/record.pyRNssapplying patch
teolmodeNsrestoring %r to %r
(4RtcheckunfinishedRR3RtparentsRRRtstatusRRtdiffoptsRRRR1R:RRRrRnRtupdateR?tAttributeErrorRtmkdirtOSErrorterrnotEEXISTRRtreplaceRtdebugtcopyfiletwjointshutiltcopystatR@ttellRtreverttdirstatetp1tgetvaluet
internalpatchtstrt	iteritemsRtrmdir(RRtmessageR"RtmergeRRtchunksR$terrt
contendersR.tchangedRtnewfilestmodifiedttobackupt	backupdirtfdttmpnameRtdopatchtnftrealname(t	backupallt
commitfunc(Rs0/usr/lib/python2.7/dist-packages/hgext/record.pyt
recordfuncs


	

%	%





 "
csS|jdd}x:tjfdD] \}}||d||q+WdS(NtlabelR9csS(N(((R(s0/usr/lib/python2.7/dist-packages/hgext/record.pyRzs(tpopRt	difflabel(torigRtkwRRR((Rs0/usr/lib/python2.7/dist-packages/hgext/record.pyt	wrapwritexs%R1(RRRRtgetRR1RtwrapfunctionRR(
RRRt
cmdsuggestRRRRRtoldwrite((RRs0/usr/lib/python2.7/dist-packages/hgext/record.pyRs

		cCsytjd}Wntk
r'dSXt|jddtjtdftd<td|jt	tdtd|jt
td	dS(
NRs^qnewis&hg qrecord [OPTION]... PATCH [FILE]...RRs interactively record a new patchRs'interactively select changes to refresh(RRRmRtcmdtableRt
diffwsoptsRt_wrapcmdRR(RR((s0/usr/lib/python2.7/dist-packages/hgext/record.pytuisetups
cCs6tj|||}|djddd|fdS(NiRR(RtwrapcommandR
R(tcmdttabletwrapfnRtentry((s0/usr/lib/python2.7/dist-packages/hgext/record.pyRs('RHtmercurial.i18nRt	mercurialRRRRRRRRRRRIRRRtcommandt
testedwithRJR!R)RlR%RORRrRRRRRRRRRR	R(((s0/usr/lib/python2.7/dist-packages/hgext/record.pyt<module>s4(T	3<	(	P					

Copyright © 2017 || Recoded By Mr.Bumblebee