+
    jHàjÞš  ã                  ó¨  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIt]P                  ! ]4      tRHtRRRRRR]P                    23t]! 0 RIm4      t]! 0 RJm4      t]! 0 RKm4      t^t ! R R	]4      tR
tRRRR/tR]R&   RR/R R lltR R ltRLR R lltR R ltR R lt R R lt!R R lt"R t#R  R! lt$R" R# lt%R$ R% lt&R&R/R' R( llt'R&R/R) R* llt(R+ R, lt)^t*R- R. lt+]! R/04      t,R0t-R1 R2 lt.R3 R4 lt/R5 R6 lt0R7 R8 lt1R9t2^Wt3R:]2 R;]3 R<2t4R= R> lt5R? R@ lt6RAt7]Pp                  R&RBRCR/RD RE ll4       t9RF RG lt:R# )Mu¸  Checkout custody for the updater's children (R2): the ONE spawn policy for every git (and the
Node build) an update starts.

The checkout kernel lock (``update_lock``) must stay held while any process of the update tree
can still write the checkout, and must NOT leak into processes that outlive the update:

* Every updater git call carries ``-c gc.autoDetach=false -c maintenance.auto=false``: git never
  forks a detached gc/maintenance child that would inherit (POSIX) or outlive (Windows) the lock.
* POSIX: the lock fd is inherited ONLY by git commands that mutate the worktree, index or refs
  locally (:data:`LOCAL_MUTATORS`, run with ``core.fsmonitor=false`` so no fsmonitor daemon
  starts under them, with no credential helper and no repository hooks). Network/credential commands (fetch,
  ls-remote, credential) and readers run without it: a ``git credential-cache--daemon`` they
  start never holds the checkout. A partial clone's mutator would lazily fetch the objects a move
  needs as a child holding the fd (and start the daemon under it), so before a move the objects
  are fetched without the fd and with the user's helpers (:func:`_prefetch_for_move`); a lazy
  fetch the prefetch missed still runs, just without a helper. A killed fetch that leaves
  ``*.lock`` ref files is recovered by the stale-lock rules (``gitlock.clear_stale_git_locks``).
* Windows has no fd inheritance: while this process holds (or joined) the checkout lock, every
  child started here is created SUSPENDED, assigned to the update's kill-on-close job and only
  then resumed, so it and everything it spawns die with the lock owner. The Node build goes
  through ``pm.progress.run_contained`` (whose Popen it never sees): :func:`contained_command`
  wraps it in a stdlib launcher that joins the job before it starts node and, once node exits,
  terminates and waits out everything node left running (C3): a normal release never frees the
  checkout under a build descendant.
* Windows fails CLOSED (D2): a child the job refuses is never run. The msvcrt byte lock belongs
  to the process that took it â€” an inherited handle does not keep it, the kernel unlocks it when
  the owner exits â€” so nothing else could fence a writer outside the job: after the owner's
  death the lock would be free while it still wrote. A refused bind kills the still-suspended
  child; a refused launcher join exits before it starts node; either raises
  :class:`CustodyRefused`, a clear refusal of that step instead of an unfenced writer.

Every updater git runner (``update_cmd._git_run``, ``update_cmd_git._git_run``,
``update_cmd_stash``, ``update_cmd_check``, ``gitlock``, ``update_cmd_commit``,
``_early_recovery``'s restore) calls :func:`run_git`.
Not covered, on purpose: the read-only release/check readers (``source_releases``,
``source_check``: ``ls-remote``, ``cherry``, ``rev-parse``) run their own probes; they never get
the lock fd and write nothing, so they cannot leak or outlive custody of the checkout.
)ÚannotationsN)ÚSequenceú-czcore.fsmonitor=falsezcredential.helper=zcore.hooksPath=c                  ó2   a € ] tR t^TtRtR V 3R lltRtV ;t# )ÚCustodyRefusedzÒWindows would not put an update child in the update's kill-on-close job, so the child was
never run (D2): outside the job it could outlive a killed update and write the checkout after
the checkout lock is free.c               ó$   € V ^8„  d   QhRRRRRR/# )é   ÚargvúSequence[str]ÚcauseÚobjectÚreturnÚNone© )Úformats   "Ú>/home/ubuntu/.hermes/hermes-agent/hermes_cli/update_custody.pyÚ__annotate__ÚCustodyRefused.__annotate__Y   s&   € ÷ Rñ R˜]ð R°6ð R¸dñ Ró    c                	óú   <€ ^ RI pV'       d,   VP                  P                  \        V^ ,          4      4      MRpRV RV R2V n        \
        SV `  V P                   R\        P                  RR7       24       R# )	é    NÚchildzWindows would not put `z ` in this update's process job (zˆ), so it was not run: a checkout writer outside the job could outlive a killed update and write the checkout after its lock is released.Ú zthe command©Úcommand)	ÚosÚpathÚbasenameÚstrÚreasonÚsuperÚ__init__Ú_RETRYr   )Úselfr	   r   r   ÚnameÚ	__class__s   &&&  €r   r!   ÚCustodyRefused.__init__Y   sp   ø€ Ûç15ˆr�w‰w×Ñ¤ D¨¥G£Ô-¸7ˆà% d VÐ+KÈEÈ7ð S3ð 3ð 	Œô 	‰Ñ˜DŸK™K˜=¨¬&¯-©-À¨-Ó*NÐ)OÐPÖQr   )r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r!   Ú__static_attributes__Ú__classcell__)r%   s   @r   r   r   T   s   ø† ñ"÷Rö Rr   r   zoRun {command} again from a regular terminal, outside any sandbox or tool that confines the processes it starts.ÚranFÚrefusedÚdictÚ_RUNÚ	receiptedc               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   r	   r
   r   r   r2   Úboolr   r   r   )r   s   "r   r   r   o   s(   € ÷ ñ �-ð ¨ð ¸dð È~ñ r   c               ó&  € \        V \        \        34      '       d   \        V 4      MV .p \        W4      pVP                   RRP                  R V R,           4       4       2pV'       gR   \        P                  RV4       \        P                  ! \        4      ;_uu_ 4        ^ RIHp V! RRV4       R	R	R	4       \        R
,          f3   T\        R,          '       * ;'       d    \        4       '       * 3\        R
&   V#   + '       g   i     LS; i)zŒThe :class:`CustodyRefused` for ``argv``: logged, noted in the receipt (unless the caller
already did) and kept as this run's first refusal.ú: r   c              3  ó8   "  € T F  p\        V4      x € K  	  R # 5i©N©r   ©Ú.0Úargs   & r   Ú	<genexpr>Ú_refuse.<locals>.<genexpr>t   s   é € Ð&D¹8°C¤s¨3§x x»8ùó   ‚ºNr   NzRefused update child: %s©Úrecord_stepÚupdate_custodyFNr/   r.   )Ú
isinstanceÚlistÚtupler   r   ÚjoinÚloggerÚwarningÚ
contextlibÚsuppressÚ	ExceptionÚhermes_cli.update_receiptrB   r1   Ú_past_commit)r	   r   r2   ÚexcÚdetailrB   s   &&$   r   Ú_refuserQ   o   sÆ   € ô $ D¬4´¨-×8Ò8Œ4�Œ:¸t¸f€DÜ
˜Ó
%€CØ—
‘
ˆ|˜2˜cŸh™hÑ&D¸4À¾8Ó&DÓDÐEÐF€FßÜ�‰Ð1°6Ô:Ü× Ò ¤×+Õ+Ý=áÐ(¨%°Ô8÷ ,ô ˆI…ÒØ¤D¨¥K¤× FÐ F¼»Ô4FÐGŒˆY‰Ø€J÷ ,×+ús   Â$D Ä D	c               ó   € V ^8„  d   QhRR/# )r   r   r4   r   )r   s   "r   r   r   €   s   € ÷ 
sñ 
s�dñ 
sr   c                 ó`  €  ^ RI Hp  V P                  4       pTRJ;'       d{    \        ;QJ d?    R TP
                  P                  R4      ;'       g    R 4       F  '       g   K   R# 	  R# ! R TP
                  P                  R4      ;'       g    R 4       4      #   \         d     R# i ; i)zúThe update reached its commit point: its receipt records the ``apply`` stage (the
completion child resumes that receipt). No receipt is open before an update begins, nor in
the parent after its completion child returned, which starts no update child.)Ú_currentTNc              3  óH   "  € T F  qP                  R 4      R8H  x € K  	  R# 5i)r$   ÚapplyN)Úget)r;   Ústages   & r   r=   Ú_past_commit.<locals>.<genexpr>Š   s   é € Ð&rÑQqÈ§y¡y°Ó'8¸GÖ'CÓQqùs   ‚ "ÚstagesFr   )rM   rT   rW   rL   ÚanyÚdata)rT   Úcurrents     r   rN   rN   €   sŸ   € ðÝ6à—,‘,“.ˆð ˜$Ð×rÐr§3£3Ñ&rÐQX×Q]ÑQ]×QaÑQaÐbjÓQk×QqÐQqÐoqÐQqÓ&r§3¤3Ðr¢3Ðr 3Ñ&rÐQX×Q]ÑQ]×QaÑQaÐbjÓQk×QqÐQqÐoqÐQqÓ&rÓ#rÐrøô ô Úðús   ‚B ÂB-Â,B-c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   ú
str | Noner   )r   s   "r   r   r   �   s   € ÷ lñ l˜Cð l°jñ lr   c                óº   € \         R,          f   R# \         R,          w  rV'       d   RMRpRV  RVP                   RV R\        P                  RV  R2R	7       2# )
z­What the command's failure path prints when this run refused an update child (m2), in
place of whatever generic error the refusal turned into downstream; ``None`` otherwise.r/   Nz0Nothing was changed: no update step had run yet.z'Update steps before it had already run.u   âœ— `z` stopped: z
  Ú`r   )r1   r   r"   r   )r   rO   Ú	unchangedÚoutcomes   &   r   Úrefusal_noticerd   �   sf   € ô ˆI…ÒÙÜ˜)•_�N€CßENÑAØ8ð à�7�)˜; s§z¡z l°$°w°i¸tÄFÇMÁMÐ\]Ð^eÐ]fÐfgÐZhÀMÓDiÐCjÐkÐkr   c               ó    € V ^8„  d   QhRRRR/# )r   Úargsr
   r   r_   r   )r   s   "r   r   r   ˜   s   € ÷ ñ ˜ð ¨:ñ r   c                ó–   € \        V 4      pV F7  pV\        9   d   \        VR4       K  VP                  R4      '       d   K5  Vu # 	  R# )zZThe subcommand in ``args`` (everything after the git executable), skipping global options.NÚ-)ÚiterÚ_GLOBAL_WITH_VALUEÚnextÚ
startswith)rf   Úitr<   s   &  r   Úgit_subcommandrn   ˜   s@   € ä	ˆd‹€BÛˆØÔ$Ô$Ü��TŽNØ—‘ ×$Ô$ØŠJñ	 ñ
 r   c               ó    € V ^8„  d   QhRRRR/# )r   rf   r
   r   r4   r   )r   s   "r   r   r   £   s   € ÷ 2ñ 2˜=ð 2¨Tñ 2r   c                ó&   € \        V 4      \        9   # r8   )rn   ÚLOCAL_MUTATORS)rf   s   &r   Úis_local_mutatorrr   £   s   € Ü˜$Ó¤>Ñ1Ð1r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úgit_cmdr
   rf   r   ú	list[str]r   )r   s   "r   r   r   §   s!   € ÷ %ñ %�mð %¨=ð %¸Yñ %r   c                ó    € \        V 4      \        V4      r\        \        V R,          V,           4      '       d   \        MR,           p. V OVOVO# )zJ``git_cmd + args`` with the custody config inserted before the subcommand.ºé   NNr   )rE   ÚGIT_NO_DETACHrr   Ú_MUTATOR_CONFIG)rt   rf   Úextras   && r   Úgit_argvr|   §   sG   € ä˜“M¤4¨£:ˆTÜÔ0@ÀÈÅÈtÕAS×0TÒ0T�_ÐZ\Õ]€EØ$ˆWÐ$�uÐ$˜tÐ$Ð$r   c               ó   € V ^8„  d   QhRR/# )r   r   zdict | Noner   )r   s   "r   r   r   ®   s   € ÷ ñ ˆ{ñ r   c                 óL   €  ^ RI Hp  V P                  #   \         d     R# i ; i)r   ©Úupdate_lockN)Ú
hermes_clir€   rL   Ú_HELDr   s    r   Ú_heldrƒ   ®   s,   € ðÝ*ð ×ÑÐøô ô Úðús   ‚ ”#¢#c                 óÖ   aaa€ \         P                  P                  R4      '       g   R# ^ RIp ^ RIoV P                  RRR7      P                  oSP                  ! 4       oVVV3R lpV# )aÁ  Linux: a ``preexec_fn`` making the child die (SIGKILL) with the updater thread that waits
on it. For the git children that do NOT hold the lock fd (fetch, ls-remote, readers): a
killed owner must not leave a fetch rewriting refs under the next lock owner. The ruling's
stale-lock rules recover a fetch killed mid-write. ``None`` elsewhere (Windows: the job;
macOS has no parent-death signal: :func:`run_git` puts a fetch under :func:`_owner_watch`).ÚlinuxNT)Ú	use_errnoc                 ót   <€ S! ^^	^ ^ ^ 4       S P                   ! 4       S8w  d   S P                  ! ^‰4       R# R# )rx   N)ÚgetppidÚ_exit)r   ÚparentÚprctls   €€€r   Ú_armÚ#_death_signal_preexec.<locals>._armÄ   s1   ø€ Ùˆa��A�q˜!ÔØ�:Š:‹<˜6Ô!Ø�HŠH�SŽMñ "r   )ÚsysÚplatformrl   Úctypesr   ÚCDLLr‹   Úgetpid)r�   rŒ   r   rŠ   r‹   s     @@@r   Ú_death_signal_preexecr“   ¶   sR   ú€ ô �<‰<×"Ñ" 7×+Ò+ÙÛÛà�K‰K˜¨ˆKÓ-×3Ñ3€EØ�YŠY‹[€F÷ð
 €Kr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úinherit_lockr4   Úkwargsr0   r   r   )r   s   "r   r   r   Ì   s!   € ÷ ñ  $ð °ð ¸ñ r   c           	     óö   € \        V 4      pV'       d9   \        \        P                  . VP	                  R R4      OVO54      4      VR &   V# V '       g&   \        4       e   RV9  d   \        4       pVe   W1R&   V# )Úpass_fdsÚ
preexec_fnr   )Ú	_lock_fdsrF   r0   ÚfromkeysrW   rƒ   r“   )r•   r–   ÚfdsÚarms   &&  r   Ú_custody_kwargsrž   Ì   sr   € Ü
�LÓ
!€Cß
Ü"¤4§=¡=Ð1T°6·:±:¸jÈ"Ó3MÐ1TÐPSÑ1TÓ#UÓVˆˆzÑð
 €M÷	 œe›gÒ1°lÈ&Ô6PÜ#Ó%ˆØŠ?Ø#&�<Ñ Ø€Mr   c               ó    € V ^8„  d   QhRRRR/# )r   r•   r4   r   ztuple[int, ...]r   )r   s   "r   r   r   ×   s   € ÷ =ñ =˜Dð = _ñ =r   c                óŒ   € V '       d   \         P                  R 8X  d   R# ^ RIHp \	        V! 4       P                  RR4      4      # )Úwin32)Úcustody_spawn_kwargsr˜   r   )rŽ   r�   Úhermes_cli.update_lockr¢   rF   rW   )r•   r¢   s   & r   rš   rš   ×   s4   € ßœ3Ÿ<™<¨7Ô2Øˆ	Ý;äÑ%Ó'×+Ñ+¨J¸Ó;Ó<Ð<r   c               ó    € V ^8„  d   QhRRRR/# )r   Úprocúsubprocess.Popenr   r   r   )r   s   "r   r   r   ß   s   € ÷ ñ Ð*ð ¨tñ r   c                óÞ   € ^ RI HpHp  V! V 4       T! T 4       R\        R&   R#   \         d=   pT P	                  4        T P                  4        \        T P                  T4      ThRp?ii ; i)a9  Assign a CREATE_SUSPENDED child to the update's kill-on-close job, then resume it.

Suspended until bound, so nothing it spawns can escape the job. A refused bind kills the
child before it ran a single instruction and raises :class:`CustodyRefused` (D2: never an
unfenced writer); a failed resume kills the child.)Ú_bind_to_kill_on_close_jobÚresume_suspended_childNTr.   )	r£   r¨   r©   ÚOSErrorÚkillÚwaitrQ   rf   r1   )r¥   r¨   r©   rO   s   &   r   Ú_bind_suspendedr­   ß   s_   € ÷ Zð/Ù" 4Ô(ñ
 ˜4Ô Ø„DˆƒKøô ô /Ø�	‰	ŒØ�	‰	ŒÜ�d—i‘i Ó%¨3Ð.ûð/ús   Š% ¥A,°7A'Á'A,r•   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r	   r
   r•   r4   r   r¦   r   )r   s   "r   r   r   ñ   s'   € ÷ Qñ Q�ð Q°ð QÐK[ñ Qr   c               óî  € \         P                  R8X  d[   \        4       eO   VP                  R^ 4      \        ,          VR&   \
        P                  ! \        V 4      3/ VB p \        V4       V# \
        P                  ! \        V 4      3/ \        W4      B #   \         dQ    \        P                  ! \        4      ;_uu_ 4        TP                  4        RRR4       h   + '       g   i     h ; ii ; i)zG``subprocess.Popen`` in the update tree's custody (see the module doc).r¡   NÚcreationflags)rŽ   r�   rƒ   rW   Ú_CREATE_SUSPENDEDÚ
subprocessÚPopenrE   r­   ÚBaseExceptionrJ   rK   rª   r«   rž   )r	   r•   r–   r¥   s   &$, r   Úpopenrµ   ñ   s»   € ä
‡|�|�wÔ¤5£7Ò#6Ø"(§*¡*¨_¸aÓ"@ÔCTÕ"TˆˆÑÜ×Ò¤ T£
Ñ5¨fÑ5ˆð	Ü˜DÔ!ð
 ˆÜ×ÒœD ›JÑP¬/¸,Ó*OÑPÐPøô ô 	Ü×$Ò$¤W×-Õ-Ø—	‘	”÷ .à÷ .Ö-àúð	ús$   Á#B Â-C4ÃC Ã	C4Ã C0Ã+	C4c               ó$   € V ^8„  d   QhRRRRRR/# )r   r	   r
   r•   r4   r   úsubprocess.CompletedProcessr   )r   s   "r   r   r      s'   € ÷ Hñ Hˆmð H¨dð HÐIdñ Hr   c               ó¤  € \         P                  R8X  d   \        4       f*   \        P                  ! \        V 4      3/ \        W4      B # VP                  RR4      VP                  RR4      rCVP                  RR4      pVe   \        P                  VR&   VP                  RR4      '       d   \        P                  ;VR	&   VR
&   \        V 3/ VB ;_uu_ 4       p VP                  W4R7      w  rxTP'                  4       pRRR4       T'       d-   X'       d%   \        P(                  ! TXP*                  XXR7      h\        P,                  ! XP*                  XXX4      #   \        P                   d-   p	^ RIHp
 T
! T\        4      pTe   Tw  T	n        T	n        h Rp	?	i\"         d    TP%                  4        h i ; i  + '       g   i     LÆ; i)aK  ``subprocess.run`` in the update tree's custody. Off Windows (or outside an update) it IS
``subprocess.run`` with the caller's kwargs untouched, plus the lock fd for mutators (or the
parent-death signal for the rest); on Windows inside an update it is the same contract over
:func:`popen`, so the child is job-bound before it runs.r¡   NÚinputÚtimeoutÚcheckFÚstdinÚcapture_outputÚstdoutÚstderr©rº   )Úkill_and_drain©Úoutputr¿   )rŽ   r�   rƒ   r²   ÚrunrE   rž   ÚpopÚPIPErµ   ÚcommunicateÚTimeoutExpiredÚhermes_cli._subprocess_compatrÁ   Ú_DRAIN_SECONDSr¾   r¿   r´   r«   ÚpollÚCalledProcessErrorrf   ÚCompletedProcess)r	   r•   r–   r¹   rº   r»   r¥   r¾   r¿   rO   rÁ   ÚdrainedÚcodes   &$,          r   rÄ   rÄ      sx  € ô
 �L‰L˜GÔ#¬«Ò(;Ü�~Š~œd 4›jÑR¬O¸LÓ,QÑRÐRØ—Z‘Z ¨Ó.°·
±
¸9ÀdÓ0Kˆ7Ø�J‰J�w Ó&€EØÒÜ$Ÿ/™/ˆˆw‰Ø‡z�zÐ" E×*Ò*Ü.8¯o©oÐ=ˆˆxÑ˜6 (Ñ+Ü	ˆtÑ	�v×	Ò	 $ð	Ø!×-Ñ-¨eÐ-ÓE‰NˆFð �y‰y‹{ˆ÷ 
÷  —Ü×+Ò+¨D°$·)±)ÀFÐSYÔZÐZÜ×&Ò& t§y¡y°$¸ÀÓGÐGøô ×(Ñ(ô 	õ Eá$ T¬>Ó:ˆGØÒ"Ø)0Ñ&�”
˜CœJØûÜô 	Ø�I‰IŒKØð	ú÷ 
×	ús6   ÃF?ÃE Ã1F?Å F<Å5'FÆF<Æ)F<Æ<F?Æ?G	c               ó$   € V ^8„  d   QhRRRRRR/# )r   r	   r
   Úlabelr   r   r¦   r   )r   s   "r   r   r   "  s"   € ÷ ñ ˜Mð °Sð ÐGWñ r   c               ó„  € \         P                  R8X  d   \        4       f+   \        P                  ! \        V 4      3/ \        RV4      B # ^ RIHpH	p VP                  R^ 4      \        ,          VR&   \        P                  ! \        V 4      3/ VB p V! V4      pVeU   RV RV R2p\        R	V 2RR
7       \        P                  ! \        4      ;_uu_ 4        ^ RIHp V! RRV4       RRR4       V! V4       V#   + '       g   i     L; i  \$         d#    TP'                  4        TP)                  4        h i ; i)a·  ``subprocess.Popen`` for a checkout writer that runs after the update committed (the
historical takeover's ``update_finish``). POSIX: the lock fd. Windows inside an update:
created suspended and bound to the update's kill-on-close job before it runs. A refused bind
must not fail a committed update, so the child still runs, never silently (printed and
receipted) and never unfenced: it joins the checkout lock holding its own lease (R5b).r¡   NT)Úbind_child_to_update_treer©   r°   z$the update's job would not take the ú (z=), so it runs outside the job, holding its own checkout leaseu     âš  )ÚflushrA   rC   F)rŽ   r�   rƒ   r²   r³   rE   rž   r£   rÓ   r©   rW   r±   ÚprintrJ   rK   rL   rM   rB   r´   r«   r¬   )	r	   rÑ   r–   rÓ   r©   r¥   ÚrefusalrP   rB   s	   &$,      r   Úpopen_post_commitrØ   "  s  € ô �L‰L˜GÔ#¬«Ò(;Ü×Ò¤ T£
ÑL¬o¸dÀFÓ.KÑLÐLßXà$Ÿj™j¨¸!Ó<Ô?PÕP€Fˆ?ÑÜ×ÒœD ›JÑ1¨&Ñ1€DðÙ+¨DÓ1ˆØÒØ<¸U¸GÀ2ÀgÀYð O@ð @ˆFä�F˜6˜(Ð#¨4Õ0Ü×$Ò$¤Y×/Õ/ÝAáÐ,¨e°VÔ<÷ 0ñ 	˜tÔ$ð
 €K÷ 0×/ûô
 ô Ø�	‰	ŒØ�	‰	ŒØðús%   ÂAD ÃC?Ã-D Ã?D	Ä
D Ä-D?c               ó$   € V ^8„  d   QhRRRRRR/# )r   rt   r
   rf   r   r·   r   )r   s   "r   r   r   D  s"   € ÷ 
5ñ 
5�]ð 
5¨-ð 
5ÐFañ 
5r   c                ó\  € \        W4      p\        VR,          4      pV'       d!   \        \        V 4      \        V4      V4       MZ\	        VR,          4      \
        9   d@   \        P                  R8w  d+   \        4       e   RV9  d   \        4       f   \        W24      # \        V3RV/VB # )z THE updater git runner: custody config in argv, the lock fd only into local mutators,
Windows job binding inside an update. ``kwargs`` are ``subprocess.run``'s.rw   r¡   r™   r•   )r|   rr   Ú_prefetch_for_moverE   rn   Ú_FD_LESS_REF_WRITERSrŽ   r�   rƒ   r“   Ú_run_owner_watchedrÄ   )rt   rf   r–   r	   Úmutators   &&,  r   Úrun_gitrß   D  sˆ   € ô �GÓ"€DÜ˜t B�xÓ(€GßÜœ4 ›=¬$¨t«*°fÕ=Ü	˜˜R�Ó	!Ô%9Ô	9¼c¿l¹lÈgÔ>UÜ“Ò#¨¸FÔ(BÔG\ÓG^ÒGfÜ! $Ó/Ð/ÜˆtÑ4 'Ð4¨VÑ4Ð4r   Úfetchz‰import os, signal, sys
if not os.read(0, 1):
    try:
        os.kill(int(sys.argv[1]), signal.SIGKILL)
    except OSError:
        pass
c               ó   € V ^8„  d   QhRR/# )r   ÚpidÚintr   )r   s   "r   r   r   c  s   € ÷ ñ �cñ r   c           
     óþ  aaa€ ^ RI oSP                  ! 4       w  po \        P                  ! \        P
                  RRR\        \        V 4      .V\        P                  \        P                  RR7      o SP                  ! T4       R TTT3R	 llpT#   \         dF   pSP                  ! S4       \        P                  RY4        Rp?SP                  ! T4       R# Rp?ii ; i  SP                  ! T4       i ; i)
zúStart the parent-death stand-in for child ``pid``; returns the callable that dismisses it
once the child is done, or ``None`` when it could not start (logged: the fetch still runs, as
it did before; only the owner's death mid-fetch is then unfenced).Nú-Iú-Sr   T)r¼   r¾   r¿   Ústart_new_sessionz9Could not watch update child %s for its owner's death: %sc               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r   Ú"_owner_watch.<locals>.__annotate__t  s   € ÷ $ñ $�Tñ $r   c                 ó„  <€ \         P                  ! \        4      ;_uu_ 4        S P                  ! SR 4       RRR4       S P                  ! S4       \         P                  ! \
        P                  4      ;_uu_ 4        SP                  ^R7       RRR4       R#   + '       g   i     Lk; i  + '       g   i     R# ; i)ó   xNrÀ   )rJ   rK   rª   ÚwriteÚcloser²   rÈ   r¬   )r   ÚwatcherÚ	write_ends   €€€r   ÚdismissÚ_owner_watch.<locals>.dismisst  su   ø€ Ü× Ò ¤×)Õ)Ø�HŠH�Y Ô%÷ *à
�Š�ÔÜ× Ò ¤×!:Ñ!:×;Õ;Ø�L‰L ˆLÔ#÷ <Ñ;÷ *×)ú÷ <×;Ð;ús   ¤BÁ>B.ÂB+	Â.B?	)r   Úpiper²   r³   rŽ   Ú
executableÚ_OWNER_WATCHr   ÚDEVNULLrª   rí   rH   rI   )râ   Úread_endrO   rð   r   rî   rï   s   &   @@@r   Ú_owner_watchr÷   c  sÊ   ú€ ó àŸ'š'›)Ñ€HˆiðÜ×"Ò"¤C§N¡N°D¸$ÀÄlÔTWÐX[ÓT\Ð#]ÐemÜ*4×*<Ñ*<ÄZ×EWÑEWÐkoôq‰ð 	�Š�Ô÷$ò $ð €Nøô ô Ø
�Š�ÔÜ�‰ÐRÐTWÔ]Ûà
�Š�Öûðûð
 	�Š�Õús*   �AB ÂC%Â (C ÃC( Ã C%Ã%C( Ã(C<c               ó$   € V ^8„  d   QhRRRRRR/# )r   r	   r
   r–   r0   r   r·   r   )r   s   "r   r   r   ~  s'   € ÷ Hñ H˜]ð H°Dð HÐ=Xñ Hr   c                ó  € VP                  RR4      VP                  RR4      r2VP                  RR4      pVe   \        P                  VR&   VP                  RR4      '       d   \        P                  ;VR&   VR	&   \        P                  ! \	        V 4      3/ VB ;_uu_ 4       p\        VP                  4      p VP                  W#R
7      w  rx Te   T! 4        TP                  4       p
RRR4       T'       d-   X
'       d%   \        P                   ! T
XP"                  XXR7      h\        P$                  ! XP"                  X
XX4      #   \        P                   dk   p	TP                  4         TP                  \        R
7      w  T	n        T	n        h   \        P                   d    R;Tn        ;Tn        Tn         h i ; iRp	?	i\         d    TP                  4        h i ; i  Te	   T! 4        i i ; i  + '       g   i     EL; i)zW``subprocess.run`` for an fd-less ref writer, under :func:`_owner_watch` while it runs.r¹   Nrº   r»   Fr¼   r½   r¾   r¿   rÀ   rÂ   )rÅ   r²   rÆ   r³   rE   r÷   râ   rÇ   rÈ   r«   rÊ   r¾   r¿   r¼   r´   rË   rÌ   rf   rÍ   )r	   r–   r¹   rº   r»   r¥   rð   r¾   r¿   rO   rÏ   s   &&         r   rÝ   rÝ   ~  s·  € à—Z‘Z ¨Ó.°·
±
¸9ÀdÓ0Kˆ7Ø�J‰J�w Ó&€EØÒÜ$Ÿ/™/ˆˆw‰Ø‡z�zÐ" E×*Ò*Ü.8¯o©oÐ=ˆˆxÑ˜6 (Ñ+Ü	×	Ò	œ$˜t›*Ñ	/¨×	/Ò	/°4Ü˜tŸx™xÓ(ˆð	Ø!×-Ñ-¨eÐ-ÓE‰NˆF�Fð Ò"Ù”	Ø�y‰y‹{ˆ÷% 
0÷& —Ü×+Ò+¨D°$·)±)ÀFÐSYÔZÐZÜ×&Ò& t§y¡y°$¸ÀÓGÐGøô# ×(Ñ(ô 	Ø�I‰IŒKð>Ø)-×)9Ñ)9Ä.Ð)9Ó)QÑ&�”
˜CœJð øô ×,Ñ,ô >à9=Ð=�”
Ð=˜Tœ[¨4­;Øð>þô ô 	Ø�I‰IŒKØð	ûð Ò"Ù•	ð #ú÷! 
0×	/Ð	/úsf   Â%G9Â<EÃG9ÅG%Å GÅ1#FÆGÆ*G	Æ?GÇG	ÇGÇG%ÇG%Ç%G(Ç(G6Ç6G9Ç9H
	c               ó$   € V ^8„  d   QhRRRRRR/# )r   rt   r
   r–   r0   r   r4   r   )r   s   "r   r   r   ž  s!   € ÷ ñ ˜Mð °4ð ¸Dñ r   c                ó‚  € ^ RI Hp ^ RIHp VP	                  R4      p\
        P                  ! V 4       F'  w  rVVR8X  g   K  T! T;'       g    R4      V,          pK)  	  T! T! T;'       g    R4      4      p VRJ;'       d,    RVR,          P                  R	R
R7      P                  4       9   #   \         d     R# i ; i)zSThe repository has a promisor remote (``extensions.partialClone``), read from disk.)ÚPath)Ú_git_common_dirÚcwdú-CÚ.NÚpartialcloneÚconfigú	utf-8-sigÚreplace)ÚencodingÚerrorsF)
Úpathlibrü   r£   rý   rW   Ú	itertoolsÚpairwiseÚ	read_textÚlowerrª   )rt   r–   rü   rý   rþ   ÚflagÚvalueÚcommons   &&      r   Ú_partial_cloner  ž  sº   € åå6à
�*‰*�UÓ
€CÜ ×)Ò)¨'Ö2‰ˆØ�4Ž<Ù�s—z�z˜cÓ" UÕ*ŠCñ 3ñ ™T #§* *¨Ó-Ó.€FðØ˜TÐ!÷ Zð Z nØ�hÕ×)Ñ)°;ÀyÐ)ÓQ×WÑWÓYñ'Zð 	Zøäô Úðús   Á8
B/ Â+B/ Â/B>Â=B>c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   rt   ru   rf   r–   r0   r   r   r   )r   s   "r   r   r   °  s.   € ÷ #Pñ #P 	ð #P°ð #PÀDð #PÈTñ #Pr   c                ó˜  a a€ \        V4      pV\        9  g   \        S V4      '       g   R# R Uu/ uF  qDV9   g   K  WBV,          bK  	  upoRR/R VV 3R lllp . pWP                  V4      ^,           R  FB  pVR8X  d    M:VP	                  R4      '       d   K%  VP                  V! RRR	V R
24      4       KD  	  \        P                  V4       Uu. uF  qˆ'       g   K  VNK  	  ppV'       g   R# V! RRR	R4      ;'       g    V! RRRRRR7      p	V F`  pV	'       g   K  W‰8w  g   K  \        \        S RRRRW˜.4      3R\        P                  R\        P                  R\        P                  /SB  Kb  	  R# u upi u upi   \        \        \        P                  3 d"   p
\        P!                  RY:4        Rp
?
R# Rp
?
ii ; i)uÙ  Partial clones: fetch what a move to another commit will read â€” the target's changed trees
and blobs â€” WITHOUT the lock fd and with the user's credential helpers, so the mutator (which
has neither helper nor reason to fetch) never starts a lazy fetch or a credential daemon under
the fd (m3). ``git diff HEAD <target>`` reads exactly the trees and blobs that differ from the
checked-out tree; the rest is local. Best effort: a miss only leaves a helper-less lazy fetch.Nr¼   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úqueryr   r¼   r_   r   r   )r   s   "r   r   Ú(_prefetch_for_move.<locals>.__annotate__»  s&   € ÷ Zñ Z˜ð Z Jð Z¸*ñ Zr   c                ó   <€ \        \        S\        V4      4      3R RRRRRRRRV /V e   / MR	\        P                  /BSB pVP
                  ^ 8X  d;   VP                  P                  4       '       d   VP                  P                  4       # R# )
r½   TÚtextr  zutf-8r  r  r¹   Nr¼   )rÄ   r|   rE   r²   rõ   Ú
returncoder¾   Ústrip)r¼   r  Úoutr  rt   s   $* €€r   ÚresolveÚ#_prefetch_for_move.<locals>.resolve»  sœ   ø€ Ü”(˜7¤D¨£KÓ0ñ Àð ÈDð Ð[bð Ø"ðØ*/ðØ:?Ò:K±BÐRYÔ[e×[mÑ[mÐQnðàñˆð &)§^¡^°qÔ%8¸S¿Z¹Z×=MÑ=M×=OÒ=Oˆs�z‰z×ÑÓ!ÐYÐUYÐYr   z--rh   z	rev-parsez--verifyz-qz	^{commit}zHEAD^{commit}zhash-objectz-tÚtreez--stdinÚ )r¼   Údiffz--binaryz--no-ext-diffz--no-textconvr¾   r¿   z-Could not prefetch the objects for git %s: %s)rþ   Úenv)rn   Ú_MOVESr  Úindexrl   Úappendr0   r›   rÄ   r|   r²   rõ   rª   Ú
ValueErrorÚSubprocessErrorrH   Údebug)rt   rf   r–   ÚsubÚkeyr  Útargetsr<   ÚtargetÚbaserO   r  s   f&&        @r   rÛ   rÛ   °  s»  ù€ ô ˜Ó
€CØ
”&Ô¤¨w¸× ?Ò ?ÙÙ*8ÓJ©. 3À6¹MÔˆc˜#•;Ò©.ÑJ€FðZ°÷ Zó ZðPØˆØŸ
™
 3›¨!Õ+Ð,Ó-ˆCØ�dŒ{ÙØ—>‘> #×&Ô&Ø—‘™w {°JÀÈÈÈ[ÐFYÓZÖ[ñ	 .ô
 )-¯©°gÔ(>ÓIÑ(>˜fÃ&—6�6Ñ(>ˆÐIßÙá�{ J°°oÓF÷ Ið IÙ�} d¨F°IÀRÔHð 	ãˆFß‰t˜žÜ”H˜W v¨z¸?ÈOÐ]aÐ&jÓkñ nÜ$×,Ñ,ðnÜ5?×5GÑ5GðnÜPZ×PbÑPbðnØflônó ùò+ Kùò Jøô ”Z¤×!;Ñ!;Ð<ô PÜ�‰ÐDÀc×OÒOûðPúsY   ±E>¾E>Á<F Â8F Ã	FÃ$FÃ*
F Ã6F ÄF Ä%F Ä-AF ÆF Æ G	Æ(GÇG	z"hermes: update custody unavailablea²  import ctypes, subprocess, sys, time
k = ctypes.WinDLL('kernel32', use_last_error=True)
k.AssignProcessToJobObject.argtypes = [ctypes.c_void_p, ctypes.c_void_p]
k.GetCurrentProcess.restype = ctypes.c_void_p
k.CloseHandle.argtypes = [ctypes.c_void_p]
k.CreateJobObjectW.restype = ctypes.c_void_p
k.SetInformationJobObject.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_ulong]
k.TerminateJobObject.argtypes = [ctypes.c_void_p, ctypes.c_uint]
k.QueryInformationJobObject.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_ulong,
                                        ctypes.c_void_p]
h = ctypes.c_void_p(int(sys.argv[1]))
def refuse(why):
    note = 'zö (%s); the command was not run' % why
    sys.stderr.write(note + '\n')
    sys.stderr.flush()
    try:
        with open(sys.argv[2], 'w', encoding='utf-8') as report:
            report.write(note)
    except OSError:
        pass
    sys.exit(a†  )
if not k.AssignProcessToJobObject(h, k.GetCurrentProcess()):
    refuse('could not join the update job: %d' % ctypes.get_last_error())
class Basic(ctypes.Structure):
    _fields_ = [('times', ctypes.c_int64 * 2), ('flags', ctypes.c_uint32), ('ws', ctypes.c_size_t * 2),
                ('procs', ctypes.c_uint32), ('affinity', ctypes.c_size_t), ('classes', ctypes.c_uint32 * 2)]
class Limits(ctypes.Structure):
    _fields_ = [('basic', Basic), ('io', ctypes.c_uint64 * 6), ('memory', ctypes.c_size_t * 4)]
class Usage(ctypes.Structure):
    _fields_ = [('times', ctypes.c_int64 * 4), ('faults', ctypes.c_uint32), ('total', ctypes.c_uint32),
                ('active', ctypes.c_uint32), ('terminated', ctypes.c_uint32)]
tree = k.CreateJobObjectW(None, None)
limits = Limits()
limits.basic.flags = 0x2000
if not tree or not k.SetInformationJobObject(tree, 9, ctypes.byref(limits), ctypes.sizeof(limits)):
    refuse('could not create the job for the command tree: %d' % ctypes.get_last_error())
k.IsProcessInJob.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int)]
p = subprocess.Popen(sys.argv[3:], stdin=subprocess.DEVNULL, creationflags=0x4)
def in_job():
    inside = ctypes.c_int(0)
    return k.IsProcessInJob(ctypes.c_void_p(int(p._handle)), h, ctypes.byref(inside)) and inside.value
if not in_job() and not (k.AssignProcessToJobObject(h, ctypes.c_void_p(int(p._handle))) and in_job()):
    p.kill()
    p.wait()
    refuse('the command would start outside the update job')
if not k.AssignProcessToJobObject(tree, ctypes.c_void_p(int(p._handle))):
    error = ctypes.get_last_error()
    p.kill()
    p.wait()
    refuse('could not hold the command tree in a job: %d' % error)
k.CloseHandle(h)
nt = ctypes.WinDLL('ntdll')
nt.NtResumeProcess.argtypes = [ctypes.c_void_p]
if nt.NtResumeProcess(ctypes.c_void_p(int(p._handle))) != 0:
    p.kill()
code = p.wait()
k.TerminateJobObject(tree, 1)
usage, end = Usage(), time.monotonic() + 10
while time.monotonic() < end:
    if not k.QueryInformationJobObject(tree, 1, ctypes.byref(usage), ctypes.sizeof(usage), None):
        break
    if not usage.active:
        break
    time.sleep(0.02)
sys.exit(code)
c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úreportr   r	   r
   r   r_   r   )r   s   "r   r   r   2  s!   € ÷ ñ  ð ¨Mð ¸jñ r   c                ó|  € ^ RI p \        V RR7      ;_uu_ 4       pVP                  4       P                  4       pRRR4       \
        P                  ! \        4      ;_uu_ 4        TP                  ! T 4       RRR4       X'       g   R# \        P                  RTRP                  R TR,           4       4      4       \
        P                  ! \        4      ;_uu_ 4        ^ R	IHp T! R
RT RRP                  R TR,           4       4       24       RRR4       T#   + '       g   i     Lê; i  \         d    Rp Lüi ; i  + '       g   i     LÓ; i  \
        P                  ! \        4      ;_uu_ 4        TP                  ! T 4       RRR4       i   + '       g   i     i ; i; i  + '       g   i     T# ; i)z’Make a refused job join visible: a warning (errors.log) and a receipt step. The notice,
or None when the child joined (or never ran the launcher).Nr  )r  r  z%s: %sr   c              3  ó8   "  € T F  p\        V4      x € K  	  R # 5ir8   r9   r:   s   & r   r=   Ú'_report_refused_join.<locals>.<genexpr>A  s   é € Ð+IÁ¸¬C°¯H¨HÃùr?   r@   rA   rC   Fr6   c              3  ó8   "  € T F  p\        V4      x € K  	  R # 5ir8   r9   r:   s   & r   r=   r/  E  s   é € Ð@^ÑU]ÈcÄÀSÇÀÓU]ùr?   )r   ÚopenÚreadr  rª   rJ   rK   ÚunlinkrH   rI   rG   rL   rM   rB   )r,  r	   r   ÚfhÚnoterB   s   &&    r   Ú_report_refused_joinr6  2  s.  € ó ðÜ�& ;×/Õ/°2Ø—7‘7“9—?‘?Ó$ˆD÷ 0ô
 × Ò ¤×)Õ)Ø�IŠI�fÔ÷ *çÙÜ
‡N�N�8˜T 3§8¡8Ñ+IÀÀRÆÓ+IÓ#IÔJÜ	×	Ò	œY×	'Õ	'Ý9áÐ$ e°¨v°R¸¿¹Ñ@^ÐUYÐZ\ÖU]Ó@^Ó8^Ð7_Ð-`Ôa÷ 
(ð €K÷ 0×/ûäô ØŠðú÷ *×)ûŒZ× Ò ¤×)Õ)Ø�IŠI�fÔ÷ *×)×)Ð)ý÷
 
(Ö	'ð €Kúsu   †D/ ›DºD/ Á$EÃ3F*ÄD,	Ä'D/ Ä+E Ä,D/ Ä/D?Ä<E Ä>D?Ä?E ÅE	Å#F'Å8F	Æ	F'ÆF$ÆF'Æ*F;	c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   I  s   € ÷ ñ ˜sñ r   c                 ó¢   € ^ RI p \        \        RR4      pV'       d$   V P                  P	                  V4      '       d   V# \        P
                  # )ac  The interpreter for the job-joining launcher: the real one, never a venv redirector.

A venv's ``Scripts\python.exe`` is a redirector: it starts the base interpreter as its own
child, inside a job of its own. That child cannot join the update's job once the job holds a
process from another job hierarchy (the updater's git children): ``AssignProcessToJobObject``
fails with ERROR_ACCESS_DENIED (5). And the redirector, never joined, keeps its inherited copy
of the job handle open, so the job would not close when the owner dies. The launcher is
stdlib-only (``-I -S``), so the base interpreter runs it as is.
NÚ_base_executable)r   ÚgetattrrŽ   r   Úisfileró   )r   r*  s     r   Ú_join_launcher_pythonr<  I  s:   € ó ä”3Ð*¨DÓ1€Dß�—‘—‘˜t×$Ò$ØˆÜ�>‰>Ðr   aÜ  
import os, signal, subprocess, sys, time
KILL = signal.SIGKILL  # windows-footgun: ok - POSIX-only launcher
fds = tuple(int(fd) for fd in sys.argv[1].split(','))
caller = os.getpgrp()
if caller != os.getpid():
    os.setpgid(0, 0)
stand_in = os.getpid()
custodian = os.fork()
if custodian:
    def relay(signum, frame):
        try:
            os.kill(custodian, signum)
        except OSError:
            pass
    for name in ('SIGINT', 'SIGTERM', 'SIGHUP'):
        signal.signal(getattr(signal, name), relay)
    code = os.waitstatus_to_exitcode(os.waitpid(custodian, 0)[1])
    sys.exit(code if code >= 0 else 128 - code)
os.setpgid(0, 0)
me = os.getpid()
reaper = False
if sys.platform.startswith('linux'):
    try:
        import ctypes
        reaper = ctypes.CDLL(None, use_errno=True).prctl(36, 1, 0, 0, 0) == 0  # PR_SET_CHILD_SUBREAPER
    except (OSError, AttributeError):
        reaper = False

def children():
    found = []
    for entry in os.listdir('/proc'):
        if not entry.isdigit():
            continue
        try:
            with open('/proc/%s/stat' % entry, 'rb') as fh:
                stat = fh.read()
            if int(stat[stat.rindex(b')') + 2:].split()[1]) == me:
                found.append(int(entry))
        except (OSError, ValueError, IndexError):
            continue
    return found

def table():
    try:
        out = subprocess.run(['ps', '-A', '-o', 'pid=,ppid=,stat=,lstart='], stdin=subprocess.DEVNULL,
                             capture_output=True, text=True, errors='replace', timeout=10).stdout
    except (OSError, subprocess.SubprocessError):
        return {}
    rows = {}
    for line in out.splitlines():
        parts = line.split(None, 3)
        if len(parts) == 4 and parts[0].isdigit() and parts[1].isdigit() and not parts[2].startswith('Z'):
            rows[int(parts[0])] = (int(parts[1]), parts[3].strip())
    return rows

seen = {}

def sample(root):
    rows = table()
    tree = {pid for pid, start in seen.items() if rows.get(pid, (0, None))[1] == start}
    if root is not None:
        tree.add(root)
    grew = True
    while grew:
        grew = False
        for pid, (ppid, start) in rows.items():
            if ppid in tree and pid not in tree:
                tree.add(pid)
                seen[pid] = start
                grew = True
    return [pid for pid, start in seen.items() if rows.get(pid, (0, None))[1] == start]

def kill(pids):
    for pid in pids:
        try:
            os.kill(pid, KILL)
        except OSError:
            pass

p = subprocess.Popen(sys.argv[2:], pass_fds=fds, process_group=caller)
got = []

def forward(signum, frame):
    got.append(signum)
    try:
        p.send_signal(signum)
    except OSError:
        pass

for name in ('SIGINT', 'SIGTERM', 'SIGHUP'):
    signal.signal(getattr(signal, name), forward)
deadline = None
while True:
    try:
        code = p.wait(timeout=0.5)
        break
    except subprocess.TimeoutExpired:
        pass
    if not reaper:
        sample(p.pid)
    if got or os.getppid() != stand_in:
        deadline = deadline or time.monotonic() + 10
        if time.monotonic() > deadline:
            p.kill()
end = time.monotonic() + 10
while time.monotonic() < end:
    live = children() if reaper else sample(None)
    if not live:
        break
    kill(live)
    while reaper:
        try:
            if not os.waitpid(-1, os.WNOHANG)[0]:
                break
        except ChildProcessError:
            break
    time.sleep(0.02)
sys.exit(code if code >= 0 else 128 - code)
TÚrootc               ó    € V ^8„  d   QhRRRR/# )r   r	   r
   r•   r4   r   )r   s   "r   r   r   î  s   € ÷ (ñ (˜Mð (¸Dñ (r   c             #  óÚ  "  € \        V 4      p \        P                  R8X  d   \        4       fƒ   ^ RIHp V'       d   Ve   \        V! V4      4      M
\        V4      pV'       d:   \        P                  RRR\        RP                  \        \        V4      4      .V Op Y'       d   RV/M/ 3x € R#  \        4       p^ RIp^ RIpTP%                  R	R
R7      w  ršTP&                  ! T	4        \(        P*                  ! 4       pRT./Tn        \/        4       RRR\0        \        T4      T
.T ORT/3x € ^ RIpTP5                  R4      P7                  TP9                  T4      4       \;        Y 4      pT'       d<   TP=                  \>         R24      PA                  R4      ^ ,          p\        YRR7      hR\B        R&   R#   \         d   p\        Y4      ThRp?ii ; i  ^ RIpTP5                  R4      P7                  TP9                  T4      4       \;        Y 4      pT'       d<   TP=                  \>         R24      PA                  R4      ^ ,          p\        YRR7      hR\B        R&   i ; i5i)a‹  ``(argv, kwargs)`` for a checkout writer started by a runner that hides its Popen (the Node
build in ``pm.progress.run_contained``). POSIX: the lock fd (this process's, or one it
inherited for checkout ``root``), under a launcher that keeps the command in the caller's
process group and kills every descendant left when it exits (:data:`_REAP_TREE`).
Windows inside an update: the command runs under a launcher that joins the update's
kill-on-close job first and returns only once no process the command started is left (C3);
when the job cannot be handed over or the join is refused, the command never runs and
:class:`CustodyRefused` is raised (D2).r¡   N)Úcheckout_lock_fdsrå   ræ   r   Ú,r˜   zhermes-custody-z.txt)ÚprefixÚsuffixÚhandle_listÚstartupinfoÚkernel32rÔ   Ú)T)r2   r.   )"rE   rŽ   r�   rƒ   r£   r@  rF   rš   ró   Ú
_REAP_TREErG   Úmapr   Ú_inheritable_job_handlerª   rQ   r   ÚtempfileÚmkstemprí   r²   ÚSTARTUPINFOÚlpAttributeListr<  Ú	_JOIN_JOBr�   ÚWinDLLÚCloseHandleÚc_void_pr6  ÚremoveprefixÚ_CUSTODY_UNAVAILABLEÚ	partitionr1   )r	   r•   r=  r@  rœ   ÚhandlerO   r   rK  Úfdr,  Úinfor�   r5  r   s   &$$            r   Úcontained_commandrY  í  s  é € ô �‹:€DÜ�L‰L˜GÔ#¬«Ò(;Ý<ç0<ÀÒAQŒeÑ% dÓ+Ô,ÔW`ÐamÓWnˆßÜ—N‘N D¨$°´jÀ#Ç(Á(Ì3ÌsÐTWË=ÓBYÐaÐ\`ÐaˆDØ®#�j #Ñ&°2Ð6Ò6Ùð*Ü(Ó*ˆó Ûà×!Ñ!Ð):À6Ð!ÓJ�J€BØ‡H‚HˆR„LðÜ×%Ò%Ó'ˆØ -°¨xÐ8ˆÔÜ%Ó'¨¨t°T¼9ÄcÈ&ÃkÐSYÐaÐ\`ÐaØ˜tÐ$ð&ò 	&ó 	à�‰�jÓ!×-Ñ-¨f¯o©o¸fÓ.EÔFÜ# FÓ1ˆßØ×%Ñ%Ô)=Ð(>¸bÐ&AÓB×LÑLÈSÓQÐRSÕTˆEÜ˜$°Ô6Ð6ØŒˆU‹øô) ô *Ü�dÓ  cÐ)ûð*ûó 	à�‰�jÓ!×-Ñ-¨f¯o©o¸fÓ.EÔFÜ# FÓ1ˆßØ×%Ñ%Ô)=Ð(>¸bÐ&AÓB×LÑLÈSÓQÐRSÕTˆEÜ˜$°Ô6Ð6ØŒˆUŠüsP   ‚:I+½'I+Á%AI+Â2
F= Â</I+Ã,AG Ä1BI+Æ=GÇGÇGÇI+ÇBI(É(I+c               ó   € V ^8„  d   QhRR/# )r   r   rã   r   )r   s   "r   r   r     s   € ÷ ñ  ñ r   c            	     óª  € ^ RI p ^ RIHp  V! 4       pV P                  RRR7      pV P                  VP
                  n        V P                  V P                  V P                  V P                  V P                  4      V P                  V P                  V P                  .VP                  n        VP                  4       V P	                  4       rTVP                  WBW@P                  V4      ^ R^4      '       g    V P                  V P                  4       4      h\        VP                   4      #   \"         d   p\$        P'                  RT4       h Rp?ii ; i)z�An inheritable duplicate of the update's kill-on-close job handle (Windows). Raises
``OSError`` when the job cannot be created or duplicated.N)Úupdate_tree_jobrF  T)Úuse_last_errorz4Could not hand the update's job to a build child: %s)r�   r£   r\  rP  rR  ÚGetCurrentProcessÚrestypeÚPOINTERÚc_ulongÚc_intÚDuplicateHandleÚargtypesÚbyrefÚWinErrorÚget_last_errorrã   r  rª   rH   rI   )r�   r\  ÚjobrF  ÚmeÚduprO   s          r   rJ  rJ    s  € ó å6ðÙÓˆØ—=‘= ¸D�=ÓAˆØ-3¯_©_ˆ×"Ñ"Ô*Ø-3¯_©_¸f¿o¹oÈvÏÉØ-3¯^©^¸F¿O¹OÓ-LÈfÏnÉnÐ^d×^jÑ^jØ-3¯^©^ð-=ˆ× Ñ Ô)ð ×,Ñ,Ó.°·±Ó0AˆCà×'Ñ'¨°·\±\À#Ó5FÈÈ4ÐQT×UÒUØ—/‘/ &×"7Ñ"7Ó"9Ó:Ð:Ü�3—9‘9‹~ÐøÜô Ü�‰ÐMÈsÔSØûðús   ŒDD+ Ä+EÄ6EÅE)r   zgc.autoDetach=falser   zmaintenance.auto=false>   ÚamÚgcÚmvÚrmÚaddÚtagrV   ÚcleanÚmergeÚresetÚstashÚbranchÚcommitÚrebaseÚrevertÚswitchÚrestoreÚcheckoutÚworktreeú	read-treeú
update-refúcherry-pickúpack-objectsúsymbolic-refúupdate-indexúcheckout-index>   rr  rs  ry  r{  r}  >
   rÿ   r   ú	--git-dirú--exec-pathú--list-cmdsú--namespaceú--work-treeú--config-envú--attr-sourceú--super-prefix)zhermes update);Ú__conditional_annotations__r+   Ú
__future__r   rJ   Úloggingr   r²   rŽ   Úcollections.abcr   r  Ú	getLoggerr'   rH   ry   Údevnullrz   Ú	frozensetrq   r   rj   r±   rª   r   r"   r1   Ú__annotations__rQ   rN   rd   rn   rr   r|   rƒ   r“   rž   rš   r­   rµ   rÄ   rØ   rÊ   rß   rÜ   rô   r÷   rÝ   r  rÛ   rT  Ú_REFUSED_EXITrO  r6  r<  rH  ÚcontextmanagerrY  rJ  )rŒ  s   @r   Ú<module>r–     sà  øðô%õN #ã Û Û 	Û Û 
Ý $Û à	×	Ò	˜8Ó	$€ð N€ð Ð/°Ð7KÈTÐUdÐeg×eoÑeoÐdpÐSqÐr€ñ ò ó €ñ 
ÒHÓ	I€ñ ò  bó cÐ ð Ð ôR�Wô Rð %€ð �U˜I tÐ,€€dÓ ,ðÀU÷ õ"
s÷lõõ2õ%õòõ,õ=õð$Q°u÷ QðH°U÷ HõDð> €õ
5ñ  ! ' Ó+Ð ðð õõ6Hõ@õ$#Pðf <Ð Ø€ðð (Ð(ð )ð "�?ð 4#ð)Hð 
õZõ.ðTw€
ðt ×Ñð(À4ð (Èdö (ó ð(÷Vr   