HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python2.7/dist-packages/mercurial/crecord.pyc

Xc@@sddlmZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
ZmZejZejejde	dZe	dZe	d	Zy=ddlZddlZddlZejejejWnBek
rKyddlZejWqLek
rGeZqLXnXd
ZejZ de!fdYZ"d
e"e#fdYZ
de"fdYZ$de"fdYZ%de"fdYZ&dZ'dZ(dZ)dZ*dZ+de!fdYZ,dS(i(tabsolute_importNi(t_(tencodingterrortpatchtutilus# To remove '-' lines, make them ' ' lines (context).
# To remove '+' lines, delete them.
# Lines starting with # will be removed from the patch.
s,#
# 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.
s#
# If the patch applies cleanly, the edited patch will immediately
# be finalised. If it does not apply cleanly, rejects files will be
# generated. You can use those when you try again.
cC@sto|jddkS(sReturn True if the user wants to use curses

    This method returns True if curses is found (and that python is built with
    it) and that the user has the correct flag for the ui.
    t
chunkselectortcurses(Rt	interface(tui((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytcheckcursesFst	patchnodecB@sYeZdZdZdZdZdZdZdZe	dZ
dZRS(	sVabstract class for patch graph nodes
    (i.e. patchroot, header, hunk, hunkline)
    cC@stddS(Ns&method must be implemented by subclass(tNotImplementedError(tself((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt
firstchildUscC@stddS(Ns&method must be implemented by subclass(R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt	lastchildXscC@stddS(s8Return a list of all of the direct children of this nodes&method must be implemented by subclassN(R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytallchildren[scC@stddS(s
        Return the closest next item of the same type where there are no items
        of different types between the current item and this closest item.
        If no such item exists, return None.
        s&method must be implemented by subclassN(R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytnextsibling_scC@stddS(s
        Return the closest previous item of the same type where there are no
        items of different types between the current item and this closest item.
        If no such item exists, return None.
        s&method must be implemented by subclassN(R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytprevsiblinggscC@stddS(Ns&method must be implemented by subclass(R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt
parentitemoscC@sy
|j}Wntk
r&t}nX|r|r|j}|dkr~y|jj}Wq~tk
rzd}q~Xn|S|j}|dk	r|S|j}|dk	r|Sy<|jj}|dk	r|S|jjjSWntk
r
dSXdS(sx
        Try to return the next item closest to this item, regardless of item's
        type (header, hunk, or hunkline).

        If skipfolded == True, and the current item is folded, then the child
        items that are hidden due to folding will be skipped when determining
        the next item.

        If it is not possible to get the next item, return None.
        N(tfoldedtAttributeErrortFalseRtNoneRR(R
t
skipfoldedt
itemfoldedtnextitemtitem((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRrs2





cC@sx|j}|dk	rn|j}|dk	rg|jrg|j}|dk	r`|jr`|S|Sqn|Sn|jS(s
        Try to return the previous item closest to this item, regardless of
        item's type (header, hunk, or hunkline).

        If it is not possible to get the previous item, return None.
        N(RRRRR(R
Rtprevsiblinglastchildtprevsiblinglclc((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytprevitems	

(t__name__t
__module__t__doc__RRRRRRtTrueRR(((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRPs						.RcB@seZdZdZRS(s8
    list of header objects representing the patch.
    cC@s+|j|x|D]}||_qWdS(N(textendR(R
t
headerlisttheader((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt__init__s

(RR R!R&(((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRstuiheadercB@s_eZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
sIpatch header

    xxx shouldn't we move this to mercurial/patch.py ?
    cC@sb||_t|_t|_t|_d|_t|_g|j	D]}t
||^q@|_	dS(N(tnonuiheaderR"tappliedRtpartialRRRt
neverunfoldedthunkstuihunk(R
R%th((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR&s						cC@s t}|j||jS(N(tstringiotprettytgetvalue(R
tx((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt	prettystrs	
cC@sNt|j}|jj|}||dkrF|j|d}|SdSdS(Ni(tlenRtindexR(R
tnumheadersinpatchtindexofthisheadert
nextheader((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRscC@s;|jj|}|dkr3|j|d}|SdSdS(Nii(RR5R(R
R7tpreviousheader((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRs
cC@sdS(sj
        there is no 'real' parent item of a header that can be selected,
        so return None.
        N(R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRscC@s(t|jdkr |jdSdSdS(sDreturn the first child of this item, if one exists.  otherwise None.iN(R4R,R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRscC@s(t|jdkr |jdSdSdS(sCreturn the last child of this item, if one exists.  otherwise None.iiN(R4R,R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRscC@s|jS(s8return a list of all of the direct children of this node(R,(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRscC@st|j|S(N(tgetattrR((R
tname((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt__getattr__s(RR R!R&R3RRRRRRR<(((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR's			
					t
uihunklinecB@sMeZdZdZdZdZdZdZdZdZ	RS(s#represents a changed line in a hunkcC@s(||_t|_||_t|_dS(N(tlinetextR"R)thunkRR(R
R>R?((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR&s			cC@s|jS(N(R>(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR3scC@sWt|jj}|jjj|}||dkrO|jj|d}|SdSdS(Ni(R4R?tchangedlinesR5R(R
tnumlinesinhunktindexofthislinetnextline((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRscC@sA|jjj|}|dkr9|jj|d}|SdSdS(Nii(R?R@R5R(R
RBtpreviousline((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR's
cC@s|jS(s%return the parent to the current item(R?(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR/scC@sdS(sDreturn the first child of this item, if one exists.  otherwise None.N(R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR3scC@sdS(sCreturn the last child of this item, if one exists.  otherwise None.N(R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR8s(
RR R!R&R3RRRRR(((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR=s				
			R-cB@seZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
e
ZdZd
ZdZRS(s:ui patch hunk, wraps a hunk and keep track of ui behavior icC@se||_g|jD]}t||^q|_||_|j|_t|_t|_	t
|_dS(N(t_hunkR?R=R@R%tremovedtoriginalremovedR"RR)RR*(R
R?R%tline((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR&As	(			cC@sWt|jj}|jjj|}||dkrO|jj|d}|SdSdS(Ni(R4R%R,R5R(R
tnumhunksinheadertindexofthishunktnexthunk((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRPscC@sA|jjj|}|dkr9|jj|d}|SdSdS(Nii(R%R,R5R(R
RJtprevioushunk((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRZs
cC@s|jS(s%return the parent to the current item(R%(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRbscC@s(t|jdkr |jdSdSdS(sDreturn the first child of this item, if one exists.  otherwise None.iN(R4R@R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRfscC@s(t|jdkr |jdSdSdS(sCreturn the last child of this item, if one exists.  otherwise None.iiN(R4R@R(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRmscC@s|jS(s8return a list of all of the direct children of this node(R@(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRtscC@stg|jD]+}|jr
|jddkr
|^q
}tg|jD]+}|jrN|jddkrN|^qN}||fS(schangedlines -> (n+,n-)it+t-(R4R@R)R3(R
tltaddtrem((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytcountchangesxs
%%cC@s|j|j}t|jt|j|}|jrY|jddkrY|d8}n||j}||j}|j|j}}|dkr|dkr|d8}n|dkr|d8}qnd|||||jod|jf}|S(Nis\ No newline at end of file
iis@@ -%d,%d +%d,%d @@%s
t (	RGRFR4tbeforetaftertaddedtfromlinettolinetproc(R
tremovedconvertedtocontextt
contextlentfromlenttolenRWRXt
fromtoline((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt
getfromtolines"



cC@s|j\|_|_|j|jg}x^|jD]S}|j}|jrf|j|q;|ddkr;|jd|dq;q;W|jdj	|j
||jdS(NiRNRSit(RRRVRFtwriteR_R@R3R)tappendtjoinRTRU(R
tfpthunklinelisttchangedlinetchangedlinestr((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRas	cC@s t}|j||jS(N(R/R0R1(R
R2((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR3s	
cC@st|j|S(N(R:RE(R
R;((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR<scC@sd|j|jfS(Ns<hunk %r@%d>(tfilenameRW(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt__repr__s(RR R!t
maxcontextR&RRRRRRRRR_RaR0R3R<Ri(((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR-=s 		
										cC@sWt|}g|D]}t|tjr|^q}t|dkrSgifSg|D]}t|^qZ}|||}g}x|D]}	|	jr|	jstg|	jD]}|jr|^qdkr|j	|	d}
xY|	jD]K}|jr.|j	||
rB|j
|
7_
qBq|
|j|j7}
qWqqW||fS(s:interactively filter patch chunks into applied-only chunksi(
tlistt
isinstancetpatchmodR%R4R'R)tspecialR,RbRXRFRV(R	tchunksRtctheadersR.t	uiheaderstrettappliedhunklistthdrt	fixoffsetthnk((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytfilterpatchs&+

	=
	
cC@s;tjdtjttjddd!\}}||fS(s)
    magically get the current height and width of the window (without initscr)

    this is a rip-off of a rip-off - taken from the bpython code.  it is
    useful / necessary because otherwise curses.initscr() must be called,
    which can leave the terminal in a nasty state after exiting.
    thhhhsiiis(tstructtunpacktfcntltioctlt_origstdoutttermiost
TIOCGWINSZ(R.tw((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytgethws+cC@s|jtdt||}tjtj}tj|j|j	dk	rhtj|j	ntjtj||j
S(sk
    curses interface to get selection of chunks, and mark the applied flags
    of the chosen chunks.
    sstarting interactive selection
N(RaRtcurseschunkselectortsignalt	getsignaltSIGTSTPRtwrappertmaintiniterrRRtAborttopts(R	R$Rtf((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRsc@sfd}|S(Nc@s||S(N((targstkwargs(Rttestfn(s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytus((RRR((RRs5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt
testdecoratorscC@st||}|rtjj|rt|}td|j}|jx/tr|j	|j
ddtrXPqXqXWn|jS(si
    test interface to get selection of chunks, and mark the applied flags
    of the chosen chunks.
    cS@s
|jdS(Ns
(trstrip(R2((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt<lambda>sittest(Rtostpathtexiststopentmapt	readlinestcloseR"thandlekeypressedtpopR(RR	R$Rttestfttestcommands((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyttestchunkselectors
	Rc	B@seZdZdZdZdZdZdZdZdZ	dZ
d	Zd&d
Z
dZd&edZd
Zd&d&d&d&d&eeedZdZdZeeedZeeedZeedZeedZd&eeedZdZdZedZd&eedZdZd&d&d&d&dZ dZ!dZ"dZ#dZ$d Z%d!Z&d&ed"Z'd#Z(ed$Z)d%Z*RS('cC@st||_||_i|_d|_g|_x1|D])}|jj||jj|j	q:Wi|_
i|_|jd|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_t|_dS(NiiiiR`(RR$R	RRterrorstrt	chunklistRbR#R,t
colorpairstcolorpairnamestcurrentselecteditemtselecteditemstartlinetselecteditemendlinetheaderindentnumcharsthunkindentnumcharsthunklineindentnumcharstfirstlineofpadtoprinttnumpadlinestnumstatuslinestlinesprintedtopadsofartcommenttextR"twaslasttoggleallapplied(R
R$R	R.((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR&s.				
													cC@s7|j}|j}|dkr*|}n||_dS(sM
        try to select the previous item to the current item that has the
        most-indented level.  for example, if a hunk is selected, try to select
        the last hunkline of the hunk prior to the selected hunk.  or, if
        the first hunkline of a hunk is currently selected, then select the
        hunk itself.
        N(RRR(R
tcurrentitemR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytuparroweventBs
		cC@sR|j}|j}|dkr0|j}n|dkrE|}n||_dS(s
        select (if possible) the previous item on the same level as the
        currently selected item.  otherwise, select (if possible) the
        parent-item of the currently selected item.
        N(RRRR(R
RR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytuparrowshifteventUs		cC@s7|j}|j}|dkr*|}n||_dS(sg
        try to select the next item to the current item that has the
        most-indented level.  for example, if a hunk is selected, select
        the first hunkline of the selected hunk.  or, if the last hunkline of
        a hunk is currently selected, then select the next hunk, if one exists,
        or if not, the next header if one exists.
        N(RRR(R
RR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytdownarroweventgs
			cC@sv|j}|j}|dkrTy|jj}WqTtk
rPd}qTXn|dkri|}n||_dS(s
        select (if possible) the next item on the same level as the currently
        selected item.  otherwise, select (if possible) the next item on the
        same level as the parent item of the currently selected item.
        N(RRRRR(R
RR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytdownarrowshifteventys	

	cC@sP|j}|j}|jr.|j|n|dkrC|}n||_dS(sL
        select (if possible) the first of this item's child-items.
        N(RRRttogglefoldedR(R
RR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytrightarrowevents			cC@s|j}t|ts8|js8|jd|dSn|j}|dkru|}|jsu|jd|qun||_dS(s
        if the current item can be folded (i.e. it is an unfolded header or
        hunk), then fold it.  otherwise try select (if possible) the parent
        of this item.
        RN(RRlR=RRRR(R
RR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytleftarrowevents			cC@st|j}t|tr8|js8|jd|dSnx,trf|j}|dkr]Pq;|}q;W||_dS(s
        select the header of the current item (or fold current item if the
        current item is already a header).
        RN(RRlR'RRR"RR(R
RR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytleftarrowshiftevents			
cC@s|j}|j}|j}||j|jd}|d}|d}||krg|j||n ||kr|j||ndS(s6scroll the screen to fully show the currently-selectediiN(RRRtyscreensizeRtscrolllines(R
tselstarttselendtpadstarttpadendtpadstartbufferedtpadendbuffered((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytupdatescrolls			

cC@sW|j|7_|jdkr*d|_n|j|jdkrS|jd|_ndS(s>scroll the screen up (down) by numlines when numlines >0 (<0).iiN(RR(R
tnumlines((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRs
cC@s7|dkr|j}n|j|_t|trt|_|jrx}|jD],}t|_x|j	D]}t|_qiWqPWq3x|jD]5}t|_t|_x|j	D]}t|_qWqWnjt|t
rt|_x|j	D]}|j|_qWg|jjD]}|j^q}t|k}t|k}g|jjD]}|j^qH}t|k}|r|jjst|j_t|j_qq3t|j_|p||j_nut|t
r3g|jj	D]}	|	j^q}t|k}t|k}|r(t|j_t|j_n9|rIt|j_t|j_nt|j_t|j_g|jjjD]}|j^qq}
t|
k}t|
k}g|jjjD]}|j^q}
t|
k}|r|jjjs0t|jj_t|jj_q0q3t|jj_|p$||jj_ndS(s
        toggle the applied flag of the specified item.  if no item is specified,
        toggle the flag of the currently selected item.
        N(RRR)RlR'RR*R,R"R@R-R%RnR=R?(R
RRwthunklinetsiblingappliedstatustallsiblingsappliedtnosiblingsappliedtsiblingspartialstatustsomesiblingspartialtlntparentsiblingsappliedtnoparentsiblingsappliedtallparentsiblingsappliedtparentsiblingspartialtsomeparentsiblingspartial((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyttoggleapplysr
						"""""cC@sw|jr9xZ|jD]}|jr|j|qqWn-x*|jD]}|jsC|j|qCqCW|j|_dS(s%toggle the applied flag of all items.N(RR$R)R(R
R((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt	toggleall@s			cC@s|dkr|j}n|s6t|tr|jrt|ts[|j|_}n|jrpt|_nt|trx$|jD]}|j|_qWqnt|tt	fr|j|_ndS(sEtoggle folded flag of specified item (defaults to currently selected)N(
RRRlR'R+RRRRR-(R
Rt
foldparenttchild((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRLs	cC@s_|j\}}|j}|jd}tj|}||||d}|d|dS(s
        add whitespace to the end of a string in order to make it fill
        the screen in the x direction.  the current cursor position is
        taken into account when making this calculation.  the string can span
        multiple lines.
        iiRSs
(tgetyxtxscreensizet
expandtabsRtcolwidth(R
tinstrtwindowtytxstarttwidthtstrwidtht	numspaces((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytalignstring_s	cC@s|jd}tjdd|jd}|d
k	rE|}n|d
k	ra|j|}ng|d
krvd}n|d
krd}n||f|jkr|j||f}n|j||}|d
krg}n|dkrxQ|D]}||O}qWn6x3tj	tj
fD]}||kr||O}qqW|jj\}
}d}|
rt
|}|jd}t
|}||}n|r|j||n||7}|
r|tjB}|rx*t|D]}|jtj|qWn|d	|7}n|	r\|r=|jd|}|j||n|j||}||7}n|t
||j}|j|7_|S(s
        print the string, text, with the specified colors and attributes, to
        the specified curses window object.

        the foreground and background colors are of the form
        curses.color_xxxx, where xxxx is one of: [black, blue, cyan, green,
        magenta, red, white, yellow].  if pairname is provided, a color
        pair will be looked up in the self.colorpairnames dictionary.

        attrlist is a list containing text attributes in the form of
        curses.a_xxxx, where xxxx can be: [bold, dim, normal, standout,
        underline].

        if align == True, whitespace is added to the printed string such that
        the string stretches to the right border of the window.

        if showwhtspc == True, trailing whitespace of a string is highlighted.
        is[\x00-\x08\x0a-\x1f]cS@sdtt|jdS(Nt^i@(tchrtordtgroup(tm((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRss
iiR`s 
RSN(RtretsubtstripRRRtgetcolorpairRtA_UNDERLINEtA_BOLDtchunkpadRR4Rtaddstrt	A_REVERSEtrangetaddchtACS_CKBOARDRRR(R
Rttexttfgcolortbgcolortpairtpairnametattrlistttowintalignt
showwhtspct	colorpairttextattrRRtttoriglentstrippedlentnumtrailingspacestwscolorpairtitextrawhitespacetlinesprinted((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytprintstringns^					




cC@sa|jj|jj|j}y|jdk	ru||j|jdd||jddd|jjdSd}d}||jtj||j	ddd||jtj||j	dddWnt
jk
rnXyN|j|j
|jj|jd|jd|jd|j|j	Wnt
jk
rOnX|jjdS(NRtlegendsPress any key to continuesYSELECT CHUNKS: (j/k/up/dn/pgup/pgdn) move cursor; (space/A) toggle hunk/all; (e)dit hunk;se (f)old/unfold; (c)onfirm applied; (q)uit; (?) help | [X]=hunk applied **=folded, toggle [a]mend modeii(t	statuswinteraseRRRRtrefreshRtellipsisRRRt	printitemRRRR(R
Rtline1tline2((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytupdatescreens<

	
		

	cC@s|jr4t|tr+|jr+d}q:d}nd}yi|jr||d7}t|tr|j}||d7}qn&|d7}t|tr|d7}nWntk
r|d7}nX|S(sx
        create a string to prefix a line with which indicates whether 'item'
        is applied and/or folded.
        s[~]s[x]s[ ]s**RSs  (R)RlR=R*RR't
changetypeR(R
Rtcheckboxt
filestatus((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytgetstatusprefixstrings"				
	

c	C@sd}|j}|jj|}|dkri|jri||j|jd|jd|dt7}n|jd|r~dpdd	t	j
g}d}	|j|}
|js|r|jd
}|
|d}n|
|j
}||j|j|d|d|7}|js|rt|dkrxR|dD]C}
d
|	t|
|
}||j|j|d|d|7}q:Wqn|S(s
        print the header to the pad.  if countlines is True, don't print
        anything, but just count the number of lines which would be printed.
        R`iRRRR;tselectedtnormalRs
RiRS(R3RR5RRRRRRRRRtsplitRhR4(R
R%RRt
ignorefoldingtoutstrRt
chunkindexRtindentnumcharsRttextlisttlinestrRH((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytprintheaders.
c
C@sid}|jjj|}|dkrV||j|jd|jd|dt7}n|jd|rkdpndd	tj	g}|j
|}d|j|}	d
|jj
d}
||j|j|	d|dt7}||j|j|
d|d|7}|jr|r|SxK|jD]@}d|jt||}||j|j|d|7}q!W|S(
s!includes start/end line indicatorR`iRSRRR;RRRs   s
R(R%R,R5RRRRRRRRRR_RRRTRR4(
R
R?RRRRt	hunkindexRRt
lineprefixtfrtolineRHR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytprinthunklinesbefore8s(

#cC@s{d}|jr|r|S|j|}xK|jD]@}d|jt||}||j|j|d|7}q3W|S(NR`RSR(RRRURR4RR(R
R?RRRRRHR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytprinthunklinesafter]s#c	
C@sd}|j|}|jjd}|rE|jdd}nl|jdri|jdd}nH|jdr|jdd}n$|jd	r|jdd
}nd|j|}||j|j|d|d
t7}||j|j|d|d|dt	7}|S(NR`s
R;RRMtadditionRNtdeletions\RRSRRRR(
RR3RRt
startswithRRRRR"(	R
RRRRRRRR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytprinthunkchangedlinejs"
cC@sY|dkr|j}n|r*d|_ng}|j||||d|dj|S(s
        use __printitem() to print the the specified item.applied.
        if item is not specified, then print the entire patch.
        (hiding folded elements, etc. -- see __printitem() docstring)
        iRR`N(RR$Rt_curseschunkselector__printitemRc(R
RRtrecursechildrenRR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR
scC@sX|jj\}}td|j|j}|j|jd}||kpW||kS(Nii(RRtminRR(R
RRtminytmaxy((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytoutofdisplayedareascC@sW||jk}|rS|rS|j|_|j|dt}|j|d|_n|S(NR&i(RRRtgetnumlinesdisplayedRR(R
RR&Rtselecteditemlines((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pythandleselections	c
C@s|r|jrdS|j||}t|trm|rmx*|D]}|j|||||qDWqmnt|tr|j|j||d|d||rx-|jD]}|j|||||qWqnt|t	r||j
js|r||j|j||d|d||rx*|j
D]}	|j|	||||q1W|j|j|d|d|qnDt|tr|jjs|r|j|j||d|n|S(s{
        recursive method for printing out patch/header/hunk/hunk-line data to
        screen.  also returns a string with all of the content of the displayed
        patch (not including coloring, etc.).

        if ignorefolding is True, then folded items are printed out.

        if recursechildren is False, then only print the item without its
        child items.
        NRR(R*R-RlRR%R'RbRR,R-R%RRR@R R=R?R$(
R
RRR&RRRRuRwRO((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt__printitems<




cC@s2|j|||dt}t||j}|S(sY
        return the number of lines which would be displayed if the item were
        to be printed to the display.  the item will not be printed to the
        display (pad).
        if no item is given, assume the entire patch.
        if ignorefolding is True, folded items will be unfolded when counting
        the number of lines.
        R(R
RR4R(R
RRR&tpatchdisplaystringR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR+scC@syptjt\|_|_|jj|j|j|jdt	d|_
tj|j
|j|_Wntj
k
rnXdS(shandle window resizingRiN(RtendwinRRRRtresizeRR+R"RtnewpadRR(R
tntframe((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytsigwinchhandlers
c	C@sd|dk	r+||jkr+|j|}n|dkr@d}n|dkrUd}n||f|jkr|j||f}nkt|jd}tj|||tj|}|j||f<|dk	rtj||j|<n|dkrg}n|dkr*xQ|D]}||O}qWn6x3tjtjfD]}||kr=||O}q=q=W|S(s
        get a curses color pair, adding it to self.colorpairs if it is not
        already defined.  an optional string, name, can be passed as a shortcut
        for referring to the color-pair.  by default, if no arguments are
        specified, the white foreground / black background color-pair is
        returned.

        it is expected that this function will be used exclusively for
        initializing color pairs, and not curses.init_pair().

        attrlist is used to 'flavor' the returned color-pair.  this information
        is not stored in self.colorpairs.  it contains attribute values like
        curses.A_BOLD.
        iiiN(	RRRR4Rt	init_pairt
color_pairRR(	R
RRR;RRt	pairindexRt
textattrib((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRs,		 	
cO@s|j||dS(ssame as getcolorpair.N(R(R
RR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt
initcolorpair&scC@sd}tj|jddd}|jd}|dg|j|jt|d}y+x$|D]}|j||ddqcWWntjk
rnX|jy|j	Wntjk
rnXdS(	s<print a help window to the screen.  exit after any keypress.s            [press any key to return to the patch-display]

crecord allows you to interactively choose among the changes you have made,
and confirm only those changes you select for further processing by the command
you are running (commit/shelve/revert), after confirming the selected
changes, the unselected changes are still present in your working copy, so you
can use crecord multiple times to split large changes into smaller changesets.
the following are valid keystrokes:

                [space] : (un-)select item ([~]/[x] = partly/fully applied)
                      A : (un-)select all items
    up/down-arrow [k/j] : go to previous/next unfolded item
        pgup/pgdn [K/J] : go to previous/next item of same type
 right/left-arrow [l/h] : go to child item / parent item
 shift-left-arrow   [H] : go to parent header / fold selected header
                      f : fold / unfold item, hiding/revealing its children
                      F : fold / unfold parent item and all of its ancestors
                 ctrl-l : scroll the selected line to the top of the screen
                      m : edit / resume editing the commit message
                      e : edit the currently selected hunk
                      a : toggle amend mode, only with commit -i
                      c : confirm selected changes
                      r : review/edit and confirm selected changes
                      q : quit without confirming (no changes will be made)
                      ? : help (what you're currently reading)is
RSiRRN(
RtnewwinRRRR4RRRtgetkey(R
thelptextthelpwint	helplinesRH((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt
helpwindow*s	 

cC@stj|jddd}y:|jd}x$|D]}|j||ddq4WWntjk
rknX|jj|jyt|jj	}Wnt
k
rd}nX|S(sEdisplay an informational window, then wait for and return a keypress.is
RRN(RR;RRRRtstdscrRRtgetcht
ValueErrorR(R
t
windowtextt
confirmwintlinesRHtresponse((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytconfirmationwindowUs




cC@sKd}|j|}|dkr*d}n|jjdrCtStSdS(sPask for 'y' to be pressed to confirm selected. return True if
        confirmed.sif you answer yes to the following, the your currently chosen patch chunks
will be loaded into an editor.  you may modify the patch from the editor, and
save the changes if you wish to change the patch.  otherwise, you can just
close the editor without saving to accept the current patch as-is.

note: don't add/remove lines unless you also modify the range information.
      failing to follow this rule will result in the commit aborting.

are you sure you want to review/edit and confirm the selected changes [yn]?
R3RN(RHRtlowerR#R"R(R
tconfirmtextRG((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytreviewcommiths
	cC@syttjd }Wntk
r3d}nX|dkrId}nP|jddkrqt|d<d}n(|jdtkrd|d<d}n|s|j|ndS(	sToggle the amend flag.

        When the amend flag is set, a commit will modify the most recently
        committed changeset, instead of creating a new changeset.  Otherwise, a
        new changeset will be created (the normal commit behavior).
        iigQ@sRThe amend option is unavailable with hg versions < 2.2

Press any key to continue.tamendsAmend option is turned on -- commiting the currently selected changes will not create a new changeset, but instead update the most recently committed changeset.

Press any key to continue.sAmend option is turned off -- commiting the currently selected changes will create a new changeset.

Press any key to continue.N(tfloatRtversionRCtgetRR"RH(R
RRtvertmsg((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyttoggleamend~s

	
	
	cC@s|jdt|jdS(s
        once we scrolled with pg up pg down we can be pointing outside of the
        display zone. we print the patch with towin=False to compute the
        location of the selected item even though it is outside of the displayed
        zone and then update the scroll.
        RN(R
RR(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytrecenterdisplayedareascC@s?d}d}|dkr*|j}nt|tr=dSt|tr[|j}nt|tsndS|jjj|}|j	|j
}}|||}|dkr|s||ndS|j}	|	jj|}
|	j|
 }|	j|
d}|d}
g|
jD]}t||	^q}tg|D]}|j	^q=}tg|D]}|j
^q_}||||}x|D]}|j
|7_
qWx|D]}t|_qW||||	_|jr||g||	_n|	|_t|	j|kr(|	j||_n|s;||ndS(s3
        edit the currently selected chunk
        cS@sl|jdtd|_tj|j|j|_|j|jj	|j
j	|jjddS(NRi(R+R"RRR2RRRRARRtkeypad(R
((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pytupdateuis


cS@s:|dkr6|jjtd|jjddS|jjro|jjtd|jjddSt}|jtt|jj||j|y,|jj	|j
ddidd6}Wn&tjk
r}t
||_dSXg|jD]}|jds|d^q}tj|S(	Ns cannot edit patch for whole files
s!cannot edit patch for binary fileR`textras.difftsuffixt#(RR	RaRR%tbinaryR/tdiffhelptextthunkhelptextteditR1RRtstrRt
splitlinesR#Rmt
parsepatch(R
tchunkRtexcRH((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyteditpatchwitheditors*	
Nii(RRRlR'R=RR-R,R5RVRFR%tsumRXRRt
emptypatchR4(R
RRRURbt	itemindextbeforeaddedt
beforeremovedt
newpatchesR%teditedhunkindexthunksbeforet
hunksaftertnewpatchheaderR.tnewhunkstnewaddedt
newremovedtoffset((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt
toggleeditsL		
	

%""


	cC@s5|j}|stSx|D]}|jrtSqWtS(N(R$R"R,R(R
RR%((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRds	
	cC@sd|d"kr|jn|d#kr2|jn.|d$krK|jn|d%krd|jn|d&kr}|jn|d'kr|jn|d(kr|jn|d)krtjt	dn|d*kr|j
|j|nk|d+krtS|r|d,krtS|d-krG|j
r`t|jd<tSn|rj|d.krjt|jd<tS|d/ks|r|d0kr|jn|d1kr|jn|d2kr|jd|n|d3kr|jnz|d4kr|jdtn[|d5kr8|j|jj|jjn(tj|d6kr`|j|jnd!S(7sd
        Perform actions based on pressed keys.

        Return true to exit the main loop.
        tktKEY_UPtKt	KEY_PPAGEtjtKEY_DOWNtJt	KEY_NPAGEROt	KEY_RIGHTR.tKEY_LEFTtHt	KEY_SLEFTtqs	user quittaRptXtrtreviewtRRStTOGGLEtAteRRtFRt?s^LN(RrRs(RtRu(RvRw(RxRy(RORz(R.R{(R|R}(R~(R(Rp(R(R(R(RS(R(R(R(R(R(R(s^L(RRRRRRRRRRRRRR"RKRRRqRR@RAtclearRRtunctrlRR(R
t
keypressedR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRsZ













cC@s(tjtj|j}||_d|_|jj\|_|_t	j
t	j|jdddd|jt	j
t	jdd|jt	jddd|jt	jddd|jt	j
t	jddt	j|jddd|_|jjdt	jd|j|_|jd	td|_yt	j|j|j|_Wn$t	jk
r}td
|_dSX|j|jdt|_xutr|j y1|jj!}|j"dk	rd|_"wnWnt	jk
rd
}nX|j#|rPqqWtjtj|dS(sP
        method to be wrapped by curses.wrapper() for selecting chunks.
        R;RRR"R!RiiRs&this diff is too large to be displayedNR&tfoobar($RtSIGWINCHR5RARRtgetmaxyxRRRtstart_colortuse_default_colorsR:tCOLOR_WHITEt
COLOR_MAGENTAt	COLOR_REDtCOLOR_GREENt
COLOR_BLUER;RRRTR2RR+R"RRRRRRR
R<RR(R
RAtorigsigwinchhandlerR((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyR6sH		

	
	

N(+RR R&RRRRRRRRRRRRRRRR"RR
RRRR R$R
R*R-R%R+R5RR:R@RHRKRRRSRqRdRR(((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyRsX	6									X			V	*	!'$
				1		0		+				
S		5(-t
__future__RtlocaleRRRRztsysti18nRR`RRRRmRR/t	setlocaletLC_ALLRZR[t
patchhelptextRR|RR}RtImportErrortwcursesRR
t
__stdout__R~tobjectRRkR'R=R-RxRRRRR(((s5/usr/lib/python2.7/dist-packages/mercurial/crecord.pyt<module>sT"				

		j
K.~	!