+
    5mj:  c                     ^ RI Ht ^ RIt^ RIHu Ht ^ RIt^ RI	t
^ RI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t]P.                  P1                  ^ ]! ]! ]4      P7                  4       P8                  ^,          4      4       ^ RItR^RRRR	R
R. RORRRRRRRRRR///RRR	R
R. RORRRRRRRR///RRR	RR. RORRRRRRRR///./tR^RR U u. uF  p RRV  2R	R
RRR.RRRRV  2RR///NK  	  up /t]P@                  ! RR7      R  4       t!RR! R" llt"R# t#R$ t$R% t%R& t&R' t'R( t(R) t)R* t*R+ t+R, t,R- t-R. t.R/ t/R0R1R2R3R4R1R5R3/t0R6 R7 lt1R8 R9 lt2R: R; lt3RR< R= llt4R> R? lt5RR@ RA llt6RB t7RC RD lt8RE RF lt9RG RH lt:RI RJ lt;RK RL lt<RM RN lt=RO RP lt>RQ t?RR t@RS tART tBRU tCRV tDRW tERX tFRY tGRZ tHR[ tIR\ tJR] tKR^ tLR_ tMR` tNRa tORb tPRc tQRd tRRe tSRf tTRg tURh tVRi tWRj tXRk tYRl tZRm t[Rn t\Ro t]Rp t^Rq t_Rr t`Rs taRt tbRu tcRv Rw ltdRx teRy tfRz R{ ltgR| thR} R~ ltiR tjR tkR tlR tmR tnR to]P                  P                  RRR.4      R 4       trR tsR ttR tuR tvR twR txR tyR tzR t{R t|R t}R# u up i )    )annotationsN)Counter)Pathschema_versionhostsnamedebian1state	reachableroles
agent-seatagent-sandboxaccesstailscale_iphost	100.0.0.1port  useridentity_filez~/.ssh/id_ed25519_buildboxdebian2	100.0.0.2debian3unreachable	100.0.0.3debianz100.0.0.T)autousec                z    V P                  R4      pVP                  \        P                  \	        V4      4       V# )zJNo test may write placement claims into the real ~/.local/state directory.claims)mktempsetenvremote_dispatchCLAIM_DIR_ENVstr)tmp_path_factorymonkeypatch	directorys   && e/home/user/overdeck-private-tests/workstation-ai-broad2/modules/systray/tests/test_remote_dispatch.pyisolated_claim_dirr(   D   s4     !''1I44c)nE    c               $    V ^8  d   QhRRRRRR/# )   tmp_pathr   payloadzdict | Nonereturn )formats   "r'   __annotate__r1   L   s!      T K 4 r)   c                z    V R ,          pTP                  \        P                  ! Ve   TM\        4      RR7       V# )zbuildbox-hosts.jsonutf-8encoding)
write_textjsondumpsREGISTRY)r,   r-   paths   && r'   write_registryr;   L   s3    ++DOODJJ'*=w8LW^O_Kr)   c                P   V P                  \        R R 4       \        P                  q! 4       pRq2VJ qD'       g   \        P                  ! RV3RW#34      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;p;p;rCR
# )in_containerc                     R # Fr/   r/   r)   r'   <lambda>@test_should_offload_true_when_not_in_container.<locals>.<lambda>S       r)   Tpy0r!   py2py4py7assert %(py9)spy9NiszM%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.should_offload
}()
} is %(py7)ssetattrr!   should_offload
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanationr%   @py_assert1@py_assert3@py_assert6@py_assert5@py_format8@py_format10s   &      r'   .test_should_offload_true_when_not_in_containerr^   R   s    G))3)+3t3t33333+333333?3333?333)333+333t33333333r)   c                P   V P                  \        R R 4       \        P                  q! 4       pRq2VJ qD'       g   \        P                  ! RV3RW#34      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;p;p;rCR
# )r=   c                     R # Tr/   r/   r)   r'   r@   =test_should_offload_false_when_in_container.<locals>.<lambda>X       r)   FrC   r!   rD   rE   rF   rG   rH   NrI   rK   rL   rW   s   &      r'   +test_should_offload_false_when_in_containerrd   W   s    F))4)+4u4u44444+444444?4444?444)444+444u44444444r)   c                *   V P                  R R4       V P                  RR4       V P                  RR4       V P                  RR4       V P                  \        RR 4       \        P                  q! 4       pRq2VJ qD'       g   \        P
                  ! RV3RW#34      R	R
\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MR
R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;rCV P                  \        RR 4       \        P                  q! 4       pRq2VJ qD'       g   \        P
                  ! RV3RW#34      R	R
\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MR
R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;rCR# )CDX_NO_OFFLOAD1OD_REMOTE_EXECHARNESS_SEAT_CONTAINERCDX_OFFLOAD_STRICT0r=   c                     R # r?   r/   r/   r)   r'   r@   1test_should_offload_ignores_env.<locals>.<lambda>b   rB   r)   TrC   r!   rD   rE   rF   rG   rH   Nc                     R # ra   r/   r/   r)   r'   r@   rm   e   rc   r)   FrI   rK   )r    rM   r!   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   s   &      r'   test_should_offload_ignores_envro   \   s   '-'-/5+S1G))3)+3t3t33333+333333?3333?333)333+333t33333333F))4)+4u4u44444+444444?4444?444)444+444u44444444r)   c                    R RR/ /p \         P                  ! \        P                  4      ;_uu_ 4       p\        P                  ! V 4       RRR4       XP
                  q"P                  p\        P                  qCV8H  qU'       Eg3   \        P                  ! RV3RW434      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      RR	\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MR	R
\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;rTR#   + '       g   i     EL; i)r   r   r   NrC   exc_inforD   rE   py6r!   py8assert %(py10)spy10==zi%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.code
} == %(py8)s
{%(py8)s = %(py6)s.EXIT_NO_NODE
})pytestraisesr!   OffloadUnavailable
access_forvaluecodeEXIT_NO_NODErO   rP   rQ   rR   rS   rT   rU   rV   )r   rq   rX   rY   @py_assert7r[   @py_format9@py_format11s           r'   1test_access_for_without_a_door_is_a_no_node_errorr   i   s    	"D 
99	:	:h""4( 
;>>>>/">">>">>>>>>>>>>>>8>>>>8>>>>>>>>>>>>>/>>>>/>>>">>>>>>>>> 
;	:	:s   G  G	c                    \         P                  ! \        4       U u. uF  q R ,          NK  	  pp RR.q!V8H  q3'       g   \        P                  ! R	V3R
W34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;r2R# u up i )r   r   r   rC   namespy3assert %(py5)spy5Nrv   z%(py0)s == %(py3)s)r!   candidate_hostsr9   rO   rP   rQ   rR   rS   rT   rU   rV   )hr   @py_assert2rX   @py_format4@py_format6s         r'   )test_candidate_hosts_excludes_unreachabler   s   s     / ? ? IJ I1vYY IEJ	********5******5****5************ Ks   C4c                    R \        \        R ,          ^,          4      ./p \        P                  ! \        P
                  4      ;_uu_ 4       p\        P                  ! V 4       RRR4       XP                  q"P                  p\        P                  qCV8H  qU'       Eg3   \        P                  ! RV3RW434      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          pR	R
V/,          p\!        \        P"                  ! V4      4      hR;p;p;rTR#   + '       g   i     EL; i)r   NrC   rq   rD   rE   rr   r!   rs   rt   ru   rv   rx   )dictr9   ry   rz   r!   r{   r   r}   r~   r   rO   rP   rQ   rR   rS   rT   rU   rV   )r-   rq   rX   rY   r   r[   r   r   s           r'   /test_candidate_hosts_raises_when_none_reachabler   x   s   hw/2345G	99	:	:h''0 
;>>>>/">">>">>>>>>>>>>>>8>>>>8>>>>>>>>>>>>>/>>>>/>>>">>>>>>>>> 
;	:	:s   GG+	c                   a R RRR/o\         P                  ! \         P                  ! \        4      V3R lR7      w  rpV R,          pRqCV8H  qU'       gy   \        P
                  ! RV3RW434      R\        P                  ! V4      R	\        P                  ! V4      /,          pR
RV/,          p\        \        P                  ! V4      4      hR;p;rTVR,          pRqCV8H  qU'       gy   \        P
                  ! RV3RW434      R\        P                  ! V4      R	\        P                  ! V4      /,          pR
RV/,          p\        \        P                  ! V4      4      hR;p;rTR# )r   g      #@r   g?c                $   < SV R ,          ,          # r   r/   aloadss   &r'   r@   5test_select_host_picks_least_loaded.<locals>.<lambda>       ai(r)   prober   r   py1rE   assert %(py6)srr   Nr   rv   z%(py1)s == %(py4)s	r!   select_hostr   r9   rO   rP   rT   rU   rV   )	r   r   _claim@py_assert0rY   r   @py_format5@py_format7r   s	           @r'   #test_select_host_picks_least_loadedr      s    #{C0E*66''1(D& <$9$9$$$$$<$$$<$$$9$$$$$$$$&>([([(((((>(((>((([((((((((r)   c                    \         P                  ! \         P                  ! \        4      R  R7      w  rpV R,          pRqCV8H  qU'       gy   \        P
                  ! R	V3R
W434      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rTR# )c                &    V R ,          R8X  d   R# R# )r   r   Ng      @r/   r   s   &r'   r@   Atest_select_host_skips_nodes_that_do_not_answer.<locals>.<lambda>   s    &	[ 8AcAr)   r   r   r   r   rE   r   rr   Nrv   r   r   )r   _accessr   r   rY   r   r   r   s           r'   /test_select_host_skips_nodes_that_do_not_answerr      sz    +77''1AD6 <$9$9$$$$$<$$$<$$$9$$$$$$$$r)   c                     \         P                  ! \        P                  4      ;_uu_ 4        \        P                  ! \        P
                  ! \        4      R  R7       RRR4       R#   + '       g   i     R# ; i)c                    R # Nr/   r   s   &r'   r@   >test_select_host_raises_when_no_node_answers.<locals>.<lambda>   s    _cr)   r   N)ry   rz   r!   r{   r   r   r9   r/   r)   r'   ,test_select_host_raises_when_no_node_answersr      sB    	99	:	:##O$C$CH$MUcd 
;	:	:	:s   2A))A:	c                    \         P                  p R q! V4      pRq2V8H  qD'       g   \        P                  ! RV3RW#34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pR	R
V/,          p\        \        P                  ! V4      4      hR;p ;p;p;rC\         P                  p Rq! V4      pRq2VJ qD'       g   \        P                  ! RV3RW#34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pR	R
V/,          p\        \        P                  ! V4      4      hR;p ;p;p;rC\         P                  p Rq! V4      pRq2VJ qD'       g   \        P                  ! RV3RW#34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pR	R
V/,          p\        \        P                  ! V4      4      hR;p ;p;p;rCR# )z0.52 0.31 0.20 1/900 12345
gp=
ף?rC   r!   rD   rE   rr   rH    assert %(py11)spy11Ngarbagerv   )zS%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.parse_loadavg
}(%(py4)s)
} == %(py9)srI   )zS%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.parse_loadavg
}(%(py4)s)
} is %(py9)s)
r!   parse_loadavgrO   rP   rQ   rR   rS   rT   rU   rV   rX   rY   r[   @py_assert8r   r]   @py_format12s          r'   test_parse_loadavgr      s   ((P)GP()GHPDPDPPPPPHPPPPPP?PPPP?PPP(PPP)GPPPHPPPDPPPPPPPP((44(,4444444,444444?4444?444(444444,44444444444((;;(3;t;t;;;;;3;;;;;;?;;;;?;;;(;;;;;;3;;;t;;;;;;;;;r)   c                    \         P                  ! \        R 4      4      p \         P                  ! \        R4      4      p\         P                  pR p\        V4      qB! V4      qPV8H  qf'       Eg   \        P                  ! RV3RW34      RR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRRR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;rEW8g  qf'       g   \        P                  ! RV3RW34      RR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRRR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          p	RRV	/,          p
\        \        P                  ! V
4      4      hRpV P                  pRq&! V4      q'       g   RRR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;r+R# )+/home/user/Projects/overdeck/.worktrees/onez+/home/user/Projects/overdeck/.worktrees/tworC   r   rD   r!   rE   r   r   rF   rH   r   assert %(py13)spy13Nbassert %(py4)szsandbox/workspaces/one-Lassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}rr   rv   )zt%(py0)s == %(py11)s
{%(py11)s = %(py4)s
{%(py4)s = %(py2)s.remote_rel_dir
}(%(py9)s
{%(py9)s = %(py5)s(%(py7)s)
})
}!=z%(py0)s != %(py2)s)r!   remote_rel_dirr   rO   rP   rQ   rR   rS   rT   rU   rV   
startswith)r   r   rY   rZ   r   @py_assert10rX   r   @py_format14@py_format3r   r[   r   s                r'   /test_remote_rel_dir_is_stable_and_path_specificr      s   &&t,Y'Z[A&&t,Y'Z[A..c4act4a/bc./bcccccccc1cccccc1cccc1cccccccccccccc.cccccctcccctccc4accc/bcccccccccccc6MMMM1MMMMMM1MMMM1MMMMMMMMMMMMMMMMMMM<<212<1222222222122221222<222122222222222r)   c                 $   \        \        4      P                  4       P                  ^,          p V R,          P	                  RR7      pV R,          P	                  RR7      pV R,          P	                  RR7      pRqDV9   qU'       g   \
        P                  ! R!V3R"WA34      R\
        P                  ! V4      RR	\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR	/,          pR
RV/,          p\        \
        P                  ! V4      4      hR;rERqDV9   qU'       g   \
        P                  ! R!V3R"WA34      R\
        P                  ! V4      RR	\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR	/,          pR
RV/,          p\        \
        P                  ! V4      4      hR;rERqDV9   qU'       g   \
        P                  ! R!V3R"WA34      R\
        P                  ! V4      RR	\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR	/,          pR
RV/,          p\        \
        P                  ! V4      4      hR;rERqDV9   qU'       g   \
        P                  ! R!V3R"WB34      R\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR/,          pR
RV/,          p\        \
        P                  ! V4      4      hR;rERqDV9   qU'       g   \
        P                  ! R!V3R"WC34      R\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR/,          pR
RV/,          p\        \
        P                  ! V4      4      hR;rE\        R4      p\        P                  p	RqV
8H  q'       g   \
        P                  ! R#V3R$W34      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V	4      R\
        P                  ! V
4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p	;r\        P                  p	RqV
8H  q'       g   \
        P                  ! R#V3R%W34      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V	4      R\
        P                  ! V
4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p	;r\        P                   q! V4      p
R\        P"                  ! V4       2qV8H  q'       Eg3   \
        P                  ! R#V3R&W34      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V	4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V
4      R\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p	;p
;r\        P$                  q! V4      p
R \        P"                  ! V4       2qV8H  q'       Eg4   \
        P                  ! R#V3R'V
V34      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V	4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V
4      R\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p	;p
;rR# )(zdispatch, sandbox-run, receiver.mjs and the in-image e2e-remote must name the same
directory, or a dispatched run has no E2E channel and no reachable workspace.z$modules/sandbox/host/bin/sandbox-runr3   r4   z%modules/sandbox/host/lib/receiver.mjsz$modules/sandbox/image/bin/e2e-remotez-SANDBOX_ROOT="${SANDBOX_ROOT:-$HOME/sandbox}"r   r   sandbox_runr   r   Nz(WORKSPACE="$SANDBOX_ROOT/workspaces/$ID"z$--volume "$SANDBOX_ROOT:/sandbox:rw"z join(SANDBOX_ROOT, "workspaces")receiverzAWORKSPACES_ROOT="${SANDBOX_WORKSPACES_ROOT:-/sandbox/workspaces}"	image_e2er   zsandbox/workspacesrC   r!   rD   assert %(py7)srF   z/sandbox/workspaceszsandbox/workspaces/rootrs   rt   ru   z/sandbox/workspaces/inz%(py1)s in %(py3)srv   )z<%(py2)s
{%(py2)s = %(py0)s.NODE_WORKSPACES_ROOT
} == %(py5)s)zA%(py2)s
{%(py2)s = %(py0)s.CONTAINER_WORKSPACES_ROOT
} == %(py5)s)zT%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.remote_rel_dir
}(%(py3)s)
} == %(py8)s)zY%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.container_workspace
}(%(py3)s)
} == %(py8)s)r   __file__resolveparents	read_textrO   rP   rT   rQ   rR   rS   rU   rV   r!   NODE_WORKSPACES_ROOTCONTAINER_WORKSPACES_ROOTr   
sandbox_idcontainer_workspace)repor   r   r   r   r   r   r   r   rX   @py_assert4rY   r\   r   rZ   r   r   s                    r'   7test_the_workspace_root_is_the_one_every_party_resolvesr      sJ    >!!#++A.D@@KKU\K]K>>IISZI[H>>IISZI[I:IkIIIII:III:IIIIIIkIIIIkIIIIIIII5DDDDDD5DDD5DDDDDDDDDDDDDDDDDD1@[@@@@@1@@@1@@@@@@[@@@@[@@@@@@@@-999999-999-999999999999999999N[R[[[[[[N[[[N[[[[[[R[[[[[R[[[[[[[[[=>D//G3GG3GGGGGG/GGGGGG?GGGG?GGG/GGG3GGGGGGGGG44M8MM8MMMMMM4MMMMMM?MMMM?MMM4MMM8MMMMMMMMM))k)$/k5HIcIcdhIiHj3kk3kkkkkk/kkkkkk?kkkk?kkk)kkkkkk$kkkk$kkk/kkk3kkkkkkkkk.. .t4 
99$?@AA   4A    ?   ?   .     t   t   4   A       r)   c            	        \         P                  ! \        R ,          ^ ,          R,          R,          4      p V R,          p. ROq!V8H  q3'       gy   \        P                  ! RV3RW34      R\        P
                  ! V4      R\        P
                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;r2. pR	q3V 9   qwq'       d   R
qV 9   qpV'       Eg   \        P                  ! RV3R W034      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P
                  ! V 4      MR/,          p
RRV
/,          qP                  V4       V'       d   \        P                  ! RX	3R!XV 34      R\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P
                  ! V 4      MR/,          pRRV/,          qP                  V4       \        P                  ! V^ 4      / ,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p;rV R",          pRq!V8H  q3'       gy   \        P                  ! RV3RW34      R\        P
                  ! V4      R\        P
                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;r2R V  4       p\        V4      q"'       g   RRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P
                  ! \        4      MRR\        P
                  ! V4      R\        P
                  ! V4      /,          p\        \        P                  ! V4      4      hR;rbR# )#r   r   r   :N   Nr   rE   r   rr   N-p2222r   r   argv%(py7)srF   ru   py12%(py14)spy14assert %(py17)spy17zuser@100.0.0.1c              3  B   "   T F  qP                  R 4      x  K  	  R# 5i)id_ed25519_buildboxN)endswith).0r   s   & r'   	<genexpr>Jtest_ssh_argv_pins_identity_port_and_ignores_ssh_config.<locals>.<genexpr>   s     ?$Qzz/00$s   ,assert %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}rC   anyrD   )sshz-F	/dev/nullrv   r   r   z%(py3)s in %(py5)sz%(py10)s in %(py12)s)r!   ssh_argvr9   rO   rP   rT   rU   rV   rQ   rR   rS   append_format_boolopr   )r   r   rY   r   r   r   rX   r   @py_assert9@py_assert11r   r\   @py_format13@py_format15@py_format16@py_format18s                   r'   7test_ssh_argv_pins_identity_port_and_ignores_ssh_configr     s   ##HW$5a$8$B>$RSD811111111181118111111111111*4*4<**F*dN****4***4******4****4*********Fd***F******d****d****************8'''''''''8'''8''''''''''''?$??3??????????3????3??????????????r)   GIT_AUTHOR_NAMEtGIT_AUTHOR_EMAILzt@example.invalidGIT_COMMITTER_NAMEGIT_COMMITTER_EMAILc               $    V ^8  d   QhRRRRRR/# )r+   argsr#   cwdr   r.   zsubprocess.CompletedProcessr/   )r0   s   "r'   r1   r1      s"     	 	s 	 	"= 	r)   c                   \         P                  ! R .VOV RR/ \        P                  C\        CRRRR/CR7      pVP
                  p^ qCV8H  qU'       g   \        P                  ! RV3RW434      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R	\        P                  ! V4      /,          p\        P                  ! VP                  4      R
,           RV/,          p\        \        P                  ! V4      4      hR;p;rTV# )/usr/bin/gitTGIT_CONFIG_GLOBALr   GIT_CONFIG_SYSTEM)r	  capture_outputtextenvrC   donerD   r   
>assert %(py7)srF   Nrv   z2%(py2)s
{%(py2)s = %(py0)s.returncode
} == %(py5)s)
subprocessrunosenvironGIT_ENV
returncoderO   rP   rQ   rR   rS   rT   _format_assertmsgstderrrU   rV   )r	  r  r  rX   r   rY   r   r\   s   $*      r'   gitr     s    >>	$irzziWi&9;H[]hiD ??,a,a,,,,?,,,,,,4,,,,4,,,?,,,a,,,,,,,,,,,,Kr)   c                    V ^8  d   QhRRRR/# )r+   r,   r   r.   r/   )r0   s   "r'   r1   r1      s        r)   c           	         V R,          pVP                  4        \        RRRRRVR7       VR,          P                  R	R
R7       \        RRVR7       \        RRRVR7       V# )uL   A real checkout — a hand-written `.git` fixture is what let this bug ship.r   init-q-bmain.r	  file.txtzone
r3   r4   addcommit-qm)mkdirr  r6   )r,   r   s   & r'   	make_repor*     s^    fDJJLdFCT2	J""7W"=zt$%T*Kr)   c               $    V ^8  d   QhRRRRRR/# )r+   r   r   slugr#   r.   r/   )r0   s   "r'   r1   r1      s!      t 3 4 r)   c           
     b    V R ,          V,          p\        RRRRRV 2\        V4      V R7       V# )
.worktreesworktreer&  r   r!  zwt/r$  )r  r#   )r   r,  r:   s   && r'   add_worktreer0     s4    ,%D
E4TF|SYDIKr)   c               (    V ^8  d   QhRRRRRRRR/# )r+   r:   r   runtimer#   r,  r.   zremote_dispatch.Credentialr/   )r0   s   "r'   r1   r1      s/     M M$ M Mc MOi Mr)   c                X    V P                  R RR7       \        P                  ! WV R7      # )tokenr3   r4   )r2  r,  r:   )r6   r!   
Credential)r:   r2  r,  s   &&&r'   make_credentialr6     s%    OOGgO.%%gtLLr)   c                    V ^8  d   QhRRRR/# )r+   urlr#   r.   r/   )r0   s   "r'   r1   r1      s     9 9 9 9r)   c                p    R V P                  R^4      ^,          P                  R ^4      ^,          ,           # )/z://)split)r8  s   &r'   _strip_ssh_urlr<     s/    5!$Q'--c15a888r)   c                    V ^8  d   QhRRRR/# )r+   	node_homer   callszlist[list[str]] | Noner/   )r0   s   "r'   r1   r1      s        $  /E  r)   c                >   a a S P                  RRR7       VV 3R lpV# )a  Simulate the node as a real local `$HOME` and the bare mirror as a real local git
repo: an `ssh` argv runs its trailing command through `bash -c` with `HOME` and `cwd`
set to `node_home` (matching a real ssh session's default cwd), and any `ssh://` remote
in a `git push`/`fetch` argv is rewritten to the local path it names. This runs
`open_session`'s git-push transport for real, end to end, with no network.T)r   exist_okc                T  < Se   SP                  V 4       V R,          R.8X  d\   \        P                  ! RRV R,          .RR\        S4      / \        P
                  CR\        S4      /CVP                  R4      R7      # V R,          R	.8X  d|   V  Uu. uF&  q"P                  R
4      '       d   \        V4      MTNK(  	  pp\        P                  ! VRRVP                  R4      VP                  R4      VP                  R4      R7      # \        P                  ! V ^ RRR7      # u upi )NN   Nr   bash-cTHOMEtimeout)r  r  r	  r  rH  r  ssh://r  input)r  r  r  rJ  rH  r   stdoutr  r   )
r   r  r  r#   r  r  getr   r<  CompletedProcess)r   kwargstok	rewrittenr?  r>  s   &,  r'   fake_run$real_node_fake_run.<locals>.fake_run   s   LL8w>>tBx(#	N:rzz:63y>:

9-  8'']ab]aVYx0H0H,cQ]aIb>>#JJu%jj)

9-  **42bII cs   ,D%)r)  )r>  r?  rR  s   ff r'   real_node_fake_runrT     s"     OOD4O0J0 Or)   c                    \         R ,          ^,          R,          R,          p \        R4      p\        P                  ! V4      p\        P                  ! WV4      p\        P
                  ! WV4      pVRR qQ R2RV R2.qeV8H  qw'       gy   \        P                  ! RV3RWV34      R\        P                  ! V4      R\        P                  ! V4      /,          pR	R
V/,          p	\        \        P                  ! V	4      4      hR;p;rvVRR pRV R2V R2.qeV8H  qw'       gy   \        P                  ! RV3RWV34      R\        P                  ! V4      R\        P                  ! V4      /,          pR	R
V/,          p	\        \        P                  ! V	4      4      hR;p;rvV U
u. uF#  qVR,          8w  g   K  WR,          8w  g   K!  V
NK%  	  up
RR pV U
u. uF#  qVR,          8w  g   K  WR,          8w  g   K!  V
NK%  	  up
RR qeV8H  qw'       gy   \        P                  ! RV3RWV34      R\        P                  ! V4      R\        P                  ! V4      /,          pR	R
V/,          p	\        \        P                  ! V	4      4      hR;p;rv. pRqwV9   qq\'       d   RqV9   qpV'       Eg   \        P                  ! RV3RWs34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          pVP                  V4       V'       d   \        P                  ! RX3R XV34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          pVP                  V4       \        P                  ! V^ 4      / ,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p;r. pRqwV9   qq\'       d   RqV9   qpV'       Eg   \        P                  ! RV3RWs34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          pVP                  V4       V'       d   \        P                  ! RV3R W34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          pVP                  V4       \        P                  ! V^ 4      / ,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p;r. pRqwV9   qq\'       d   RqV9   qpV'       Eg   \        P                  ! RV3RWs34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          pVP                  V4       V'       d   \        P                  ! RV3R W34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          pVP                  V4       \        P                  ! V^ 4      / ,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p;rR# u up
i u up
i )!r   r   r   z/home/user/Projects/overdeckNr:  zuser@100.0.0.2:r   rE   r   rr   node_modulesr   r   pushr   rF   ru   r   pullr   r   r   r   r.  .tmpjail-workrv   r   r   r   r   r   )r9   r   r!   r   	push_argv	pull_argvrO   rP   rT   rU   rV   rQ   rR   rS   r   r   )r   r   relrW  rX  r   rY   r   r   r   r   rX   r   r   r   r   r\   r   r   r   r   s                        r'   <test_push_and_pull_are_mirror_images_with_identical_excludesr^    s   gq!(+N;F./D

(
(
.C$$V37D$$V37D9>6se1%=>>>>>>>>9>>>9>>>>>>>>>>>>9>?3%q1dV1:>>>>>>>>9>>>9>>>>>>>>>>>>?t!DH}A2hAAt?D IaR=Qr(]4I	rI  I    D  
D  
 I        =><T!<<n<&<<<<<><<<><<<<<<T<<<<T<<<<<<<<<n<<<n<<<<<<<<<<<<<<<<<<<<<<<<<<8<8488L8D$88888<888<888888488884888888888L888L888888D8888D8888888888888888>?>d">>>$'>>>>>?>>>?>>>>>>d>>>>d>>>>>>>>>>>>>>>>>>$>>>>$>>>>>>>>>>>>>>>> @ Is$   %_9
___,
_;_c                   V ^8  d   QhRR/# r+   r,   r   r/   )r0   s   "r'   r1   r1   $  s     1 1D 1r)   c                   V R ,          pVR,          P                  RR7       VR,          R,          P                  RRR7       VR,          R	,          pVP                  RR7       VP                  ^ 4       V R
,          pVP                  4         \        P                  ! RR.\
        P                  ! 4       OV R2NV R2NRRR7      pVP                  R4       VP                  p^ qeV8H  qw'       g   \        P                  ! RV3R WV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p\        P                  ! VP                  4      R,           RV/,          p	\!        \        P"                  ! V	4      4      hR;p;rvRqSV,          pRqgV,          qP$                  pRq! VR7      pRqV8H  q'       Eg   \        P                  ! RV3R!W34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\!        \        P"                  ! V4      4      hR;p;p;p;p
;p;p;p;rRqSV,          qwP&                  qf! 4       q'       * pV'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V
4      /,          p\!        \        P"                  ! V4      4      hR;p;p;p;p
pR#   TP                  R4       i ; i)"r   srcTr   zkeep.txtkeepr3   r4   rY  workmirrorrsync-ar:  r  r  i  rC   r  rD   r   r  rF   Ndestrs   ru   r   py15r   r   Qassert not %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = (%(py0)s / %(py2)s).exists
}()
}rv   r  zt%(py12)s
{%(py12)s = %(py8)s
{%(py8)s = ((%(py0)s / %(py2)s) / %(py5)s).read_text
}(encoding=%(py10)s)
} == %(py15)s)r)  r6   chmodr  r  r!   _exclude_argsr  rO   rP   rQ   rR   rS   rT   r  r  rU   rV   r   exists)r,   r   workdirrj  r  rX   r   rY   r   r\   rZ   r   r   r   @py_assert14@py_assert13r   r   r   r   s   &                   r'   -test_sync_skips_an_unreadable_overlay_workdirrt  $  s   fD	E\&	E\J**6G*D_$v-GMM$MMM%hDJJL~~dU_::<UajUTFRS*U
 	e??,a,a,,,,?,,,,,,4,,,,4,,,?,,,a,,,,,,,,,,,,L5LL:L:%L00L'L0'BLfLfLLLLLBLLLLLLDLLLLDLLL5LLL:LLL0LLL'LLLBLLLfLLLLLLLLL&0&0..0.000000000000000000000.00000000000 	es   :P8 8Qc                   V ^8  d   QhRR/# r`  r/   )r0   s   "r'   r1   r1   :  s     !^ !^QU !^r)   c                0   \        V 4      pVR ,          pVP                  4        VR,          P                  RRR7       VR,          P                  RRR7       \        RRVR	7       \        RR
RVR	7       \        RRRVR	7       VR,          P                  RRR7       VR,          P                  RRR7       V R,          pVP                  4        \        P
                  ! V4      p\        VP                  R4      P                  R4      4      pRqfV9   qw'       g   \        P                  ! R0V3R1We34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p	\        \        P                   ! V	4      4      hR;rgRqfV9   qw'       g   \        P                  ! R0V3R1We34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p	\        \        P                   ! V	4      4      hR;rgRqfV9  qw'       g   \        P                  ! R2V3R3We34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p	\        \        P                   ! V	4      4      hR;rgRqfV9  qw'       g   \        P                  ! R2V3R3We34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p	\        \        P                   ! V	4      4      hR;rg\"        P$                  ! \        P&                  ! V R2V R24      VR R!7      p
V
P(                  p^ qV8H  q'       g   \        P                  ! R4V3R5W34      R"R\        P                  ! 4       9   g   \        P                  ! V
4      '       d   \        P                  ! V
4      MRR#\        P                  ! V4      R\        P                  ! V4      /,          p	\        P*                  ! V
P,                  P/                  4       4      R$,           R%V	/,          p\        \        P                   ! V4      4      hR;p;r\"        P$                  ! . R6O\        P0                  ! 4       OV R2NV R2NR R&7      pVP(                  p^ qV8H  q'       g   \        P                  ! R4V3R5W34      R"R'\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR'R#\        P                  ! V4      R\        P                  ! V4      /,          p	\        P*                  ! VP,                  P/                  4       4      R$,           R%V	/,          p\        \        P                   ! V4      4      hR;p;rR qV,          pRqV,          pVP2                  pRpV! VR7      pRpVV8H  pV'       Eg    \        P                  ! R4V3R7VV34      R"R(\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR(R#\        P                  ! V4      R\        P                  ! V4      R)\        P                  ! V4      R*\        P                  ! V4      R+\        P                  ! V4      R,\        P                  ! V4      /,          pR-R.V/,          p\        \        P                   ! V4      4      hR;p;p;p;p;p;p;p;ppR qV,          pRqV,          pVP4                  pV! 4       pV'       * pV'       g   R/R"R(\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR(R#\        P                  ! V4      R\        P                  ! V4      R)\        P                  ! V4      R*\        P                  ! V4      /,          p\        \        P                   ! V4      4      hR;p;p;p;p;p;ppR qV,          pRqV,          pVP2                  pRpV! VR7      pRpVV8H  pV'       Eg    \        P                  ! R4V3R7VV34      R"R(\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR(R#\        P                  ! V4      R\        P                  ! V4      R)\        P                  ! V4      R*\        P                  ! V4      R+\        P                  ! V4      R,\        P                  ! V4      /,          pR-R.V/,          p\        \        P                   ! V4      4      hR;p;p;p;p;p;p;p;ppR# )8nestedz
.gitignorez ignored.txt
tracked-ignored.txt
r3   r4   ztracked-ignored.txttrackedr&  znested/.gitignorer$  -fznested/tracked-ignored.txtr'  r(  zadd nested ignorezignored.txtignoredzunignored.txt	unignoredrf      s   nested/.gitignorer   r   selected_pathsr   r   Ns   nested/tracked-ignored.txts   nested/unignored.txts   nested/ignored.txtr:  T)rJ  r  rC   rD   r  rF   )r  filteredrj  rs   ru   r   rk  r   r   z_assert not %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = ((%(py0)s / %(py2)s) / %(py5)s).exists
}()
}r   r   not inz%(py1)s not in %(py3)srv   r  )rg  rh  --deleterm  )r*  r)  r6   r  r!   git_mirror_filessetrstripr;  rO   rP   rT   rQ   rR   rS   rU   rV   r  r  tracked_sync_argvr  r  r  decodero  r   rp  )r,   r   rw  rj  selectedr}  r   r   r   r   rx  rX   r   rY   r\   r~  rZ   r   r   r   rr  rs  r   r   r   s   &                        r'   Btest_mirror_uses_nested_gitignore_without_dropping_tracked_matchesr  :  sV   XDH_F
LLNl&&'KV]&^##//	G/L"-t1t<%,$7m''	G'Do))+)HhDJJL//5H/55e<=N1>11111111111111>1111>11111111(:N:::::(:::(::::::N::::N::::::::"8.88888"888"888888.8888.88888888 666666 666 666666666666666666nn))TF!*ajAG
 ;;";;;;;;;;;;7;;;;7;;;;;;;;;;GNN$9$9$;;;;;;;;;~~]_%B%B%D]aj]UYTZZ[R\]H =!=!#==========8====8======!====X__%;%;%=========Y8OYoYo-Y-88Y'Y8'JYkYJkYYYYYJkYYYYYYDYYYYDYYY8YYYoYYY8YYY'YYYJYYYkYYYYYYYYY9x9-9-/9/77979999999999999999999x999-9997999999999999]8O]3]33]3>>]]>P]T]]PT]]]]]]PT]]]]]]]D]]]]D]]]8]]]3]]]>]]]]]]P]]]T]]]]]]]]]]]r)   c                    V ^8  d   QhRRRR/# )r+   r,   r   capsyszpytest.CaptureFixture[str]r/   )r0   s   "r'   r1   r1   ^  s     & &&6&r)   c           
        \        V 4      pVR ,          P                  RRR7       VR,          R,          R,          R,          pVP                  P                  RR	7       VP                  R
RR7       VR,          P                  RRR7       \	        RRR RRVR7       \
        P                  ! V4      p\        VP                  R4      P                  R4      4      pRqfV9  qw'       g   \        P                  ! R#V3R$We34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p	\!        \        P"                  ! V	4      4      hR;rgRqfV9   qw'       g   \        P                  ! R%V3R&We34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p	\!        \        P"                  ! V	4      4      hR;rgRqfV9   qw'       g   \        P                  ! R%V3R&We34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p	\!        \        P"                  ! V	4      4      hR;rgVP%                  4       P&                  p
RqfV
9   qw'       g   \        P                  ! R%V3R&Wj34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V
4      '       d   \        P                  ! V
4      MR/,          pRRV/,          p	\!        \        P"                  ! V	4      4      hR;rgRqfV
9   qw'       g   \        P                  ! R%V3R&Wj34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V
4      '       d   \        P                  ! V
4      MR/,          pRRV/,          p	\!        \        P"                  ! V	4      4      hR;rgRqfV
9  qw'       g   \        P                  ! R#V3R$Wj34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V
4      '       d   \        P                  ! V
4      MR/,          pRRV/,          p	\!        \        P"                  ! V	4      4      hR;rg\
        P(                  ! V4      p\        \	        RR R!WR7      P*                  P-                  4       4      pR qfV9  qw'       g   \        P                  ! R#V3R$Wl34      R\        P                  ! V4      RR"\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR"/,          pRRV/,          p	\!        \        P"                  ! V	4      4      hR;rgRqfV9   qw'       g   \        P                  ! R%V3R&Wl34      R\        P                  ! V4      RR"\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR"/,          pRRV/,          p	\!        \        P"                  ! V	4      4      hR;rgRqfV9   qw'       g   \        P                  ! R%V3R&Wl34      R\        P                  ! V4      RR"\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR"/,          pRRV/,          p	\!        \        P"                  ! V	4      4      hR;rgR# )'z.envzTOKEN=do-not-ship
r3   r4   modulesharnessseatzcredentials.jsonTrc  z{"items":[]}
z
normal.txtzship me
r&  ry  z%modules/harness/seat/credentials.jsonr$  r|  s   .envr   r   pathsr   r   Ns%   modules/harness/seat/credentials.jsons
   normal.txtz"excluded secret-shaped file '.env'logz!environment file (.env or .env.*)zdo-not-shipzls-treez-rz--name-only
tree_pathsr  r  r   r   )r*  r6   parentr)  r  r!   r  r  r  r;  rO   rP   rT   rQ   rR   rS   rU   rV   
readouterrerrsnapshot_commitrL  
splitlines)r,   r  r   manifestr  r  r   r   r   r   r  snapshotr  s   &&           r'   Ttest_dispatch_secret_filter_excludes_and_logs_env_but_keeps_manifest_and_normal_filer  ^  sa    XD	F]4wGi)+f47IIHOO$'(7;	L$$[7$CtVDlX\]//5H&,,U34E%77%%3<u<<<<<3<<<3<<<<<<u<<<<u<<<<<<<<!E!!!!!=!!!=!!!!!!E!!!!E!!!!!!!!




!
!C/6366666/666/66666636666366666666.5#55555.555.555555#5555#55555555######=###=##################..t4HSD-LSS^^`aJ######6###6##################2@j@@@@@2@@@2@@@@@@j@@@@j@@@@@@@@%:%%%%%<%%%<%%%%%%:%%%%:%%%%%%%%r)   c                   V ^8  d   QhRR/# r`  r/   )r0   s   "r'   r1   r1   {  s     & &QU &r)   c                   \        \        4      P                  ^,          R,          R,          R,          R,          p\        P                  P                  RV4      p. qCqS'       d   VP                  qfpV'       Eg5   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          qtP                  V4       V'       d~   R	R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! X4      /,          qP                  V4       \        P                  ! V^ 4      / ,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p;rF\        P                  P!                  V4      pVP                  P#                  V4       V R,          pVP%                  RRR7       R pVP'                  VP(                  RV4       \+        VP-                  VP/                  V4      4      4      p\+        VP-                  R.4      4      pRqUV9   pV'       g   \        P0                  ! RV3R W^34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;ppVP2                  qD! V4      pV'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;ppR# )!r+   sandboxr   libegress-policy.pyegress_policy_test%(py2)srD   spec#%(py6)s
{%(py6)s = %(py4)s.loader
}rE   rr   rG   rH   N
allow.jsonz0{"schema_version":1,"hosts":["allowed.example"]}r3   r4   c                .    R RRR/p^^^RW0,          ^ 33.# )zallowed.example203.0.113.10denied.examplez203.0.113.99r   r/   )r   _args_kwargsvaluess   &*, r'   fake_getaddrinfo\test_egress_policy_allows_resolved_allowlist_and_omits_denied_host.<locals>.fake_getaddrinfo  s,    #^5E~VAq"v|Q/011r)   getaddrinfor  r  r   r   allowedr   r   zLassert %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.isdisjoint
}(%(py3)s)
}rC   deniedr   r   )r   r   r   	importlibutilspec_from_file_locationloaderrQ   rR   rO   rS   rT   r   r   rU   rV   module_from_specexec_moduler6   rM   socketr  resolve_hosts
load_hostsrP   
isdisjoint)r,   r%   r:   r  rX   r   r[   r   r   r\   r]   policyconfigr  r  r  r   r   r   r   s   &&                  r'   Btest_egress_policy_allows_resolved_allowlist_and_omits_denied_hostr  {  s\   >!!!$y069EADVVD>>112FMD4DKK444DDK^^,,T2FKKF#$F
HSZ[2 }6FG&&&v'8'8'@ABG%%'7&89:F$W$$$$$>$$$>$$$$$$W$$$$W$$$$$$$$%f%%%%%%%%%7%%%%7%%%%%%%%%f%%%%f%%%%%%%%%%%r)   c                   V ^8  d   QhRR/# r`  r/   )r0   s   "r'   r1   r1     s     8 8 8r)   c                l   \        \        4      P                  ^,          R,          R,          R,          R,          p\        P                  P                  RV4      p. q2qB'       d   VP                  qUpV'       Eg5   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          qcP                  V4       V'       d~   R	R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! X4      /,          qsP                  V4       \        P                  ! V^ 4      / ,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;r5\        P                  P!                  V4      p
VP                  P#                  V
4       V R,          pVP%                  RRR7       V
P&                  pR\)        V4      .q! V4      p^qV8H  q'       g   \        P*                  ! RV3RW]34      RR\        P                  ! 4       9   g   \        P                  ! V
4      '       d   \        P                  ! V
4      MRR\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p	RRV	/,          p\        \        P                  ! V4      4      hR;p;p;p;rR# )r+   r  r   r  r  egress_policy_invalid_testr  rD   r  r  rE   rr   rG   rH   Nr  z{"schema_version":1,"hosts":[]}r3   r4   z--configrC   r  r   r   rv   )zJ%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.main
}(%(py4)s)
} == %(py9)s)r   r   r   r  r  r  r  rQ   rR   rO   rS   rT   r   r   rU   rV   r  r  r6   r"  r#   rP   )r,   r:   r  rX   r   r[   r   r   r\   r]   r  r  rY   r   r   r   s   &               r'   9test_egress_policy_fails_closed_when_allowlist_is_invalidr    s   >!!!$y069EADVVD>>112NPTUD4DKK444DDK^^,,T2FKKF#$F
7'J;;7
CK07;017R7R777771777777677776777;77707771777R777777777r)   c                   V ^8  d   QhRR/# r`  r/   )r0   s   "r'   r1   r1     s     "% "%SW "%r)   c                   \        V R ,          4      pV R,          p\        P                  ! RRRVRRR.\        P                  ! V4      R7      p\	        \        P
                  4      R	RR
\        P                  ! V4      RRRRRRRRRR.qCV8H  qU'       g   \        P                  ! RV3R W434      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;rT\        P                  qU! V4      qP                  p	Rq! V
4      q'       Eg;   RRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      R\        P                  ! V
4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;p;p	;rRqV9  qD'       g   \        P                  ! R!V3R"W34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;rR# )#	cred.json	workspacer   z//home/nodeuser/cdx-offload/git-common/repo-9999z"/home/nodeuser/.git/worktrees/maincodexexeczhello world)	host_name
git_commongit_dir
credential	exec_nameforwarded_argvr   z--hostz--idz	--runtime--git-common	--git-dir--rC   r   r   r   r   Nz
workspace-zassert %(py11)s
{%(py11)s = %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.sandbox_id
}(%(py3)s)
}.startswith
}(%(py9)s)
}r!   rD   r   rF   rH   r   z--workspacer   rv   r   r  r  )r6  r!   launcher_argvr   r#   AGENT_SANDBOX_BINrO   rP   rQ   rR   rS   rT   rU   rV   r   )r,   credr   r   r   rX   r   r   r   rZ   r   r   r   r   s   &             r'   Dtest_launcher_argv_starts_the_container_with_pinned_invocation_shaper    s^   8k12Dk!D((D4."--d3D 	O--.""4(9,       !4    !   !4    !4    !        ! $ %%D%d+D66D|D6|DDDDDDDDD?DDDD?DDD%DDDDDDdDDDDdDDD+DDD6DDD|DDDDDDDDDDD $$$$$$=$$$=$$$$$$$$$$$$$$$$$$r)   c                   V ^8  d   QhRR/# r`  r/   )r0   s   "r'   r1   r1     s     6 6T 6r)   c                   \         P                  ! R \        V R,          4      RRR.RR7      pVRR p. ROq2V8H  qD'       gy   \        P                  ! RV3RW#34      R\        P
                  ! V4      R	\        P
                  ! V4      /,          pR
RV/,          p\        \        P                  ! V4      4      hR;p;rCR# )r   z
cred2.jsonr  r  hizcdx-offload-d-1234)r  r  r  r  r   Nr   rE   r   rr   )r  r  r  r  rv   r   )r!   r  r6  rO   rP   rT   rU   rV   )r,   r   r   rY   r   r   r   s   &      r'   >test_launcher_invocation_puts_the_command_after_bare_dash_dashr    s    (("8l#:;~'D 955555555595559555555555555r)   c                   a a . oS R ,          pV3R lpVP                  \        RR)V 3R ll4       \        P                  ! RRR.\        V4      \	        S 4      VR R	7      pVP
                  pR
qeV8H  qw'       g   \        P                  ! R*V3R+WV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvR S 4       p\        V4      qw'       g   RRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
\        \        P                  ! V
4      4      hR;rWR S 4       p\        V4      qw'       g   RRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
\        \        P                  ! V
4      4      hR;rWVP                  ^ ,          p\        P                   p\#        V4      qV8H  q'       Eg;   \        P                  ! R*V3R,W34      R\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \"        4      '       d   \        P                  ! \"        4      MRRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;rVP$                  p\        P$                  pRpS V,          pV! V4      pVV8H  qw'       Eg   \        P                  ! R*V3R-VV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! S 4      '       d   \        P                  ! S 4      MRR \        P                  ! V4      R!\        P                  ! V4      /,          pR"R#V/,          p\        \        P                  ! V4      4      hR;p;p;p;p;ppVP&                  pR$qeV8H  qw'       g   \        P                  ! R*V3R.WV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvVP(                  pR%VP*                   2qeV8H  qw'       g   \        P                  ! R*V3R/WV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvVP,                  pR0qeV8H  qw'       g   \        P                  ! R*V3R1WV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvVP.                  p\        V4      pVV8H  qw'       Egl   \        P                  ! R*V3R2VV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR&\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MR&RR'\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR'R\        P                  ! V4      /,          p	R(R V	/,          p\        \        P                  ! V4      4      hR;p;ppR# )3r  c                  < SP                  V 4       V R ,          R.8X  d   \        P                  ! V ^ RRR7      # RRP                  V 4      9   d   \        P                  ! V ^ RRR7      # \        P                  ! V ^ RRR7      # rC  rg  r   rK  printf '%s\n' "$HOME" /home/nodeuser
r   r  rN  joinr   rO  r?  s   &,r'   rR  Ctest_open_session_pushes_then_returns_remote_argv.<locals>.fake_run  t    T8y ..tQr"MM%$7..tQ?QZ\]]**42bIIr)   	repo_rootNc                   < SR ,          # r   r/   r	  r,   s   &r'   r@   Ctest_open_session_pushes_then_returns_remote_argv.<locals>.<lambda>      xRXGXr)   r  r  r  c                &    V R ,          R8X  d   R# R# r   r         ?g      @r/   r   s   &r'   r@   r        qyK7@S@r)   r  registry_pathr  r   r   rC   sessionrD   r   r   rF   c              3  J   "   T F  pR RP                  V4      9   x  K  	  R# 5izmkdir -pr  Nr  r   cs   & r'   r   Dtest_open_session_pushes_then_returns_remote_argv.<locals>.<genexpr>       8%QzSXXa[(%   !#r   r   rE   c              3  8   "   T F  q^ ,          R8H  x  K  	  R# 5ir   rg  Nr/   r  s   & r'   r   r         .1tw   r   r   r#   r!   rr   rs   rt   ru   r   r,   rH   r   assert %(py14)sr   z/home/nodeuserz/home/nodeuser/r6  	cred_pathrG   r   rv   z1%(py2)s
{%(py2)s = %(py0)s.host_name
} == %(py5)s)zW%(py1)s == %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.AGENT_SANDBOX_BIN
})
})z~%(py2)s
{%(py2)s = %(py0)s.sandbox_id
} == %(py12)s
{%(py12)s = %(py6)s
{%(py6)s = %(py4)s.sandbox_id
}((%(py7)s / %(py9)s))
})z1%(py2)s
{%(py2)s = %(py0)s.node_home
} == %(py5)s)z1%(py2)s
{%(py2)s = %(py0)s.workspace
} == %(py5)sr/   z.%(py2)s
{%(py2)s = %(py0)s.mounts
} == %(py5)s)zP%(py2)s
{%(py2)s = %(py0)s.credential
} == %(py7)s
{%(py7)s = %(py4)s(%(py5)s)
})rM   r!   open_sessionr6  r;   r  rO   rP   rQ   rR   rS   rT   rU   rV   r   r   r  r#   r   r>  r  rel_dirmountsr  )r,   r%   r  rR  r  rX   r   rY   r   r\   r   r   r[   r   r   r   r   r   r   r   r   r   rZ   r]   r?  s   f&                      @r'   1test_open_session_pushes_then_returns_remote_argvr    s   E;&IJ 6XY**	"9-$X.@G )	)	)))))))))))7))))7))))))	))))))))8%883888888888838888388888888888888...3..........3....3..............<<?D/"C"CDc"CDDDDDDDD?DDD?DDDDDDcDDDDcDDDDDDD/DDDD/DDD"CDDDDDDDDDDDDN!;!;NvNHv<MN!;<M!NN!NNNNNN!NNNNNNN7NNNN7NNNNNNNNNNNNNNNN!;NNNNNNHNNNNHNNNvNNN!NNNNNNNNNN0 00 000000000000700007000000 000000000C/'//1B CC CCCCCCCCCCCC7CCCC7CCCCCC CCCCCCCCC>>RR>77>R;!;;!;;;;;;!;;;;;;;7;;;;7;;;;;;;;;;;;;;;;;;;;;;;;;;;!;;;;;;;;;r)   c                	   \         P                  ! \        P                  4      ;_uu_ 4       p\        P                  ! R RR.\        V 4      R R7       RRR4       XP                  q3P                  p\        P                  qTV8H  qf'       Eg3   \        P                  ! RV3RWE34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R	\        P                  ! V4      R
R\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                   ! V4      4      hR;p;p;reR qP                  p\#        V4      qYV9   q'       Eg3   \        P                  ! RV
3RW34      R\        P                  ! V	4      RR\        P                  ! 4       9   g!   \        P                  ! \"        4      '       d   \        P                  ! \"        4      MRR	R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR
\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                   ! V4      4      hR;p	;p
;reVP$                  p
Rq! V4      p\'        V4      p. qV8H  q'       Eg_   \        P                  ! RV3RW34      RR\        P                  ! 4       9   g!   \        P                  ! \&        4      '       d   \        P                  ! \&        4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V
4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                   ! V4      4      hR;p
;p;p;p;rR#   + '       g   i     ELs; i) r  r  r  c                    R # r  r/   r   s   &r'   r@   @test_open_session_requires_a_credential_object.<locals>.<lambda>      Cr)   )r  r   NrC   rq   rD   rE   rr   r!   rs   rt   ru   r   r   r#   *.claimlistr(   r   rF   rH   r   r  r   rv   zl%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.code
} == %(py8)s
{%(py8)s = %(py6)s.EXIT_CREDENTIAL
}r   zK%(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.value
})
}zi%(py9)s
{%(py9)s = %(py0)s(%(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.glob
}(%(py5)s)
})
} == %(py12)s)ry   rz   r!   r{   r  r;   r}   r~   EXIT_CREDENTIALrO   rP   rQ   rR   rS   rT   rU   rV   r#   globr  )r,   r(   rq   rX   rY   r   r[   r   r   r   r   r   rZ   r   r   r   r   r   s   &&                r'   .test_open_session_requires_a_credential_objectr    s   	99	:	:h$$TN(2		
 
; >>AA/"A"AA"AAAAAAAAAAAA8AAAA8AAA>AAAAAAAAA/AAAA/AAA"AAAAAAAAA)..)c.))))))))7)))7))))))c))))c)))))))())))())).))))))))))))"''9	9'	294239r9r9999939999994999949999999"9999"999'999	99929993999r999999999 
;	:	:s   'R>>S	c                   V R ,          pVP                  RRR7       VP                  4        \        P                  ! \        P
                  4      ;_uu_ 4       p\        P                  ! RRR.\        P                  ! RRV4      \        V 4      R R	7       R
R
R
4       XP                  q3P                  p\        P                  qTV8H  qf'       Eg3   \        P                  ! RV3RWE34      RR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRR\        P"                  ! V4      R\        P"                  ! V4      RR\        P                  ! 4       9   g!   \        P                   ! \        4      '       d   \        P"                  ! \        4      MRR\        P"                  ! V4      /,          pRRV/,          p\%        \        P&                  ! V4      4      hR
;p;p;reRqP                  p\)        V4      qYV9  q'       Eg3   \        P                  ! RV
3RW34      R\        P"                  ! V	4      RR\        P                  ! 4       9   g!   \        P                   ! \(        4      '       d   \        P"                  ! \(        4      MRRR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRR\        P"                  ! V4      R\        P"                  ! V4      /,          pRRV/,          p\%        \        P&                  ! V4      4      hR
;p	;p
;reRqP                  p\)        V4      qYV9   q'       Eg3   \        P                  ! RV
3R W34      R\        P"                  ! V	4      RR\        P                  ! 4       9   g!   \        P                   ! \(        4      '       d   \        P"                  ! \(        4      MRRR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRR\        P"                  ! V4      R\        P"                  ! V4      /,          pRRV/,          p\%        \        P&                  ! V4      4      hR
;p	;p
;re\)        V4      qP                  p\)        V4      qV9   q'       Eg   \        P                  ! RV3R!W34      RR\        P                  ! 4       9   g!   \        P                   ! \(        4      '       d   \        P"                  ! \(        4      MRRR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRR\        P"                  ! V
4      RR\        P                  ! 4       9   g!   \        P                   ! \(        4      '       d   \        P"                  ! \(        4      MRRR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRR\        P"                  ! V4      R\        P"                  ! V4      /,          pRRV/,          p\%        \        P&                  ! V4      4      hR
;p
;p;r[R
#   + '       g   i     ELC; i)"r  zvery-sensitive-tokenr3   r4   r  r  r  acctc                    R # r  r/   r   s   &r'   r@   Stest_open_session_rejects_a_missing_or_unreadable_credential_path.<locals>.<lambda>  r	  r)   r  r  r   NrC   rq   rD   rE   rr   r!   rs   rt   ru   r   r   r#   credential_pathr   assert %(py12)sr   rv   r  r  )zO%(py1)s not in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.value
})
}r   r  )zk%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} in %(py10)s
{%(py10)s = %(py5)s(%(py8)s
{%(py8)s = %(py6)s.value
})
})r6   unlinkry   rz   r!   r{   r  r5  r;   r}   r~   r  rO   rP   rQ   rR   rS   rT   rU   rV   r#   )r,   r  rq   rX   rY   r   r[   r   r   r   r   r   r   r   s   &             r'   Atest_open_session_rejects_a_missing_or_unreadable_credential_pathr    s   ,O5H	99	:	:h$$TN&11'6?S(2	
 
; >>AA/"A"AA"AAAAAAAAAAAA8AAAA8AAA>AAAAAAAAA/AAAA/AAA"AAAAAAAAA!<^^<^)<<)<<<<<<!<<<!<<<<<<<<<<<<<<<<<X<<<<X<<<^<<<)<<<<<<<<<)..)c.))))))))7)))7))))))c))))c)))))))())))())).))))))))))))6~~63~#66#666666666666366663666666666666666666663666636666666x6666x666~666#666666666 
;	:	:s   >[["	c                &  a  R  pVP                  \        RRV 3R ll4       \        P                  ! \        P                  RR7      ;_uu_ 4       p\        P
                  ! RRR.\        S R	,          4      \        S 4      VR
 R7       RRR4       XP                  qDP                  p\        P                  qeV8H  qw'       Eg3   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MRR\        P                   ! V4      R\        P                   ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                   ! \        4      MRR\        P                   ! V4      /,          pRRV/,          p	\#        \        P$                  ! V	4      4      hR;p;p;rvR#   + '       g   i     EL; i)c                    V ^ ,          R8X  d   ^M^ pV ^ ,          R8X  d   \         P                  ! V ^ RRR7      # \         P                  ! WRRR7      # )r   rg  r   r  r   rK  	disk fullr  rN  r   rO  rcs   &, r'   rR  Dtest_open_session_fails_closed_when_the_push_fails.<locals>.fake_run
  sT    q'W$Q!7e..a 22  **4B{SSr)   r  Nc                   < SR ,          # r  r/   r  s   &r'   r@   Dtest_open_session_fails_closed_when_the_push_fails.<locals>.<lambda>  r  r)   zmirror push failed)matchr  r  r  r  c                    R # r  r/   r   s   &r'   r@   r#    r	  r)   r  rC   rq   rD   rE   rr   r!   rs   rt   ru   r   rv   zh%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.value
}.code
} == %(py8)s
{%(py8)s = %(py6)s.EXIT_MIRROR
})rM   r!   ry   rz   r{   r  r6  r;   r}   r~   EXIT_MIRRORrO   rP   rQ   rR   rS   rT   rU   rV   )
r,   r%   rR  rq   rX   rY   r   r[   r   r   s
   f&        r'   2test_open_session_fails_closed_when_the_push_failsr(  	  s3   T 6XY	99AU	V	VZb$$TN&x+'=>(2	
 
W >>==/"="=="============8====8===>=========/====/==="========= 
W	V	Vs   9G??H	c                   \         P                  ! R \        R,          ^ ,          R,          R,          V RR.R7      pVP                  R R7      p. pR	qBVJqUqe'       d   R qwV9   qqh'       d   R
qV9   qpV'       Eg@   \        P
                  ! R"V3R#W$34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          qP                  V4       V'       EdN   \        P
                  ! R$X3R%XV34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          qP                  V4       V'       d   \        P
                  ! R$X
3R&X	V34      R\        P                  ! V	4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          pVP                  V4       \        P                  ! V^ 4      / ,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;p;p;p;p;p;rVP                  pR qS! VR7      pR	pVVJ pV'       g   \        P
                  ! R'V3R(VV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pR R!V/,          p\        \        P                  ! V4      4      hR	;p;p;p;ppR	# ))r   r   r   r   zcdx-offload/xr   )r  r   r   r  r   c                6    \         P                  ! V ^RRR7      # )   r   boomrK  r  r   kws   &,r'   r@   Ctest_pull_back_reports_failure_instead_of_raising.<locals>.<lambda>(  s    z::4BW]^r)   r  Nr,  rD   r  r   r   rF   ru   r   r   r   r   py19z%(py21)spy21zassert %(py24)spy24c                6    \         P                  ! V ^ RRR7      # r   r   rK  r  r-  s   &,r'   r@   r/  ,  s    z::42VXYr)   rC   r  rE   rr   rH   r   r   is not)z%(py2)s is not %(py5)sr   r   )z%(py17)s in %(py19)srI   )zS%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.pull_back
}(run=%(py4)s)
} is %(py9)s)r!   Sessionr9   	pull_backrO   rP   rQ   rR   rS   rT   r   r   rU   rV   )r,   r  r  rX   r   rY   r   r   r   @py_assert16@py_assert18r   r\   r   r   @py_format20@py_format22@py_format23@py_format25r[   r   r   r]   r   s   &                       r'   1test_pull_back_reports_failure_instead_of_raisingr@    s   %% #H-n=WG 

^  C BdAd?AAyAC/AAFAcMAAAA3AAAAAA3AAAA3AAAdAAAAAAAAAyCAAAyAAAAAACAAAACAAAAAAAAAFcAAAFAAAAAAcAAAAcAAAAAAAAAAAAAAAAA YY 	 	    	 v  7  I7  I  IY I   I	       r)   c                   \         P                  ! \        P                  4      ;_uu_ 4       p\        P                  ! V R ,          4       RRR4       XP
                  q"P                  p\        P                  qCV8H  qU'       Eg3   \        P                  ! RV3RW434      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      /,          pR	R
V/,          p\        \        P                  ! V4      4      hR;p;p;rTR#   + '       g   i     EL; i)z	nope.jsonNrC   rq   rD   rE   rr   r!   rs   rt   ru   rv   rx   )ry   rz   r!   r{   load_registryr}   r~   r   rO   rP   rQ   rR   rS   rT   rU   rV   )r,   rq   rX   rY   r   r[   r   r   s   &       r'   6test_load_registry_missing_file_is_offload_unavailablerC  0  s    	99	:	:h%%h&<= 
;>>>>/">">>">>>>>>>>>>>>8>>>>8>>>>>>>>>>>>>/>>>>/>>>">>>>>>>>> 
;	:	:s   GG	c                   \         P                  p\        V 4      q!! V4      pR qCVJ qU'       Eg   \        P                  ! RV3RW434      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R	\        P                  ! V4      R
\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR ;p;p;p;rTR # )NrC   r!   rD   r   r*  rE   r,   rr   rs   r   r   r   rI   )zo%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.git_mirror
}(%(py6)s
{%(py6)s = %(py3)s(%(py4)s)
})
} is %(py11)s)r!   
git_mirrorr*  rO   rP   rQ   rR   rS   rT   rU   rV   )r,   rX   r[   r   r   r   r   r   s   &       r'   ,test_git_mirror_is_none_for_a_plain_checkoutrF  6  s    %%Bi&9B%&9:BdBdBBBBB:BBBBBB?BBBB?BBB%BBBBBBiBBBBiBBBBBBBBBBBBBB&9BBB:BBBdBBBBBBBBBr)   c                   V R ,          pVP                  4        \        P                  q"! V4      pRqCVJ qU'       Eg3   \        P                  ! RV3RW434      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pR	R
V/,          p\        \        P                  ! V4      4      hR;p;p;rTR# )notrepoNrC   r!   rD   r   plainr   rs   rt   ru   rI   )zP%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.git_mirror
}(%(py3)s)
} is %(py8)s)r)  r!   rE  rO   rP   rQ   rR   rS   rT   rU   rV   )r,   rI  rX   r   r   rZ   r   r   s   &       r'   ,test_git_mirror_is_none_outside_a_repositoryrJ  :  s    y E	KKM%%4%e,4444444,444444?4444?444%444444e4444e444,44444444444r)   c                L   \        V 4      p\        VR 4      p\        P                  ! V4      pRqCVJqU'       g   \        P
                  ! RV3RW434      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;rTVP                  pRqV,          p	RqV
,          pR qV,          qP                  q! 4       qV8H  pV'       Egm   \        P
                  ! RV3RW_34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR	\        P                  ! V4      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V
4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p	;p
;p;p;p;rVP                  pRqV,          qP                  q! 4       qV8H  pV'       EgA   \        P
                  ! RV3R W[34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR	\        P                  ! V4      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V
4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p	;rVP                  qUP                   pRpV! V4      q'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V	4      /,          p\        \        P                  ! V4      4      hR;p;p;rVP"                  qSP                   R2pVV8H  pV'       g   \        P
                  ! RV3R!VV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR	\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;ppR# )"alphaNrC   rf  r   r   r   .git	worktreesrD   rE   r   rr   rH   r   rk  r   zassert %(py19)sr1  r   r   r   zcdx-offload/git-common/repo-zoassert %(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.remote_common
}.startswith
}(%(py6)s)
}rs   z/worktrees/alphar   rF   r6  z%(py0)s is not %(py3)srv   )z%(py2)s
{%(py2)s = %(py0)s.git_dir
} == %(py17)s
{%(py17)s = %(py15)s
{%(py15)s = (((%(py4)s / %(py6)s) / %(py9)s) / %(py12)s).resolve
}()
})zt%(py2)s
{%(py2)s = %(py0)s.common_dir
} == %(py11)s
{%(py11)s = %(py9)s
{%(py9)s = (%(py4)s / %(py6)s).resolve
}()
})z6%(py2)s
{%(py2)s = %(py0)s.remote_git_dir
} == %(py5)s)r*  r0  r!   rE  rO   rP   rQ   rR   rS   rT   rU   rV   r  r   
common_dirremote_commonr   remote_git_dir)r,   r   wtrf  r   rX   r   r   r[   r   r   r   r   rs  rr  r:  rY   r   r<  r   r   r   r   r\   s   &                       r'   Ntest_git_mirror_detects_a_linked_worktree_and_targets_the_common_worktrees_dirrT  @  sk   XD	dG	$B''+F666>>NVNVmNkNk9NGNGCNLLNLNNNNNNNN>NNNNNN6NNNN6NNN>NNNNNNdNNNNdNNNVNNNkNNNGNNNLNNNNNNNNNNNNNN999 7 79 7 99 9999999999996999969999999999999999999 7999 9999999999J**J+IJ*+IJJJJJJJJJ6JJJJ6JJJJJJ*JJJ+IJJJJJJJJJJJ  M';';&<<L$MM $MMMMMM $MMMMMMM6MMMM6MMM MMM$MMMMMMMMMr)   c                   \        V 4      p\        P                  ! \        VR 4      4      p\        P                  ! \        VR4      4      pVP                  qCP                  qTV8H  qf'       Eg   \
        P                  ! R	V3R
WE34      RR \        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR R\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p;reVP                  qCP                  qTV8g  qf'       Eg   \
        P                  ! RV3RWE34      RR \        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR R\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p;reR# )onetworC   rD   rE   rr   assert %(py8)srs   Nrv   )zX%(py2)s
{%(py2)s = %(py0)s.remote_common
} == %(py6)s
{%(py6)s = %(py4)s.remote_common
}r   )zZ%(py2)s
{%(py2)s = %(py0)s.remote_git_dir
} != %(py6)s
{%(py6)s = %(py4)s.remote_git_dir
})r*  r!   rE  r0  rQ  rO   rP   rQ   rR   rS   rT   rU   rV   rR  )	r,   r   rV  rW  rX   r[   rY   r   r   s	   &        r'   Itest_two_worktrees_of_one_repo_share_the_common_mirror_but_not_the_gitdirrY  K  sv   XD

$
$\$%>
?C

$
$\$%>
?C1 1 11 1111111111113111131111111111111111 1111111113!3!33!3333333333333333333333333333333333!333333333r)   c                    \         R ,          ^,          R,          R,          p \        P                  ! \        R4      \        R4      RRR7      p\        P                  ! W4      pRq3V9  qD'       g   \
        P                  ! RV3RW234      R	\
        P                  ! V4      R
R\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR/,          pRRV/,          p\        \
        P                  ! V4      4      hR;r4W"P                  R4      ^,           ,          pRqsV8H  qD'       gy   \
        P                  ! RV3RW734      R	\
        P                  ! V4      R\
        P                  ! V4      /,          pRRV/,          p	\        \
        P                  ! V	4      4      hR;p;rGVRR pRR.qsV8H  qD'       gy   \
        P                  ! RV3RW734      R	\
        P                  ! V4      R\
        P                  ! V4      /,          pRRV/,          p	\        \
        P                  ! V	4      4      hR;p;rG\        P                  ! W4      p
Rq3V
9   qD'       g   \
        P                  ! RV3RW:34      R	\
        P                  ! V4      R
R\        P                  ! 4       9   g   \
        P                  ! V
4      '       d   \
        P                  ! V
4      MR/,          pRRV/,          p\        \
        P                  ! V4      4      hR;r4V
RR pRR.qsV8H  qD'       gy   \
        P                  ! RV3RW734      R	\
        P                  ! V4      R\
        P                  ! V4      /,          pRRV/,          p	\        \
        P                  ! V	4      4      hR;p;rGR# ) r   r   r   z/r/.git/worktrees/a/r/.gitcdx-offload/git-common/r-abcz(cdx-offload/git-common/r-abc/worktrees/ar  rP  rQ  rR  r  r   r   r   r   r   N	--excludez
/worktreesrE   r   rr   z/r/.git/z,user@100.0.0.2:cdx-offload/git-common/r-abc/gitdirz/r/.git/worktrees/a/z8user@100.0.0.2:cdx-offload/git-common/r-abc/worktrees/a/r  r  rv   r   rZ  r   r   )r9   r!   	GitMirrorr   git_common_push_argvrO   rP   rT   rQ   rR   rS   rU   rV   indexgit_dir_push_argv)r   rf  r   r   r   r   r   rY   r   r   r_  s              r'   >test_common_push_keeps_sibling_worktrees_out_and_never_deletesrd  S  sn   gq!(+N;F&&*+	?4A	F //?D!T!!!!!:!!!:!!!!!!T!!!!T!!!!!!!!

;'!+,<<<<<<<,<<<,<<<<<<<<<<<9T%STTTTTTTT9TTT9TTTTTTTTTTTT..v>F::"#; B      ;   ;            r)   c                 "  a \         R ,          ^,          R,          R,          p \        P                  ! \        R4      \        R4      RRR7      p. oV3R lp\        P                  pR	pR
pRqc! WWVVVR7      pRqVJ q'       Eg   \
        P                  ! R%V	3R&VV34      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V 4      '       d   \
        P                  ! V 4      MRR\
        P                  ! V4      R\
        P                  ! V4      R\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRRR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      /
,          p
RRV
/,          p\        \
        P                  ! V4      4      hR;p;p;p;p;p;rS^ ,          RR' p\        P                  qD! V 4      qV8H  q'       Eg3   \
        P                  ! R(V3R)W34      R\
        P                  ! V4      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V 4      '       d   \
        P                  ! V 4      MRR\
        P                  ! V4      /,          pR RV/,          p\        \
        P                  ! V4      4      hR;p;p;rMS^ ,          R',          pR!pVV8H  q'       gz   \
        P                  ! R(V3R*VV34      R\
        P                  ! V4      R"\
        P                  ! V4      /,          pR#RV/,          p\        \
        P                  ! V4      4      hR;p;ppS^,          p\        P                  qD! W4      qlV8H  q'       Eg   \
        P                  ! R(V3R+W34      R\
        P                  ! V4      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V 4      '       d   \
        P                  ! V 4      MRRR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      /,          pR$RV/,          p\        \
        P                  ! V4      4      hR;p;p;rFS^,          p\        P                  qD! W4      qlV8H  q'       Eg   \
        P                  ! R(V3R,W34      R\
        P                  ! V4      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V 4      '       d   \
        P                  ! V 4      MRRR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      /,          pR$RV/,          p\        \
        P                  ! V4      4      hR;p;p;rFR# )-r   r   r   /r/.git/worktrees/a br[  r\  z*cdx-offload/git-common/r-abc/worktrees/a br]  c                Z   < SP                  V 4       \        P                  ! V ^ RRR7      # r5  )r   r  rN  )r   r  r?  s   &,r'   rR  Ktest_prepare_remote_git_creates_destinations_before_rsync.<locals>.fake_runr  s&    T**42bIIr)   r   zcdx-offload/rz/home/user/cdx-offload/rr0  NrC   r!   rD   r   r   rF   rH   ru   rf  r   rR  r   py16assert %(py18)spy18r   rr   rs   rt   zRmkdir -p cdx-offload/git-common/r-abc 'cdx-offload/git-common/r-abc/worktrees/a b'rE   r   r   rI   )z%(py13)s
{%(py13)s = %(py2)s
{%(py2)s = %(py0)s.prepare_remote_git
}(%(py3)s, %(py5)s, %(py7)s, %(py9)s, %(py10)s, run=%(py11)s)
} is %(py16)sr   rv   )zN%(py1)s == %(py8)s
{%(py8)s = %(py5)s
{%(py5)s = %(py3)s.ssh_argv
}(%(py6)s)
}r   )zc%(py1)s == %(py9)s
{%(py9)s = %(py5)s
{%(py5)s = %(py3)s.git_common_push_argv
}(%(py6)s, %(py7)s)
})z`%(py1)s == %(py9)s
{%(py9)s = %(py5)s
{%(py5)s = %(py3)s.git_dir_push_argv
}(%(py6)s, %(py7)s)
})r9   r!   r`  r   prepare_remote_gitrO   rP   rQ   rR   rS   rT   rU   rV   r   ra  rc  )r   rf  rR  rX   r   rZ   r   @py_assert12@py_assert15rr  @py_format17@py_format19r   r   r   r   r   rY   r   r   r]   r   r?  s                         @r'   9test_prepare_remote_git_creates_destinations_before_rsyncrq  h  s   gq!(+N;F&&,-	?4C	F  EJ -- *,F-?  
 
     
  v  ?   I?   I-   v    I  I  I*  I,F  v  HN  IHN  v    I  I    I 
        8CR=<O44<4V<<<<<<<<=<<<=<<<<<<O<<<<O<<<4<<<<<<V<<<<V<<<<<<<<<<<<8B< 	7<	7   <	7  <   	7        8K;;K;FKKKKKKKK8KKK8KKKKKKKKKKKKK;KKKKKKFKKKKFKKKKKKKFKKKKFKKKKKKKKKKKK8H88H8HHHHHHHH8HHH8HHHHHHHHHHHHH8HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHr)   c                 D   \         R ,          ^,          R,          R,          p \        R4      p\        P                  \        P                  3 EFM  pRpRpRqR! WWER7      qcV9   qw'       Eg   \
        P                  ! RV3RW634      R\
        P                  ! V4      R	R
\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR
RR\        P                  ! 4       9   g   \
        P                  ! V 4      '       d   \
        P                  ! V 4      MRRR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      R\
        P                  ! V4      /,          pRRV/,          p	\        \
        P                  ! V	4      4      hR;p;p;p;rVRpRqB! WV4      qSV9  qw'       Egy   \
        P                  ! RV3RW534      R\
        P                  ! V4      R	R
\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR
RR\        P                  ! 4       9   g   \
        P                  ! V 4      '       d   \
        P                  ! V 4      MRRR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      R\
        P                  ! V4      /,          p
RRV
/,          p\        \
        P                  ! V4      4      hR;p;p;rEEKP  	  R# )r   r   r   z)/home/user/Projects/overdeck/.worktrees/xz/.gitdT)exclude_gitr   r   buildrE   r   r   rF   rH   r   r   r   Nr   r   )zY%(py1)s in %(py11)s
{%(py11)s = %(py3)s(%(py4)s, %(py5)s, %(py7)s, exclude_git=%(py9)s)
}r  )zF%(py1)s not in %(py9)s
{%(py9)s = %(py3)s(%(py4)s, %(py5)s, %(py7)s)
})r9   r   r!   r[  r\  rO   rP   rT   rQ   rR   rS   rU   rV   )r   r   ru  r   rZ   r   r   r   r   r   r]   s              r'   ?test_dot_git_is_excluded_both_ways_only_for_a_worktree_dispatchrv    s   gq!(+N;F;<D!++_-F-FGDcDtD%cDDDDDDDDwDDDwDDDDDD%DDDD%DDDDDDDDDDDDDDDDDDDDDDDDDcDDDtDDDDDDDDDDDD6#6eF#66666666w666w666666e6666e6666666F6666F6666666D6666D666#666666666666 Hr)   c                R   \        V 4      p\        VR4      p\        P                  ! V4      p\        P                  ! V4      p\        P
                  ! V4      pV R,          p\        P                  ! W&V,          \        P                  ! R4      R7       \        P                  ! VP                  WcP                  ,          \        P                  ! R4      R7       \        P                  ! VP                  WcP                  ,          4       \        P                  ! RR\        P                  ! WEV4      .RR/ \         P"                  C\$        CR	\'        V4      /CR
7      pVP(                  p^ qV	8H  q'       g   \*        P,                  ! R@V
3RAW34      RR\.        P0                  ! 4       9   g   \*        P2                  ! V4      '       d   \*        P4                  ! V4      MRR\*        P4                  ! V4      R\*        P4                  ! V	4      /,          p\*        P6                  ! VP8                  4      R,           RV/,          p\;        \*        P<                  ! V4      4      hR;p;rWd,          pRqV,          qP>                  p	Rq! VR7      pRWcP                  ,           R2pVV8H  pV'       Eg
   \*        P,                  ! R@V3RBVV34      RR\.        P0                  ! 4       9   g   \*        P2                  ! V4      '       d   \*        P4                  ! V4      MRR\*        P4                  ! V4      R\*        P4                  ! V	4      R\*        P4                  ! V4      R\*        P4                  ! V4      R\*        P4                  ! V4      /,          pRRV/,          p\;        \*        P<                  ! V4      4      hR;p;p
;p	;p;p;ppVP                  pVV,          p	RpV	V,          pVP>                  pRpV! VR7      pRpVV8H  pV'       Egn   \*        P,                  ! R@V3RCVV34      RR\.        P0                  ! 4       9   g   \*        P2                  ! V4      '       d   \*        P4                  ! V4      MRRR\.        P0                  ! 4       9   g   \*        P2                  ! V4      '       d   \*        P4                  ! V4      MRR \*        P4                  ! V4      R!\*        P4                  ! V4      R\*        P4                  ! V4      R"\*        P4                  ! V4      R#\*        P4                  ! V4      R$\*        P4                  ! V4      /,          pR%R&V/,          p\;        \*        P<                  ! V4      4      hR;p;p	;p;p;p;p;p;ppVP                  pVV,          p	R'pV	V,          pVP>                  pRpV! VR7      pV R(2pVV8H  pV'       Egn   \*        P,                  ! R@V3RCVV34      RR\.        P0                  ! 4       9   g   \*        P2                  ! V4      '       d   \*        P4                  ! V4      MRRR\.        P0                  ! 4       9   g   \*        P2                  ! V4      '       d   \*        P4                  ! V4      MRR \*        P4                  ! V4      R!\*        P4                  ! V4      R\*        P4                  ! V4      R"\*        P4                  ! V4      R#\*        P4                  ! V4      R$\*        P4                  ! V4      /,          pR%R&V/,          p\;        \*        P<                  ! V4      4      hR;p;p	;p;p;p;p;p;ppR)pR*p
\A        WVR+7      qPB                  qPD                  pV! 4       p\'        V4      pVV8H  pV'       Eg0   \*        P,                  ! R@V3RDVV34      RR,\.        P0                  ! 4       9   g!   \*        P2                  ! \@        4      '       d   \*        P4                  ! \@        4      MR,R\*        P4                  ! V4      R-\*        P4                  ! V
4      RR\.        P0                  ! 4       9   g   \*        P2                  ! V4      '       d   \*        P4                  ! V4      MRR\*        P4                  ! V4      R\*        P4                  ! V4      R"\*        P4                  ! V4      R#\*        P4                  ! V4      R.R/\.        P0                  ! 4       9   g!   \*        P2                  ! \&        4      '       d   \*        P4                  ! \&        4      MR/R$R\.        P0                  ! 4       9   g   \*        P2                  ! V4      '       d   \*        P4                  ! V4      MRR&\*        P4                  ! V4      /,          pR0R1V/,          p\;        \*        P<                  ! V4      4      hR;p;p
;p;p;p;p;ppR2pR3p	R4p\A        WVR+7      pVPB                  pVV9   pV'       Eg`   \*        P,                  ! REV3RFVV34      R\*        P4                  ! V4      R R,\.        P0                  ! 4       9   g!   \*        P2                  ! \@        4      '       d   \*        P4                  ! \@        4      MR,R\*        P4                  ! V	4      R\*        P4                  ! V4      R5R\.        P0                  ! 4       9   g   \*        P2                  ! V4      '       d   \*        P4                  ! V4      MRR6\*        P4                  ! V4      R\*        P4                  ! V4      /,          pRRV/,          p\;        \*        P<                  ! V4      4      hR;p;p;p	;p;ppVR7,          PG                  R8RR7       \A        R9R7VR+7       \A        R:R;R<VR+7       R=pR>p
R?p\A        WVVR+7      qPB                  pVPD                  pV! 4       pR<pVV8H  p V '       Eg   \*        P,                  ! R@V 3RGVV34      RR,\.        P0                  ! 4       9   g!   \*        P2                  ! \@        4      '       d   \*        P4                  ! \@        4      MR,R\*        P4                  ! V4      R-\*        P4                  ! V
4      R!\*        P4                  ! V4      RR\.        P0                  ! 4       9   g   \*        P2                  ! V4      '       d   \*        P4                  ! V4      MRR\*        P4                  ! V4      R"\*        P4                  ! V4      R#\*        P4                  ! V4      R.\*        P4                  ! V4      R&\*        P4                  ! V4      /
,          pR0R1V/,          p\;        \*        P<                  ! V4      4      hR;p;p
;p;p;p;p;p;p pR# )HzNRuns the real remote script against a real mirror laid out under a fake $HOME.rL  zremote-homerM  )ignorerN  rE  rF  TrG  )r  r  r  rC   r  rD   r   r  rF   Nr3   r4   zgitdir: 
	remote_wtrH   r   r  r   	commondirz../..
homer   rf  r   rr   r   r   ri  rj  rk  r_  z/.git
	rev-parsez--show-toplevelr$  r  rE   rk  r#   zassert %(py20)spy20zwt/alphastatusz-sbrs   ru   r%  zedited on the node
r&  r'  r(  z	node editr  -1z--pretty=%srv   r  ze%(py9)s
{%(py9)s = %(py5)s
{%(py5)s = (%(py0)s / %(py2)s).read_text
}(encoding=%(py7)s)
} == %(py12)s)z%(py13)s
{%(py13)s = %(py9)s
{%(py9)s = ((%(py0)s / %(py3)s
{%(py3)s = %(py1)s.remote_git_dir
}) / %(py6)s).read_text
}(encoding=%(py11)s)
} == %(py16)s)z%(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = %(py0)s(%(py2)s, %(py4)s, cwd=%(py5)s)
}.stdout
}.strip
}()
} == %(py18)s
{%(py18)s = %(py15)s(%(py16)s)
}r   )zf%(py1)s in %(py12)s
{%(py12)s = %(py10)s
{%(py10)s = %(py3)s(%(py5)s, %(py7)s, cwd=%(py8)s)
}.stdout
})z%(py15)s
{%(py15)s = %(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py0)s(%(py2)s, %(py4)s, %(py6)s, cwd=%(py7)s)
}.stdout
}.strip
}()
} == %(py18)s)$r*  r0  r!   rE  r   r   shutilcopytreeignore_patternsrP  rQ  r  rR  r  r  git_pointer_commandr  r  r  r#   r  rO   rP   rQ   rR   rS   rT   r  r  rU   rV   r   r  rL  stripr6   )!r,   r   rS  rf  r  container_dirr|  r  rX   r   rY   r   r\   rz  rZ   r   r   r   r   r   r   r[   r   rm  rn  rr  ro  rp  @py_assert17@py_format21r   r   r:  s!   &                                r'   Ctest_pointer_command_makes_the_mirrored_worktree_a_working_checkoutr    s	   XD	dG	$B''+F,,R0G#77;Mm#D
OOBwv/E/Ef/MN
OO4"6"66v?U?UVa?b OOFNND+@+@$@A>>	::7SYZ[8rzz8W8fc$i8	D ??,a,a,,,,?,,,,,,4,,,,4,,,?,,,a,,,,,,,,,,,,I  )) 7 )7; 
4///03;3   ;3    I   I      )   7   ;   3         ((`D((`;`(;6`6AA`7`A7S`W``SW``````SW```````D````D```````6````6```(```;```A```7```S```W``````````(( D(( 8 (83 3>>  >P /!P!   P!    D   D     6   6   (   8   >      P   !         ^-^3{9=^DD^JJ^JL^PST]P^^LP^^^^^^LP^^^^^^^3^^^^3^^^{^^^-^^^^^^9^^^^9^^^=^^^D^^^J^^^L^^^^^^PS^^^^PS^^^^^^^T]^^^^T]^^^P^^^^^^^^^^CXCuCX)<C<CCC:CCCCCC:CCCC:CCCCCCCCCCCCCXCCCuCCCCCC)CCCC)CCC<CCCCCCCCCCCCC''(>'Qzy)%)4WdWMW3uMy9W@@W@FFWFHWKWHKWWWWWHKWWWWWW3WWWW3WWWuWWWdWWWMWWWWWWyWWWWyWWW9WWW@WWWFWWWHWWWKWWWWWWWWWWr)   c            	        \         P                  ! \        R 4      \        R4      RRR7      p \         P                  ! RRV 4      p\        P
                  ! RRR	VP                  R
^4      ^,           2.RRR7      pRq2P                  qCV9   qU'       g   \        P                  ! RV3RW434      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rTRq2P                  qCV9   qU'       g   \        P                  ! RV3RW434      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rTR# )rf  r[  z#cdx-offload/git-common/r' $(id)-abcz1cdx-offload/git-common/r' $(id)-abc/worktrees/a br]  zsandbox/workspaces/x y-1z/sandbox/workspaces/x y-1rE  rF  zprintf '%s' z	bash -lc Tri  z$(id)r   r   proofr   r   rF   Nz'sandbox/workspaces/x y-1'r   )z.%(py1)s in %(py5)s
{%(py5)s = %(py3)s.stdout
})r!   r`  r   r  r  r  r;  rL  rO   rP   rT   rQ   rR   rS   rU   rV   )rf  cmdr  r   r   r   r   r\   s           r'   >test_pointer_command_survives_a_path_with_shell_metacharactersr    s^   &&,-	?;J	F 
-
-"$?C NN	ciiQ&?&B%CDEE
 "ll"l"""""7"""7""""""e""""e"""l""""""""'7<<7<77777'777'777777577775777<77777777r)   c                +  a( \        V 4      p\        VR 4      o(S(R,          P                  RRR7       . pV R,          p\        V R,          V4      pVP	                  \
        RRGV(3R	 ll4       \
        P                  ! R
RR.\        V4      \        V 4      VR R7      pVP                  pRqVJ q'       g   \        P                  ! RHV	3RIWx34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\!        \        P"                  ! V4      4      hR;p;rVP$                  pRqVJ q'       g   \        P                  ! RHV	3RJWx34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\!        \        P"                  ! V4      4      hR;p;rVP&                  pRqVJ q'       g   \        P                  ! RHV	3RKWx34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\!        \        P"                  ! V4      4      hR;p;rVP(                  qvP*                  3qV8H  q'       g   \        P                  ! RLV	3RMWx34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\!        \        P"                  ! V4      4      hR;p;r. pRqP,                  qV9   qq'       d   VP*                  qP,                  pVV9   pTpV'       Eg   \        P                  ! RNV3ROW34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          pVP/                  V4       V'       Ed   \        P                  ! RNX3RPXX34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pR R!V/,          pVP/                  V4       \        P0                  ! V^ 4      / ,          pR"R#V/,          p\!        \        P"                  ! V4      4      hR;p;p;p;p;p;p;ppR$qP,                  qV9  q'       g   \        P                  ! RQV3RRW34      R%\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          p
RRV
/,          p\!        \        P"                  ! V4      4      hR;p;rVP2                  pRqVJq'       g   \        P                  ! RSV	3RTWx34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\!        \        P"                  ! V4      4      hR;p;rR& V 4       p\5        V4      q'       * pV'       g   R'RR(\        P                  ! 4       9   g!   \        P                  ! \4        4      '       d   \        P                  ! \4        4      MR(R\        P                  ! V4      R)\        P                  ! V	4      /,          p
\!        \        P"                  ! V
4      4      hR;p;p	pV R,          VP6                  ,          pRpVV,          qP8                  pRq! VR7      pRpVV8H  pV'       Eg
   \        P                  ! RLV3RUVV34      RR*\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR*R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R+\        P                  ! V4      /,          pR,R-V/,          p\!        \        P"                  ! V4      4      hR;p;p	;p;p;p;pp\;        R.R/VR07      pVP<                  qwP>                  q! 4       pRpVV8H  pV'       g   \        P                  ! RLV3RVVV34      RR.\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR.R\        P                  ! V4      R)\        P                  ! V	4      R1\        P                  ! V4      R\        P                  ! V4      /,          pR2RV/,          p \!        \        P"                  ! V 4      4      hR;p;p	;p;ppR3pR4p	R5p\;        WyVVR07      pVP<                  pVP>                  q! 4       pVP2                  p!VV!8H  pV'       Eg   \        P                  ! RLV3RWVV!34      RR6\        P                  ! 4       9   g!   \        P                  ! \:        4      '       d   \        P                  ! \:        4      MR6R\        P                  ! V4      R)\        P                  ! V	4      R1\        P                  ! V4      RR*\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR*R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR!\        P                  ! V!4      /,          pR7R8V/,          p"\!        \        P"                  ! V"4      4      hR;p;p	;p;p;p;p;p;pp!VR9,          P                  R:RR7       VPA                  VR;7      p#RpV#VJ qw'       g   \        P                  ! RHV3RXV#V34      RR<\        P                  ! 4       9   g   \        P                  ! V#4      '       d   \        P                  ! V#4      MR<R\        P                  ! V4      /,          p$R=RV$/,          p
\!        \        P"                  ! V
4      4      hR;r|R9pS(V,          qP8                  pRq! VR7      pR:pVV8H  pV'       Eg
   \        P                  ! RLV3RUVV34      RR>\        P                  ! 4       9   g   \        P                  ! S(4      '       d   \        P                  ! S(4      MR>R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R+\        P                  ! V4      /,          pR,R-V/,          p\!        \        P"                  ! V4      4      hR;p;p	;p;p;p;ppRpS(V,          qP8                  pRq! VR7      pRpVV8H  pV'       Eg
   \        P                  ! RLV3RUVV34      RR>\        P                  ! 4       9   g   \        P                  ! S(4      '       d   \        P                  ! S(4      MR>R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R+\        P                  ! V4      /,          pR,R-V/,          p\!        \        P"                  ! V4      4      hR;p;p	;p;p;p;pp\;        R.R?S(R07      P<                  PC                  4        U%u/ uF  p%V%R@,          V%RA,          bK  	  p&p%V&PD                  pR9q! V	4      pRBpVV8H  pV'       g   \        P                  ! RLV3RYVV34      RRC\        P                  ! 4       9   g   \        P                  ! V&4      '       d   \        P                  ! V&4      MRCR\        P                  ! V4      R)\        P                  ! V	4      R1\        P                  ! V4      R\        P                  ! V4      /,          pR2RV/,          p \!        \        P"                  ! V 4      4      hR;p;p	;p;ppV&PD                  pRq! V	4      pRBpVV8H  pV'       g   \        P                  ! RLV3RYVV34      RRC\        P                  ! 4       9   g   \        P                  ! V&4      '       d   \        P                  ! V&4      MRCR\        P                  ! V4      R)\        P                  ! V	4      R1\        P                  ! V4      R\        P                  ! V4      /,          pR2RV/,          p \!        \        P"                  ! V 4      4      hR;p;p	;p;ppRDqV&9  q'       g   \        P                  ! RQV3RZVV&34      R%\        P                  ! V4      RRC\        P                  ! 4       9   g   \        P                  ! V&4      '       d   \        P                  ! V&4      MRC/,          p$R=RV$/,          p
\!        \        P"                  ! V
4      4      hR;rREpS(V,          qPF                  q! 4       q'       * pV'       g   RFRR>\        P                  ! 4       9   g   \        P                  ! S(4      '       d   \        P                  ! S(4      MR>R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p'\!        \        P"                  ! V'4      4      hR;p;p	;p;ppR# u up%i )[rL  untracked.txtzscratch
r3   r4   r  r>  r  Nc                   < S# r   r/   )r	  rS  s   &r'   r@   Ztest_open_session_uses_git_push_for_a_worktree_and_the_result_comes_home.<locals>.<lambda>  s    rr)   r  r  r  c                    R # r  r/   r   s   &r'   r@   r        r)   r  TrC   r  rD   r   r   r   rF   Fr  r   %(py9)srH   r   r   rk  r   z%(py19)sr1  zassert %(py22)spy22r  r   c              3  8   "   T F  q^ ,          R8H  x  K  	  R# 5ir  r/   r  s   & r'   r   [test_open_session_uses_git_push_for_a_worktree_and_the_result_comes_home.<locals>.<genexpr>       2EqQ47?Er  0assert not %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}r   rE   node_workspacer   r  r   r  z--shortr$  rr   r   r  r  z--format=%Hr  assert %(py21)sr2  zmade-remotely.txtzresult
r0  errorr   rS  z--porcelain:r   NN:Nr+   Nz??	porcelainzcdx-offload.lockz.cdx-offload.lockrl  r   rI   z0%(py2)s
{%(py2)s = %(py0)s.git_push
} is %(py5)sz3%(py2)s
{%(py2)s = %(py0)s.git_warning
} is %(py5)s)z3%(py2)s
{%(py2)s = %(py0)s.exclude_git
} is %(py5)srv   r   r   )z,%(py3)s in %(py7)s
{%(py7)s = %(py5)s.argv
})zP%(py13)s
{%(py13)s = %(py11)s.bare_abs
} in %(py17)s
{%(py17)s = %(py15)s.argv
}r  )z0%(py1)s not in %(py5)s
{%(py5)s = %(py3)s.argv
}r6  )z3%(py2)s
{%(py2)s = %(py0)s.pre_sha
} is not %(py5)sr  )z`%(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stdout
}.strip
}()
} == %(py9)s)z%(py15)s
{%(py15)s = %(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py0)s(%(py2)s, %(py4)s, %(py6)s, cwd=%(py7)s)
}.stdout
}.strip
}()
} == %(py19)s
{%(py19)s = %(py17)s.pre_sha
}z%(py0)s is %(py3)s)zI%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.get
}(%(py4)s)
} == %(py9)sr  )$r*  r0  r6   rT  rM   r!   r  r6  r;   git_pushrO   rP   rQ   rR   rS   rT   rU   rV   git_warningrt  r  bare_absr   r   r   pre_shar   r  r   r  rL  r  r9  r  rM  rp  ))r,   r%   r   r?  r  rR  r  rX   r   rY   r   r\   r   rZ   r   rm  r:  rr  r]   r   r<  r  r>  r[   r  r   r   r   r   r   r  r   r   r;  r=  r  r   liner  r   rS  s)   &&                                      @r'   Htest_open_session_uses_git_push_for_a_worktree_and_the_result_comes_homer    s#   XD	dG	$B/%%kG%DE;&I!(["8%@H6IJ**	"9-$X.G #t#t###########7####7######t########&$&$&&&&&&&&&&&7&&&&7&&&&&&$&&&&&&&&'%'%'''''''''''7''''7''''''%''''''''>>0..00000000>000000700007000>000000000000N>N\\N\)NNg.>.>N,,N.>,.NNNNN>NNN>NNNNNNWNNNNWNNN\NNNNNNNNN.>,NNNNNNgNNNNgNNN.>NNNNNN'NNNN'NNN,NNNNNNNNNNNNNNNN*ll*l*****;***;******g****g***l********??&$&$&&&&&?&&&&&&7&&&&7&&&?&&&$&&&&&&&&2E22s222222222222s2222s222222222222222+goo=N,XN_,X77XX7IX[XI[XXXXXI[XXXXXXNXXXXNXXX_XXX7XXXXXXIXXX[XXXXXXXXX9.9F==&& &B& B&&&&& B&&&&&&6&&&&6&&&=&&&&&& &&&B&&&&&&&&`d`M`3uM~>`>EE`EKK`KM`QXQ`Q``MQ``````MQ```````3````3```u```d```M``````~````~```>```E```K```M``````QX````QX```Q``````````))55j75S(+E5D=5D55D$OB$$O//OO/AOZOAZOOOOOAZOOOOOOBOOOOBOOO$OOO/OOOOOOAOOOZOOOOOOOOO LB L++LWL+W=LL=LLLLL=LLLLLLBLLLLBLLLLLL+LLLWLLL=LLLLLLLLLLLL 14HmQS0T0[0[0f0f0hi0hb48#0hIi==5,5=,-55-55555-555555955559555=555,555-55555555555==11=)1T1)T11111)T111111911119111=111111)111T11111111.Y.....Y.........Y....Y........(2((20020222222222222222222(222022222222222	 js   F8AWc           	     F
  a \        V 4      o. pV R ,          p\        V R,          V4      pVP                  \        RRV3R ll4       \        P                  ! RRR.\        V4      \        V 4      VR R	7      pVP                  pR
qvVJ q'       g   \        P                  ! R V3R!Wg34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p;r. qeP                   pRqVJ qq'       d   VP"                  pRqVJ pTpV'       Eg   \        P                  ! R V3R"W34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          pVP%                  V4       V'       d   \        P                  ! R X3R#XX34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          pVP%                  V4       \        P&                  ! V^ 4      / ,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p;p;p;ppVP(                  qeP*                  3qvV8H  q'       g   \        P                  ! R$V3R%Wg34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p;rR V 4       p\-        V4      q'       * q'       g   RRR\        P                  ! 4       9   g!   \        P                  ! \,        4      '       d   \        P                  ! \,        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p	\        \        P                  ! V	4      4      hR;p;rR# )&r  r>  r  Nc                   < S# r   r/   r	  r   s   &r'   r@   Jtest_open_session_uses_git_push_for_a_plain_checkout_too.<locals>.<lambda>      tr)   r  r  r  c                    R # r  r/   r   s   &r'   r@   r     r  r)   r  TrC   r  rD   r   r   rF   FrE   r  rH   r   r   ri  z%(py18)srk  r  r2  c              3  8   "   T F  q^ ,          R8H  x  K  	  R# 5ir  r/   r  s   & r'   r   Ktest_open_session_uses_git_push_for_a_plain_checkout_too.<locals>.<genexpr>  r  r  r  r   r   rI   r  )z3%(py4)s
{%(py4)s = %(py2)s.git_warning
} is %(py7)s)z7%(py13)s
{%(py13)s = %(py11)s.exclude_git
} is %(py16)srv   r   )r*  rT  rM   r!   r  r6  r;   r  rO   rP   rQ   rR   rS   rT   rU   rV   r  rt  r   r   r  r  r   )r,   r%   r?  r  rR  r  rX   r   rY   r   r\   rZ   r[   r   rm  rn  rr  r]   ro  rp  r<  r=  r   s   &&                    @r'   8test_open_session_uses_git_push_for_a_plain_checkout_toor    s   XDE;&I!(["8%@H6KL**	"9-$X.G #t#t###########7####7######t########GG$G$&GG7+>+>G%G%+GGGGGGGGGGG7GGGG7GGGGGG$GGGGGGGGG+>%GGGGGG7GGGG7GGG+>GGG%GGGGGGGGGGGGGGGG>>0..00000000>000000700007000>0000000000002E22s222222222222s2222s222222222222222r)   c                  a \        V 4      oV R ,          p\        V R,          4      pVP                  \        RRV3R ll4       \        P                  ! RRR.\        V4      \        V 4      VR R	7      pSR
,          P                  RRR7       VP                  VR7      pRqeVJqw'       g   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p	\        \        P                   ! V	4      4      hR;rvRqV9   qf'       g   \        P                  ! R V3R!W34      R\        P                  ! V
4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p	\        \        P                   ! V	4      4      hR;rR
pSV,          qP"                  pRq! VR7      pRqV8H  pV'       Eg	   \        P                  ! R"V3R#W34      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                   ! V4      4      hR;p;p;p;p;p;ppR# )$r  r>  r  Nc                   < S# r   r/   r  s   &r'   r@   Stest_open_session_pull_back_refuses_when_the_local_checkout_moved.<locals>.<lambda>  r  r)   r  r  r  c                    R # r  r/   r   s   &r'   r@   r    r  r)   r  z	raced.txtzowner touched this
r3   r4   r0  rC   r  r   r   r   znot overwritingr   r   rD   rF   rH   r   r  r   r   r6  rO  r   r   rv   r  )r*  rT  rM   r!   r  r6  r;   r6   r9  rO   rP   rQ   rR   rS   rT   rU   rV   r   )r,   r%   r  rR  r  r  r   rX   r   r   r   rY   r   rZ   r   r   r   r   r   r   s   &&                 @r'   Atest_open_session_pull_back_refuses_when_the_local_checkout_movedr    s   XD;&I!(["89H6KL**	"9-$X.G 
K##$:W#M(+E555%%%%%%%%%%%%%%%%%%%%%%%%%%%UD;U))U7U)7;U?UU?UUUUUU;UUUUUUDUUUUDUUU;UUU)UUU7UUU;UUU?UUUUUUUUUUr)   c                "  aa \        V 4      oV R ,          p\        V R,          4      oV3R lpVP                  \        RRV3R ll4       \        P
                  ! \        P                  4      ;_uu_ 4       p\        P                  ! RRR.\        V4      \        V 4      VR	 R
7       RRR4       XP                  qUP                  p\        P                  qvV8H  q'       Eg3   \        P                  ! RV3RWg34      RR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRR\        P$                  ! V4      R\        P$                  ! V4      RR\        P                   ! 4       9   g!   \        P"                  ! \        4      '       d   \        P$                  ! \        4      MRR\        P$                  ! V4      /,          p	RRV	/,          p
\'        \        P(                  ! V
4      4      hR;p;p;rRqP                  p\+        V4      q{V9   q'       Eg3   \        P                  ! RV3RW34      R\        P$                  ! V4      RR\        P                   ! 4       9   g!   \        P"                  ! \*        4      '       d   \        P$                  ! \*        4      MRRR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRR\        P$                  ! V4      R\        P$                  ! V4      /,          p	RRV	/,          p
\'        \        P(                  ! V
4      4      hR;p;p;rR#   + '       g   i     EL; i)r  r>  c                   < V R ,          R.8X  d)   RV R,          9   d   \         P                  ! V ^RRR7      # S! V 3/ VB # )rC  r   zgit init -q --barer   no space left on devicerK  r   r  r   rO  base_fake_runs   &,r'   rR  Xtest_open_session_fails_closed_when_the_bare_mirror_cannot_be_prepared.<locals>.fake_run"  sE    8w#748#C..tQrJcddT,V,,r)   r  Nc                   < S# r   r/   r  s   &r'   r@   Xtest_open_session_fails_closed_when_the_bare_mirror_cannot_be_prepared.<locals>.<lambda>'  r  r)   r  r  r  c                    R # r  r/   r   s   &r'   r@   r  /  r	  r)   r  rC   rq   rD   rE   rr   r!   rs   rt   ru   r  r   r   r#   r   rv   r&  r   r  )r*  rT  rM   r!   ry   rz   r{   r  r6  r;   r}   r~   r'  rO   rP   rQ   rR   rS   rT   rU   rV   r#   )r,   r%   r  rR  rq   rX   rY   r   r[   r   r   r   r   r  r   s   &&           @@r'   Ftest_open_session_fails_closed_when_the_bare_mirror_cannot_be_preparedr    s   XD;&I&x+'=>M-
 6KL	99	:	:h$$TN&y1(2	
 
; >>==/"="=="============8====8===>=========/====/==="=========$;NN;N(;;(;;;;;;$;;;$;;;;;;;;;;;;;;;;;H;;;;H;;;N;;;(;;;;;;;;; 
;	:	:s   82M==N	c           	     L  aa V R ,          oSP                  4        \        P                  ! . ROSRR7       . oV R,          pV3R lpVP                  \        RRV3R ll4       \        P
                  ! RR	R
.\        V4      \        V 4      VR R7      pVP                  pRqeVJ qw'       g   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                   ! V	4      4      hR;p;rvVP"                  pRqeVJ qw'       g   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                   ! V	4      4      hR;p;rvR S 4       p\%        V4      qw'       g   RRR\        P                  ! 4       9   g!   \        P                  ! \$        4      '       d   \        P                  ! \$        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p
\        \        P                   ! V
4      4      hR;rWR# )z
fresh-repoTr	  checkr  c                
  < V R ,          R.8X  d   \         P                  ! V RRR7      # SP                  V 4       RRP                  V 4      9   d   \         P                  ! V ^ RRR7      # \         P                  ! V ^ RRR7      # )	rC  r  Tri  r  r  r  r   rK  )r  r  r   r  rN  r  s   &,r'   rR  ]test_open_session_falls_back_to_the_tree_copy_transport_when_head_is_unborn.<locals>.fake_run<  sq    8''>>$t$GGT%$7..tQ?QZ\]]**42bIIr)   r  Nc                   < S# r   r/   r  s   &r'   r@   ]test_open_session_falls_back_to_the_tree_copy_transport_when_head_is_unborn.<locals>.<lambda>D  r  r)   r  r  r  c                    R # r  r/   r   s   &r'   r@   r  K  r  r)   r  FrC   r  rD   r   r   rF   c              3  8   "   T F  q^ ,          R8H  x  K  	  R# 5ir  r/   r  s   & r'   r   ^test_open_session_falls_back_to_the_tree_copy_transport_when_head_is_unborn.<locals>.<genexpr>O  r  r  r   r   rE   )r  r  r   r!  r"  r#  r   rI   r  )z/%(py2)s
{%(py2)s = %(py0)s.pre_sha
} is %(py5)s)r)  r  r  rM   r!   r  r6  r;   r  rO   rP   rQ   rR   rS   rT   rU   rV   r  r   )r,   r%   r  rR  r  rX   r   rY   r   r\   r   r?  r   s   &&         @@r'   Ktest_open_session_falls_back_to_the_tree_copy_transport_when_head_is_unbornr  5  s   l"DJJLNND$VZ[E;&IJ 6KL**	"9-$X.G $u$u$$$$$$$$$$$7$$$$7$$$$$$u$$$$$$$$??"d"d"""""?""""""7""""7"""?"""d""""""""...3..........3....3..............r)   c                   \        V 4      p\        R RVR7      P                  P                  4       p\        P
                  q3! V4      qDV8H  qU'       Egk   \        P                  ! RV3RWB34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R	R
\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR
/,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rER# )r}  HEADr$  rC   r!   rD   r   r   r   rF   headrG   rH   Nrv   )zU%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.snapshot_commit
}(%(py3)s)
} == %(py7)s)r*  r  rL  r  r!   r  rO   rP   rQ   rR   rS   rT   rU   rV   )r,   r   r  rX   r   rZ   r\   r]   s   &       r'   6test_snapshot_commit_returns_head_unchanged_when_cleanr  R  s    XD{F-44::<D**8*408D888880888888?8888?888*8888884888848880888888D8888D88888888r)   c                   \        V 4      p\        R RVR7      P                  P                  4       pVR,          P	                  RRR7       \
        P                  ! V4      pW28g  qD'       g   \        P                  ! R V3R!W234      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR	R
\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR
/,          pRRV/,          p\        \        P                  ! V4      4      hRpR pRp\        WGVR7      qP                  qP                  q! 4       qV8H  q'       Eg   \        P                  ! R"V3R#W34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR	\        P                  ! V4      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      R\        P                  ! V
4      R\        P                  ! V4      RR
\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR
/	,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p	;p
;rRpRqs R2p\        WGWR7      qP                  p
RpV
V8H  q'       Egv   \        P                  ! R"V3R$V
V34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR	\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V	4      R\        P                  ! V
4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p	;p
;ppRqAV,          qwP                  pV! 4       q'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR	\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;p;ppR# )%r}  r  r$  r  zx
r3   r4   rC   sharD   r  r   rE   Nr  r   r   rF   rH   r   r   rk  r   r   zcat-filer   z:untracked.txtrr   r   zassert %(py16)sri  zMassert %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = (%(py0)s / %(py2)s).exists
}()
}r   r   rv   )z%(py13)s
{%(py13)s = %(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = %(py0)s(%(py2)s, %(py4)s, cwd=%(py5)s)
}.stdout
}.strip
}()
} == %(py15)s)zn%(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py0)s(%(py2)s, %(py4)s, %(py6)s, cwd=%(py7)s)
}.stdout
} == %(py14)s)r*  r  rL  r  r6   r!   r  rO   rP   rQ   rR   rS   rT   rU   rV   rp  )r,   r   r  r  rX   r   r   rY   rZ   r   r   rm  rr  r   r   r[   rs  r   ro  r   r\   s   &                    r'   Atest_snapshot_commit_captures_untracked_files_without_moving_headr  X  s:   XD{F-44::<D	O'''@

)
)$
/C;333$$DFD3{-D44D::D:<DDDDDD<DDDDDD3DDDD3DDD{DDDFDDDDDDDDDDDDD-DDD4DDD:DDD<DDDDDDDDDDDDDDDDDDDR4R5!7R3z!7BRIIRURIURRRRRIURRRRRR3RRRR3RRRzRRR4RRR!7RRRRRRTRRRRTRRRBRRRIRRRURRRRRRRRR",?",**,*,,,,,,,,,D,,,,D,,,?,,,*,,,,,,,,,,,r)   c                (   V R ,          pVP                  4        \        P                  ! . ROVRR7       \        P                  q"! V4      pRqCVJ qU'       Eg3   \
        P                  ! RV3RW434      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR	\
        P                  ! V4      R
\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;p;p;rTR# )freshTr  NrC   r!   rD   r   r   r   rs   rt   ru   )r  r  r   r#  rI   )zU%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.snapshot_commit
}(%(py3)s)
} is %(py8)s)r)  r  r  r!   r  rO   rP   rQ   rR   rS   rT   rU   rV   )r,   r   rX   r   r   rZ   r   r   s   &       r'   4test_snapshot_commit_returns_none_for_an_unborn_headr  c  s    gDJJLNN6DM**8*408D8D888880888888?8888?888*8888884888848880888D88888888r)   c                   \        V 4      pR p\        P                  ! \        P                  4      ;_uu_ 4       p\        P
                  ! WR7       RRR4       XP                  qDP                  p\        P                  qeV8H  qw'       Eg3   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      RR	\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MR	R
\        P                  ! V4      /,          pRRV/,          p	\        \        P                   ! V	4      4      hR;p;p;rvR#   + '       g   i     EL; i)u   A hung/timed-out local git call must surface as `OffloadUnavailable` (a nonzero exit
downstream) — never as a raw exception or a swallowed success.c                P    \         P                  ! WP                  R ^4      R7      h)rH  )r  rH  )r  TimeoutExpiredrM  r   rO  s   &,r'   timing_out_runZtest_a_transport_timeout_during_snapshot_fails_closed_not_silently.<locals>.timing_out_runo  s    ''D**YPQ:RSSr)   r0  NrC   rq   rD   rE   rr   r!   rs   rt   ru   rv   r&  )r*  ry   rz   r!   r{   r  r}   r~   r'  rO   rP   rQ   rR   rS   rT   rU   rV   )
r,   r   r  rq   rX   rY   r   r[   r   r   s
   &         r'   Btest_a_transport_timeout_during_snapshot_fails_closed_not_silentlyr  j  s     XDT 
99	:	:h''A 
;>>==/"="=="============8====8===>=========/====/==="========= 
;	:	:s   G		G	c                 	   \         P                  ! \        R 4      4      p \         P                  pR p\        V4      q1! V4      q@V8H  qU'       Eg   \        P                  ! RV3RW34      RR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRRR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R	\        P                  ! V4      R
\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;r4\         P                  qU! V 4      p\         P                   RV  R2qV	8H  q"'       Eg3   \        P                  ! RV3RW34      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          p
RRV
/,          p\        \        P                  ! V4      4      hR;p;p;r)\         P                  p\         P                  qV8g  q'       Eg%   \        P                  ! RV3RW\34      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      /,          pRRV/,          p
\        \        P                  ! V
4      4      hR;p;rR# )z/home/user/repo/.gitrC   keyrD   r!   rE   r   r   rF   rH   r   r   r   Nr:  rM  r   rs   rt   ru   rr   rX  rv   )zn%(py0)s == %(py11)s
{%(py11)s = %(py4)s
{%(py4)s = %(py2)s.repo_key
}(%(py9)s
{%(py9)s = %(py5)s(%(py7)s)
})
})zU%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.remote_bare_dir
}(%(py3)s)
} == %(py8)sr   )zh%(py2)s
{%(py2)s = %(py0)s.REMOTE_GIT_BARE_ROOT
} != %(py6)s
{%(py6)s = %(py4)s.REMOTE_GIT_COMMON_ROOT
})r!   repo_keyr   rO   rP   rQ   rR   rS   rT   rU   rV   remote_bare_dirREMOTE_GIT_BARE_ROOTREMOTE_GIT_COMMON_ROOT)r  rY   rZ   r   r   rX   r   r   r   r   r   r   r[   r   s                 r'   ;test_repo_key_and_remote_bare_dir_are_stable_and_namespacedr  w  so   

"
"4(>#?
@C!**H0FH40F+GH*+GHHHHHHHH3HHHHHH3HHHH3HHHHHHH/HHHH/HHH*HHHHHH4HHHH4HHH0FHHH+GHHHHHHHHHHHH**f*3/fo6Z6Z5[[\]`\aae3ff3ffffff/ffffff?ffff?fff*ffffff3ffff3fff/fff3fffffffff//Y?3Y3YY3YYYYYY/YYYYYY?YYYY?YYY/YYYYYY?YYYY?YYY3YYYYYYYYYr)   c                 0   \         P                  p R RRR/pRq ! W4      pRqCV8H  qU'       Eg   \        P                  ! RV3RW434      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p ;p;p;p;rT\         P                  p R RRRRR/pRpV ! W4      pRpVV8H  qU'       Eg   \        P                  ! RV3RVV34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p ;p;p;p;rTR# )r   r   r   uz/a/b.gitzssh://u@h/a/b.gitrC   r!   rD   rE   rr   rs   r   r   r   Nr   r   zssh://u@h:2222/a/b.gitrv   )z\%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.bare_ssh_url
}(%(py4)s, %(py6)s)
} == %(py11)s)
r!   bare_ssh_urlrO   rP   rQ   rR   rS   rT   rU   rV   )rX   rY   r[   r   r   r   r   r   s           r'   -test_bare_ssh_url_includes_port_only_when_setr  ~  s   ''ffc(BfJf'(BOfSffSffffffOffffff?ffff?fff'fff(BfffJfffOfffSffffffffff$$&,c63%MOY$%MZ#Z#	$  Z#        $  %M  OY  Z  #       r)   c                    \         P                  ! \        R 4      RRR4      p . R
OqV8H  q"'       g   \        P                  ! RV3RW34      RR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;r!R	# )/repossh://u@h/a.gitdeadbeefrefs/cdx/x/inrC   r   r   r   r   N)r  -Cr  rW  r   z--no-verifyr  zdeadbeef:refs/cdx/x/inrv   r   )r!   push_commit_argvr   rO   rP   rQ   rR   rS   rT   rU   rV   )r   r   rX   r   r   s        r'   test_push_commit_argv_shaper    s    ++DM;LjZijD      4     4   4           r)   c                 
   \         P                  p R pRq ! W4      p\         P                  pR qT! V4      qcV8g  qw'       Eg   \        P                  ! RV3RW634      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR	\        P                  ! V4      R
\        P                  ! V4      R\        P                  ! V4      /	,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p ;p;p;p;p;p;rV\         P                  p R pRq ! W4      q3P                  p\         P                  q! V
4      q'       Ego   RRR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V
4      R\        P                  ! V4      /	,          p\        \        P                  ! V4      4      hR;p ;p;p;p;p;r\         P                  p R q! V4      q"P                  p\         P                  q! V4      q'       EgY   RRR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      R\        P                  ! V
4      /,          p\        \        P                  ! V4      4      hR;p ;p;p;p;rR# )idd1rC   r!   rD   rE   rr   rs   ru   r   r   ri  rj  rk  Nzassert %(py15)s
{%(py15)s = %(py10)s
{%(py10)s = %(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.dispatch_ref
}(%(py4)s, %(py6)s)
}.startswith
}(%(py13)s
{%(py13)s = %(py11)s.PUSH_REF_PREFIX
})
}r   r   rk  zassert %(py13)s
{%(py13)s = %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.result_ref
}(%(py4)s)
}.startswith
}(%(py11)s
{%(py11)s = %(py9)s.PUSH_REF_PREFIX
})
}rH   r   )z%(py8)s
{%(py8)s = %(py2)s
{%(py2)s = %(py0)s.dispatch_ref
}(%(py4)s, %(py6)s)
} != %(py16)s
{%(py16)s = %(py12)s
{%(py12)s = %(py10)s.result_ref
}(%(py14)s)
})r!   dispatch_ref
result_refrO   rP   rQ   rR   rS   rT   rU   rV   r   PUSH_REF_PREFIX)rX   rY   r[   r   r   rs  rn  r   ro  rp  rm  rr  r   r   r   s                  r'   5test_dispatch_and_result_refs_are_distinct_namespacesr    s   ''WWdW'3W7Q7QWRVW7QRV7WW7WWWWWW3WWWWWW?WWWW?WWW'WWWWWWdWWW3WWWWWWWWWWWWW7QWWWRVWWW7WWWWWWWWWW''__d_'3_>>_?^?^_>?^_________?____?___'______d___3___>_____________?^___________%%WdW%d+W66W7V7VW67VWWWWWWWWW?WWWW?WWW%WWWdWWW+WWW6WWWWWWWWWWWWW7VWWWWWWWWWWWr)   c                 :
   \         P                  ! 4       \         P                  ! 4       rW8g  q"'       g   \        P                  ! RV3RW34      RR\        P
                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRRR\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hRp\         P                  pRqR! WP4      p\         P                  pRq! W4      qV	8g  q'       Eg   \        P                  ! RV
3RWi34      RR	\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MR	R\        P                  ! V4      R\        P                  ! V4      R
R\        P
                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      RR	\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MR	R\        P                  ! V4      R\        P                  ! V4      RR\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V	4      /
,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p
;p;rW3 EF  p\         P                  pRqR! W]4      p\         P                   RV R2qV8H  q'       EgJ   \        P                  ! RV
3RVV34      RR	\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MR	R\        P                  ! V4      R\        P                  ! V4      R
R\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;rEK  	  R# )r   rC   r   rD   r   r   rE   Nsboxr!   r   rF   rH   r   r   r   ri  rj  rk  z/sbox//indispatch_idru   r  r   r   r   )z%(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.dispatch_ref
}(%(py4)s, %(py5)s)
} != %(py16)s
{%(py16)s = %(py11)s
{%(py11)s = %(py9)s.dispatch_ref
}(%(py13)s, %(py14)s)
}rv   )z\%(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.dispatch_ref
}(%(py4)s, %(py5)s)
} == %(py10)s)r!   new_dispatch_idrO   rP   rQ   rR   rS   rT   rU   rV   r  r  )r   r   rX   r   r   rY   rZ   r   rm  rn  r   ro  rp  r  r   r   r   s                    r'   ?test_dispatch_ref_is_unique_per_invocation_for_the_same_sandboxr    s   **,o.M.M.Oq6MMMM1MMMMMM1MMMM1MMMMMMMMMMMMMMMMMMM'']]'2]o6R6R]SY]6RSY6]]6]]]]]]2]]]]]]?]]]]?]]]']]]]]]]]]]]]]]]]2]]]]]]o]]]]o]]]6R]]]SY]]]]]][\]]]][\]]]6]]]]]]]]]]v++ 	
F 	
+F@ 	
../vk]#F	
F
 	
 	
 	
@F	
 	
	6	
 	
 	
 	
 	
 			
 	
 	
 			
+ 	
 	
 			
F 	
 	
	6	
 	
 	
K 	
 	
 			
K 	
 	
 			
@ 	
 	
 			
F	
 	
 	
 	
 	
 	
 	
 	
 r)   c                v	  a \        V 4      o. pV R ,          p\        V R,          V4      pVP                  \        RRV3R ll4       \        P                  ! RRR.\        V4      \        V 4      VR R	7      pV Uu. uF,  qfR
,          R.8X  g   K  RVR ,          9   g   K#  VR ,          NK.  	  pp\        V4      p^qV	8H  q'       Eg   \        P                  ! R!V
3R"W34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rR\        P                    RVP"                   R2pV^ ,          qV9   q'       g   \        P                  ! R#V3R$W34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;rRpV^ ,          pVV9   q'       gz   \        P                  ! R#V3R%VV34      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;ppRpV^ ,          pVV9   q'       gz   \        P                  ! R#V3R%VV34      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;ppR\        P                    RVP"                   R2pV^ ,          pVV9  q'       gz   \        P                  ! R&V3R'VV34      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;ppR# u upi )(r  r>  r  Nc                   < S# r   r/   r  s   &r'   r@   Ftest_open_session_fetches_the_exact_per_dispatch_ref.<locals>.<lambda>  r  r)   r  r  r  c                    R # r  r/   r   s   &r'   r@   r    r  r)   r  rC  r   zcheckout -qfrC   lenr   checkout_scriptsr   rr   rX  rs   +r:  expectedr   r   z:refs/cdx/inrE   r   z/in:refs/cdx/inz/in:r   r   rv   z0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sr   )z%(py0)s in %(py3)s)z%(py1)s in %(py4)sr  )z%(py1)s not in %(py4)s)r*  rT  rM   r!   r  r6  r;   r   rO   rP   rQ   rR   rS   rT   rU   rV   r  r   )r,   r%   r?  r  rR  r  r  r  r   r[   r   r   r   r  rX   r   r   r   rY   r   r   s   &&                  @r'   4test_open_session_fetches_the_exact_per_dispatch_refr    s   XDE;&I!(["8%@H6KL**	"9-$X.G !"% 0^qu5L"u    %A%A%%%%% %%%%%%3%%%%3%%%%%%%%%%%%%% %%%A%%%%%%%%?2231W5G5G4HJH'********8******8****8************0-a00>000000>0000>0000000000003 0 33 333333 3333333 333333333../q1C1C0DDIdQabcQddIQddddddIQddddIdddQddddddddds   =R6R6"R6c           	     	  a \        V 4      oV R ,          p\        V R,          4      pVP                  \        RR"V3R ll4       \        P                  ! RRR.\        V4      \        V 4      VR R	7      pV R,          \        P                  ! \        P                  ! \        P                  ! S4      4      4      ,          pVP                  p\        P                   R
V 2pV R
\        ^4       RR# R2pV R
\        \        P                  P                  4       4       RR$ R2p	\        RRSR7      P                  P!                  4       p
W3 F!  p\        RR\#        V4      V
 RV 2SR7       K#  	  \        P$                  ! S\#        V4      V\        P&                  ! VR4      \(        P*                  \,        P.                  R7      pRqVJ q'       g   \0        P2                  ! R%V3R&W34      RR\4        P6                  ! 4       9   g   \0        P8                  ! V4      '       d   \0        P:                  ! V4      MRR\0        P:                  ! V4      /,          pRRV/,          p\=        \0        P>                  ! V4      4      hR;r\        R\#        V4      V R2SR7      P                  PA                  4        Uu0 uF  pVPC                  4       ^,          kK  	  ppVV9  q'       g   \0        P2                  ! R'V3R(VV34      RR\4        P6                  ! 4       9   g   \0        P8                  ! V4      '       d   \0        P:                  ! V4      MRRR\4        P6                  ! 4       9   g   \0        P8                  ! V4      '       d   \0        P:                  ! V4      MR/,          pRR V/,          p\=        \0        P>                  ! V4      4      hRpV	V9   q'       g   \0        P2                  ! R)V3R*V	V34      RR!\4        P6                  ! 4       9   g   \0        P8                  ! V	4      '       d   \0        P:                  ! V	4      MR!RR\4        P6                  ! 4       9   g   \0        P8                  ! V4      '       d   \0        P:                  ! V4      MR/,          pRR V/,          p\=        \0        P>                  ! V4      4      hRpR# u upi )+r  r>  r  Nc                   < S# r   r/   r  s   &r'   r@   Wtest_gc_dispatch_refs_deletes_only_stale_refs_never_the_in_flight_one.<locals>.<lambda>  r  r)   r  r  r  c                    R # r  r/   r   s   &r'   r@   r    r  r)   r  r:  -r  r}  r  r$  rW  r   :zkeep-mer  r  rC   warningr   r   r   	ls-remote/*/in	stale_refrD   	remainingr   rE   	fresh_refr    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbrI   r  r  z%(py0)s not in %(py2)sr   z%(py0)s in %(py2)s)"r*  rT  rM   r!   r  r6  r;   r  r  git_common_dirr   r  inttimer  rL  r  r#   gc_dispatch_refsr  r  r  r  r  rO   rP   rQ   rR   rS   rT   rU   rV   r  r;  )r,   r%   r  rR  r  bare_dirr  prefixr  r  r  refr  r   rX   r   r   r  r  r   r   r   s   &&                   @r'   Etest_gc_dispatch_refs_deletes_only_stale_refs_never_the_in_flight_oner    s:   XD;&I!(["89H6KL**	"9-$X.G +%(G(G  !?!?!EF) H D//0$8F(!CF81XJc2I(!C 4 4 9 9 ;<=QxjLI{F-44::<D%FD#h-D63%dC & ..c(mT?#?#?i#PVXV`V`fpftftG d?777d S]vhe4D$OVVaaccD 	

Qc   I%%%%%9I%%%%%%9%%%%9%%%%%%%I%%%%I%%%%%%%%	!!!!!9	!!!!!!9!!!!9!!!!!!!	!!!!	!!!!!!!!s   ? Sc           	        \        V 4      pV R ,          p\        RRR\        V4      V R7       Rp\        P                  ! 4       p\        P
                  ! W44      p\        P
                  ! VRR 24      p\        RRVR7      P                  P                  4       pWV3 F!  p\        R	R\        V4      V R
V 2VR7       K#  	  \        P                  ! V\        V4      W5\        P                  \        P                  R7      p	RqV
J q'       g   \        P                  ! RV3RW34      RR\        P                   ! 4       9   g   \        P"                  ! V	4      '       d   \        P$                  ! V	4      MRR\        P$                  ! V
4      /,          pRRV/,          p\'        \        P(                  ! V4      4      hR;r\        R\        V4      RV R2VR7      P                  P+                  4        Uu0 uF  pVP-                  4       ^,          kK  	  ppW_9   q'       g   \        P                  ! RV3RW_34      RR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRRR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR/,          pRRV/,          p\'        \        P(                  ! V4      4      hRpWo9  q'       g   \        P                  ! R V3R!Wo34      RR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRRR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR/,          pRRV/,          p\'        \        P(                  ! V4      4      hRpR# u upi )"zbare.gitr  r   z--barer$  r  z1-r}  r  rW  r  r  NrC   r  r   r   r   r  z	refs/cdx/r  keep_refrD   r  r   rE   old_ref ccccccccccccccccccccccccccccccccrI   r  r   r  r  r  )r*  r  r#   r!   r  r  rL  r  r  r  r  r  r  rO   rP   rQ   rR   rS   rT   rU   rV   r  r;  )r,   r   r  r  keep_idr   r!  r  r  r  r   rX   r   r   r  r  r   r   s   &                 r'   7test_gc_dispatch_refs_never_deletes_the_ref_just_pushedr$    sx   XD*$HhH8<D--/G++D:H**42hZAG{F-44::<D"FD#h-D63%dC # ..c(mTG d?777d S]ivU4KQUV]]hhjjD 	

Qj        8      8    8       y    y        #####7######7####7#######)####)########s   8 Pc           
     v   \        V 4      pR  p\        P                  ! VRRR\        P                  RVR7      pRqCVJqU'       g   \
        P                  ! RV3RW434      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR	\
        P                  ! V4      /,          pR
RV/,          p\        \
        P                  ! V4      4      hR;rTRqV9   qD'       g   \
        P                  ! RV3RW34      R\
        P                  ! V4      R	R\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR/,          pR
RV/,          p\        \
        P                  ! V4      4      hR;rRqV9  qD'       g   \
        P                  ! RV3RW34      R\
        P                  ! V4      R	R\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR/,          pR
RV/,          p\        \
        P                  ! V4      4      hR;rRqV9  qD'       g   \
        P                  ! RV3RW34      R\
        P                  ! V4      R	R\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR/,          pR
RV/,          p\        \
        P                  ! V4      4      hR;rR# )c                6    \         P                  ! V ^RRR7      # )rD  r   connection refusedrK  r  r  s   &,r'   failing_runItest_gc_dispatch_refs_failure_is_a_non_fatal_warning.<locals>.failing_run  s    **42FZ[[r)   zssh://u@h/gone.gitr  zrefs/cdx/sbox/x/indebian9)r  r  r  NrC   r  r   r   r   r   r'  rI  r6  rO  r   r   r  r  )r*  r!   r  r  r  rO   rP   rQ   rR   rS   rT   rU   rV   )	r,   r   r(  r  r   rX   r   r   r   s	   &        r'   4test_gc_dispatch_refs_failure_is_a_non_fatal_warningr+    s   XD\ .."F,@JJ)G $777$99.w..............w....w........"7"""""8"""8""""""7""""7""""""""r)   c                  aa \        V 4      oV R ,          p\        V R,          4      oV3R lpVP                  \        RRV3R ll4       \        P                  ! RRR.\        V4      \        V 4      VR	 R
7      pVP                  pRqeVJ qw'       g   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvVP                   pRqeVJqw'       g   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvVP"                  qTP                   qV
9   qw'       Eg   \        P                  ! RV3RWZ34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rzRqP                   qmV9  q'       g   \        P                  ! R V3R!W34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rR# )"r  r>  c                v   < V R ,          R.8X  d"   RV 9   d   \         P                  ! V ^RRR7      # S! V 3/ VB # )rC  r  r  r   could not resolve hostrK  r  r  s   &,r'   rR  Rtest_open_session_still_succeeds_when_gc_cannot_reach_the_remote.<locals>.fake_run  sA    8''K4,?..tSLdeeT,V,,r)   r  Nc                   < S# r   r/   r  s   &r'   r@   Rtest_open_session_still_succeeds_when_gc_cannot_reach_the_remote.<locals>.<lambda>  r  r)   r  r  r  c                    R # r  r/   r   s   &r'   r@   r1    r  r)   r  TrC   r  rD   r   r   rF   rE   rr   rX  rs   r.  r   r   r   rI   r  r6  )z7%(py2)s
{%(py2)s = %(py0)s.git_warning
} is not %(py5)sr   )zR%(py2)s
{%(py2)s = %(py0)s.host_name
} in %(py6)s
{%(py6)s = %(py4)s.git_warning
}r  )z7%(py1)s not in %(py5)s
{%(py5)s = %(py3)s.git_warning
})r*  rT  rM   r!   r  r6  r;   r  rO   rP   rQ   rR   rS   rT   rU   rV   r  r  )r,   r%   r  rR  r  rX   r   rY   r   r\   r[   r   r   r   r   r  r   s   &&             @@r'   @test_open_session_still_succeeds_when_gc_cannot_reach_the_remoter3    sr   XD;&I&x+'=>M-
 6KL**	"9-$X.G #t#t###########7####7######t########*d*d***********7****7******d********3 3 33 3333333333337333373333333333333333 333333333#>+>+>>+>>>>>>#>>>#>>>>>>7>>>>7>>>+>>>>>>>>>r)   c                 l   \         P                  ! R RRR4      p RqV 9   q"'       g   \        P                  ! RV3RW34      R\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MR/,          pRR	V/,          p\        \        P                  ! V4      4      hR
;r\         P                   F  pRV 2qV 9   q"'       g   \        P                  ! RV3RW34      R\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MR/,          pRR	V/,          p\        \        P                  ! V4      4      hR
;rK  	  R
# )sandbox/workspaces/x/home/n/cdx-offload/repos/k.gitr  r  zclean -qffdr   r   scriptr   r   Nz-e r   r   )r!   remote_checkout_scriptrO   rP   rT   rQ   rR   rS   rU   rV   SYNC_EXCLUDES)r7  r   r   r   r   excludeds         r'   9test_remote_checkout_script_scopes_clean_to_sync_excludesr;    s    33 A?T^F "F"""""="""=""""""F""""F""""""""#11XJ)6))))))))))))))6))))6)))))))) 2r)   c                    \         P                  ! RRRR4      p \         P                  ! RRR4      pW3 EF  pRq3V9   qD'       g   \        P                  ! RV3RW234      R\        P
                  ! V4      RR	\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR	/,          pR
RV/,          p\        \        P                  ! V4      4      hR;r4Rq3V9  qD'       g   \        P                  ! RV3RW234      R\        P
                  ! V4      RR	\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MR	/,          pR
RV/,          p\        \        P                  ! V4      4      hR;r4EK  	  R# )zA lock file in the worktree root is an untracked path `git add -A` in
remote_result_script would pick up and round-trip home as spurious state.r5  r6  r  r  refs/cdx/x/outz"$w/.git/cdx-offload.lock"r   r   r7  r   r   Nz"$w/.cdx-offload.lock"r   r   r  r  )r!   r8  remote_result_scriptrO   rP   rT   rQ   rR   rS   rU   rV   )checkoutresultr7  r   r   r   r   s          r'   Etest_checkout_and_result_scripts_lock_inside_git_dir_not_the_worktreerA  (  s	    55 A?T^H 11 ACSF $+5v55555+555+555555v5555v55555555'5v55555'555'555555v5555v55555555 %r)   c                    \         P                  ! RRR4      p RqV 9   q"'       g   \        P                  ! RV3RW34      R\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MR/,          pRR	V/,          p\        \        P                  ! V4      4      hR
;rR
# )zThe out ref points at the latest result, not at a history. A reused workspace whose
base moved makes the push a non-fast-forward, and a rejected push strands the run.r5  r6  r=  z.git push -q --force "$b" "$sha:refs/cdx/x/out"r   r   r7  r   r   Nr   r   )
r!   r>  rO   rP   rT   rQ   rR   rS   rU   rV   )r7  r   r   r   r   s        r'   'test_result_push_forces_the_scratch_refrC  6  s     11 ACSF <EvEEEEE;EEE;EEEEEEvEEEEvEEEEEEEEr)   c                   V ^8  d   QhRR/# )r+   r   r   r/   )r0   s   "r'   r1   r1   ?  s       r)   c                f    \         P                  ! \         P                  ! \        4      R V R7      # )uQ   Every node reports the same lagging load average — placement must still spread.c                    R # )g      ?r/   r   s   &r'   r@   %flat_load_selection.<locals>.<lambda>C  r  r)   r   r   )r!   r   r   THREE_REACHABLE)r   s   &r'   flat_load_selectionrJ  ?  s)    &&''8 r)   c                   \        ^4       Uu. uF  p\        V 4      NK  	  ppR V 4       p\        V4      p. ROqTV8H  qf'       g   \        P                  ! RV3RWE34      RR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;p;reR
 V 4       p\        V4      qD'       g   RRR\
        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p	\        \        P                  ! V	4      4      hR	;r4R	# u upi )r   c              3  8   "   T F  w  rq1R ,          x  K  	  R# 5i)r   Nr/   )r   r   r   r   s   &   r'   r   Stest_selections_with_identical_probe_results_spread_across_hosts.<locals>.<genexpr>J  s     AD#84&v,,Dr  rC   sortedrD   rE   rF   rG   rH   Nc              3  .   "   T F  w  rq3R Jx  K  	  R # 5ir   r/   )r   _hostr   claims   &   r'   r   rM  O  s     Cd%:UUD ds   r   all)r   r   r   rv   )z0%(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py7)s)rangerJ  rN  rO   rP   rQ   rR   rS   rT   rU   rV   rR  )
r(   _heldrX   rY   rZ   r[   r\   r]   r   s
   &         r'   @test_selections_with_identical_probe_results_spread_across_hostsrV  H  s~   =B1XFX 23XDFADA 6AA  F  F    	A   	  	6   	6   	A   	A   	 F      	  
 DdCC3CCCCCCCCCC3CCCC3CCCCCCCCCCCCCC Gs   G<c                   \        ^4       Uu. uF  p\        V 4      NK  	  ppV^,          w  r4pVP                  4        \        V 4      w  rdpVR,          qR,          qV	8H  q'       gy   \        P                  ! RV
3RW34      R\        P
                  ! V4      R\        P
                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rR# u upi )	r   r   r   rE   r   rr   Nrv   r   )rS  rJ  releaserO   rP   rT   rU   rV   )r(   rT  rU  
freed_hostr   rQ  r   r   r   rY   r   r   r   s   &            r'   ;test_a_released_claim_frees_its_host_for_the_next_selectionrZ  R  s    =B1XFX 23XDF!%aJ	MMO/0BCD6<-f--------<---<------------	 Gs   C)c               $    V ^8  d   QhRRRRRR/# )r+   r   r#   resultsr.   Noner/   )r0   s   "r'   r1   r1   Z  s!      S 3  r)   c                2   \         P                  ! 4        VP                  ^R7       \        \	        V 4      4      w  rEp\	        V4      \        \        P                  ! 4       4      ,          P                  VR,          RR7       VP                  ^R7       R# )   rH  r   r3   r4   N)	randomseedwaitrJ  r   r#   r  getpidr6   )r   r\  startholdr   r   r   s   &&&&   r'   _child_selectionrg  Z  se    
KKM	JJrJ/V=D6	']S%%11$v,1QIIbIr)   c                   \         P                  ! R4      pVR,          pVP                  4        VP                  ^4      VP                  ^4      rT\	        ^4       Uu. uF/  pVP                  \        \        V 4      \        V4      WE3R7      NK1  	  ppV F  pVP                  4        K  	  V F  pVP                  ^<R7       K  	  R V 4       p	\        V	4      q'       g   \        P                  ! V Uu. uF  qP                  NK  	  up4      R,           RR\        P                  ! 4       9   g!   \        P                   ! \        4      '       d   \        P"                  ! \        4      MRR	\        P"                  ! V	4      R
\        P"                  ! V
4      /,          p\%        \        P&                  ! V4      4      hR;rVP)                  4        Uu. uF  qP+                  RR7      NK  	  pp\-        V4      p^pVV8H  pV'       Eg   \        P.                  ! RV3R VV34      RR\        P                  ! 4       9   g!   \        P                   ! \,        4      '       d   \        P"                  ! \,        4      MRRR\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRR\        P"                  ! V4      R\        P"                  ! V4      /,          pRRV/,          p\%        \        P&                  ! V4      4      hR;p;pp\1        V4      qP2                  pV! 4       p\5        V4      p^pVV8*  pV'       Eg   \        P.                  ! R!V3R"VV34      RR\        P                  ! 4       9   g!   \        P                   ! \4        4      '       d   \        P"                  ! \4        4      MRRR\        P                  ! 4       9   g!   \        P                   ! \0        4      '       d   \        P"                  ! \0        4      MRR	R\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRR
\        P"                  ! V
4      R\        P"                  ! V4      R\        P"                  ! V4      R\        P"                  ! V4      R\        P"                  ! V4      /,          pRRV/,          p\%        \        P&                  ! V4      4      hR;p
;p;p;p;pp\7        V4      p
\-        V
4      p^pVV8  pV'       Eg   \        P.                  ! R#V3R$VV34      RR\        P                  ! 4       9   g!   \        P                   ! \,        4      '       d   \        P"                  ! \,        4      MRRR\        P                  ! 4       9   g!   \        P                   ! \6        4      '       d   \        P"                  ! \6        4      MRR	R\        P                  ! 4       9   g   \        P                   ! V4      '       d   \        P"                  ! V4      MRR
\        P"                  ! V
4      R\        P"                  ! V4      R\        P"                  ! V4      /,          pRRV/,          p\%        \        P&                  ! V4      4      hR;p
;p;ppR# u upi u upi u upi )%zQThe measured defect: seven simultaneous probes saw one idle node and all took it.spawnr\  )targetr  r`  c              3  >   "   T F  qP                   ^ 8H  x  K  	  R# 5i)r   N)exitcode)r   childs   & r'   r   Jtest_concurrent_dispatches_do_not_all_stack_on_one_host.<locals>.<genexpr>s  s     9u~~"s   z.
>assert %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}rC   rR  rD   rE   Nr3   r4   r   r   chosenr   rr   rX  rs   maxr   ru   r   zassert %(py15)srk  r  rH   r   r   rv   r  )<=)z%(py10)s
{%(py10)s = %(py0)s(%(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py1)s(%(py2)s)
}.values
}()
})
} <= %(py13)s)>=)zN%(py6)s
{%(py6)s = %(py0)s(%(py4)s
{%(py4)s = %(py1)s(%(py2)s)
})
} >= %(py9)s)multiprocessingget_contextr)  BarrierrS  Processrg  r#   re  r  rR  rO   r  rl  rQ   rR   rS   rT   rU   rV   iterdirr   r   rP   r   r  rp  r  )r(   r,   ctxr\  re  rf  rT  childrenrm  rX   rY   r  r   r:   ro  r   r[   r   r   r   r   r   rm  r   r   r   r   r]   r   s   &&                           r'   7test_concurrent_dispatches_do_not_all_stack_on_one_hostrz  b  s   

%
%g
.C"GMMO++a.#++a.4 q
 A	 	#()3w<E 	 	
     

2
 99Y399Y9YYPX;YPX1JJPX;YYYYYYYY3YYYY3YYY9YYY9YYYYYY;B??;LM;L4nngn.;LFMv;!;!;!33vv;!v-%%-%'-3'(-A-(A-----(A------3----3-------w----w-------v----v------%---'---(---A---------6{ 3{ q q     q      3    3       s    s       6    6   {      q         <ZMs   5[#8[([-c          
     ,    V ^8  d   QhRRRRRRRRRR/# )	r+   r&   r   r   r#   pidr  start_ticksr.   r/   )r0   s   "r'   r1   r1   z  s/      D  # C D r)   c                H    W R V R V R2,          pVP                  4        V# )__z__planted.claim)touch)r&   r   r|  r}  r:   s   &&&& r'   _plant_claimr  z  s+    r#b_EEDJJLKr)   c           	       a \         P                  ! R.4      pVP                  4        \        V RVP                  R4      p\        V R\
        P                  ! 4       R4      pRRRRR	R/o\        P                  ! \        P                  ! \        4      V3R
 lV R7      w  rEpVR,          pRqV8H  q'       gy   \        P                  ! RV	3RWx34      R\        P                  ! V4      R\        P                  ! V4      /,          p
RRV
/,          p\        \        P                  ! V4      4      hR;p;rVP                   q! 4       q'       * q'       g   RRR\"        P$                  ! 4       9   g   \        P&                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;rVP                   q! 4       q'       * q'       g   RRR\"        P$                  ! 4       9   g   \        P&                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;rR# )zJA crashed or killed dispatch must not leave its node looking busy forever.z	/bin/truer   rk   	999999999r   g?r   g333333?r   c                $   < SV R ,          ,          # r   r/   r   s   &r'   r@   Ftest_a_claim_whose_pid_is_dead_is_reaped_and_ignored.<locals>.<lambda>  r   r)   rH  r   r   rE   r   rr   NzEassert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.exists
}()
}rC   corpserD   live_pid_wrong_identityrv   r   )r  Popenrc  r  r|  r  rd  r!   r   r   rI  rO   rP   rT   rU   rV   rp  rQ   rR   rS   )r(   goner  r  r   r   r   r   rY   r   r   r   rX   r[   r   r   s   &              @r'   4test_a_claim_whose_pid_is_dead_is_reaped_and_ignoredr    s   [M*DIIK,i3GF*Iryy{K #{CcBE+77''8(!D6 <$9$9$$$$$<$$$<$$$9$$$$$$$$}}}vv}&--/-///////////&////&///-///////////r)   c           	     h   \        T R \        P                  ! 4       \        P                  ! \        P                  ! 4       4      ;'       g    R4      p\        V 4      w  r#pVR,          pR qeV8g  qw'       gy   \        P                  ! RV3RWV34      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvVP                  q! 4       qf'       g   RR	R
\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR
R\        P                  ! V
4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;rR# )r   rk   r   r   rE   r   rr   NzAassert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.exists
}()
}rC   minerD   r   )z%(py1)s != %(py4)s)r  r  rd  r!   _process_start_ticksrJ  rO   rP   rT   rU   rV   rp  rQ   rR   rS   )r(   r  r   r   r   r   rY   r   r   r   rX   s   &          r'   1test_a_live_claim_is_counted_and_survives_reapingr    s    
		,,RYY[9@@S	D 00BCD6<$9$9$$$$$<$$$<$$$9$$$$$$$$;;;==44;=r)   c                d  a V R ,          pVP                  RRR7       RRRRRR	/o\        P                  ! \        P                  ! \        4      V3R
 lVR7      w  r#pVR,          pRqeV8H  qw'       gy   \
        P                  ! RV3RWV34      R\
        P                  ! V4      R\
        P                  ! V4      /,          pRRV/,          p	\        \
        P                  ! V	4      4      hR;p;rvRqtVJ q'       g   \
        P                  ! RV
3RWG34      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR\
        P                  ! V4      /,          pRRV/,          p\        \
        P                  ! V4      4      hR;rR# )znot-a-directoryr   r3   r4   r   g      "@r   g?r   g      @c                $   < SV R ,          ,          # r   r/   r   s   &r'   r@   Otest_claim_bookkeeping_failure_degrades_to_plain_least_loaded.<locals>.<lambda>  r   r)   rH  r   r   r   rE   r   rr   NrC   rQ  r   r   r   rv   r   rI   r  )r6   r!   r   r   rI  rO   rP   rT   rU   rV   rQ   rR   rS   )r,   unusabler   r   rQ  r   rY   r   r   r   rX   r   r   r   s   &            @r'   =test_claim_bookkeeping_failure_degrades_to_plain_least_loadedr    s   ++HW-#{CcBE*66''8(D5
 <$9$9$$$$$<$$$<$$$9$$$$$$$$D=555Dr)   c                  a  S R ,          pR pVP                  \        RRV 3R ll4       \        P                  ! \        P                  4      ;_uu_ 4        \        P
                  ! RRR.\        S R,          4      \        S \        4      VR	 VR
7       RRR4       VP                  pRqT! V4      p\        V4      p. qV8H  q'       Eg_   \        P                  ! RV	3RWx34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                   ! \        4      MRRR \        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR R\        P                   ! V4      R\        P                   ! V4      R\        P                   ! V4      R\        P                   ! V4      R\        P                   ! V4      /,          p
RRV
/,          p\#        \        P$                  ! V4      4      hR;p;p;p;p;rR#   + '       g   i     EL; i)r   c                X    V ^ ,          R8X  d   ^M^ p\         P                  ! WRRR7      # )r   rg  r   r  rK  r  r  s   &, r'   rR  Qtest_open_session_releases_the_claim_when_the_mirror_push_fails.<locals>.fake_run  s)    q'W$Q!**4B{SSr)   r  Nc                   < SR ,          # r  r/   r  s   &r'   r@   Qtest_open_session_releases_the_claim_when_the_mirror_push_fails.<locals>.<lambda>  r  r)   r  r  r  r  c                    R # r  r/   r   s   &r'   r@   r    r	  r)   r  r  r  r   r   r
  rC   r  r   r   r   rF   rH   r   r  r   r   rv   r  )rM   r!   ry   rz   r{   r  r6  r;   rI  r  r  rO   rP   rQ   rR   rS   rT   rU   rV   )r,   r%   r   rR  r   r   rZ   r   r   r   r   r   s   f&          r'   ?test_open_session_releases_the_claim_when_the_mirror_push_failsr    s`    FT 6XY	99	:	:$$TN&x+'=>(?C	
 
; -I-I&-4&'-2-2-----'------4----4-----------------I---&---'---2--------- 
;	:	:s   ?H77I	c                h  a  S R ,          pVP                  \        RRV 3R ll4       \        P                  ! RRR.\        S R,          4      \	        S \
        4      R R	 VR
7      pVP                  pRqT! V4      p\        V4      p\        V4      p^qV	8H  q'       Eg   \        P                  ! R V
3R!W34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR \        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V	4      /	,          pRRV/,          p\        \        P                   ! V4      4      hR;p;p;p;p;p;rVP#                  4        VP                  pRq! V4      p\        V4      p. pVV8H  pV'       Eg`   \        P                  ! R V3R"VV34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR \        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                   ! V4      4      hR;p;p;p;p;ppVP#                  4        R# )#r   r  Nc                   < SR ,          # r  r/   r  s   &r'   r@   Jtest_session_release_frees_the_claim_at_the_end_of_a_run.<locals>.<lambda>  r  r)   r  r  r  r  c                6    \         P                  ! V ^ RRR7      # )r   r  r   rK  r  r-  s   &,r'   r@   r    s    z::!.r 
r)   c                    R # r  r/   r   s   &r'   r@   r    r  r)   r  r
  rC   r   r   r  rD   rE   rr   rs   ru   r   rk  r   r   r   r   rF   rH   r  r   r   rv   )z%(py12)s
{%(py12)s = %(py0)s(%(py10)s
{%(py10)s = %(py1)s(%(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s.glob
}(%(py6)s)
})
})
} == %(py15)sr  )rM   r!   r  r6  r;   rI  r  r  r   rO   rP   rQ   rR   rS   rT   rU   rV   rX  )r,   r%   r   r  rY   r[   r   r   r   rr  rs  r   r   r   r   rZ   r   r   r   r   s   f&                  r'   8test_session_release_frees_the_claim_at_the_end_of_a_runr    se    F6XY**	"8k#9:$X?
 
G KK1	1K	*1t*+13+,1111111,1111113111131111111t1111t1111111F1111F111K111	111*111+111,111111111111OO-I-I&-4&'-2-'2-----'2------4----4-----------------I---&---'---2---------OOr)   c           	        a R  pVP                  \        RR	V3R ll4       VP                  \        RV3R l4       \        P                  ! RV\        V R,          4      \	        V 4      VR R7      # )
c                    R RP                  V 4      9   d   \        P                  ! V ^ RRR7      # \        P                  ! V ^ RRR7      # r  r  r  r   rK  )r  r  rN  r  s   &,r'   rR  "_workdir_session.<locals>.fake_run  sB    %$7..tQ?QZ\]]**42bIIr)   r  c                   < S# r   r/   r  s   &r'   r@   "_workdir_session.<locals>.<lambda>  r  r)   git_toplevelc                   < S# r   r/   r  s   &r'   r@   r    s    Tr)   r  r  c                    R # r  r/   r   s   &r'   r@   r    r  r)   r  r   )rM   r!   r  r6  r;   )r,   r%   r  r   rR  s   &&&f r'   _workdir_sessionr    se    J
 6KL9IJ''"8k#9:$X. r)   flagr  z--cdc                   V R,          pVR,          P                  RR7       V R,          P                  R4       \        WRV\        VR,          4      R.V4      p\        P
                  ! V4       R	2pVP                  qvV9   q'       g   \        P                  ! RV3RWg34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;rRqV,          p\        V4      qP                  qV9  q'       Eg   \        P                  ! RV3RW34      R
R\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;rR# )zOA workstation path forwarded verbatim makes codex die with a bare `os error 2`.r   subTrc  r  {}r  r  z/subrC   r  rD   r  rE   r   rr   Nr#   r   r   r   rs   ru   r  r   r   )z,%(py0)s in %(py4)s
{%(py4)s = %(py2)s.argv
}r  )z\%(py6)s
{%(py6)s = %(py0)s((%(py1)s / %(py3)s))
} not in %(py10)s
{%(py10)s = %(py8)s.argv
})r)  r6   r  r#   r!   r   r   rO   rP   rQ   rR   rS   rT   rU   rV   )r,   r%   r  r(   r   r  r  rY   rX   r   r   r   r   r[   r   r   r   r   s   &&&&              r'   Ctest_open_session_translates_the_workdir_flag_to_its_container_pathr    s   
 fD	E\&''-c$,.?FG "55d;<DAH||#|#####8######8####8#######w####w###|########0e|03|0LL0L000000000003000030000000t0000t000e000000000G0000G000L000000000r)   c                   V R ,          pV R,          pVP                  RR7       VP                  4        V R,          P                  R4       \        P                  ! \        P
                  4      ;_uu_ 4       p\        WRR\        V4      R.V4       R	R	R	4       XP                  qfP                  p\        P                  qV8H  q'       Eg3   \        P                  ! RV	3RWx34      R
R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MRR\        P                   ! V4      R\        P                   ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                   ! \        4      MRR\        P                   ! V4      /,          p
RRV
/,          p\#        \        P$                  ! V4      4      hR	;p;p;rRqP                  p	\        V	4      qV9   q'       Eg3   \        P                  ! RV3RW34      R\        P                   ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                   ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MRR\        P                   ! V	4      R\        P                   ! V4      /,          p
RRV
/,          p\#        \        P$                  ! V4      4      hR	;p;p;rR	#   + '       g   i     EL; i)r   	elsewhereTrc  r  r  r  r  r  NrC   rq   rD   rE   rr   r!   rs   rt   ru   zoutside the mirrored checkoutr   r   r#   rv   r&  r   r  )r)  r6   ry   rz   r!   r{   r  r#   r}   r~   r'  rO   rP   rQ   rR   rS   rT   rU   rV   )r,   r%   r(   r   outsiderq   rX   rY   r   r[   r   r   r   r   s   &&&           r'   Atest_open_session_refuses_a_workdir_outside_the_mirrored_checkoutr    s    fD$GJJtJMMO''-	99	:	:hs7|T0RTXY 
;>>==/"="=="============8====8===>=========/====/==="=========*A..Ac..AA.AAAAAA*AAA*AAAAAAcAAAAcAAAAAAA(AAAA(AAA.AAA.AAAAAAAAA 
;	:	:s   9M''M8	c                <   V R,          pVP                  4        V R,          P                  R4       VP                  \        RR 4       \        P
                  ! \        P                  4      ;_uu_ 4       p\        P                  ! RRR\        V4      R	.\        V R,          4      \        V 4      R
7       RRR4       XP                  qUP                  p\        P                  qvV8H  q'       Eg3   \        P                  ! RV3RWg34      RR\         P"                  ! 4       9   g   \        P$                  ! V4      '       d   \        P&                  ! V4      MRR\        P&                  ! V4      R\        P&                  ! V4      RR\         P"                  ! 4       9   g!   \        P$                  ! \        4      '       d   \        P&                  ! \        4      MRR\        P&                  ! V4      /,          p	RRV	/,          p
\)        \        P*                  ! V
4      4      hR;p;p;rRqP                  p\        V4      q{V9   q'       Eg3   \        P                  ! RV3RW34      R\        P&                  ! V4      RR\         P"                  ! 4       9   g!   \        P$                  ! \        4      '       d   \        P&                  ! \        4      MRRR\         P"                  ! 4       9   g   \        P$                  ! V4      '       d   \        P&                  ! V4      MRR\        P&                  ! V4      R\        P&                  ! V4      /,          p	RRV	/,          p
\)        \        P*                  ! V
4      4      hR;p;p;rR#   + '       g   i     EL; i)zWWithout this guard a non-repo `-C` makes repo_root fall back to it and mirror it whole.looser  r  r  c                    R # r   r/   r$  s   &r'   r@   Otest_open_session_refuses_a_workdir_that_is_not_in_a_checkout.<locals>.<lambda>  s    Tr)   r  r  r  r  )r  r  NrC   rq   rD   rE   rr   r!   rs   rt   ru   znot inside a git checkoutr   r   r#   rv   r&  r   r  )r)  r6   rM   r!   ry   rz   r{   r  r#   r6  r;   r}   r~   r'  rO   rP   rQ   rR   rS   rT   rU   rV   )r,   r%   r(   r  rq   rX   rY   r   r[   r   r   r   r   s   &&&          r'   =test_open_session_refuses_a_workdir_that_is_not_in_a_checkoutr    s    wE	KKM''-9IJ	99	:	:h$$T3u:t,&x+'=>(2		
 
; >>==/"="=="============8====8===>=========/====/==="=========&=nn=#n*==*======&===&======#====#=======h====h===n===*========= 
;	:	:s   6AN

N	c                    \         P                  p . ROq! V4      pRq2V8H  qD'       g   \        P                  ! RV3RW#34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rC\         P                  p . ROq! V4      pR	q2VJ qD'       g   \        P                  ! RV3RW#34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rC\         P                  p R R
.q! V4      pR	q2VJ qD'       g   \        P                  ! RV3RW#34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p ;p;p;rCR	# )r  rC   r!   rD   rE   rr   rH   r   r   Nr  )r  r  /az--cd=/bx)r   rD  z/brv   )zR%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.find_workdir
}(%(py4)s)
} == %(py9)s)r  r  r  r  rI   )zR%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.find_workdir
}(%(py4)s)
} is %(py9)s)
r!   find_workdirrO   rP   rQ   rR   rS   rT   rU   rV   r   s          r'   Mtest_find_workdir_takes_the_last_occurrence_and_stops_at_the_prompt_separatorr    s   ''](L]'(LM]Q]]Q]]]]]]M]]]]]]?]]]]?]]]']]](L]]]M]]]Q]]]]]]]]]''K(BK'(BCKtKtKKKKKCKKKKKK?KKKK?KKK'KKK(BKKKCKKKtKKKKKKKK''??'7?4?4?????7???????????????'??????7???4?????????r)   c                    \         P                  ! RR/\        R4      R4      p \        \	        W R,          4      4      pRq"V9   q3'       g   \
        P                  ! RV3RW!34      R\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MR/,          pR	R
V/,          p\        \
        P                  ! V4      4      hR;r#R# )zK`.tmpjail-work/work` is mode 000 by kernel requirement; rsync aborts on it.r   r   r  r]  :rD  NNr   r   pairsr   r   N)r^  rY  r   r   )r!   r[  r   r  ziprO   rP   rT   rQ   rR   rS   rU   rV   )r   r  r   r   r   r   s         r'   3test_push_excludes_the_tmpjail_overlay_scratch_rootr  !  s    $$fc]DM5IDT8$%E)2U22222)222)222222U2222U22222222r)   c                   V P                  \        P                  R R7       \        P                  q! 4       pR q2VJ qD'       g   \        P
                  ! RV3RW#34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;p;rCV P                  \        P                  R
4       \        P                  q! 4       pRq2VJ qD'       g   \        P
                  ! RV3RW#34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;p;rCR	# )FraisingrC   r!   rD   rE   rF   rG   rH   Nrg   TrI   )zU%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.no_workspace_requested
}()
} is %(py7)s)delenvr!   NO_WORKSPACE_ENVno_workspace_requestedrO   rP   rQ   rR   rS   rT   rU   rV   r    rW   s   &      r'   -test_no_workspace_requested_reads_the_env_varr  (  sG   77G11<13<u<u<<<<<3<<<<<<?<<<<?<<<1<<<3<<<u<<<<<<<<77=11;13;t;t;;;;;3;;;;;;?;;;;?;;;1;;;3;;;t;;;;;;;;r)   c                	   V R ,          p\         P                  q"! V4      p\         P                  qD! V4      qSV8g  qf'       Eg   \        P                  ! RV3RW534      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      R	R\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR
\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;rE\         P                  q"! V4      q3P                  p\         P                  q! V4      q! V
4      q'       Eg   RRR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR	\        P                  ! V	4      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V
4      R\        P                  ! V4      /
,          p\        \        P                  ! V4      4      hR;p;p;p;p	;rR# )r   rC   r!   rD   r   r   r   rF   rH   ru   r   r  r   Nzassert %(py15)s
{%(py15)s = %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.remote_scratch_dir
}(%(py3)s)
}.startswith
}(%(py13)s
{%(py13)s = %(py10)s
{%(py10)s = %(py8)s.remote_rel_dir
}(%(py11)s)
})
}rs   r   r   rk  r   )z%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.remote_scratch_dir
}(%(py3)s)
} != %(py12)s
{%(py12)s = %(py9)s
{%(py9)s = %(py7)s.remote_rel_dir
}(%(py10)s)
})r!   remote_scratch_dirr   rO   rP   rQ   rR   rS   rT   rU   rV   r   )r,   r   rX   r   r   r   rZ   r   r   r   rm  rr  r   s   &            r'   ;test_remote_scratch_dir_never_collides_with_the_real_mirrorr  /  sN   fD--[-d3[7U7U[7UVZ7[[7[[[[[[3[[[[[[?[[[[?[[[-[[[[[[d[[[[d[[[3[[[[[[[[[[[[[7U[[[[[[VZ[[[[VZ[[[7[[[[[[[[[--d-d3d>>d?]?]d?]^b?cd>?cddddddddd?dddd?ddd-ddddddddddddddd3ddd>ddddddddddddd?]dddddd^bdddd^bddd?cdddddddddddr)   c                p  a a" . o"S R ,          pV"3R lpVP                  \        P                  R4       VP                  \        RR8V 3R ll4       \        P                  ! RRR.\        V4      \        S 4      VR	 R
7      pVP                  pRqeV8H  qw'       g   \        P                  ! R9V3R:WV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvVP                   pRqeVJ qw'       g   \        P                  ! R;V3R<WV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvR S" 4       p\#        V4      qw'       * q'       g   RRR\        P                  ! 4       9   g!   \        P                  ! \"        4      '       d   \        P                  ! \"        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;rzR S" 4       p\#        V4      qw'       g   RRR\        P                  ! 4       9   g!   \        P                  ! \"        4      '       d   \        P                  ! \"        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;rWVP$                  p\        P&                  p
RpS V,          q! V4      qV8H  qw'       Eg   \        P                  ! R9V3R=W^34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V
4      RR\        P                  ! 4       9   g   \        P                  ! S 4      '       d   \        P                  ! S 4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRR V/,          p\        \        P                  ! V4      4      hR;p;p;p
;p;rVP(                  pR>qeV8H  qw'       g   \        P                  ! R9V3R?WV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvVP*                  pRqeVJ qw'       g   \        P                  ! R;V3R@WV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;rvVP,                  qU! VR!7      pRpVVJ pV'       Eg,   \        P                  ! R;V3RAVV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R"R#\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR#R\        P                  ! V4      R$\        P                  ! V4      /,          pR%R&V/,          p\        \        P                  ! V4      4      hR;p;p;ppR' S" 4       p\#        V4      qw'       * q'       g   RRR\        P                  ! 4       9   g!   \        P                  ! \"        4      '       d   \        P                  ! \"        4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;rz\        P.                  ! S R,          4      pVP0                  qUV8H  qw'       Eg    \        P                  ! R9V3RBVV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR(\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR(/,          pR)RV/,          p\        \        P                  ! V4      4      hR;rWVP$                  qUP2                  qw! V4      pV'       Eg   R*RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      RR(\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR(R\        P                  ! V4      /,          p	\        \        P                  ! V	4      4      hR;p;pp. pR+V R,2pR,qP4                  pVP6                  pV! V4      pVV9   qfpV'       g   VP6                  pVV9   pTpV'       Eg=   \        P                  ! RCV3RDVV34      R"\        P                  ! V4      R\        P                  ! V
4      R$\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR-\        P                  ! V4      R.\        P                  ! V4      /,          pR/R0V/,          pVP9                  V4       V'       g   \        P                  ! RCX3REVX34      R1R(\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR(R2R\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR3\        P                  ! V4      /,          pR4R5V/,          pVP9                  V4       \        P:                  ! V^4      / ,          p R6R7V /,          p!\        \        P                  ! V!4      4      hR;p;p;p;p;p
;p;p;p;ppR# )Fr  c                   < SP                  V 4       R RP                  V 4      9   d   \        P                  ! V ^ RRR7      # \        P                  ! V ^ RRR7      # r  )r   r  r  rN  r  s   &,r'   rR  Btest_open_session_no_workspace_transfers_nothing.<locals>.fake_run9  sO    T%$7..tQ?QZ\]]**42bIIr)   rg   r  Nc                   < SR ,          # r  r/   r  s   &r'   r@   Btest_open_session_no_workspace_transfers_nothing.<locals>.<lambda>@  r  r)   r  r  zreply OKc                &    V R ,          R8X  d   R# R# r  r/   r   s   &r'   r@   r  G  r  r)   r  r   rC   r  rD   r   r   rF   Tc              3  L   "   T F  q;'       d    V^ ,          R9   x  K  	  R# 5ir   N)rg  scpr/   r  s   & r'   r   Ctest_open_session_no_workspace_transfers_nothing.<locals>.<genexpr>K  #     A5a111!1115   $$r  r   rE   c              3  J   "   T F  pR RP                  V4      9   x  K  	  R# 5ir  r  r  s   & r'   r   r  L  r  r  r   r   r!   rr   r,   rH   r   r  r   r0  r   rR  rs   rt   ru   c              3  L   "   T F  q;'       d    V^ ,          R9   x  K  	  R# 5ir  r/   r  s   & r'   r   r  Q  r  r  
scratch_idr   zgassert %(py7)s
{%(py7)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.rel_dir
}.endswith
}(%(py5)s)
}z--id r  r   r   z%(py15)srk  r   r1  r2  z%(py23)spy23zassert %(py26)spy26r   rv   r  rI   z4%(py2)s
{%(py2)s = %(py0)s.no_workspace
} is %(py5)s)z%(py2)s
{%(py2)s = %(py0)s.rel_dir
} == %(py12)s
{%(py12)s = %(py6)s
{%(py6)s = %(py4)s.remote_scratch_dir
}((%(py7)s / %(py9)s))
}r/   r   r  )zS%(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.pull_back
}(run=%(py3)s)
} is %(py8)s)z2%(py2)s
{%(py2)s = %(py0)s.sandbox_id
} == %(py4)sr   )zh%(py3)s in %(py13)s
{%(py13)s = %(py8)s
{%(py8)s = %(py6)s.join
}(%(py11)s
{%(py11)s = %(py9)s.argv
})
})z0%(py17)s in %(py21)s
{%(py21)s = %(py19)s.argv
})r    r!   r  rM   r  r6  r;   r  rO   rP   rQ   rR   rS   rT   rU   rV   no_workspacer   r  r  r  r  r9  scratch_sandbox_idr   r   r  r   r   r   )#r,   r%   r  rR  r  rX   r   rY   r   r\   r[   r   r   r   r   r   r   r   rZ   r   r   r  r   r   rm  r   @py_assert20r;  r   r   r=  @py_format24r?  @py_format27r?  s#   f&                                @r'   0test_open_session_no_workspace_transfers_nothingr  5  s   E;&IJ 77=6XY**	"9-$X.@G )	)	)))))))))))7))))7))))))	))))))))'4'4'''''''''''7''''7''''''4''''''''A5AAsAAAAAAAAAAAAsAAAAsAAAAAAAAAAAAAA8%883888888888838888388888888888888??So@@SFSFARS@ARSSSSSSSS?SSSSSS7SSSS7SSS?SSSSSSoSSSSoSSS@SSSSSSSSSSSSSFSSSSSSSSSSSSS>>RR>77>R&$&$&&&&&&&&&&&7&&&&7&&&&&&$&&&&&&&&2*2d2*d22222*d2222227222272222222222222222*222d22222222A5AAsAAAAAAAAAAAAsAAAAsAAAAAAAAAAAAAA !33Hv4EFJ++++++++++++7++++7+++++++++++++++++++++??/##/#J//////////7////7///?///#//////J////J///////////XU:,a XCXHHXW\\XH\$:X $::XXGLLXjL>XXXXX $:XXX XXXCXXXHXXXXXXWXXXXWXXX\XXX$:XXXXXXXXXjLXXXXXXjXXXXjXXXXXXXGXXXXGXXXLXXXXXXXXXXXXXXXXXr)   c                  a  VP                  \        P                  R 4       VP                  \        RRV 3R ll4       \        P
                  ! \        P                  4      ;_uu_ 4       p\        P                  ! RRR\        S 4      R.\        S R,          4      \        S 4      R	 R
7       RRR4       XP                  q3P                  p\        P                  qTV8H  qf'       Eg3   \        P                  ! RV3RWE34      RR\         P"                  ! 4       9   g   \        P$                  ! V4      '       d   \        P&                  ! V4      MRR\        P&                  ! V4      R\        P&                  ! V4      RR\         P"                  ! 4       9   g!   \        P$                  ! \        4      '       d   \        P&                  ! \        4      MRR\        P&                  ! V4      /,          pRRV/,          p\)        \        P*                  ! V4      4      hR;p;p;re\        P                  q2P                  p	\        V	4      qV
9   qD'       Eg   \        P                  ! RV3RW:34      RR\         P"                  ! 4       9   g!   \        P$                  ! \        4      '       d   \        P&                  ! \        4      MRR\        P&                  ! V4      RR\         P"                  ! 4       9   g!   \        P$                  ! \        4      '       d   \        P&                  ! \        4      MRRR\         P"                  ! 4       9   g   \        P$                  ! V4      '       d   \        P&                  ! V4      MRR\        P&                  ! V	4      R\        P&                  ! V
4      /,          pRRV/,          p\)        \        P*                  ! V4      4      hR;p;p;rR#   + '       g   i     EL@; i)rg   r  Nc                   < SR ,          # r  r/   r  s   &r'   r@   Gtest_open_session_no_workspace_refuses_a_workdir_flag.<locals>.<lambda>\  r  r)   r  r  r  r  r  c                    R # r  r/   r   s   &r'   r@   r  c  r	  r)   r  rC   rq   rD   rE   rr   r!   rs   rt   ru   r#   r   rF   rH   r   r   r   rv   r&  r   )zq%(py2)s
{%(py2)s = %(py0)s.NO_WORKSPACE_ENV
} in %(py9)s
{%(py9)s = %(py4)s(%(py7)s
{%(py7)s = %(py5)s.value
})
})r    r!   r  rM   ry   rz   r{   r  r#   r6  r;   r}   r~   r'  rO   rP   rQ   rR   rS   rT   rU   rV   )r,   r%   rq   rX   rY   r   r[   r   r   rZ   r   r]   r   s   f&           r'   5test_open_session_no_workspace_refuses_a_workdir_flagr  Z  s   77=6XY	99	:	:h$$T3x=$/&x+'=>(2	
 
; >>==/"="=="============8====8===>=========/====/==="=========++B>>Bs>/BB/BBBBBB+BBBBBB?BBBB?BBB+BBBBBBsBBBBsBBBBBBB8BBBB8BBB>BBB/BBBBBBBBB 
;	:	:s   +AO%%O6	c                `  a  VP                  \        P                  R 4       VP                  \        RRV 3R ll4       \        P
                  ! \        P                  4      ;_uu_ 4       p\        P                  ! RRR.\        S R,          4      \        S R. /4      R	 R
7       RRR4       XP                  q3P                  p\        P                  qTV8H  qf'       Eg3   \        P                  ! RV3RWE34      RR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRR\        P$                  ! V4      R\        P$                  ! V4      RR\        P                   ! 4       9   g!   \        P"                  ! \        4      '       d   \        P$                  ! \        4      MRR\        P$                  ! V4      /,          pRRV/,          p\'        \        P(                  ! V4      4      hR;p;p;reR#   + '       g   i     EL; i)rg   r  Nc                   < SR ,          # r  r/   r  s   &r'   r@   Ztest_open_session_no_workspace_still_fails_closed_with_no_reachable_host.<locals>.<lambda>k  r  r)   r  r  r  r  r   c                    R # r  r/   r   s   &r'   r@   r  r  r	  r)   r  rC   rq   rD   rE   rr   r!   rs   rt   ru   r   rv   rx   )r    r!   r  rM   ry   rz   r{   r  r6  r;   r}   r~   r   rO   rP   rQ   rR   rS   rT   rU   rV   )	r,   r%   rq   rX   rY   r   r[   r   r   s	   f&       r'   Htest_open_session_no_workspace_still_fails_closed_with_no_reachable_hostr  i  s>   77=6XY	99	:	:h$$TN&x+'=>(GR=A	
 
; >>>>/">">>">>>>>>>>>>>>8>>>>8>>>>>>>>>>>>>/>>>>/>>>">>>>>>>>> 
;	:	:s   +;HH-	c           	     \  a a
 VP                  \        P                  R R7       . o
V
3R lpVP                  \        RRV 3R ll4       \        P                  ! RRR.\        S R	,          4      \        S 4      VR
 R7      pVP                  pR qTVJ qf'       g   \        P                  ! RV3RWE34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;reR S
 4       p\!        V4      qf'       g   RRR\        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p	\        \        P                  ! V	4      4      hR;rFR# )Fr  c                  < SP                  V 4       V R ,          R.8X  d   \        P                  ! V ^ RRR7      # RRP                  V 4      9   d   \        P                  ! V ^ RRR7      # \        P                  ! V ^ RRR7      # r  r  r  s   &,r'   rR  Ktest_open_session_normal_path_still_pushes_when_env_unset.<locals>.fake_run{  r  r)   r  Nc                   < SR ,          # r  r/   r  s   &r'   r@   Ktest_open_session_normal_path_still_pushes_when_env_unset.<locals>.<lambda>  r  r)   r  r  r  r  c                &    V R ,          R8X  d   R# R# r  r/   r   s   &r'   r@   r    r  r)   r  rC   r  rD   r   r   rF   c              3  L   "   T F  q;'       d    V^ ,          R8H  x  K  	  R# 5ir  r/   r  s   & r'   r   Ltest_open_session_normal_path_still_pushes_when_env_unset.<locals>.<genexpr>  s!     4e$$QqTW_$er  r   r   rE   r   rI   r  )r  r!   r  rM   r  r6  r;   r  rO   rP   rQ   rR   rS   rT   rU   rV   r   )r,   r%   rR  r  rX   r   rY   r   r\   r   r?  s   f&        @r'   9test_open_session_normal_path_still_pushes_when_env_unsetr  w  sN   77GEJ 6XY**	"8k#9:$X.@G (5(5(((((((((((7((((7((((((5((((((((4e443444444444434444344444444444444r)   c                   \         P                  ! V R,          4      p\        P                  pRq2! W14      qD'       Eg*   \        P
                  ! V4      R,           RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRR\        P                  ! V4      R\        P                  ! V4      RR	\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	R
\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;r4VP                  pRq2! V4      qf'       g   RRR	\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR	R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;r6R# )zsandbox-run enforces ^[a-z0-9][a-z0-9._-]{0,63}$; a capital letter in the
checkout directory name must fold, not kill the dispatch before it starts.	Botmasterz[a-z0-9][a-z0-9._-]{0,63}zV
>assert %(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.fullmatch
}(%(py4)s, %(py5)s)
}rC   rerD   rE   r   sidrF   Nz
botmaster-r   rr   )r!   r   r  	fullmatchrO   r  rQ   rR   rS   rT   rU   rV   r   )r,   r  rX   rY   rZ   r\   r[   r   s   &       r'   3test_sandbox_id_survives_an_uppercase_checkout_namer    s0    
$
$X%;
<C<<?4?<4:?:??C???????2????2???<???4??????c????c???:??????>>','>,'''''''''3''''3'''>''','''''''''''r)   )builderr   r   )rD  r+   r   r   )r  r  )~
__future__r   builtinsrQ   _pytest.assertion.rewrite	assertionrewriterO   r7   importlib.utilr  r  rs  r  ra  r  r  syscollectionsr   pathlibr   ry   r:   insertr#   r   r   r   r!   r9   rI  fixturer(   r;   r^   rd   ro   r   r   r   r   r   r   r   r   r   r  r  r  r*  r0  r6  r<  rT  r^  rt  r  r  r  r  r  r  r  r  r  r(  r@  rC  rF  rJ  rT  rY  rd  rq  rv  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r$  r+  r3  r;  rA  rC  rJ  rV  rZ  rg  rz  r  r  r  r  r  r  r  markparametrizer  r  r  r  r  r  r  r  r  r  r  r  )ns   0r'   <module>r     s   "     	  	    
    3tH~--/77:; <  aI[?KDF#%A	!		
 I[?~VT6SY'Z[		
 I]?~VT6SY'Z[		
)B a  A fQCL[lO4~(1#'OP		
   4
5

5?+
?)%e
<3.@ s+#.		M
9 F? 1,!^H&:&(8"%J6<@
:7$>,"?C5N4*I67%XP8&*3Z3*V*<0/:9-9
>ZX
e6""J$0#"?2*6FD.!00,	
.*($ $01 11B>&@3<e"YJC?52(q*s   !J

