https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/hgext/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/hgext/__pycache__/githelp.cpython-310.pyc
o

�]Lb���@s�dZddlmZddlZddlZddlmZddlmZm	Z	m
Z
mZmZm
Z
ddlmZdZiZe�e�Zdd	�Zed
ged�ejdd
�dd��Zdd�ZGdd�de�ZGdd�de�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Z d$d%�Z!d&d'�Z"d(d)�Z#d*d+�Z$d,d-�Z%d.d/�Z&d0d1�Z'd2d3�Z(d4d5�Z)d6d7�Z*d8d9�Z+d:d;�Z,d<d=�Z-d>d?�Z.d@dA�Z/dBdC�Z0dDdE�Z1dFdG�Z2dHdI�Z3dJdK�Z4dLdM�Z5dNdO�Z6dPdQ�Z7dRdS�Z8dTdU�Z9dVdW�Z:dXdY�Z;dZd[�Z<d\d]�Z=d^d_�Z>d`da�Z?dbdc�Z@ddde�ZAdfdg�ZBidhe�die�dje�dke�dle�dme�dne!�doe"�dpe#�dqe$�dre%�dse'�dte(�due)�dve*�dwe+�dxe,�idye-�dze.�d{e/�d|e0�d}e1�d~e2�de3�d�e4�d�e5�d�e6�d�e7�d�e8�d�e9�d�e:�d�e;�d�e<�d�e=��eBe&d���ZCe>e?e@eAd��ZDdS)�z�try 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.
�)�absolute_importN)�_)�encoding�error�	fancyopts�pycompat�	registrar�scmutil)�procutilsships-with-hg-corecCs<|�d�r|dd�Sd|vr|�dd�}t�dd|�}|S)Nsorigin/�sHEAD�.s~$s~1)�
startswith�replace�re�sub)�s�r�//usr/lib/python3/dist-packages/hgext/githelp.py�convert,s
rsgithelp|gits
hg githelpT)�helpcategory�	helpbasiccOs�t|�dkst|�dkr|ddkrt�td���|ddkr%|dd�}|d}|tvr6t�td�|��|�d�|dd�}t|||g|�Ri|��S)zgsuggests the Mercurial equivalent of the given git command

    Usage: hg githelp -- <git command>
    r�sgits8missing git command - usage: hg githelp -- <git command>Nserror: unknown git command %ssgithelp)�lenr�Abortr�gitcommands�pager)�ui�repo�args�kwargs�cmdrrr�githelp6s$
�
r!cCsZt|�}i}t|�}	zt�t|�||d�}Wn|tjy�}znd|jvr&�d|j|jvr7dt�|j�}nd|j|jvrHdt�|j�}n
t�	t
d�t�|j���z|�|�Wn"ty~t
d�}t
d	�}tj	|t�|j�|t�|j�d
��w|�
t
d�|�WYd}~nd}~wwqtdd
�|D��}tdd
�t�|�D��}||fS)NTzrequires argumentz--�--�-�-sunknown option %ss-unknown option '%s' packed with other optionss2please try passing the option as its own flag: -%s)�hintsignoring unknown option %s
cS�g|]}t|��qSr�r)�.0�xrrr�
<listcomp>s�z parseoptions.<locals>.<listcomp>cSs.g|]\}}t|t�r|t|�fn||f�qSr)�
isinstance�bytesr)r(�k�vrrrr*us��)�listr�getopt�GetoptError�msg�optr�bytestrrrr�remove�	Exception�warn�dict�	iteritems)r�
cmdoptionsr�opts�ex�flagr3r%rrr�parseoptionsTsL
��������r?c@sFeZdZdd�Zdd�Ze�e�Zdd�Zdd�Z	d	d
�Z
dd�Zd
S)�CommandcCs||_g|_i|_dS�N)�namerr<)�selfrBrrr�__init__s
zCommand.__init__cCs�d|j}|jr6tt�|j��D]%\}}|D]}|r-t|t�r"d}nd}||||f7}q|d|f7}qq|jrE|d7}|d�|j�7}|S)Nshg s %s %ds %s %ss %s� )	rBr<�sortedrr:r,�intr�join)rCr r.�valuesr/�fmtrrr�	__bytes__�s

�
zCommand.__bytes__cC�|j�|�dSrA)r�append)rC�valuerrrrM��zCommand.appendcCrLrA)r�extend)rCrIrrrrP�rOzCommand.extendcCs|j�|g�}|�|�dSrA)r<�
setdefaultrM)rC�keyrNrIrrr�__setitem__�szCommand.__setitem__cC�
t||�SrA��
AndCommand�rC�otherrrr�__and__��
zCommand.__and__N)�__name__�
__module__�__qualname__rDrKr�	strmethod�__str__rMrPrSrYrrrrr@~s
r@c@s$eZdZdd�Zdd�Zdd�ZdS)rVcCs||_||_dSrA��left�right)rCrarbrrrrD�s
zAndCommand.__init__cCsd|j|jfS)Ns%s && %sr`)rCrrrr_�rOzAndCommand.__str__cCrTrArUrWrrrrY�rZzAndCommand.__and__N)r[r\r]rDr_rYrrrrrV�srVcOszddg}t|||�\}}|�d�r|�td��td�}ntd�}|�d�s,|�|�n|�td��|�t|�d	�dS)
N)�A�allN���p�patchNrerhsUnote: Mercurial will commit when complete, as there is no staging area in Mercurial

�commit --interactive�addrds?note: use hg addremove to remove files that have been deleted

�
)r?�get�statusrr@rPr-�rrrrr;r<r rrr�add�s(�
��

��rocO�,g}t|||�td�}|�t|�d�dS)Nsimportrk�r?r@rmr-�rrrrr;r rrr�am�srscOsvddtdfdg}t|||�\}}td�}|�d�r |�d�|d<|�d�r,|�d�|d<|�|�|�t|�d�dS)	Nrgre)re�	directoryreresimport --no-commit�-prts--prefixrk)rGr?r@rlrPrmr-rnrrr�apply�s
�


rvcO�|�td��dS)Ns,see 'hg help bisect' for how to use bisect

�rmr�rrrrrrr�bisect�srzcOsDg}t|||�\}}td�}|�dd�|D��|�t|�d�dS)Ns
annotate -udlcSr&rr')r(r/rrrr*�r+zblame.<locals>.<listcomp>rk�r?r@rPrmr-rnrrr�blame�s
r|c
Os(gd�}t|||�\}}td�}|�d�s|�d�r#|�td��dS|�d�r:td�}|D]}||d<q.d|d<nP|�d	�rit|�d
krTt|�dkrQ|�d
�}n
d}nt�td
���|d
}	||d<|�	|	�n!t|�dkr}|d|d<|�	|d
�n
t|�dkr�|�	|d
�|�t
|�d�dS)N))resset-upstreamNre)resset-upstream-torere��d�deleteNre)�DrNre)�m�moveNre)�Mr�Nre�bookmarksset_upstreamsset_upstream_tos.Mercurial has no concept of upstream branches
rsstrip�-Br�rrs"`hg log -T"{activebookmark}" -r .`smissing newbranch argument�-m�-rrk)r?r@rlrmrr�poprrrMr-)
rrrrr;r<r �branch�old�newrrrr��s4



r�cCsht�||�rdS|��}|dkr|}n|d|}|j�|�}|r#dS|d��}||vp1|�|�}|S)a
    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.
    Fre�/Tr)r	�isrevsymbol�getcwd�wvfs�exists�manifest�hasdir)r�string�cwd�repopathr�r��didexistrrr�ispath"sr�cOs�gd�}g}d|vr |�d�}|�||dd��|d|�}t|||�\}}d}|r8t||d�r8||}n|rF|d}|dd�|}td�}	|�d�rW|sS|rWd|	d<|�d�rdtd	�}	d|	d
<|�d�r�t|�dkr|td�}	|	�|�d��ne|	�|d�td�}
|
�|�d��|	|
@}	nMt|�dkr�|�t	d
��td	�}	|�d�r�d|	d
<|r�||	d<|	�|�n'|r�|�d�r�||	d<n|	�|�n|�d�r�td	�}	d|	d<nt
�t	d���|�t|	�d�dS)N)��b�branchrere)�Br�rere��f�forceNrerfr"rr�updater�s-Crh�revert�-ir�r�s5note: use --no-backup to avoid creating .orig files

r��--allsa commit must be specifiedrk)
�indexrPr?r�r@rlrrMrmrrrr-)rrrrr;�paths�sepindexr<�revr �bookcmdrrr�checkout?sZ










r�cOs�gd�}t|||�\}}td�}|�d�rd|d<|�d�r#d|d<n|�d�r1|�td��dS|�|�|�t|�d	�dS)
N)�re�continueNre�re�abortNre)�e�editNresgraftr�s--editr��
--continuer�s&note: hg graft does not have --abort

rk�r?r@rlrmrrPr-rnrrr�
cherrypicks




r�cOsPgd�}t|||�\}}td�}|�d�rd|d<|�|�|�t|�d�dS)N))r~r~Nrer�)�xr�Nrespurger�r�rk)r?r@rlrPrmr-rnrrr�clean�s

r�cOs�gd�}t|||�\}}t|�dkrt�td���td�}|�|d�t|�dkr1|�|d�|�d�rBd|d<|�td��n	|�d	�rKd|d<|�d
�r`td�}|�|�d
��||@}|�t	|�d�dS)
N))re�bareNre)�nsno-checkoutNrer�rs'a repository to clone must be specified�clonerr�s-Usanote: Mercurial does not have bare clones. -U will clone the repo without checking out a commit

sno_checkoutr�r�rk)
r?rrrrr@rMrlrmr-)rrrrr;r<r �cocmdrrr�clone�s,
��

r�cOsgd�}t|||�\}}td�}|�d�rtd�}|�d�r,|�d�r(td�}nd|d<|�d�r8|�d�|d	<|�d
�rGd|�d
�f|d<|�d
�rS|�td��|�d�r_|�d�|d<|�d�rk|�d�|d<|�d�rw|�d�|d<|�|�|�t|�d�dS)N)	��ardNre)r��messagerererf)�Cs
reuse-messagerere)�F�filerere)re�authorrere)re�daterere)re�amendNre)resno-editNre�commitrhrir�sno_edits--amends
reuse_messages-Mr�s'%s'r�rdsqnote: Mercurial doesn't have a staging area, so there is no --all. -A will add and remove files for you though.

r��-lr�s-ur��-drkr�rnrrr�commit�s6






��



r�cOrw)NsXthis command has been deprecated in the git project, thus isn't supported by this tool

)r8rryrrr�
deprecated��
��r�c	Os�gd�}t|||�\}}td�}|�d�r|�td��|�d�r%d|d<t|�D] }|�|�z|�|�||d<Wq)tyI|�	|�Yq)w|�t
|�d�dS)	N)r�)re�cachedNre)�R�reverseNre�diffr�sLnote: Mercurial has no concept of a staging area, so --cached does nothing

r�s	--reverser�rk)r?r@rlrmrr0r6�revsr7rMr-)rrrrr;r<r �arrr�diffs(
��


�r�cOrw)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 <program>

See 'hg help extdiff' and 'hg help -e extdiff' for more information.
rxryrrr�difftool'r�r�cOs�ddg}t|||�\}}td�}t|�dkrA|�|d�t|�dkrA|�td��|dd�D]}||jvr<||d<q0||d<q0|�t|�d	�dS)
N�rerdNrer��pullrr�note: Mercurial doesn't have refspecs. -r can be used to specify which commits you want to pull. -B can be used to specify which bookmark you want to pull.

r�r�rk�r?r@rrMrmr�
_bookmarksr-�rrrrr;r<r r/rrr�fetch5s$���


r�cOs:g}t|||�\}}td�}|�|�|�t|�d�dS)N�greprkr{rnrrr�grepRs

r�cOsJg}t|||�\}}td�}t|�dkr|�|d�|�t|�d�dS)N�initrrk�r?r@rrMrmr-rnrrr�init_sr�cOs�gd�}t|||�\}}|�d�p|�d�}|r+td�}||d<|�dt|��dS|�td��|�td��td	�}d|d
<|�d�rM|�d�|d<|�d
�rVd
|d<|�d�r_d|d<|�d�rhd|d<|�d�rqd|d<|�d�s�|�d�s�|�d�r�|�dd�}d|vr�|�td��d|d<n|�td��d|d<t|�dkr�d|dvr�|d�d�\}	}
d |	|
f|d!<|d=|�|�|�t|�d"�dS)#N))resfollowNre)resdecorateNre)r��numberrere)�1r�Nre�re�prettyrere)re�formatrere)re�onelineNre)re�statNre)re�graphNrerf)�Gs	grep-diffrere)�Ss
pickaxe-regexreres	grep_diffs
pickaxe_regexr�s--diffs%s
senote: -v prints the entire commit message like Git does. To print just the first line, drop the -v.

sFnote: see hg help revset for information on how to filter log output

�logs-vr�r�r�r��--statr�s-Grhrur�r�r�re�format:scnote: --format format:??? equates to Mercurial's --template. See hg help templates for more info.

s???s
--templatesqnote: --pretty/format/oneline equate to Mercurial's --style or --template. See hg help templates for more info.

s--stylers..s'%s::%s'r�rk)	r?rlr@rmr-rr�splitrP)rrrrr;r<�grep_patr �format�since�untilrrr�logksh����




��
��
r�cOs�gd�}t|||�\}}|�d�s |�d�s |�d�s |�d�rItd�}|�d�r-d|d<|�d�r6d|d<|�d�r?d|d	<|�d�rHd|d
<ntd�}|�d�rY|�td
��|�d�rbd|d<|�d�|D]	}t�|�|d<qi|�t|�d�dS)N))�cr�Nre)r~�deletedNre)r��modifiedNre)�o�othersNre)�i�ignoredNre)�s�stageNre)�z�_zeroNrer�r�r�r��statusr�r�s-or�sfilesr�s>note: Mercurial doesn't have a staging area, ignoring --stage
r�s-0rs-Irk)	r?rlr@rmrrMr
�
shellquoter-)rrrrr;r<r �includerrr�lsfiles�sB	����



�
��

r�cOsRg}t|||�\}}td�}t|�dkr|�|t|�d�|�t|�d�dS)N�mergerrrkr�rnrrr�merge�sr�cOshg}t|||�\}}t|�dkrddg}td|d|df�}|�td�td��|�t|�d	�dS)
N�rcr�s&log -T '{node}\n' -r 'ancestor(%s,%s)'rrs1note: ancestors() is part of the revset language
s3(learn more about revsets with 'hg help revsets')

rk)r?rr@rmrr-rnrrr�	mergebase�s��rcOsNg}t|||�\}}td�}t|�dkrd|d<|�|�|�t|�d�dS)Nsresolverr�rk)r?r@rrPrmr-rnrrr�	mergetools
rcO�bddg}t|||�\}}td�}|�|�|�d�rd|d<|�d�r'd|d<|�t|�d�dS)	Nr��r�sdry-runNre�mvr��-f�dry_run�-nrk�r?r@rPrlrmr-rnrrr�mv��


r
cOs�gd�}t|||�\}}td�}d|d<t|�dkrE|�|d�t|�dkrE|�td��|dd�D]}||jvr@||d<q4||d<q4|�t|�d	�dS)
N)r�r�)�r�rebaseNrer�s--rebaserrr�r�r�rkr�r�rrr�pull$s"��


rcOs�ddg}t|||�\}}td�}t|�dkrA|�|d�t|�dkrA|�td��|dd�D]}||jvr<||d<q0||d<q0|�d	�rJd|d
<|�t|�d�dS)Nr�r��pushrrs�note: Mercurial doesn't have refspecs. -r can be used to specify which commits you want to push. -B can be used to specify which bookmark you want to push.

r�r�r�rrk)	r?r@rrMrmrr�rlr-r�rrr�pushCs(���



rcOs�gd�}t|||�\}}|�d�r3|�td��td�}t|�dkr)|�td��|�t|�d�dS|�d�rDtd	�}|�t|�d�td
�}|�d�sR|�d�rVd|d<|�d
�r_d|d<|�d�r�|�td��t|�d��|d<t|�dkr�t�	td���dt|d�t|d�f|d<n%t|�dkr�t|d�|d<nt|�dkr�t|d�|d<t|d�|d<|�t|�d�dS)N)r�)r��interactiveNre)re�ontorerer�r�)re�skipNrersEnote: hg histedit does not perform a rebase. It just edits history.

shisteditrscalso note: 'hg histedit' will automatically detect your stack, so no second argument is necessary

rkrsrevert --all -r .r
r�r�r�s--abortrsxnote: if you're trying to lift a commit off one branch, try hg rebase -d <destination commit> -s <commit to be lifted>

r�rs(expected format: git rebase --onto X Y Zs
'::%s - ::%s'rs-ss-b)
r?rlrmrr@rr-rrrrnrrr�rebasecsR
����


��"rcOsldg}t|||�\}}td�}|�d�rd|d<t|�dkr%|�|d�|�t|�d�|�td��dS)Nr�sjournalrdr�rs

sHnote: in hg commits can be deleted from repo but we always have backups
)r?r@rlrrMrmr-rrnrrr�reflog�s�
��rc	Os�gd�}t|||�\}}tt|�dkr|dnd�}|�d�}|�d�r+|�td��|�d�r7|�td��td	�}|rB|�d
�|�|�|�t|�d�dS)N))re�softNre)re�hardNre)re�mixedNrerrrrsBnote: --mixed has no meaning since Mercurial has no staging area

rsAnote: --soft has no meaning since Mercurial has no staging area

r�s--cleanrk)	r?rrrlrmrr@rMr-)	rrrrr;r<r��hardr rrr�reset�s*

��
��

rcOs\g}t|||�\}}t|�dkr|�td��td�}|r$|�|d�|�t|�d�dS)Nrs;note: hg backout doesn't support multiple commits at once

sbackoutrrk)r?rrmrr@rMr-rnrrr�revert�s��rcOsrddg}t|||�\}}|�d�s|�d�r0td�}|�d�r&|�td��|�t|�d�dS|�td��dS)	N)res	show-cdupNre)res
show-toplevelNres	show_cdups
show_toplevelsroots1note: hg root prints the root of the repository

rks5note: see hg help revset for how to refer to commits
)r?rlr@rmrr-rnrrr�revparse�s�
rcOr)	Nr�r�rmr�rrrrkr	rnrrr�rm�rrcOsddddtdfg}t|||�\}}|�d�r5|�d�dkr&td	�}d
|d<nRtd�}|�d
�|�d�nCt|�dkr`t||d�rGtd�}ntd�}|�|�|�d�r_|�d|df�n|�d�rttd�}|�d|df�ntd�}|�t	|�d�dS)N)resname-statusNrer��Usunifiedresname_statusr�r�r�rs--changer�s--style statuss-r .rscatsexports--config diff.unified=%drk)
rGr?rlr@rMrr�rPrmr-rnrrr�shows2
�





�
r cOs�dg}t|||�\}}td�}t|�dkr|dnd}|dkr-d|d<|�d�r,d|d<n�|dkrM|�d�r;d|d<nd|d	<t|�d
krL|�|d
�nw|dkrVd|d<nn|d
krrd|d<t|�d
krl|�|d
�nX|�d�nR|dksz|dkr�td�}t|�d
kr�|�|d
�|dkr�d|d<n0|dks�|dkr�|�td��dSt|�dkr�|ddkr�|d|d<nt|�d
kr�|d
|d<|�t|�d�dS)Nrfsshelver�listr�rhru�showr�rsclears	--cleanupsdropr�s
<shelve name>spop�applysunshelves--keepr�screatesTnote: Mercurial doesn't have equivalents to the git stash branch or create actions

ssaves--namerk)r?r@rrlrMrmrr-)rrrrr;r<r �actionrrr�stash/sX�
�

�
���r%cOsNdg}t|||�\}}td�}|�|�|�d�rd|d<|�t|�d�dS)N)rer�Nrer�r�r�rkr	rnrrrrmcs�

rmcOs\|s	t�td���|d}|tvrt�td�|��|dd�}t|||g|�Ri|��S)Nsmissing svn commandrsunknown git svn command "%s"r)rrr�gitsvncommands)rrrr�svncmdrrr�svnrsr(cOrp)Nrrkrqrrrrr�
svndcommit}sr)cOs6g}t|||�td�}|�d�|�t|�d�dS)Nr��default-pushrk�r?r@rMrmr-rrrrr�svnfetch�s

r,cOsNg}t|||�\}}|st�td���td�}|d|d<|�t|�d�dS)Nsmissing find-rev argumentr�rr�rk)r?rrrr@rmr-rnrrr�
svnfindrev�sr-cOsRdg}t|||�td�}|�d�td�}|�d�||@}|�t|�d�dS)N)�lslocalNrer�r*r
stiprkr+)rrrrr;�pullcmd�	rebasecmdr rrr�	svnrebase�s�

r1cOs�gd�}t|||�\}}|�d�rtd�}n2td�}|s#t�td���|�|d�t|�dkr6|d|d<|�d	�r?d|d
<|�d�rHd|d<|�t	|�d
�dS)N)r�)r.r!Nrer}r!stags�tagsmissing tag argumentrrr�rs--remover�rrk)
r?rlr@rrrrMrrmr-rnrrr�tag�s



r3rjsamr#sbisectsblamer�scheckoutscherry-pickscleanr�r�r�sdifftool�fetchr�r�r�sls-filesr�s
merge-bases	mergetoolrr�rr
sreflogsresetr�s	rev-parserr"sstashr�ssvn)r2swhatchanged)sdcommitr4sfind-revr
)E�__doc__�
__future__rr1r�mercurial.i18nr�	mercurialrrrrrr	�mercurial.utilsr
�
testedwith�cmdtable�commandr�
CATEGORY_HELPr!r?�objectr@rVrorsrvrzr|r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr
rrrrrrrrr r%rmr(r)r,r-r1r3rr&rrrr�<module>s 

�
*),@#5	 
P- >#!4	

��������	�
���
������������������� �!�"�#�(
�

https://t.me/RX1948 - 2025