HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/self/root/usr/lib64/python2.7/site-packages/mercurial/windows.pyc
�
1�3\c@@siddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
mZmZmZyddlZejWnek
r�ddlZnXejd�ZejZejZejZejZejZejZejZejZej Z ej!Z!ej"Z"ej#j$Z$ej%Z%ej&Z&dZ'de(fd	��YZ)d
e(fd��YZ*dd
d�Z+ej,Z,de(fd��YZ-d�Z.d�Z/d�Z0d�Z1d�Z2dd�Z4d�Z5d�Z6d�Z7d�Z8d�Z9d�Z:d�Z;ej<j=Z>ej?Z@d�ZAd�ZBdaCdaDd �ZEd!�ZFd"�ZGd#�ZHd$�ZId%�ZJejKejLhZMd&�ZNdd'�ZOdd(�ZPd)�ZQd*�ZRd+�ZSd,�ZTd-�ZUd.�ZVd/e(fd0��YZWddd1�ZXeYZZd2�Z[d3�Z\d4�Z]d5�Z^d6�Z_dS(7i(tabsolute_importNi(t_(tencodingterrortpolicytpycompattwin32tosutilitmixedfilemodewrappercB@s�eZdZdZdZdZd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�ZRS(s)Wraps a file handle when it is opened in read/write mode.

    fopen() and fdopen() on Windows have a specific-to-Windows requirement
    that files opened with mode r+, w+, or a+ make a call to a file positioning
    function when switching between reads and writes. Without this extra call,
    Python will raise a not very intuitive "IOError: [Errno 0] Error."

    This class wraps posixfile instances when the file is opened in read/write
    mode and automatically adds checks or inserts appropriate file positioning
    calls when necessary.
    iiicC@s*tj|d|�tj|dd�dS(Nt_fpt_lastopi(tobjectt__setattr__(tselftfp((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt__init__DscC@s|jj�|S(N(R	t	__enter__(R
((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyRHs
cC@s|jj|||�dS(N(R	t__exit__(R
texc_typetexc_valtexc_tb((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyRLscC@st|j|�S(N(tgetattrR	(R
tname((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt__getattr__OscC@s|jj||�S(N(R	R(R
Rtvalue((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyRRscC@s|jjdtj�dS(Ni(R	tseektostSEEK_CUR(R
((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt	_noopseekUscO@s)tj|d|j�|jj||�S(NR
(RRtOPNONER	R(R
targstkwargs((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyRXscC@sE|j|jkr|j�ntj|d|j�|jj|�S(NR
(R
tOPREADRRRtOPWRITER	twrite(R
td((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR"\s
cO@sH|j|jkr|j�ntj|d|j�|jj||�S(NR
(R
R t
_noopeseekRRR!R	t
writelines(R
RR((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR%cs
cO@sH|j|jkr|j�ntj|d|j�|jj||�S(NR
(R
R!RRRR R	tread(R
RR((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR&js
cO@sH|j|jkr|j�ntj|d|j�|jj||�S(NR
(R
R!RRRR R	treadline(R
RR((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR'qs
cO@sH|j|jkr|j�ntj|d|j�|jj||�S(NR
(R
R!RRRR R	t	readlines(R
RR((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR(xs
(t__name__t
__module__t__doc__RR R!RRRRRRRR"R%R&R'R((((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR4s 											tfdproxycB@s;eZdZd�Zd�Zd�Zd�Zd�ZRS(seWraps osutil.posixfile() to override the name attribute to reflect the
    underlying file name.
    cC@s||_||_dS(N(RR	(R
RR((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR�s	cC@s|jj�|S(N(R	R(R
((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR�s
cC@s|jj|||�dS(N(R	R(R
Rt	exc_valuet	traceback((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR�scC@s
t|j�S(N(titerR	(R
((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt__iter__�scC@st|j|�S(N(RR	(R
R((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR�s(R)R*R+RRRR0R(((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR,s				tri����cC@s�yptj|||�}tjr3t||�}nd|krU|jdtj�nd|krkt|�S|SWn;t	k
r�}t
|jdtj
|�|jf��nXdS(s/Open a file with even more POSIX-like semanticstait+s%s: %sN(Rt	posixfileRtispy3R,RRtSEEK_ENDRtWindowsErrortIOErrorterrnoRtstrfromlocaltstrerror(Rtmodet	bufferingRterr((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR4�s	
t	winstdoutcB@s;eZdZd�Zd�Zd�Zd�Zd�ZRS(s3stdout on windows misbehaves if sent through a pipecC@s
||_dS(N(R(R
R((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR�scC@st|j|�S(N(RR(R
tkey((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR�scC@s)y|jj�Wntk
r$nXdS(N(RtcloseR8(R
((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyRA�s
cC@s�y_d}t|�}d}d|_x7||kr]||}|jj|||!�|}q'WWnTtk
r�}|jdkr�tj|�r��n|j�ttj	d��nXdS(Ni�>isBroken pipe(
tlent	softspaceRR"R8R9RtlasterrorwaspipeerrorRAtEPIPE(R
tstlimittltstarttendtinst((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR"�s	

cC@sRy|jj�SWn:tk
rM}tj|�s8�nttjd��nXdS(NsBroken pipe(RtflushR8RRDR9RE(R
RK((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyRL�s(R)R*R+RRRAR"RL(((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR?�s				cC@sFytj�ddkSWn'tk
rAdtjjdd�kSXdS(s+return true if run on windows 95, 98 or me.iitcommandtcomspectN(tsystgetwindowsversiontAttributeErrorRtenvirontget(((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt
_is_win_9x�s
cC@st�S(N(RU(((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt
openhardlinks�scC@s.|d}|ddkr*|dd!}n|S(s<parses the output produced by patch and returns the filenameiit`ii����((toutput_linetpf((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytparsepatchoutput�s
cC@s�d|j�krdpd}|r4d||fp7|}|jd�sX|jd�rttjtd�|��nt|�}|r�d|t|�|f}n|S(	s$Build argument list for ssh or Plinktplinks-Ps-ps%s@%st-t/s9illegal ssh hostname or username starting with - or /: %ss%s %s %s(tlowert
startswithRtAbortRt
shellquote(tsshcmdthosttusertporttpflagR((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytsshargs�s	
cC@sdS(N((tfRHtx((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytsetflags�scC@sdS(N((tsrctdstR<((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytcopymode�scC@stS(N(tFalse(tpath((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt	checkexec�scC@stS(N(Rn(Ro((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt	checklinkscC@sJt|dd�}|dk	rF|�dkrFtj|�tj�ndS(Ntfilenoi(RtNonetmsvcrttsetmodeRtO_BINARY(tfdtfno((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt	setbinaryscC@s|jtjd�S(NR](treplaceRtossep(Ro((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytpconvertscC@s|jdd�S(NR]s\(Rz(Ro((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt	localpathscC@sttjj|��S(N(R|RRotnormpath(Ro((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR~scC@s
tj|�S(N(Rtupper(Ro((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytnormcasescC@stS(N(Rn(ts1ts2((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytsamestatsc@s�t�fd�dD��s �Stjtjtj�d}d}d}t��}x`||kr��||d!}|dkr��|d�t��}y)�jd�}|d�| d7}Wq�tk
r�||�7}|d}q�Xn�|d	krw�|d�t��}y�jd	�}Wn)tk
rW|d	�7}|d}q�X�| }|d	|d	7}n3|d
kr��|d|d!dkrC�|d�t��}y\�jd
�}�| }|j	|d�dkr|d	|d	7}n|d|d
7}Wq�tk
r?|d�7}|d}q�Xq�d}|d7}�||d!}xA|dkr�||kr�||7}|d7}�||d!}qgW|j	|d�dkr�|d	|d	7}n|d
|7}|dkr�|d8}q�n�|dkrC|d|krC�|d|d!dkrC|d7}ng|dkr�|d|kr��|d|d!dkr�|�|d|d!7}|d7}n
||7}|d7}qXW|S(s�Convert shell variables in the form $var and ${var} inside ``path``
    to %var% form.  Existing Windows style variables are left unchanged.

    The variables are limited to the given environment.  Unknown variables are
    left unchanged.

    >>> e = {b'var1': b'v1', b'var2': b'v2', b'var3': b'v3'}
    >>> # Only valid values are expanded
    >>> shelltocmdexe(b'cmd $var1 ${var2} %var3% $missing ${missing} %missing%',
    ...               e)
    'cmd %var1% %var2% %var3% $missing ${missing} %missing%'
    >>> # Single quote prevents expansion, as does \$ escaping
    >>> shelltocmdexe(b"cmd '$var1 ${var2} %var3%' \$var1 \${var2} \\", e)
    'cmd "$var1 ${var2} %var3%" $var1 ${var2} \\'
    >>> # $$ is not special. %% is not special either, but can be the end and
    >>> # start of consecutive variables
    >>> shelltocmdexe(b"cmd $$ %% %var1%%var2%", e)
    'cmd $$ %% %var1%%var2%'
    >>> # No double substitution
    >>> shelltocmdexe(b"$var1 %var1%", {b'var1': b'%var2%', b'var2': b'boom'})
    '%var1% %var1%'
    >>> # Tilde expansion
    >>> shelltocmdexe(b"~/dir ~\dir2 ~tmpfile \~/", {})
    '%USERPROFILE%/dir %USERPROFILE%\\dir2 ~tmpfile ~/'
    c3@s|]}|�kVqdS(N((t.0tc(Ro(s7/usr/lib64/python2.7/site-packages/mercurial/windows.pys	<genexpr>8ss$'~s_-ROiis't"t%t$it{t}s${t~s\R]s
%USERPROFILE%(s\R](R�R�(
tanyRtsysbyteststringt
ascii_letterstdigitsRBtindext
ValueErrorRT(RotenvtvarcharstresR�tpathlenR�tvar((Ros7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt
shelltocmdexes|










cC@sztdkrtjd�antdkr?tjd�jan|rft|�rftj|�rf|Sdtjd|�S(s�
    >>> shellquote(br'C:\Users\xyz')
    '"C:\\Users\\xyz"'
    >>> shellquote(br'C:\Users\xyz/mixed')
    '"C:\\Users\\xyz/mixed"'
    >>> # Would be safe not to quote too, since it is all double backslashes
    >>> shellquote(br'C:\\Users\\xyz')
    '"C:\\\\Users\\\\xyz"'
    >>> # But this must be quoted
    >>> shellquote(br'C:\\Users\\xyz/abc')
    '"C:\\\\Users\\\\xyz/abc"'
    s(\\*)("|\\$)s[^a-zA-Z0-9._:/-]s"%s"s\1\1\\\2N(t_quotereRstretcompilet_needsshellquotetsearchtsub(RF((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyRa�s#cC@s-|jd�r)|jd�r)|dd!S|S(NR�ii����(R_tendswith(RF((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt_unquote�scC@stjttj|dt��S(s3Parse a command string in cmd.exe way (best-effort)tposix(RtmaplistR�t
shlexsplitRn(RF((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt
shellsplit�scC@stjdkrd|dS|S(s4Build a command string suitable for os.popen* calls.iiiR�(iii(RPtversion_info(tcmd((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytquotecommand�scC@stS(N(tTrue(tst((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytisowner�sc@stjjdd�}g|j�jtj�D]}|^q.�tjj	|�dj��krndg�n�fd�}tj
|kr�||�SxTtjjdd�jtj�D]1}|tjj||��}|dk	r�|Sq�W|tjj
tjj|���S(s*Find executable for command searching like cmd.exe does.
    If command is a basename then PATH is searched for command.
    PATH isn't searched if command is an absolute or relative path.
    An extension from PATHEXT is found and added if not present.
    If command isn't found None is returned.tPATHEXTs.COM;.EXE;.BAT;.CMDiROc@s5x.�D]&}||}tjj|�r|SqWdS(s:Will append extension (if needed) and return existing fileN(RRotexistsRs(tpathcommandtextt
executable(tpathexts(s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytfindexisting�s


tPATHN(RRSRTR^tsplitRt	ospathsepRRotsplitextR{tjoinRst
expandusert
expandvars(RMtpathextR�R�RoR�((R�s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytfindexe�s+"
(cc@s4i}tj}x|D]}t|�}tjj|�\}}|sOd}n|j|d�}|dkryVtgt	|t
�D]6\}}}	||	j�tkr�t|�|	f^q��}
Wn@t
k
r}|jtjtjtjfkr��ni}
nX|j||
�}n|j|d�VqWdS(s�Stat each file in files. Yield each stat, or None if a file
    does not exist or has a type we don't care about.

    Cluster and cache stat per directory to minimize number of OS stat calls.t.N(tstattS_IFMTR�RRoR�RTRstdicttlistdirR�tst_modet_wantedkindstOSErrorR9tENOENTtEINVALtENOTDIRt
setdefault(tfilestdircachetgetkindtnftdirtbasetcachetntkRFtdmapR>((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt	statfiles�s(	
	4
cC@sdS(siReturn the name of the user with the given uid.

    If uid is None, return the name of the current user.N(Rs(tuid((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytusernamescC@sdS(skReturn the name of the group with the given gid.

    If gid is None, return the name of the current group.N(Rs(tgid((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt	groupnamescC@stjtjtj|���S(N(RtfsencodeRtreadlinktfsdecode(tpathname((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR�scC@s�t|�rdStj|�tjj|�\}}|sVtjj|�\}}nxd|r�|r�y!t|�rxdStj|�Wnttfk
r�PnXtjj|�\}}qYWdS(s�special version of os.removedirs that does not remove symlinked
    directories or junction points if they actually contain filesN(R�RtrmdirRoR�R�R�(Rtheadttail((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt
removedirss
cC@s`ytj||�WnEtk
r[}|jtjkr>�nt|�tj||�nXdS(s=atomically rename file src to dst, replacing dst if it existsN(RtrenameR�R9tEEXISTtunlink(RkRlte((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR�#s
cC@s1gtjgtjd D]}tj|�^qS(Ni(RPR�targvRt
strtolocal(targ((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytgethgcmd-scC@s
t�dS(N(tKeyError(R((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytgroupmembers0scC@stS(N(Rn(Rh((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytisexec4st	cachestatcB@seZd�Zd�ZRS(cC@sdS(N((R
Ro((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR8scC@stS(N(Rn(R
((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt	cacheable;s(R)R*RR�(((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyR�7s	cC@s�|dkr!tjtjf}n!t|ttf�sB|f}nx�|D]�}yftj|tj	|���E}|r�tj	|�p�|}tj
||�d}tj|�SWdQXWqItk
r�qIXqIWdS(s* Look up a key/value name in the Windows registry.

    valname: value name. If unspecified, the default value for the key
    is used.
    scope: optionally specify scope for registry lookup, this can be
    a sequence of scopes to look up in order. Default (CURRENT_USER,
    LOCAL_MACHINE).
    iN(
RstwinregtHKEY_CURRENT_USERtHKEY_LOCAL_MACHINEt
isinstancetlistttupletOpenKeyRR:tQueryValueExt
unitolocaltEnvironmentError(R@tvalnametscopeRFthkeyRtval((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt	lookupreg>s	

cC@stS(s(check whether a stat result is a symlink(Rn(R�((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt
statislinkWscC@stS(s1check whether a stat result is an executable file(Rn(R�((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt
statisexec[scC@s
t��dS(N(tNotImplementedError(tfds((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytpoll_scC@s_g}xItrQtj|�}|s(Pn|j|�}|sAPn|j|�q	Wdj|�S(s$Read all available data from a pipe.RO(R�RtpeekpipeR&tappendR�(tpipetchunkstsizeRF((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytreadpipecs	cC@std��dS(Nsunsupported platform(R�(tsockRo((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pytbindunixsocketrs(`t
__future__RR9RtRR�R�R�RPti18nRRORRRRRt_winregR�tCloseKeytImportErrort	importmodRt
getvolumenametgetfsmountpointt	getfstypetgetusert
hidewindowtmakedirtnlinkstoslinkt
samedevicetsamefiletsetsignalhandlert
spawndetachedRoR�ttestpidR�tumaskRRR,R4R�R?RURVRZRgRjRsRmRpRqRyR|R}R~R�t
normcasespecsRtnormcasespect
upperfallbacktnormcasefallbackR�R�R�R�RaR�R�R�R�R�tS_IFREGtS_IFLNKR�R�R�R�R�R�R�R�R�R�R�R�R�texpandglobsR�R�R�RR(((s7/usr/lib64/python2.7/site-packages/mercurial/windows.pyt<module>s�(
													K	)				
											v