+
    iJ                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t^ RI
Ht ^ RIHt ^ RIHtHt ^ RIHtHtHt ^ RIHt ^ RIHtHtHtHtHtHtHt ]P>                  P@                  t ]P>                  PB                  t!]PD                  ! ]#4      t$]PJ                  ! R	4      t&]PJ                  ! R
4      t']PJ                  ! R]PP                  4      t)R R lt* ! R R]4      t+]PX                  ! ]+4       R# )    )annotationsN)replace)Any)
BadCommandInstallationError)
HiddenTextdisplay_pathhide_url)make_command)AuthInfoRemoteNotFoundErrorRemoteNotValidError
RevOptionsVersionControl(find_path_to_project_root_from_repo_rootvcsz(^git version (\d+)\.(\d+)(?:\.(\d+))?.*$z^[a-fA-F0-9]{40}$a/  ^
    # Optional user, e.g. 'git@'
    (\w+@)?
    # Server, e.g. 'github.com'.
    ([^/:]+):
    # The server-side path. e.g. 'user/project.git'. Must start with an
    # alphanumeric character so as not to be confusable with a Windows paths
    # like 'C:/foo/bar' or 'C:\foo\bar'.
    (\w[^:]*)
    $c                    V ^8  d   QhRRRR/# )   shastrreturnbool )formats   "[/Users/ahmad/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_internal/vcs/git.py__annotate__r   :   s     ' ' ' '    c                >    \        \        P                  V 4      4      # N)r   
HASH_REGEXmatch)r   s   &r   looks_like_hashr"   :   s    
  %&&r   c                    a  ] tR t^>tRtRtRtR0tR1tRt	]
R R l4       t]R V 3R ll4       tR	 R
 ltR R lt]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       tR R ltR2R R lltR2R R llt]R R l4       t]
R R  l4       t]R! R" l4       t]R3R# R$ ll4       t]R% R& l4       t]R' V 3R( ll4       t]R2R) R* ll4       t]R+ V 3R, ll4       t]
R- R. l4       t R/t!V ;t"# )4Gitgitz.gitcloneHEADc                    V ^8  d   QhRRRR/# )r   revr   r   z	list[str]r   )r   s   "r   r   Git.__annotate__O   s      s y r   c                	    V .# r   r   r)   s   &r   get_base_rev_argsGit.get_base_rev_argsN   s	    ur   c               $    V ^8  d   QhRRRRRR/# )r   argsr   kwargsr   r   r   )r   s   "r   r   r*   S   s!     4 4 4s 4s 4r   c                	   < \         P                  P                  R 4      '       d!   VP                  R/ 4      pRVR&   RVR&   W2R&   \        SV `  ! V/ VB # )PIP_NO_INPUTextra_environ0GIT_TERMINAL_PROMPTzssh -oBatchMode=yesGIT_SSH_COMMAND)osenvirongetsuperrun_command)clsr0   r1   r4   	__class__s   &*, r   r<   Git.run_commandR   sY    ::>>.))"JJ;M36M/0/DM+,&3?#w"D3F33r   c               $    V ^8  d   QhRRRRRR/# )r   urlr   destr   r   r   )r   s   "r   r   r*   [   s!     $ $S $ $ $r   c                	   V P                  \        V4      4      w  r4VP                  '       g   R # V P                  W$P                  4      '       g   R # \	        V P                  W$P                  4      ^ ,          4      pV'       * # )F)get_url_rev_optionsr
   r)   is_commit_id_equalr   get_revision_sha)selfrA   rB   _rev_optionsis_tag_or_branchs   &&&   r   is_immutable_rev_checkoutGit.is_immutable_rev_checkout[   sh    11(3-@&&t__==    5 5dOO LQ OP###r   c                   V ^8  d   QhRR/# )r   r   ztuple[int, ...]r   )r   s   "r   r   r*   i   s     : : :r   c                	    V P                  R .RRRR7      p\        P                  V4      pV'       g   \        P	                  RV4       R# \        VP                  ^4      4      \        VP                  ^4      4      3# )versionzgit versionFT)command_descshow_stdoutstdout_onlyzCan't parse git version: %sr   )r<   GIT_VERSION_REGEXr!   loggerwarningintgroup)rG   rO   r!   s   &  r   get_git_versionGit.get_git_versioni   ss    ""K&	 # 
 "''0NN8'BIEKKN#SQ%899r   c                    V ^8  d   QhRRRR/# r   locationr   r   
str | Noner   )r   s   "r   r   r*   w   s      # * r   c                    . ROpV P                  VRRRVR7      pVP                  4       pVP                  R4      '       d   V\        R4      R # R# )zT
Return the current branch, or None if HEAD isn't at a branch
(e.g. detached HEAD).
FTextra_ok_returncodesrQ   rR   cwdzrefs/heads/N)zsymbolic-ref-qr'      )r<   strip
startswithlen)r=   r\   r0   outputrefs   &&   r   get_current_branchGit.get_current_branchv   s]     .!% ! 
 lln>>-((s=)+,,r   c               $    V ^8  d   QhRRRRRR/# )r   rB   r   r)   r   ztuple[str | None, bool]r   )r   s   "r   r   r*      s"     + +C +c +6M +r   c                   V P                  RV.VRRRR7      p/ pVP                  4       P                  R4       F8  pVP                  R4      pV'       g   K   VP                  R^R	7      w  rgYdT&   K:  	  RV 2pRV 2p	VP                  V4      p
V
e   V
R3# VP                  V	4      p
V
R3#   \         d    \	        R
T: 24      hi ; i)z
Return (sha_or_none, is_branch), where sha_or_none is a commit hash
if the revision names a remote branch or tag, otherwise None.

Args:
  dest: the repository directory.
  rev: the revision name.
zshow-refFTignore)ra   rQ   rR   on_returncode
 )maxsplitzunexpected show-ref line: zrefs/remotes/origin/z
refs/tags/)r<   re   splitrstrip
ValueErrorr:   )r=   rB   r)   rh   refslineref_sharef_name
branch_reftag_refr   s   &&&        r   rF   Git.get_revision_sha   s     " ! 
  LLN((.D;;t$DH$(JJsQJ$?! %N / ,C51
se$hhz"?;hhwU|!  H !#=dX!FGGHs   B..C	c               $    V ^8  d   QhRRRRRR/# )r   rB   r   r)   r   r   r   )r   s   "r   r   r*      s!       3 4 r   c                    VP                  R4      '       d   R# \        V4      '       g   R# V P                  W4      '       d   R# R# )z
Return true if rev is a ref or is a commit that we don't have locally.

Branches and tags are not considered in this method because they are
assumed to be always available locally (which is a normal outcome of
``git clone`` and ``git fetch --tags``).
zrefs/TF)rf   r"   
has_commit)r=   rB   r)   s   &&&r   _should_fetchGit._should_fetch   s9     >>'""s##>>$$$r   c               (    V ^8  d   QhRRRRRRRR/# )r   rB   r   rA   r   rI   r   r   r   )r   s   "r   r   r*      s,     + ++'+6@+	+r   c           	        VP                   pVf   Q hV P                  W4      w  rVVe*   VP                  V4      p\        Y6'       d   TMRR7      pV# \	        V4      '       g   \
        P                  RV4       V P                  W4      '       g   V# V P                  \        RRW#P                  4       4      VR7       V P                  VRR7      pVP                  V4      pV# )	z
Resolve a revision to a new RevOptions object with the SHA1 of the
branch, tag, or ref if found.

Args:
  rev_options: a RevOptions object.
N)branch_namez:Did not find branch or tag '%s', assuming revision or ref.fetchrb   ra   
FETCH_HEADr,   )arg_revrF   make_newr   r"   rT   infor   r<   r   to_argsget_revision)r=   rB   rA   rI   r)   r   	is_branchs   &&&&   r   resolve_revisionGit.resolve_revision   s     !! --d8?%..s3K!+9CRVXK s##KKL
   ++ 	$-@-@-BC 	 	

 t6!**3/r   c               $    V ^8  d   QhRRRRRR/# )r   rB   r   namer]   r   r   r   )r   s   "r   r   r*     s!     . .c . . .r   c                >    V'       g   R# V P                  V4      V8H  # )z
Return whether the current commit hash equals the given name.

Args:
  dest: the repository directory.
  name: a string name.
F)r   )r=   rB   r   s   &&&r   rE   Git.is_commit_id_equal  s      %--r   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r   rB   r   rA   r   rI   r   	verbosityrV   r   Noner   )r   s   "r   r   r*     s4     =: =:=:(=:7A=:NQ=:	=:r   c                	   VP                  4       p\        P                  R W%\        V4      4       V^ 8:  d   RpMV^8X  d   RpMRpV P	                  4       R8  d#   V P                  \        RR.VOVNVN5!  4       M V P                  \        R.VOVNVN5!  4       VP                  '       d   V P                  WV4      p\        VRR4      p\        P                  RW74       VfP   V P                  WP                  4      '       g.   \        RRVP                  4       4      pV P                  WR7       MWV P                  V4      V8w  d   R	V 2p	RR
VRV	.pV P                  WR7       M"V P                  V4      p
VP                  V
4      p\        P                  RW#P                  4       V P!                  WR7       R# )zCloning %s%s to %sr&   z--filter=blob:noner   NzRev options %s, branch_name %scheckoutrb   r   zorigin/z-bz--trackzResolved %s to commit %sr   )z--quietr   )z	--verbosez
--progress)r      )
to_displayrT   r   r	   rX   r<   r   r)   r   getattrdebugrE   r   rj   r   r   update_submodules)rG   rB   rA   rI   r   rev_displayflagsr   cmd_argstrack_branchr   s   &&&&&      r   	fetch_newGit.fetch_new  s    ",,.(#L<NO>%1E!^E/E!W, (  	
  \'EEE3EEF???//;GK!+}dCKLL9;T" ..t__EE+"#++- H
 $$X$8((.+= ")6     4##D)C%..s3K.__E 	t9r   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r   r   )r   s   "r   r   r*   P  s<     : :: :  	:
 : 
:r   c                	    V P                  \        R RV4      VR7       . pV^ 8:  d   VP                  R4       \        R.VOVP                  4       N5!  pV P                  WaR7       V P	                  WR7       R# )configzremote.origin.urlr   rb   r   r   N)r<   r   appendr   r   rG   rB   rA   rI   r   extra_flagsr   s   &&&&&  r   switch
Git.switchP  s     	#6< 	 	

 >t$
P[P+:M:M:OP,t9r   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r   r   )r   s   "r   r   r*   f  s<     : :: :  	:
 : 
:r   c                	h   . pV^ 8:  d   VP                  R4       V P                  4       R	8  d   V P                  RR.VOVR7       MV P                  R.VOVR7       V P                  WV4      p\	        RR.VOVP                  4       N5!  pV P                  WaR7       V P                  WR7       R# )
r   rb   r   z--tagsr   resetz--hardr   N)rd   	   )r   rX   r<   r   r   r   r   r   s   &&&&&  r   update
Git.updatef  s     >t$ !V+gx>+>DIg44$?++D{C
 
 !	
 	,t9r   c                    V ^8  d   QhRRRR/# )r   r\   r   r   r   )r   s   "r   r   r*     s     7 7c 7c 7r   c                F   V P                  . RORRRVR7      pVP                  4       p V^ ,          pT F  pTP	                  R4      '       g   K  Tp M	  TP                  R4      ^,          pT P                  TP                  4       4      #   \         d    \        hi ; i)z
Return URL of the first remote encountered.

Raises RemoteNotFoundError if the repository does not have a remote
url configured.
FTr_   zremote.origin.url rr   )r   z--get-regexpzremote\..*\.urlrc   )r<   
splitlines
IndexErrorr   rf   rt   _git_remote_to_pip_urlre   )r=   r\   stdoutremotesfound_remoteremoterA   s   &&     r   get_remote_urlGit.get_remote_url  s     :!% ! 
 ##%	&"1:L F  !566%    %a())#))+66  	&%%	&s   	B B c                    V ^8  d   QhRRRR/# )r   rA   r   r   r   )r   s   "r   r   r*     s     ' 'C 'C 'r   c                D   \         P                  ! RV 4      '       d   V # \        P                  P	                  V 4      '       d%   \
        P                  ! V 4      P                  4       # \        P                  V 4      pV'       d   VP                  R4      # \        V 4      h)a  
Convert a remote url from what git uses to what pip accepts.

There are 3 legal forms **url** may take:

    1. A fully qualified url: ssh://git@example.com/foo/bar.git
    2. A local project.git folder: /path/to/bare/repository.git
    3. SCP shorthand for form 1: git@example.com:foo/bar.git

Form 1 is output as-is. Form 2 must be converted to URI and form 3 must
be converted to form 1.

See the corresponding test test_git_remote_url_to_pip() for examples of
sample inputs/outputs.
z\w+://zssh://\1\2/\3)rer!   r8   pathexistspathlibPurePathas_uri	SCP_REGEXexpandr   )rA   	scp_matchs   & r   r   Git._git_remote_to_pip_url  sw    " 88Is##J77>># ##C(//11OOC(	##$455!#&&r   c               $    V ^8  d   QhRRRRRR/# )r   r\   r   r)   r   r   r   )r   s   "r   r   r*     s!      # C D r   c                j     V P                  RRRRV,           .VRR7       R#   \         d     R# i ; i)zE
Check if rev is a commit that is available in the local repository.
	rev-parserb   z--verifyzsha^F)ra   log_failed_cmdT)r<   r   )r=   r\   r)   s   &&&r   r   Git.has_commit  sG    
		OOdJ=$    ! 		s   # 22c               $    V ^8  d   QhRRRRRR/# )r   r\   r   r)   r]   r   r   )r   s   "r   r   r*     s!     	# 	#C 	#j 	#C 	#r   c                	\    Vf   RpV P                  RV.RRVR7      pVP                  4       # )Nr'   r   FTrQ   rR   ra   )r<   re   )r=   r\   r)   current_revs   &&& r   r   Git.get_revision  sA    ;Coo#	 & 
   ""r   c                    V ^8  d   QhRRRR/# r[   r   )r   s   "r   r   r*     s     M M M
 Mr   c                d   V P                  RR.RRVR7      P                  4       p\        P                  P	                  V4      '       g    \        P                  P                  W4      p\        P                  P                  \        P                  P                  VR4      4      p\        W4      # )zy
Return the path to Python project root, relative to the repo root.
Return None if the project root is in the repo root.
r   z	--git-dirFTr   z..)r<   re   r8   r   isabsjoinabspathr   )r=   r\   git_dir	repo_roots   &&  r   get_subdirectoryGit.get_subdirectory  s     //+&	 " 

 %' 	 ww}}W%%ggll85GGGOOBGGLL$$?@	7LLr   c                    V ^8  d   QhRRRR/# )r   rA   r   r   z tuple[str, str | None, AuthInfo]r   )r   s   "r   r   r*     s     # #s #/O #r   c                4  < \        V4      w  r#rEpVP                  R4      '       d   VR\        VP                  R4      4      )  pV\        P
                  P                  V4      P                  RR4      P                  R4      ,           pVP                  R4      ^,           p	VRV	 \        W)R W8WV34      ,           pRV9  dA   RV9  g   Q hVP                  RR	4      p\        SV `-  V4      w  rpVP                  R
R4      pM\        SV `-  V4      w  rpWV3# )a  
Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
That's required because although they use SSH they sometimes don't
work with a ssh:// scheme (e.g. GitHub). But we need a scheme for
parsing. Hence we remove it again afterwards and return it as a stub.
fileN/\+z://zfile:zgit+z
git+ssh://zssh:// )urlsplitendswithrg   lstripurllibrequesturl2pathnamer   find
urlunsplitr;   get_url_rev_and_auth)r=   rA   schemenetlocr   queryfragmentinitial_slashesnewpath
after_plusr)   	user_passr>   s   &&          r   r   Git.get_url_rev_and_auth  s    19-X??6"""#;c$++c*:&;%;<O%(C(CD(I(Q(Qc)fSkG  S)A-J*%
$fuG) C #%%%++fl3C"''">s"CCi++h+C"''">s"CCi""r   c               $    V ^8  d   QhRRRRRR/# )r   r\   r   r   rV   r   r   r   )r   s   "r   r   r*     s!     
 
 
 
T 
r   c                	    . ROpV^ 8:  d   VP                  R4       \        P                  P                  \        P                  P	                  VR4      4      '       g   R# V P                  VVR7       R# )	submodulerb   z.gitmodulesNr   )r   r   z--initz--recursive)r   r8   r   r   r   r<   )r=   r\   r   argvs   &&& r   r   Git.update_submodules  sV    ?>KKww~~bggll8]CDD 	 	
r   c                    V ^8  d   QhRRRR/# r[   r   )r   s   "r   r   r*     s     2 23 2: 2r   c           	     	0  < \         SV `  V4      pV'       d   V#  V P                  R R.VRRRRR7      p\        P                  P                  TP                  R4      4      #   \         d    \        P                  RT4        R# \         d     R# i ; i)	r   z--show-toplevelFTraise)ra   rQ   rR   ro   r   zKcould not determine if %s is under git control because git is not availableNz
)r;   get_repository_rootr<   r   rT   r   r   r8   r   normpathru   )r=   r\   locrr>   s   &&  r   r   Git.get_repository_root  s    g)(3J	/0! %$   A" ww 011  	LL/
   		s   A# #!BBBBc                    V ^8  d   QhRRRR/# )r   repo_urlr   r   r   r   )r   s   "r   r   r*   6  s      C D r   c                    R# )zEIn either https or ssh form, requirements must be prefixed with git+.Tr   )r  s   &r   should_add_vcs_url_prefixGit.should_add_vcs_url_prefix5  s     r   r   )zgit+httpz	git+httpszgit+sshzgit+gitzgit+file)GIT_DIRGIT_WORK_TREE)r   r   )#__name__
__module____qualname____firstlineno__r   dirname	repo_nameschemesunset_environdefault_arg_revstaticmethodr-   classmethodr<   rK   rX   rj   rF   r   r   rE   r   r   r   r   r   r   r   r   r   r   r   r  __static_attributes____classcell__)r>   s   @r   r$   r$   >   s   DGIG 1MO  4 4$:  0 + +Z  , + +Z . .=:~:,:< 7 7: ' '<   	# 	# M M" # #< 
 
 2 20  r   r$   )-
__future__r   loggingos.pathr8   r   r   urllib.parser   urllib.requestdataclassesr   typingr   pip._internal.exceptionsr   r   pip._internal.utils.miscr   r	   r
   pip._internal.utils.subprocessr    pip._internal.vcs.versioncontrolr   r   r   r   r   r   r   parser   r   	getLoggerr  rT   compilerS   r    VERBOSEr   r"   r$   registerr   r   r   <module>r)     s    "    	     B G G 7   <<  \\$$
 
		8	$ JJ  ZZ+,
 JJ		 JJ	'z. zz S r   