\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sdZddlmZddlZddlZddlmZddlmZm Z m Z m Z m Z ddl mZdZiZe jeZdZed ged d ejd ed ZdZdefdYZdefdYZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&d Z'd!Z(d"Z)d#Z*d$Z+d%Z,d&Z-d'Z.d(Z/d)Z0d*Z1d+Z2d,Z3d-Z4d.Z5d/Z6d0Z7d1Z8d2Z9d3Z:d4Z;d5Z<d6Z=d7Z>d8Z?d9Z@d:ZAd;ZBi$ed<6ed=6ed>6ed?6ed@6edA6e!dB6e"dC6e#dD6e$dE6e%dF6e'dG6e(dH6e)dI6e*dJ6e+dK6e,dL6e-dM6e.dN6e/dO6e0dP6e1dQ6e2dR6e3dS6e4dT6e5dU6e6dV6e7dW6e8dX6e9dY6e:dZ6e;d[6e<d\6e=d]6eBd^6e&d_6ZCie>d`6e?dI6e@da6eAdT6ZDdS(bstry mapping git commands to Mercurial commands Tries to map a given git command to a Mercurial command: $ hg githelp -- git checkout master hg update master If an unknown command or parameter combination is detected, an error is produced. i(tabsolute_importN(t_(tencodingterrort fancyoptst registrartscmutil(tprocutilsships-with-hg-corecC@sQ|jdr|dSd|kr8|jdd}ntjdd|}|S(Nsorigin/itHEADt.s~$s~1(t startswithtreplacetretsub(ts((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytconvert,s  s githelp|gits hg githelpt helpcategoryt helpbasiccO@st|dks4t|dkrL|ddkrLtjtdn|ddkri|d}n|d}|tkrtjtd|n|jd|d}t|||||S(sgsuggests the Mercurial equivalent of the given git command Usage: hg githelp -- iitgits8missing git command - usage: hg githelp -- serror: unknown git command %stgithelp(tlenRtAbortRt gitcommandstpager(tuitrepotargstkwargstcmd((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyR5s 4     c C@st|}i}t|}x@tr`y#tjt|||t}PWq!tjk r\}d}d|jkrznd|j|jkrd|j}nBd|j|jkrd|j}ntj t d|jy|j |WnLt k rAt d}t d}tj ||jd||jnX|j t d|q!Xq!Wtg|D]}t|^qk}tg|jD]9\} } t| tr| t| fn | | f^q}||fS( Nsrequires arguments--t-sunknown option %ss-unknown option '%s' packed with other optionss2please try passing the option as its own flag: -%sthintsignoring unknown option %s (tlisttTrueRtgetoptt GetoptErrortNonetmsgtoptRRRtremovet ExceptiontwarnRtdictt iteritemst isinstancetstr( Rt cmdoptionsRtoptstextflagR$Rtxtktv((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyt parseoptionsMs6      '%LtCommandcB@sMeZdZdZejeZdZdZdZ dZ RS(cC@s||_g|_i|_dS(N(tnameRR.(tselfR6((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyt__init__os  cC@sd|j}|jr~xet|jjD]K\}}x<|D]4}|rb|d||f7}q?|d|f7}q?Wq,Wn|jr|d7}|dj|j7}n|S(Nshg s %s %ss %st (R6R.tsortedR*Rtjoin(R7RR2tvaluesR3((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyt __bytes__ts  "   cC@s|jj|dS(N(Rtappend(R7tvalue((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyR>scC@s|jj|dS(N(Rtextend(R7R<((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyR@scC@s&|jj|g}|j|dS(N(R.t setdefaultR>(R7tkeyR?R<((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyt __setitem__scC@s t||S(N(t AndCommand(R7tother((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyt__and__s( t__name__t __module__R8R=Rt strmethodt__str__R>R@RCRF(((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyR5ns     RDcB@s#eZdZdZdZRS(cC@s||_||_dS(N(tlefttright(R7RKRL((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyR8s cC@sd|j|jfS(Ns%s && %s(RKRL(R7((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRJscC@s t||S(N(RD(R7RE((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRFs(RGRHR8RJRF(((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRDs  cO@sd d g}t|||\}}|jdrU|jtdtd}n>td}|jds|j|n|jtd |jt|d dS( NtAtallttptpatchsUnote: Mercurial will commit when complete, as there is no staging area in Mercurial scommit --interactivetadds?note: use hg addremove to remove files that have been deleted s (RMRNNRO(RPRQNRO(R#R4tgettstatusRR5R@tbytes(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRRs  cO@sDg}t|||\}}td}|jt|ddS(Ntimports (R4R5RTRU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytams cO@sddtdfg}t|||\}}td}|jdr^|jd|dRU( RRRRR-R.Rtbranchtoldtnew((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRgs>        cC@stj||rtS|j}|dkr7|}n|d|}|jj|}|ratS|dj}||kp|j|}|S(s The first argument to git checkout can either be a revision or a path. Let's generally assume it's a revision, unless it's obviously a path. There are too many ways to spell revisions in git for us to reasonably catch all of them, so let's be conservative. ROt/R ( Rt isrevsymboltFalsetgetcwdtwvfstexistsR tmanifestthasdir(RtstringtcwdtrepopathRoRptdidexist((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytispaths   c O@sddddg}g}d |krU|jd }|j||d || }nt|||\}}d}|rt||d r||}n!|r|d }|d |}ntd } |jdr|s|rd| d RTRRRRU( RRRRR-tpathstsepindexR.trevRtbookcmd((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytcheckouts`                  cO@sd d d g}t|||\}}td}|jdrOd|dRSRTRU(RRRRR-R.Rtcocmd((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyR|s(      c O@sdddd d!d"d#d$d%g }t|||\}}td}|jdrctd}n|jdr|jdrtd}qd|d    cO@s|jtddS(NsXthis command has been deprecated in the git project, thus isn't supported by this tool (R(R(RRRR((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyt deprecatedscO@sd d dg}t|||\}}td}|jdrX|jtdn|jdrtd|d RU(RRRRR-R.RR((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRs"      cO@s|jtddS(NsMercurial does not enable external difftool by default. You need to enable the extdiff extension in your .hgrc file by adding extdiff = to the [extensions] section and then running hg extdiff -p See 'hg help extdiff' and 'hg help -e extdiff' for more information. (RTR(RRRR((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytdifftoolscO@sd d g}t|||\}}td}t|dkr|j|dt|dkr|jtdx;|dD],}||jkr||d RTRt _bookmarksRU(RRRRR-R.RR3((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytfetchs   cO@sQg}t|||\}}td}|j||jt|ddS(Ntgreps (R4R5R@RTRU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyR s   cO@sjg}t|||\}}td}t|dkrP|j|dn|jt|ddS(Ntinitis (R4R5RR>RTRU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRs  c O@sd!d"d#d$d%d&d'd(d)d*g }t|||\}}|jtd|jtdtd}d|d<|jdr|jd|dnote: Mercurial doesn't have a staging area, ignoring --stage s-0R s-Is (RRNRO(R\RNRO(R_RNRO(RRNRO(RRNRO(RRNRO(RRNRO( R#R4RSR5RTRR>Rt shellquoteRU(RRRRR-R.Rtinclude((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytlsfilesYs8         cO@stg}t|||\}}td}t|dkrZ|j|t|dn|jt|ddS(Ntmergeiis (R4R5RR>RTRU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyR}s  cO@sg}t|||\}}t|dkr?ddg}ntd|d|df}|jtdtd|jt|d dS( NiRMRxs&log -T '{node}\n' -r 'ancestor(%s,%s)'iis1note: ancestors() is part of the revset language s3(learn more about revsets with 'hg help revsets') s (R4RR5RTRRU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyt mergebases cO@spg}t|||\}}td}t|dkrId|dRTRRRU(RRRRR-R.RR3((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRs    cO@sd dg}t|||\}}td}t|dkr|j|dt|dkr|jtdx;|dD],}||jkr||d RTRRRSRU(RRRRR-R.RR3((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRs    c O@s7ddddddg}t|||\}}|jdr|jtd td }t|d kr|jtd n|jt|d dS|jdrtd}|jt|d ntd}|jds|jdr d|d -s s-dis(expected format: git rebase --onto X Y Zs '::%s - ::%s'is-ss-b(RORNNRO(RRNRO(RORRORO(RORNRO(RORNRO(RORNRO( R#R4RSRTRR5RRURRR(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRsD      +cO@sdg}t|||\}}td}|jdrId|dRTRUR(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytreflogs   c O@sd d dg}t|||\}}tt|dkrF|dnd}|jd}|jdr|jtdn|jdr|jtdntd }|r|jd n|j||jt |d dS(NROtsoftthardtmixediR sBnote: --mixed has no meaning since Mercurial has no staging area sAnote: --soft has no meaning since Mercurial has no staging area R{s--cleans (RORNRO(RORNRO(RORNRO( R#R4RRRSRTRR5R>RU( RRRRR-R.RRR((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytreset&s (  cO@sg}t|||\}}t|dkrF|jtdntd}|rl|j|dn|jt|ddS(Nis;note: hg backout doesn't support multiple commits at once tbackoutis (R4RRTRR5R>RU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyR|@s cO@sd d g}t|||\}}|jdsB|jdrtd}|jdrs|jtdn|jt|dn|jtd dS( NROs show-cdups show-toplevelt show_cdupt show_topleveltroots1note: hg root prints the root of the repository s s5note: see hg help revset for how to refer to commits (ROs show-cdupNRO(ROs show-toplevelNRO(R#R4RSR5RTRRU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytrevparseOs  cO@sd d g}t|||\}}td}|j||jdrYd|dRRvR@RTRU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytshowos.        cO@sg}t|||\}}td}t|dkrF|dnd}|dkred|dRfRYtunshelves--keepRgRtcleartcreatesbnote: Mercurial doesn't have equivalents to the git stash branch, show, clear, or create actions tsaves--names (R4R5RR#R>RTRRU(RRRRR-R.Rtaction((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytstashs6 "      $ cO@spdg}t|||\}}td}|j||jdrVd|dRTRU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pytsvnfetchs   cO@spg}t|||\}}|s<tjtdntd}|d|d<|jt|ddS(Nsmissing find-rev argumentRis-rs (R4RRRR5RTRU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyt svnfindrevs c O@swd g}t|||\}}td}|jdtd}|jd||@}|jt|ddS( NtltlocalRORs default-pushRttips (RRNRO(R#R4R5R>RTRU( RRRRR-R.tpullcmdt rebasecmdR((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyt svnrebases      cO@sdddg}t|||\}}|jdrEtd}ntd }|sotjtd n|j|d t|d kr|d |d RRTRU(RRRRR-R.R((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyRs"    RRRWRYRZR[RgRs cherry-pickRRRRRRRRRsls-filesRs merge-baseRRRRRRRR|s rev-parseRRRRTRRt whatchangedtdcommitsfind-rev(Et__doc__t __future__RR!R tmercurial.i18nRt mercurialRRRRRtmercurial.utilsRt testedwithtcmdtabletcommandRt CATEGORY_HELPR RR4tobjectR5RDRRRWRYRZR[RgRvRRRRRRRRRRRRRRRRRRRRRRR|RRRRRTRRRRRRRR(((s3/usr/lib64/python2.7/site-packages/hgext/githelp.pyts  (   !#     +  ?    0    6 $     1      $