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__/win32mbcs.cpython-310.pyc
o

�]Lb��@s�dZddlmZddlZddlZddlmZddlmZm	Z	ddl
mZmZm
Z
mZdZiZe�e�Zedd	d
d�d�dad
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdZdZdZd Zd!d"�ZdS)#a�allow the use of MBCS paths with problematic encodings

Some MBCS encodings are not good for some path operations (i.e.
splitting path, case conversion, etc.) with its encoded bytes. We call
such a encoding (i.e. shift_jis and big5) as "problematic encoding".
This extension can be used to fix the issue with those encodings by
wrapping some functions to convert to Unicode string before path
operation.

This extension is useful for:

- Japanese Windows users using shift_jis encoding.
- Chinese Windows users using big5 encoding.
- All users who use a repository with one of problematic encodings on
  case-insensitive file system.

This extension is not needed for:

- Any user who use only ASCII chars in path.
- Any user who do not use any of problematic encodings.

Note that there are some limitations on using this extension:

- You should use single encoding in one repository.
- If the repository path ends with 0x5c, .hg/hgrc cannot be read.
- win32mbcs is not compatible with fixutf8 extension.

By default, win32mbcs uses encoding.encoding decided by Mercurial.
You can specify the encoding by config option::

 [win32mbcs]
 encoding = sjis

It is useful for the users who want to commit with UTF-8 log message.
�)�absolute_importN)�_)�getattr�setattr)�encoding�error�pycompat�	registrarsships-with-hg-core�	win32mbcs�encodingcCstjS�N)r�r
r
�1/usr/lib/python3/dist-packages/hgext/win32mbcs.py�<lambda>Ksr)�defaultcCs�t|t�r|�t�}||�t�kr|Std��t|t�r#ttt|��St|t�r-tt|�St|t	�rA|�
�D]
\}}t|�||<q6|S)NsNot local encoding)�
isinstance�bytes�decode�	_encoding�encode�UnicodeError�tuple�map�list�dict�items)�arg�uarg�k�vr
r
rrQs





rcCsnt|tj�r|�t�St|t�rttt|��St|t�r!tt|�St|t�r5|�	�D]
\}}t|�||<q*|Sr)
rr�unicoderrrrrrr)rrrr
r
rras




rcCsBzt|�}Wnty|}Ynw|r|ddvr|tj7}|S)N���s:/\)rrr�ossep)�s�usr
r
r�	appendsepns�
r%cCsd|D]}t||�r||i|��Sqz||||�i||����WSty1t�td�t��w)Ns8[win32mbcs] filename conversion failed with %s encoding
)rrr�Abortrr)�func�argtype�enc�dec�args�kwdsrr
r
r�basewrapperys
����r-cCst|tjtt||�Sr)r-rr rr�r'r+r,r
r
r�wrapper�sr/cCst|ttt||�Sr)r-�strrrr.r
r
r�reversewrapper�sr1cCsB|rt|�}t|d�|d<d|vrt|d�|d<||i|��S)Nrspath)rr%r.r
r
r�wrapperforlistdir�sr2csJ|�dd�\}}tj|}t||����fdd�}�j|_t|||�dS)N�.�cs��||�Srr
)r+r,�r'r/r
r�f�szwrapname.<locals>.f)�rsplit�sys�modulesr�__name__r)�namer/�moduler6r
r5r�wrapname�s

r=s:os.path.join os.path.split os.path.splitext
 os.path.normpath os.makedirs mercurial.util.endswithsep
 mercurial.util.splitpath mercurial.util.fscasesensitive
 mercurial.util.fspath mercurial.util.pconvert mercurial.util.normpath
 mercurial.util.checkwinfilename mercurial.util.checkosfilename
 mercurial.util.splitsRmercurial.encoding.upper mercurial.encoding.lower
 mercurial.util._filenamebytestrsos.path.splituncs�big5 big5-tw csbig5 big5hkscs big5-hkscs
 hkscs cp932 932 ms932 mskanji ms-kanji shift_jis csshiftjis shiftjis
 sjis s_jis shift_jis_2004 shiftjis2004 sjis_2004 sjis2004
 shift_jisx0213 shiftjisx0213 sjisx0213 s_jisx0213 950 cp950 ms950 cCs�tjjstjdkr|�td��dS|�dd�at�	�t
��vr_t��D]}t
|t�q$tjr;t��D]}t
|t�q3t
dt�t
dt�t��D]}t
|t�qIdtjvra|�dt�dSdSdS)	Nscygwins.[win32mbcs] cannot activate on this platform.
r
rsmercurial.util.listdirsmercurial.windows.listdirs--debugs([win32mbcs] activated with encoding: %s
)�os�path�supports_unicode_filenamesr�sysplatform�warnr�configr�lower�problematic_encodings�split�funcsr=r/�	iswindows�winfuncsr2�rfuncsr1r8�argv�writenoi18n)�uir6r
r
r�extsetup�s*



��rN) �__doc__�
__future__rr>r8�mercurial.i18nr�mercurial.pycompatrr�	mercurialrrrr	�
testedwith�configtable�
configitemrrrr%r-r/r1r2r=rGrJrIrErNr
r
r
r�<module>s:#
�



https://t.me/RX1948 - 2025