\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@s+ddlmZddlZddlZddlZddlZddlmZddlm Z m Z m Z m Z mZddlmZejZejejdedZed Zed ZyddlZej WnBek r#yddlZej Wq$ek reZq$XnXd e jfd YZd ZdefdYZdee fdYZ defdYZ!defdYZ"defdYZ#ddZ%ddZ&dZ'ddZ(iedd6edd6ed d6Z)d!efd"YZ*dS(#i(tabsolute_importNi(t_(tencodingterrortpatchtscmutiltutil(t stringutilus# 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. t fallbackerrorcB@seZdZRS(sDError that indicates the client should try to fallback to text mode.(t__name__t __module__t__doc__(((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRDscC@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(R t interface(tui((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt checkcursesIst patchnodecB@sYeZdZdZdZdZdZdZdZe dZ dZ RS( sVabstract class for patch graph nodes (i.e. patchroot, header, hunk, hunkline) cC@stddS(Ns&method must be implemented by subclass(tNotImplementedError(tself((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt firstchildVscC@stddS(Ns&method must be implemented by subclass(R(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt lastchildYscC@stddS(s8Return a list of all of the direct children of this nodes&method must be implemented by subclassN(R(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt allchildren\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((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt nextsibling`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((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt prevsiblinghscC@stddS(Ns&method must be implemented by subclass(R(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt parentitempscC@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(Rt skipfoldedt itemfoldedtnextitemtitem((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR ss2               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(RRtprevsiblinglastchildtprevsiblinglclc((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytprevitems        ( R R R RRRRRRtTrueR R$(((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRQs       .RcB@seZdZdZRS(s8 list of header objects representing the patch. cC@s+|j|x|D]}||_qWdS(N(textendR(Rt headerlisttheader((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt__init__s  (R R R R)(((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRstuiheadercB@s_eZdZdZdZdZdZdZdZdZ dZ d Z RS( 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( t nonuiheaderR%tappliedRtpartialRRRt neverunfoldedthunkstuihunk(RR(th((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR)s      cC@s t}|j||jS(N(tstringiotprettytgetvalue(Rtx((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt prettystrs  cC@sNt|j}|jj|}||dkrF|j|d}|SdSdS(Ni(tlenRtindexR(Rtnumheadersinpatchtindexofthisheadert nextheader((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRs cC@s;|jj|}|dkr3|j|d}|SdSdS(Nii(RR8R(RR:tpreviousheader((s7/usr/lib64/python2.7/site-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((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRscC@s(t|jdkr |jdSdSdS(sDreturn the first child of this item, if one exists. otherwise None.iN(R7R/R(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRs cC@s(t|jdkr |jdSdSdS(sCreturn the last child of this item, if one exists. otherwise None.iiN(R7R/R(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRs cC@s|jS(s8return a list of all of the direct children of this node(R/(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR scC@st|j|S(N(tgetattrR+(Rtname((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt __getattr__ s( R R R R)R6RRRRRRR?(((s7/usr/lib64/python2.7/site-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(RRARB((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR)s   cC@s|jS(N(RA(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR6scC@sWt|jj}|jjj|}||dkrO|jj|d}|SdSdS(Ni(R7RBt changedlinesR8R(Rtnumlinesinhunktindexofthislinetnextline((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRs cC@sA|jjj|}|dkr9|jj|d}|SdSdS(Nii(RBRCR8R(RREt previousline((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR(s  cC@s|jS(s%return the parent to the current item(RB(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR0scC@sdS(sDreturn the first child of this item, if one exists. otherwise None.N(R(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR4scC@sdS(sCreturn the last child of this item, if one exists. otherwise None.N(R(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR9s( R R R R)R6RRRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR@s    R0cB@seZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z e Zd Zd ZdZdZRS(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_hunkRBR@RCR(tremovedtoriginalremovedR%RR,RR-(RRBR(tline((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR)Bs (    cC@sWt|jj}|jjj|}||dkrO|jj|d}|SdSdS(Ni(R7R(R/R8R(Rtnumhunksinheadertindexofthishunktnexthunk((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRQs cC@sA|jjj|}|dkr9|jj|d}|SdSdS(Nii(R(R/R8R(RRMt previoushunk((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR[s  cC@s|jS(s%return the parent to the current item(R((R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRcscC@s(t|jdkr |jdSdSdS(sDreturn the first child of this item, if one exists. otherwise None.iN(R7RCR(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRgs cC@s(t|jdkr |jdSdSdS(sCreturn the last child of this item, if one exists. otherwise None.iiN(R7RCR(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRns cC@s|jS(s8return a list of all of the direct children of this node(RC(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRuscC@stg|jD]+}|jr |jddkr |^q }tg|jD]+}|jrN|jddkrN|^qN}||fS(schangedlines -> (n+,n-)it+t-(R7RCR,R6(Rtltaddtrem((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt countchangesys %%cC@s|j|j}t|jt|j|}|jrY|jddkrY|d8}n||j}||j}|j|j}}|dkr|dkr|d8}n|dkr|dkr|d8}qnd|||||jod|jf}|S(Nis\ No newline at end of file iis@@ -%d,%d +%d,%d @@%s t ( RJRIR7tbeforetaftertaddedtfromlinettolinetproc(Rtremovedconvertedtocontextt contextlentfromlenttolenRZR[t fromtoline((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt getfromtolines"       cC@s|j\|_|_|j|jg}x^|jD]S}|j}|jrf|j|q;|ddkr;|jd|dq;q;W|jdj |j ||j dS(NiRQRVit( RURYRItwriteRbRCR6R,tappendtjoinRWRX(Rtfpt hunklinelistt changedlinetchangedlinestr((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRds  cC@s t}|j||jS(N(R2R3R4(RR5((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR6s  cC@s$g}g}x|jD]}|j}|jry|ddkrR|j|dq|ddkr|j|dqq|ddkr|j|d|j|dqqWg|D]}d|^qg|D]}d|^q}|j}tj|j|j|j |j |j ||j S(sSreturn a recordhunk which is the reverse of the hunk Assuming the displayed patch is diff(A, B) result. The returned hunk is intended to be applied to B, instead of A. For example, when A is "0 1 2 6 " and B is "0 3 4 5 6 ", and the user made the following selection: 0 [x] -1 [x]: selected [ ] -2 [ ]: not selected [x] +3 [ ] +4 [x] +5 6 This function returns a hunk like: 0 -3 -4 -5 +1 +4 6 Note "4" was first deleted then added. That's because "4" exists in B side and "-4" must exist between "-3" and "-5" to make the patch applicable to B. iRPiRQs-%ss+%s( RCRAR,ReRHtpatchmodt recordhunkR(R[RZR\RWRX(RtdelstaddsRKttextRRRBR1((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt reversehunks   8 cC@st|j|S(N(R=RH(RR>((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR?scC@sd|j|jfS(Ns (tfilenameRZ(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt__repr__s(R R R t maxcontextR)RRRRRRRURbRdR3R6RpR?Rr(((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR0>s"           0 c C@s]t|}g|D]}t|tjr|^q}t|dkrSgifSg|D]}t|^qZ}|||d|}g} x|D]} | jr| jstg| jD]}|jr|^qdkr| j | d} xY| jD]K} | jr4| j | | rH| j | 7_ qHq| | j | j 7} qWqqW| |fS(s:interactively filter patch chunks into applied-only chunksit operation( tlistt isinstanceRkR(R7R*R,tspecialR/ReR[RIRY( RtchunksR RttctheadersR1t uiheaderstrettappliedhunklistthdrt fixoffsetthnk((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt filterpatchs& +   =   cC@s|jtdt|||}t}}tjtdrYtjtj}nz/t j |j |j dk r|j nWd||k rtjtj|nX|jS(sk curses interface to get selection of chunks, and mark the applied flags of the chosen chunks. sstarting interactive selection tSIGTSTPN(RdRtcurseschunkselectortobjectRt safehasattrtsignalt getsignalRR twrappertmaintinitexcRtopts(RR'RtR t origsigtstptsentinel((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR s  c@sfd}|S(Nc@s||S(N((targstkwargs(tfttestfn(s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytu"s((RRR((RRs7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt testdecorator!scC@st|||}|rtjj|rt|d}g|jD]}|jd^qF}|jx/tr|j |j ddtrnPqnqnWn|j S(si test interface to get selection of chunks, and mark the applied flags of the chosen chunks. trbs ittest( Rtostpathtexiststopent readlinestrstriptcloseR%thandlekeypressedtpopR(RRR'RtR ttestfR5t testcommands((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyttestchunkselector&s(   sSelect hunks to applytapplysSelect hunks to discardtdiscardsSelect hunks to recordRc B@seZd+dZdZdZdZdZdZdZ dZ dZ d Z d Z d+d Zd Zd+ed ZdZd+d+d+d+d+eeedZdZdZdZdZeeedZeeedZeedZeedZd+eeedZdZdZedZ d+eedZ!dZ"d+d+d+d+dZ#dZ$d Z%d!Z&d"Z'd#Z(d$Z)d%Z*d+ed&Z+d'Z,ed(Z-d)Z.d*Z/RS(,cC@sQt||_||_i|_d|_g|_x1|D])}|jj||jj|j q:Wi|_ i|_ t j |jjdd}|tk |_|jd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_t|_|tkrDtj d|n||_!dS( NRtcoloriiiiRcsunexpected operation: %s("RR'RRRterrorstrt chunklistReR&R/t colorpairstcolorpairnamesRt parsebooltconfigRtusecolortcurrentselecteditemtselecteditemstartlinetselecteditemendlinetheaderindentnumcharsthunkindentnumcharsthunklineindentnumcharstfirstlineofpadtoprintt numpadlinestnumstatuslinestlinesprintedtopadsofart commenttextR%twaslasttoggleallappliedt_headermessagesRtProgrammingErrorRt(RR'RRtR1tuicolor((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR)<s8                    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(RR$R(Rt currentitemR ((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt uparrowevent~s     cC@s\|j}|j}|dkr0|j}n|dkrE|}n||_|jdS(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(RRRRtrecenterdisplayedarea(RRR ((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytuparrowshiftevents      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(RR R(RRR ((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytdownarrowevents    cC@s|j}|j}|dkrTy|jj}WqTtk rPd}qTXn|dkri|}n||_|jdS(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(RRRRRR(RRR ((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytdownarrowshiftevents        c@s|jfd}j}x)|dk rO|| rO|j}q'W|dkre}n1|j}|dk r|jr|j|n||_|jdS(Nc@st|tS(N(Rvttype(R!(R(s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyts(RR RRRt togglefoldedR(RtsametypeR tparent((Rs7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt nextsametypes      cC@sP|j}|j}|jr.|j|n|dkrC|}n||_dS(sL select (if possible) the first of this item's child-items. N(RRRRR(RRR ((s7/usr/lib64/python2.7/site-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. R!N(RRvR@RRRR(RRR ((s7/usr/lib64/python2.7/site-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). R!N(RRvR*RRR%RR(RRR ((s7/usr/lib64/python2.7/site-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(RRRt yscreensizeRt scrolllines(Rtselstarttselendtpadstarttpadendtpadstartbufferedtpadendbuffered((s7/usr/lib64/python2.7/site-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(Rtnumlines((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR0s  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|j jD]}|j^q}t|k}t|k}g|j jD]}|j^qH}t|k}|r|j j 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|jj jD]}|j^qq} t| k} t| k} g|jj jD]}|j^q} t| k}| r |jj j 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,RvR*RR-R/R%RCR0R(RwR@RB(RR!Rthunklinetsiblingappliedstatustallsiblingsappliedtnosiblingsappliedtsiblingspartialstatustsomesiblingspartialtlntparentsiblingsappliedtnoparentsiblingsappliedtallparentsiblingsappliedtparentsiblingspartialtsomeparentsiblingspartial((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt toggleapply8sr         "  "   "      "  " 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(RR!((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt togglealls   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( RRRvR*R.RRRRR0(RR!t foldparenttchild((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRs    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. iiRVs (tgetyxt xscreensizet expandtabsRtcolwidth(Rtinstrtwindowtytxstarttwidthtstrwidtht numspaces((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt alignstrings  c C@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|j j \} }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((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRss iiRcs RVN(RtretsubtstripRRRt getcolorpairR t A_UNDERLINEtA_BOLDtchunkpadRR7Rtaddstrt A_REVERSEtrangetaddcht ACS_CKBOARDRRR(RRRotfgcolortbgcolortpairtpairnametattrlistttowintalignt showwhtspct colorpairttextattrRRtttoriglent strippedlentnumtrailingspacest wscolorpairtitextrawhitespacet linesprinted((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt printstrings^                   c C@s|jj}td}td}tt|t|}d||rQ|n|f}t|jdtdtdtdtd|td g}|S( s-> [str]. return segmentssspace/enter: selectsspace/enter: deselects%-*sRQs[x]=selected **=collapseds c: confirmsq: aborts arrow keys: move/expand/collapses?: help(RR,RtmaxR7RRt(Rtselectedt spaceselectt spacedeselecttspacelent selectedlabeltsegments((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt_getstatuslinesegmentss        c C@sH|jdk r'|jtdg}n|j}|j}g}|}x|D]}tj|}dd|o}|ddk}||t||kr|j||}qO|dc||7<||t|7}qOWt||j krt||_ |j j |j |jng|D]}t j ||jd^q%S(s<() -> [str]. return short help used in the top status windowsPress any key to continueRViis-[iN(RRRRRRRR7ReRt statuswintresizeRtellipsis( RtlinesRRt lastwidthtstwtsepRR((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt_getstatuslines+s$     cC@s|jj|jj|j}y>x*|jD]}||j|ddq3W|jjWntjk rwnX|jdk rdSyJ|j |j |jj|j d|j d|j|j |jWntjk rnXdS(NRtlegendi(RteraseRRR$trefreshR RRRt printitemRRRRR(RRRK((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt updatescreenCs(       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**RVs (R,RvR@R-RR*t changetypeR(RR!tcheckboxt filestatus((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytgetstatusprefixstring^s"        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. RciRRRR>RtnormalRs RiRV(R6RR8RRRRRRR RR-tsplitRqR7(RR(RRt ignorefoldingtoutstrRot chunkindexR tindentnumcharsR+ttextlisttlinestrRK((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt printheaders.  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 indicatorRciRVRRR>RR.Rs s R(R(R/R8RRRRRR RR-RRbRRRWRR7( RRBRRR0R1t hunkindexR R+t lineprefixtfrtolineRKR5((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytprinthunklinesbefores(   #cC@s{d}|jr| r|S|j|}xK|jD]@}d|jt||}||j|j|d|7}q3W|S(NRcRVR(RR-RXRR7RR(RRBRR0R1R+RKR5((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytprinthunklinesafters#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(NRcs R>RRPtadditionRQtdeletions\R.RVRRRR( R-R6RRt startswithRRRRR%( RRRRR1R+R5R R8((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytprinthunkchangedlines" 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) iRRcN(RR'Rt_curseschunkselector__printitemRf(RR!R0trecursechildrenRR1((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR(s   cC@sX|jj\}}td|j|j}|j|jd}||kpW||kS(Nii(RRtminRR(RRRtminytmaxy((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytoutofdisplayedareascC@sW||jk}|rS|rS|j|_|j|dt}|j|d|_n|S(NRAi(RRRtgetnumlinesdisplayedRR(RR!RARtselecteditemlines((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pythandleselection s    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. NRR0(RERHRvRR@R*ReR6R/R0R(RR:RCR;R@RBR?( RR!R0RAR1RRR~RRR((s7/usr/lib64/python2.7/site-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(RR7R(RR!R0RAtpatchdisplaystringR((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRFHs cC@syytjtj|j\|_|_|jj|j |j|j dt d|_ tj |j |j|_Wntjk rnXdS(shandle window resizingR0iN(R tendwinRttermsizeRRRRRRRFR%RtnewpadRR(Rtntframe((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytsigwinchhandlerYs c C@s|dk r+||jkr+|j|}n|dkr@d}n|dkrUd}n||f|jkr|j||f}nt|jd}|jrtj|||tj|}|j||f<|dk rHtj||j|RR t pairindextcvalR t textattrib((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRds:               cO@s|j||dS(ssame as getcolorpair.N(R(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt initcolorpairscC@std}tj|jddd}|jd}|dg|j|jt|d}y+x$|D]}|j||ddqiWWntjk rnX|j y'|j j d|j Wd QXWntjk rnXd S( s<print a help window to the screen. exit after any keypress.sG [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) [enter] : (un-)select item and go to next item of same type 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 RViRR%tcrecordN( RR tnewwinRR/RR7RRR'Rttimeblockedsectiontgetkey(Rthelptextthelpwint helplinesRK((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt helpwindows"     cC@smtjtjtj|jj|j|jj|_tj|j j |j j ddS(s?Create a temporary commit message editing window on the screen.iN( R trawt def_prog_modeRKRteditRtusernametcbreaktstdscrR'tkeypad(R((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytcommitMessageWindows   $  cC@stj|jddd}y:|jd}x$|D]}|j||ddq4WWntjk rknX|jj|jy2|jj dt |jj }WdQXWnt k rd}nX|S(sEdisplay an informational window, then wait for and return a keypress.is RRRWN(R RXRR/RRRdR'RRYRtgetcht ValueErrorR(Rt windowtextt confirmwinRRKtresponse((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pytconfirmationwindows     cC@sjtd}|jjd|j|}WdQX|dkrId}n|jjdrbtStSdS(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]? RWNRNR( RRRYRlRtlowerR>R%R(Rt confirmtextRk((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt reviewcommits   cC@syttjd }Wntk r3d}nX|dkrOtd}n\|jddkr}t|dRkt parsepatch(RtchunkRtexcRK((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyteditpatchwitheditor8s(   %Nii(RRRvR*R@RR0R/R8RYRIR(tsumR[RRt emptypatchR7(RR!RRwRt itemindext beforeaddedt beforeremovedt newpatchesR(teditedhunkindext hunksbeforet hunksaftertnewpatchheaderR1tnewhunkstnewaddedt newremovedtoffset((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt toggleedit,sL         %""     cC@s5|j}|stSx|D]}|jrtSqWtS(N(R'R%R/R(RR!R(((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR~s   cC@s|d%kr|jn|d&kr2|jnj|d'krK|jnQ|d(krd|jn8|d)kr}|jn|d*kr|jn|d+kr|jn|d,krtjt dn|d-kr|j |j |n|d.krt S|r|d/krt S|d0krG|j rt |j dR.RR=R<R%iiR0s&this diff is too large to be displayedRARWtfoobarRcs(?m)^\s.*( |$)tmessage()RdRRtgetmaxyxRRR t start_colortuse_default_colorsRRRRVt COLOR_WHITEt COLOR_MAGENTAt COLOR_REDt COLOR_GREENt COLOR_BLUERXRRReRMRRFR%RRRRRR)RRYRZRRRRRR(RRdRtwhitespaceremoved((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyRsT          N(0R R RR)RRRRRRRRRRRRRRRR%RRR$R)R-R6R:R;R?R(RERHR@RFRPRRVR^RfRlRoRvRRRRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyR;sb B           X   V    ! ' $    1   8  .    R : (+t __future__RtlocaleRRRti18nRRcRRRRkRRtutilsRR2t setlocaletLC_ALLR|R}t patchhelptextR t ImportErrortwcursesRR~RRRRRuR*R@R0RRR RRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/crecord.pyt sP    (           j K. !