
    q"h-                     f   S SK r S SKrS SKrS SKJrJrJr  S SKJrJ	r	J
r
JrJr  S SKJrJr  S SKJrJrJrJrJr  \ R,                  " \5      r\R2                  " S5      r\R2                  " S5      r\R2                  " S5      r\R2                  " S	5      r " S
 S\5      r\R>                  " \5        g)    N)ListOptionalTuple)
HiddenTextdisplay_pathis_console_interactiveis_installable_dirsplit_auth_from_netloc)CommandArgsmake_command)AuthInfoRemoteNotFoundError
RevOptionsVersionControlvcszurl="([^"]+)"zcommitted-rev="(\d+)"z\s*revision="(\d+)"z<url>(.*)</url>c                   L  ^  \ rS rSrSrSrSrSr\S\	S\
4S j5       r\S	\	S\\	   4S
 j5       r\S\	S\	4S j5       r\S\	S\	S\\	\\\	   \\	   4   4   4U 4S jj5       r\S\	S\\	\\	   \4   4U 4S jj5       r\S\\	   S\\   S\4S j5       r\S\	S\	4S j5       r\S\	S\\\	   \4   4S j5       r\S\	S\\	   S\
4S j5       rS'S\\
   SS4U 4S jjjrS\\S4   4S jrS\\S4   4S jrS\4S  jrS\	S\S!\ S"\SS4
S# jr!S\	S\S!\ SS4S$ jr"S\	S\S!\ SS4S% jr#S&r$U =r%$ )(
Subversion   svnz.svncheckout)zsvn+sshzsvn+httpz	svn+httpszsvn+svnzsvn+file
remote_urlreturnc                     g)NT )clsr   s     N/var/www/html/env/lib/python3.13/site-packages/pip/_internal/vcs/subversion.pyshould_add_vcs_url_prefix$Subversion.should_add_vcs_url_prefix$   s        revc                 
    SU /$ )Nz-rr   )r    s    r   get_base_rev_argsSubversion.get_base_rev_args(   s    c{r   locationc                    Sn[         R                  " U5       H  u  p4nU R                  U;  a  / USS& M  UR                  U R                  5        [         R                  R                  X0R                  S5      n[         R                  R                  U5      (       d  M  U R                  U5      u  pxX1:X  a  Uc   eUS-   nO$U(       a  UR                  U5      (       d  / USS& M  [        X(5      nM     [        U5      $ )zB
Return the maximum revision for all files under a given location
r   Nentries/)oswalkdirnameremovepathjoinexists_get_svn_url_rev
startswithmaxstr)	r   r$   revisionbasedirs_
entries_fndirurllocalrevs	            r   get_revisionSubversion.get_revision,   s     WWX.MD{{$&QKK$dKKCJ77>>*--"33D9F)))|6#4#4T#:#:Q8.H% /& 8}r   netlocschemec                 D   > US:X  a  [         TU ]  X5      $ [        U5      $ )z
This override allows the auth information to be passed to svn via the
--username and --password options instead of via the URL.
ssh)superget_netloc_and_authr
   )r   r<   r=   	__class__s      r   rA   Subversion.get_netloc_and_authI   s)     U? 7.v>>%f--r   urlc                 f   > [         TU ]  U5      u  pnUR                  S5      (       a  SU-   nXU4$ )Nzssh://zsvn+)r@   get_url_rev_and_authr0   )r   rD   r    	user_passrB   s       r   rF   Subversion.get_url_rev_and_authX   s<     $g:3?)>>(##3,C""r   usernamepasswordc                 B    / nU (       a  USU /-  nU(       a  USU/-  nU$ )Nz
--usernamez
--passwordr   )rI   rJ   
extra_argss      r   make_rev_argsSubversion.make_rev_args`   s3     #%
<22J<22Jr   c                 
   Un[        U5      (       dT  Un[        R                  R                  U5      nX:X  a  [        R                  SU5        [        e[        U5      (       d  MT  U R                  U5      u  pEUc  [        eU$ )NzMCould not find Python project for directory %s (tried all parent directories))r	   r(   r,   r*   loggerwarningr   r/   )r   r$   orig_locationlast_locationrD   _revs         r   get_remote_urlSubversion.get_remote_urll   s     !$X..$Mwwx0H( *!
 *) %X.. ((2	;%%
r   c                 <   SSK Jn  [        R                  R	                  XR
                  S5      n[        R                  R                  U5      (       a%  [        U5       nUR                  5       nS S S 5        OSnS nWR                  S5      (       d,  UR                  S5      (       d  UR                  S5      (       a  [        [        [        R                  UR                  S5      5      5      nUS   S	 US   S	   nU Vs/ s H.  n[        U5      S
:  d  M  US
   (       d  M   [!        US
   5      PM0     snS/-   n	GOUR                  S5      (       a  ["        R%                  U5      n
U
(       d  ['        SU< 35      eU
R)                  S5      n[*        R-                  U5       Vs/ s H  n[!        UR)                  S5      5      PM     snS/-   n	O} U R/                  SSU/SSS9n[0        R%                  U5      n
U
c   eU
R)                  S5      n[2        R-                  U5       Vs/ s H  n[!        UR)                  S5      5      PM     n	nU	(       a  [5        U	5      nXm4$ SnXm4$ ! , (       d  f       GN= fs  snf s  snf s  snf ! U a    S / p NFf = f)Nr   )InstallationErrorr&    8910z

   	   z<?xmlzBadly formatted data:    infoz--xmlFTshow_stdoutstdout_only)pip._internal.exceptionsrX   r(   r,   r-   r*   r.   openreadr0   listmapr2   
splitlinessplitlenint_svn_xml_url_research
ValueErrorgroup_svn_rev_refinditerrun_command_svn_info_xml_url_re_svn_info_xml_rev_rer1   )r   r$   rX   entries_pathfdatarD   r&   drevsmatchmxmlr    s                 r   r/   Subversion._get_svn_url_rev   s?   >ww||Hkk9E77>>,''l#qvvx $# D??34??3#7#74??4;P;P3s~~tzz*/EFGG
1!*Q-C'.Fw!#a&1*I1IC!IwF!LD__W%%#**40E #9$!BCC++a.C-8-A-A$-GH-GC
O-GHA3ND% ooWh/ % $ & 
 -33C8(((kk!n1E1N1Ns1ST1SAAGGAJ1ST d)C x CxU $# G I" U$ % "T%sI    I.J J 'J +$JAJ .$J
J .
I=
J 	JJdestnamec                     g)z&Always assume the versions don't matchFr   )r   r   r   s      r   is_commit_id_equalSubversion.is_commit_id_equal   s     r   Nuse_interactivec                 V   > Uc
  [        5       nXl        S U l        [        TU ]  5         g N)r   r   _vcs_versionr@   __init__)selfr   rB   s     r   r   Subversion.__init__   s,    "46O. 8<r   .c                 4   SnU R                  S/SSS9nUR                  U5      (       d  gU[        U5      S R                  5       S   nUR	                  S	5      S   R                  S
5      n [        [        [        U5      5      nU$ ! [         a     gf = f)zQuery the version of the currently installed Subversion client.

:return: A tuple containing the parts of the version information or
    ``()`` if the version returned from ``svn`` could not be parsed.
:raises: BadCommand: If ``svn`` is not installed.
zsvn, version z	--versionFTra   r   Nr   -.)	rs   r0   rk   rj   	partitiontuplerh   rl   ro   )r   version_prefixversionversion_listparsed_versions        r   call_vcs_versionSubversion.call_vcs_version   s     )""K=eQU"V!!.11#n-/0668;((-a066s;	"3sL#9:N   		s   /B
 

BBc                 d    U R                   b  U R                   $ U R                  5       nXl         U$ )a]  Return the version of the currently installed Subversion client.

If the version of the Subversion client has already been queried,
a cached value will be used.

:return: A tuple containing the parts of the version information or
    ``()`` if the version returned from ``svn`` could not be parsed.
:raises: BadCommand: If ``svn`` is not installed.
)r   r   )r   vcs_versions     r   get_vcs_versionSubversion.get_vcs_version   s8     ( $$$++-'r   c                 `    U R                   (       d  S/$ U R                  5       nUS:  a  S/$ / $ )a  Return options to be used on calls to Subversion that contact the server.

These options are applicable for the following ``svn`` subcommands used
in this class.

    - checkout
    - switch
    - update

:return: A list of command line arguments to pass to ``svn``.
z--non-interactive)r_      z--force-interactive)r   r   )r   svn_versions     r   get_remote_call_options"Subversion.get_remote_call_options   s>     ## (((**, & )**	r   rev_options	verbosityc                     UR                  5       n[        R                  SUU[        U5      5        US::  a  S/nO/ n[	        S/UQU R                  5       PUR                  5       PUPUP76 nU R                  U5        g )NzChecking out %s%s to %sr   z--quietr   )
to_displayrP   r`   r   r   r   to_argsrs   )r   r   rD   r   r   rev_displayflagscmd_argss           r   	fetch_newSubversion.fetch_new  s     ",,.%		
 >KEE

 ((*
 !	

 
 
 	"r   c                 |    [        SU R                  5       UR                  5       UU5      nU R                  U5        g )Nswitchr   r   r   rs   r   r   rD   r   r   s        r   r   Subversion.switch0  s=    ((*!
 	"r   c                 z    [        SU R                  5       UR                  5       U5      nU R                  U5        g )Nupdater   r   s        r   r   Subversion.update:  s:    ((*!	
 	"r   )r   r   r   )&__name__
__module____qualname____firstlineno__r   r*   	repo_nameschemesclassmethodr2   boolr   staticmethodr   r"   r:   r   r   rA   r   rF   r   r   rM   rU   rl   r/   r   r   r   r   r   r   r   r   r   __static_attributes____classcell__)rB   s   @r   r   r      sr   DGIIG3 4   s tCy   C C  8 .."%.	sE(3-#677	8. . #s #uS(3-5Q/R # # 	3-	+3J+?			 	 c c  . / /hsmS6H0I / /b c # 4   $  %S/ 8sCx ( >##(#7A#NQ#	#0#3 #Z #j #T ##3 #Z #j #T # #r   r   ) loggingr(   retypingr   r   r   pip._internal.utils.miscr   r   r   r	   r
   pip._internal.utils.subprocessr   r    pip._internal.vcs.versioncontrolr   r   r   r   r   	getLoggerr   rP   compilerm   rq   ru   rt   r   registerr   r   r   <module>r      s     	 	 ( (  E  
		8	$**_-jj12zz"89 zz"45 c# c#L	 Z r   