\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sdZddlmZddlZddlZddlZddlZddlmZddl m Z m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z#ddl$m%Z%ddl&m'Z'm(Z(iZ)ej*e)Z*d Z+iZ,ej-e,Z-e-d d d d dZ.dZ/ddd gZ0dZ1dZ2de3fdYZ4de3fdYZ5dZ6dZ7dZ8dZ9dZ:dZ;e<dZ=dZ>dZ?d Z@d!ZAd"ZBd#ZCd$ZDd%ZEd&ZFd'ZGd(ZHd)ZId*ZJd+ZKd,ZLd-ZMd.ZNd/ZOd0ZPd1ZQd2ZRd3ZSd4ZTd5ZUd6ZVd7ZWe*d8d9d:ded;fd<d=ded>fd?d@dedAfdBdCdDedEedFfdGdHdDedIfdDdJdDedKedLfgedMdNe*jYdOZZdPZ[e*d dQdRdedSfdTdUdedVfdDdWdedXfdDdJdDedYedLfdZd[ded\fd]d^e<ed_fd`dadedbfdcdddDedeedffdBdCdDedgedFfdhddedifdjdkdedlfdDdmdednfg ej\edodNe*jYdpZ]dqZ^dS(rs@save and restore changes to the working directory The "hg shelve" command saves changes made to the working directory and reverts those changes, resetting the working directory to a clean state. Later on, the "hg unshelve" command restores the changes saved by "hg shelve". Changes can be restored even after updating to a different parent, in which case Mercurial's merge machinery will resolve any conflicts if necessary. You can have more than one shelved change outstanding at a time; each shelved change has a distinct name. For details, see the help for "hg shelve". i(tabsolute_importN(t_(t bookmarkstbundle2t bundlerepot changegrouptcmdutilt discoveryterrortexchangethgtlocktmdifftmerget narrowspectnodetpatchtphasestpycompatt registrartrepairtscmutilttemplatefilterstutiltvfsi(trebase(tdateutilt stringutilsships-with-hg-coretshelvet maxbackupstdefaulti s shelve-backuptshelvedR Rsshelve@localhostt shelvedfilecB@seZdZddZdZdZdZdZdZ ddZ d Z d Z d Z d Zd ZRS(s~Helper for the file storing a single shelve Handles common functions on shelve files (.hg/.patch) using the vfs layercC@s||_||_tj|jjt|_tj|jjt|_|jj|_|rw|d||_ n ||_ dS(Nt.( trepotnametvfsmodRtjoint shelvedirt backupdirt backupvfstuitfname(tselfR"R#tfiletype((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt__init___s  cC@s|jj|jS(N(RtexistsR*(R+((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyR.jscC@s|jj|jS(N(RR%R*(R+((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pytfilenamemscC@sOd}|jj|j}x*||D]}|jj|s+|Sq+WdS(Ncs@sM|V|jdd\}}x)tjdD]}d|||fVq-WdS(NR!is%s-%d.%s(trsplitt itertoolstcount(tbasetextti((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pytgennamesqs(R(R%R*R.(R+R6R#tn((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pytbackupfilenameps  cC@s?|jjs|jjntj|j|jdS(N(R(tisdirtmakedirRtrenameR/R8(R+((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt movetobackup|scC@s|jj|jS(N(RtstatR*(R+((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyR=strbcC@sey|j|j|SWnGtk r`}|jtjkrAntjtd|jnXdS(Nsshelved change '%s' not found( RR*tIOErrorterrnotENOENTRtAbortRR#(R+tmodeterr((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pytopeners c C@s|j}ztj}tj|js6tj}ntj|jj||j |j }|jd}|jj }t j |j||dddd|j j|j d||jd}||kr|jdd}|j|}n|SWd|jXdS( Nttiptsourcetunshelveturlsbundle:t targetphaset revduplicatesi(RERtinternaltsupportinternalR"tsecretR t readbundleR)R*RtcurrenttransactionRt applybundleR%tchangestclose(R+tfpRJtgentpretipttrt shelvectxt shelverev((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyRQs$   $   cC@s;|jj|j}tj|jjd|jj|fS(Nsbundle://%s+%s(RR%R*RtinstanceR"tbaseuitroot(R+tpath((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyRsc C@stj|j}|dkr-d}d}n d}d}|jj}tj|d|d|g}tj|||d}tj |j ||j ||j d|dS( Nt01tHG10BZtHG20tBZt missingrootst missingheadsRt compression( Rt safeversionR"tNonet unfilteredRtoutgoingtmakechangegroupRt writebundleR)R*R( R+tbasesRt cgversiontbtypeRdR"Rhtcg((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyRjs   !cC@s#tj|j|jj|dS(N(RtsimplekeyvaluefileRR*twrite(R+tinfo((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt writeinfoscC@stj|j|jjS(N(RRoRR*tread(R+((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pytreadinfosN(t__name__t __module__t__doc__RfR-R.R/R8R<R=RERQRRjRrRt(((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyR Zs         t shelvedstatecB@seZdZdZdZdZdZdZedZ edZ edZ ed Z ee d d Zed ZRS( sHandle persistence during unshelving operations. Handles saving and restoring a shelved state. Ensures that different versions of a shelved state are possible and handles them appropriately. iRxtkeeptnokeeps:no-active-bookmarkcC@sytj|d|dsRRt addremoveRRLR!Rsshelved as %s (,RfR}RRRBRRRRtnullidt descriptionRRR t transactionRRRRt_iswctxonnewbrancht _isbareshelveRt setbranchRRRRtdorecordt recordfilterRRRRt formattedRtellipsist termwidthRR tupdateRRtlockmodtrelease(R)R"RRRR}Rt origbranchtdescR RWRRtincludeunknownR#RRR((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyRsX    #      & cC@s>| o=|jdt o=|jdt o=|jdt S(NRtincludetexclude(RR(RR((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyR scC@s|dj|djkS(NR!(RfR(R"((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyRscC@s||jjxb|jjtD]N\}}|jddd}|tkrdt||jnt|q WWdQXdS(s#subcommand that deletes all shelvesR!iiN( RRtreaddirR&R0RR R<R(R)R"R#t_typetsuffix((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt cleanupcmds   c C@s|stjtdn|jygxV|D]N}xEtD]=}t|||}|jsr|tkrB|jqBqBWq5Wt |WnDt k r}|j t j krntjtd|nXWdQXdS(s)subcommand that deletes a specific shelvesno shelved changes specified!sshelved change '%s' not foundN( RRBRRRR R.RR<RtOSErrorR@RA(R)R"RR#R!tshfileRD((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt deletecmds   c C@sy|jjt}Wn,tk rD}|jtjkr@ngSXg}x|D]{\}}|jdd\}}| sR|tkrqRnt||j }|j |t j t||j fqRWt |dtS(s6return all shelves in repo as list of (time, filename)R!itreverse(RRR&R#R@RAR0RR R=RRR/RR( R"tnamesRDRqR#R tpfxtsfxtst((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt listshelves4s-c C@st|}d}|js-|j}nd}|jdxKt|D]=\}}tj|d}|r||krqMn|j|d|d}|jr|jdqMn|jdd t |d } t j |} d t j | d t} |j| dd |jdd t | | d 7} t|dtd7} xqtr| j} | ssPn| jdsW| j}|jrtj||| }n|j|PqWqWW|jd|dp|dswMn| j}|dr>x6tjt|D]\}}|j|d|qWn|drx9tj|d|D]\}}|j|d|q^WnWdQXqMWdS(s,subcommand that displays the list of shelvesiPs shelve.newestRiRs shelve.names R~is(%s)tabbrevs shelve.agei R!R>t#RR=twidthN(tsettplainRtpagerR+RRRptquietRRtmakedateRtageRtopenRRRtrstripRRRt readlinesRt difflabeltitert diffstatui(R)R"RRR.t namelabelRR#tsnametusedRR4RTtlineRt difflinestchunkR((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pytlistcmdEsV               "c C@st|dkrkt|}|s<tjtdn|d\}}tj|d}|g}nxB|D]:}t||tj srtjtd|qrqrWt ||||dS(s subcommand that displays shelvesisthere are no shelves to showiscannot find shelf %sN( RR+RRBRRRR RR.RA( R)R"RRtshelvesRR#R<t shelfname((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt patchcmdsss    cC@s4|j|jjkr0tjtdndS(s'check parent while resuming an unshelves5working directory parents do not match unshelve stateN(R}RRRBR(R"tstate((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt checkparentsscC@s/|j}g|D]}|j||^qS(N(tgetcwdtpathto(R"tfilestcwdR((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt pathtofiless c C@s%|jzt||tj||jdtdt|jrm|j|jkrmt j ||jn|j j dr|j j ddtj|nt|||j|jtj|stj|||jdtddnWdtj||jtd |jXWdQXdS( s-subcommand that abort an in-progress unshelvet branchmergetforcetunshelverebasestatet rebasestatetbackupttopicRNsunshelve of '%s' aborted (R RFR RR|RRRt _bookmarksRRRR.R;Rt clearstatust mergefilesRRRMRRRRxRtwarnRR#(R)R"RER((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt unshelveaborts     c C@s|jitd6tj||jg}|j|j|j|jdjxK|jdtj D]4}||kryt j |t j |||qyqyW|jttj||||jjt||itd6|jWdQXdS(sLupdates to wctx and merges the changes from shelvectx into the dirstate.R)R2iRt no_backupN(R)R2(RRR RRtextendRIR}RRRR;Rtorigpatht pushbufferRtrevertRRKt popbuffer(R)R"RRXRItfile((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyRTs &  cC@sI|rE||jjkrE|jj||jtd|ndS(Ns&marked working directory as branch %s (RRRRR(R)R"R((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt restorebranchscC@s\|jdsXx9tD]1}t|||}|jr|jqqWt|ndS(s&remove related files after an unshelveRyN(RRR R.R<R(R)R"R#RR,R$((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pytunshelvecleanups   c C@s|jt||tjj|}t|jrbtjt ddt dn||j d}|j }|j j 7|j|j jtj|j j|jWdQXtj}tj|stj}ni|d6}|jj|dq|j j [|j|j d tj|jd |jd |jd |jd |j} WdQXWdQX| dkrtjj ||j }t d} |j!| n|j"j#| || }t$j%||jdt&|j'j(dr)|j'j)ddt*j+|nt,|||j-|t.|||j/tj|st0j1|||j"dt&ddnt2||j3t4j5|t6|||j7||j!t d|j7WdQXdS(s.subcommand to continue an in-progress unshelves$unresolved conflicts, can't continuethints/see 'hg resolve', then 'hg unshelve --continue'iNRs new-commitRHittextRtuserRs<note: unshelved changes already existed in the working copy t overwriteRNRORPRQRsunshelve of '%s' complete (Rs new-commit(8R RFR t mergestateRsRt unresolvedRRBRR}R|Rt parentchanget setparentsRRR RpRPRRLRMRNR)RRR RRbRRftcleanRRRR t updaterepoRRR.R;RRSRTRR^RRRRRRxRR_R#( R)R"RERtmsRXR|RJRtnewnodetmsg((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pytunshelvecontinuesV               c C@s|j}t|j}|jp3|jp3|js@||fS|jtdidd6}td|dtdt}i}d|d<|jd |d <|j it d 6 t j |||g|} Wd QX|| }||fS(sETemporarily commit working copy changes before moving unshelve commitsLtemporarily committing pending changes (restore with 'hg unshelve --abort') RRLRRRs pending changes temporary commitRRR)R2N(R)R2( Rt frozensettaddedtmodifiedtremovedRRRRRRRR( R)R"RttmpwctxRt addedbeforeRRttempoptsR((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt_commitworkingcopychangess     ! cC@s|j}d}t||djrIt||djd}n|dksa||kr|jitd6t||dj}WdQX|dkritj |j d6}t||dj |qn ||}||fS(s5Recreate commit in the repository during the unshelveRRR)R2R N(R)R2( RgRfR R.RtRRRQRRRRr(R)R"tbasenameRRXRq((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt_unshelverestorecommits   c C@s|j|jdjkr&|Si|jddd6tjd6} |jj| d|jtd t j |||j d d d gd t } | j r,|jgtj|t|D]} |jj| ^q}tj|||||| |jd| tjtdn|jjZ|j|jtj|jd|jd|jd|jd|j }WdQX|dkrt j"j#||}td}|j|n#||}t$j%||jt&WdQX|S(sBRebase restored commit from its original location to a destinationittoolRR)t forcemergeRs new-commitRHsrebasing shelved changes tlabelsRs working-copytkeepconflictparentRysFunresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')RaRRbRNs<note: unshelved changes already existed in the working copy (R)Ry(Rs new-commit('RR}RRRNR)RRRR tgrafttp1RtunresolvedcountRSRtxrangeRt changelogRxRRtInterventionRequiredRRfRgRR RR RRbRRfRdRhR RiR(R)R"RRWt oldtiprevRvtpctxRrRXRRRtstatsRRRkRl((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt_rebaserestoredcommit,s@"     4     cC@sl|jjd}|sdSt|jd}t|jj}||@|}|dj|dS(NRs(RRRnRRRoRftforget(R"RXRst shelveunknownt addedafterttoforget((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt_forgetunknownfiles_scC@s4t|||jjj||t|dS(N(RRgRRR(R"RRWR((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt_finishunshelvejs cC@spt|jj}t|j}|j|}|rltd}td}tj|d|ndS(sYCheck potential problems which may result from working copy having untracked changes.s$shelved change touches missing filess,run hg status to see which files are missingR`N(R/RRRIt intersectionRRRB(R)R"RXt wcdeletedt shelvetouchedRtmR`((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyt_checkunshelveuntrackedproblemsss  RHtaRs&abort an incomplete unshelve operationtctcontinues)continue an incomplete unshelve operationtkRyskeep shelve after unshelvingR7R#Rs&restore shelved change with given nametNAMEttRxsspecify merge toolRs+set date for temporary commits (DEPRECATED)tDATEshg unshelve [[-n] SHELVED]t helpcategoryc O@s*|jt||||SWdQXdS(s+restore a shelved change to the working directory This command accepts an optional name of a shelved change to restore. If none is given, the most recent shelved change is used. If a shelved change is applied successfully, the bundle that contains the shelved changes is moved to a backup location (.hg/shelve-backup). Since you can restore a shelved change on top of an arbitrary commit, it is possible that unshelving will result in a conflict between your changes and the commits you are unshelving onto. If this occurs, you must resolve the conflict, then use ``--continue`` to complete the unshelve operation. (The bundle will not be moved until you successfully complete the unshelve.) (Alternatively, you can use ``--abort`` to abandon an unshelve that causes a conflict. This reverts the unshelved changes, and leaves the bundle in place.) If bare shelved change(when no files are specified, without interactive, include and exclude option) was done on newly created branch it would restore branch information to the working directory. After a successful unshelve, the shelved changes are stored in a backup directory. Only the N most recent backups are kept. N defaults to 10 but can be overridden using the ``shelve.maxbackups`` configuration option. .. container:: verbose Timestamp in seconds is used to decide order of backups. More than ``maxbackups`` backups are kept, if same timestamp prevents from deciding exact order of them, for safety. N(Rt _dounshelve(R)R"RR((s2/usr/lib64/python2.7/site-packages/hgext/shelve.pyRH~s2 c O@stj|}|jd}|jd}| rK| rKtj|nt|}|jdrz|j|dn|s|r<|r|rtjt dn|rtjt dn|r|jdt r|j t dny8t j |}|jddkr-|j|ds     dm    "       @     .       >   3          ( f                     D