ó
    ‘óýj«$  ã                   ó®  • S r / SQrSSKrSSKrSSKJrJr  SSKJr  SSK	J
r
Jr  SSKJr  SS	KJrJrJr  \R$                  " S
/ SQ5      rS\\-  S\\\4   4S jrS\S-  S\S\S\\-  S\S\S\4S jrS\S\4S jrS\\
\   -  \-  S\\SS4   4S jrS#S\S\S\SS4S jjr   S$S\S\S-  S\S-  S\\/\4   S-  S\4
S  jjrS!\S\\SS4   4S" jr g)%z-Utilities for reading and generating reflogs.)ÚEntryÚdrop_reflog_entryÚexpire_reflogÚformat_reflog_lineÚiter_reflogsÚparse_reflog_lineÚparse_reflog_specÚread_reflogé    N)ÚCallableÚ	Generator)ÚPath)ÚIOÚBinaryIOé   )Ú_GitFile)ÚZERO_SHAÚformat_timezoneÚparse_timezoner   ©Úold_shaÚnew_shaÚ	committerÚ	timestampÚtimezoneÚmessageÚrefspecÚreturnc                 ón  • [        U [        5      (       a  U R                  S5      n SU ;  a  [        SU < S35      eU R	                  SS5      u  pUR                  S5      (       d  [        SU < S35      eUSS nUR                  5       (       d  [        S	U< S
35      eU(       d  SnU[        U5      4$ )a8  Parse a reflog specification like 'HEAD@{1}' or 'refs/heads/master@{2}'.

Args:
    refspec: Reflog specification (e.g., 'HEAD@{1}', 'master@{0}')

Returns:
    Tuple of (ref_name, index) where index is in Git reflog order (0 = newest)

Raises:
    ValueError: If the refspec is not a valid reflog specification
úutf-8s   @{zInvalid reflog spec: z. Expected format: ref@{n}r   ó   }NéÿÿÿÿzInvalid reflog index: z. Expected integer in ref@{n}s   HEAD)Ú
isinstanceÚstrÚencodeÚ
ValueErrorÚsplitÚendswithÚisdigitÚint)r   ÚrefÚrestÚ	index_strs       Ú9/usr/local/lib/python3.13/site-packages/dulwich/reflog.pyr   r   2   sÍ   € ô �'œ3×ÑØ—.‘. Ó)ˆà�GÓÜØ# G¡;Ð.JÐKó
ð 	
ð —‘˜e QÓ'�I€CØ�=‰=˜×ÑÜØ# G¡;Ð.JÐKó
ð 	
ð �S�b�	€IØ×Ñ×ÑÜØ$ Y¡MÐ1PÐQó
ð 	
ö
 Øˆà”�I“ÐÐó    r   r   r   r   r   r   c                 óæ   • U c  [         n SR                  UR                  5       5      nU S-   U-   S-   U-   S-   [        [	        U5      5      R                  S5      -   S-   [        U5      -   S-   U-   $ )zÀGenerate a single reflog line.

Args:
  old_sha: Old Commit SHA
  new_sha: New Commit SHA
  committer: Committer name and e-mail
  timestamp: Timestamp
  timezone: Timezone
  message: Message
ó    Úasciió   	)r   Újoinr&   r#   r)   r$   r   r   s         r-   r   r   Y   s¥   € ð$ �Üˆð
 �i‰i˜Ÿ™›Ó(€GàØ
ñ	à
ñ	ð ñ	ð ñ		ð
 ñ	ô Œc�)‹nÓ
×
$Ñ
$ WÓ
-ñ	.ð ñ	ô ˜(Ó
#ñ	$ð ñ		ð ñ
	ðr.   Úlinec           	      óÈ   • U R                  SS5      u  pUR                  SS5      u  p4nUR                  SS5      u  pgn[        UUU[        U5      [	        U5      S   U5      $ )z„Parse a reflog line.

Args:
  line: Line to parse
Returns: Tuple of (old_sha, new_sha, committer, timestamp, timezone,
    message)
r2   r   r0   é   r
   )r&   Úrsplitr   r)   r   )	r4   Úbeginr   r   r   r+   r   Útimestamp_strÚtimezone_strs	            r-   r   r   �   so   € ð —z‘z %¨Ó+Ñ€UØ$Ÿ{™{¨4°Ó3Ñ€W�tØ/3¯{©{¸4ÀÓ/CÑ,€Y˜|ÜØØØÜˆMÓÜ�|Ó$ QÑ'Øóð r.   Úfc              #   óV   #   • U  H  n[        UR                  S5      5      v •  M!     g7f)zORead reflog.

Args:
  f: File-like object
Returns: Iterator over Entry objects
ó   
N)r   Úrstrip)r;   r4   s     r-   r	   r	   –   s%   é € ó ˆÜ §¡¨EÓ 2Ó3Ô3ò ùs   ‚')ÚindexÚrewritec                 óT  • US:  a  [        SU 35      e/ nU R                  5       nU  H>  nUR                  U[        UR	                  S5      5      45        U R                  5       nM@     [        U5      U-
  S-
  nX6   S   nU R                  U5        US:X  a  U R                  5         gX6	 U(       az  US:”  at  U(       am  US:X  a  [        nOX6S-
     S   R                  nX6   u  pIU[        UU	R                  U	R                  U	R                  U	R                  U	R                  5      4X6'   X6S  Hc  u  p©U R                  [!        U	R"                  U	R                  U	R                  U	R                  U	R                  U	R                  5      S-   5        Me     U R                  5         g)a  Drop the specified reflog entry.

Args:
    f: File-like object
    index: Reflog entry index (in Git reflog reverse 0-indexed order)
    rewrite: If a reflog entry's predecessor is removed, set its
        old SHA to the new SHA of the entry that now precedes it
r
   zInvalid reflog index r=   r   N)r%   ÚtellÚappendr   r>   ÚlenÚseekÚtruncater   r   r   r   r   r   r   Úwriter   r   )r;   r?   r@   ÚlogÚoffsetr4   Úinverse_indexÚwrite_offsetÚprevious_newÚentryÚ_s              r-   r   r   £   s…  € ð ˆqƒyÜÐ0°°Ð8Ó9Ð9à
€CØ�V‰V‹X€FÛˆØ�
‰
�FÔ-¨d¯k©k¸%Ó.@ÓAÐBÔCØ—‘“Šñ ô ˜“H˜uÑ$ qÑ(€MØÑ% aÑ(€LØ‡F�Fˆ<Ôà�ƒzØ	�
‰
ŒØàÐÞ�5˜1“9¦Ø˜AÓÜ#‰Là¨qÑ0Ñ1°!Ñ4×<Ñ<ˆLØÑ*‰ˆàÜØØ—‘Ø—‘Ø—‘Ø—‘Ø—‘óð

ˆÑð ˜Ó'‰ˆØ	�‰ÜØ—‘Ø—‘Ø—‘Ø—‘Ø—‘Ø—‘óð ñö
	
ñ (ð ‡J�J…Lr.   Úexpire_timeÚexpire_unreachable_timeÚreachable_checkerc                 óÔ  • Uc  Uc  g/ nU R                  5       nU  H>  nUR                  U[        UR                  S5      5      45        U R                  5       nM@     / nSnU Hp  u  pYSn
SnUb  U" U	R                  5      nU(       a  Ub  U	R
                  U:  a  Sn
OUb  U	R
                  U:  a  Sn
U
(       a  US-  nM^  UR                  XY45        Mr     US:”  aŠ  U R                  S5        U Hc  u  pÉU R                  [        U	R                  U	R                  U	R                  U	R
                  U	R                  U	R                  5      S-   5        Me     U R                  5         U$ )aH  Expire reflog entries based on age and reachability.

Args:
    f: File-like object for the reflog
    expire_time: Expire entries older than this timestamp (seconds since epoch).
        If None, entries are not expired based on age alone.
    expire_unreachable_time: Expire unreachable entries older than this
        timestamp. If None, unreachable entries are not expired.
    reachable_checker: Optional callable that takes a SHA and returns True
        if the commit is reachable. If None, all entries are considered
        reachable.

Returns:
    Number of entries expired
r
   r=   FTr   )rB   rC   r   r>   r   r   rE   rG   r   r   r   r   r   rF   )r;   rO   rP   rQ   ÚentriesrI   r4   Úkept_entriesÚexpired_countrM   Úshould_expireÚis_reachablerN   s                r-   r   r   ß   s]  € ð* ÑÐ6Ñ>Øà€GØ�V‰V‹X€FÛˆØ�‰˜Ô 1°$·+±+¸eÓ2DÓ EÐFÔGØ—‘“Šñ ð
 €LØ€Mã ‰ˆØˆð ˆØÑ(Ù,¨U¯]©]Ó;ˆLö ØÑ&¨5¯?©?¸[Ó+HØ $�øð (Ñ3Ø—O‘OÐ&=Ó=à $�æØ˜QÑŠMà×Ñ  Ö0ñ/ !ð4 �qÓØ	�‰ˆqŒ	Û$‰HˆAØ�G‰GÜ"Ø—M‘MØ—M‘MØ—O‘OØ—O‘OØ—N‘NØ—M‘Móð ñö
ñ %ð 	
�
‰
ŒàÐr.   Úlogs_dirc              #   ód  #   • [         R                  R                  U 5      (       d  g[        U 5      nUR	                  S5       Hg  nUR                  5       (       d  M  [        UR                  U5      5      nUR                  [         R                  S5      nUR                  S5      v •  Mi     g7f)z¦Iterate over all reflogs in a repository.

Args:
    logs_dir: Path to the logs directory (e.g., .git/logs)

Yields:
    Reference names (as bytes) that have reflogs
NÚ*Ú/r   )ÚosÚpathÚexistsr   ÚrglobÚis_filer#   Úrelative_toÚreplaceÚsepr$   )rX   Ú	logs_pathÚlog_fileÚref_names       r-   r   r   .  s‚   é € ô �7‰7�>‰>˜(×#Ñ#Øä�X“€IØ—O‘O CÖ(ˆØ×Ñ×Óä˜8×/Ñ/°	Ó:Ó;ˆHà×'Ñ'¬¯©°Ó4ˆHØ—/‘/ 'Ó*Ô*ò )ùs   ‚AB0ÁAB0)F)NNN)!Ú__doc__Ú__all__Úcollectionsr\   Úcollections.abcr   r   Úpathlibr   Útypingr   r   Úfiler   Úobjectsr   r   r   Ú
namedtupler   r#   ÚbytesÚtupler)   r   Úfloatr   r   r	   Úboolr   r   r   © r.   r-   Ú<module>ru      s’  ðñ, 4ò	€ó Û 	ß /Ý ß å ß >Ñ >à×ÒØÚKó	€ð$˜s U™{ð $¨u°U¸C°ZÑ/@ô $ðN%Ø�T‰\ð%àð%ð ð%ð �U‰{ð	%ð
 ð%ð ð%ð ô%ðP˜Eð  eô ð*
4Ø�"�U‘)Ñ˜hÑ&ð
4àˆu�d˜DÐ Ñ!ô
4ñ9˜ð 9¨#ð 9¸ð 9Èõ 9ð| #Ø*.Ø8<ñ	LØðLà�t‘ðLð ! 4™ZðLð    ¨ Ñ.°Ñ5ð	Lð
 	õLð^+˜3ð + 9¨U°D¸$Ð->Ñ#?õ +r.   