
    ͆ho                        S SK Jr  S SKrS SKrS SKrS SKrS SKJr  S SKrS SK	J
r
  S SKrS SKJr  \(       a  S SKJr  \R                   " \5      rSrSS jrSS	 jrSS
 jrSS jr     S     SS jjrg)    )annotationsN)TYPE_CHECKING)version)Abort)MkDocsConfigz-Deployed {sha} with MkDocs version: {version}c                     [         R                  " / SQ[         R                  [         R                  S9n U R                  5         U R                  5       S:H  $ ! [         a!    [        R                  S5        [        S5      ef = f)N)git	rev-parsez--is-inside-work-treestdoutstderrz6Could not find git - is it installed and on your path?Deployment Aborted!r   )	
subprocessPopenPIPEFileNotFoundErrorlogerrorr   communicatewait)procs    Q/opt/services/DDDS/venv/lib/python3.13/site-packages/mkdocs/commands/gh_deploy.py_is_cwd_git_repor      sq    +9????
 	99;!	  +		JK)**+s   4A +Bc                    [         R                  " / SQU =(       d    S [         R                  [         R                  S9nUR                  5       u  p#UR	                  S5      R                  5       nU$ )N)r	   r
   z--shortHEAD)cwdr   r   utf-8)r   r   r   r   decodestrip)	repo_pathr   r   _shas        r   _get_current_shar#   %   sY    /	D   "IF
--
 
&
&
(CJ    c                R   SU  S3n[         R                  " SSSU/[         R                  [         R                  S9nUR                  5       u  p4UR	                  S5      R                  5       nSU;   a  UR                  SS	5      u  pgXg4$ S
U;   a  UR                  S
S	5      u  pgXg4$ g)Nzremote.z.urlr	   configz--getr   r   zgithub.com/   zgithub.com:)NN)r   r   r   r   r   r   split)remote_nameremoter   r   r!   urlhostpaths           r   _get_remote_urlr.   2   s     {m4(F	'6*D   "IF
--
 
&
&
(CYY}a0

 :	 
#	YY}a0
 : r$   c                   [         R                  " SSSSSU  3/[         R                  [         R                  S9nUR                  5       u  p#UR	                  S5      R                  5       n[        R                  " SU[        R                  [        R                  -  5      nU(       a$  [        R                  " UR                  5       5      OS n[        R                  " [        R                  5      nU(       d  [        R!                  S	5        g Xv:  a  [        R#                  S
U SU S35        g Xv:  a'  [        R%                  SU SU S35        ['        S5      eg )Nr	   showz-sz--format=%szrefs/heads/r   r   z0\d+(\.\d+)+((a|b|rc)\d+)?(\.post\d+)?(\.dev\d+)?zCVersion check skipped: No version specified in previous deployment.z1Previous deployment was done with MkDocs version z*; you are deploying with a newer version ()zHDeployment terminated: Previous deployment was made with MkDocs version z6; you are attempting to deploy with an older version (z)). Use --ignore-version to deploy anyway.r   )r   r   r   r   r   r   researchXIr   parsegroupmkdocs__version__r   warninginfor   r   )branchr   r   r!   msgm	previousvcurrentvs           r   _check_versionrA   H   s/   	m{6(-CDD   "IF
--
 
&
&
(C
		EsBDDSUSWSWKXA,-aggi(4I}}V//0HYZ		?	{ K77?jC	
 
			VW`Va bCCK* M  	

 )** 
r$   c                   [        5       (       d  [        R                  S5        U R                  nU R                  nU(       d  [        U5        Uc  [        n[        [        R                  R                  U R                  5      5      nUR                  [        R                  US9n[        R                  SU R                   U R                  5         ["        R"                  " U R                   UUUSUUUSS9	  [        R                  R+                  U R                   S5      n
[        R                  R-                  U
5      (       a`  [/        U
5       nUR1                  5       R3                  5       nS S S 5        [        R                  S	W 35        [        R                  S
5        g [5        U5      u  pUb  Uc  [        R                  S5        g UR7                  SS5      u  nnUR9                  S5      (       a  US [;        S5      *  nSU SU S3n[        R                  SU 35        g ! ["        R$                   a2  n	[        R                  SU	R&                   35        [)        S5      eS n	A	ff = f! , (       d  f       GN= f)NzECannot deploy - this directory does not appear to be a git repository)r   r"   z2Copying '%s' to '%s' branch and pushing to GitHub.T)mesgr*   r<   pushforce	use_shell
no_historynojekyllz(Failed to deploy to GitHub with error: 
r   CNAMEzTBased on your CNAME file, your documentation should be available shortly at: http://zSNOTE: Your DNS records must be configured appropriately for your CNAME URL to work.z/Your documentation should be available shortly./r'   z.gitzhttps://z.github.io/z3Your documentation should shortly be available at: )r   r   r   remote_branchr)   rA   default_messager#   osr-   dirnameconfig_file_pathformatr8   r9   r;   site_dir
ghp_importGhpErrormessager   joinisfileopenreadr   r.   r(   endswithlen)r&   rT   rE   rG   ignore_versionshellrK   r)   r"   e
cname_filef
cname_hostr,   r-   usernamerepor+   s                     r   	gh_deployrc   d   s    		YZ((M$$K}%!
277??6+B+BC
DCnnV%7%7SnAGHH<+OO !
	
 foow7J	ww~~j!!*)J ,,6<9	
 	a	
 	 -JD|t|BCC+$==  3v;,'D
+dV15FseLM;  +		=aii[IJ)**+ s$   &H- I6-I3-I..I36
J)returnbool)rd   str)r)   rf   rd   z#tuple[str, str] | tuple[None, None])r<   rf   rd   None)NFFFF)r&   r   rT   z
str | Nonerd   rg   )
__future__r   loggingrM   r2   r   typingr   rR   	packagingr   r8   mkdocs.exceptionsr   mkdocs.config.defaultsr   	getLogger__name__r   rL   r   r#   r.   rA   rc    r$   r   <module>rq      s    "  	 	       #3!E
,+< 

ENENEN 
ENr$   