
    6h##                       S SK Jr  SSKJr  SSKJrJrJrJ	r	J
rJrJrJrJrJrJr  \R&                  r0 r\R*                  " \5      rS$S jrS r     S%S jr\" S	S
S/ \" S5      \" S5      4SSS\" S5      4SSS\" S5      4SSS\" S5      4SSS\" S5      4SSS\" S5      4SS/ \" S5      \" S5      4SSS\" S 5      4/\" S!5      \R2                  S"9S# 5       rg)&    )annotations   )_)	bookmarkscmdutilerrorhglock
logcmdutil
mergestatepycompat	registrarrepairscmutilc                    U R                  5       nU(       d.  [        R                  " U 5        [        R                  " U 5        U$ [        R                  " U SS9  U$ )NT)	skipmerge)statusr   checkunfinishedbailifchanged)repoforcess      1/usr/lib/python3/dist-packages/mercurial/strip.pychecklocalchangesr      sJ    A%d# H 	5H    c           	        U R                   R                  US   5      u  p#U S    R                  5       n[        U S5      (       aF  X0R                  :w  a7  X0R
                  R                   Vs/ s H  oUR                  PM     sn;   a  UnU$ X@U   R                  5       :w  aJ  SnSnU R                  XqXfXU5      nU(       a+  U R                   n	U	R                  UR                  5       5      nU$ s  snf )Nr   mqs   parents(wdir())s7   max(((parents(%ln::%r) + %r) - %ln::%r) and branch(%s)))
	changelogparentsbranchhasattrnullidr   appliednoderevsfirst)
r   nodesunodep2currentbranchxpwdirrevsetbranchtargetcls
             r   _findupdatetargetr0   "   s    &&uQx0IEJ%%'M 	d++77??3?a66?33 L 
u+,,.	."Kyy5}
 BGGL..01EL 4s   ,C-Nc                D   UR                  5          UR                  5          U(       aS  [        XS9  [        X5      n[        R
                  " X5        UR                  R                  UR                  5       5        U(       a  [        R                  " XX$5        O[        R                  " XX$5        UR                  n	U(       a  UR                  S5       n
UR                  U;   a  [        R                   " U5        U	R#                  XU Vs/ s H  oS 4PM     sn5        S S S 5        [%        U5       H   nU R                  ['        S5      U-  5        M"     S S S 5        S S S 5        g s  snf ! , (       d  f       NS= f! , (       d  f       N-= f! , (       d  f       g = f)N)r   s   strip   bookmark '%s' deleted
)wlockr
   r   r0   r	   cleandirstatewritecurrenttransactionr   	softstripstrip
_bookmarkstransaction_activebookmarkbookmarksmod
deactivateapplychangessortedr   )uir   r%   updatebackupr   r   softurev	repomarkstrbbookmarks                r   r9   r9   9   s    
tyy{d0$T0DHHT MM 7 7 9:Rt4LL40OO	!!(+r''94 ++D1&&tY1OYd)Y1OP , #9-56AB .% #" 2P ,+ #{sM   FB5F 7E/E*E/"7F F*E//
E=9F  
F	
F
Fs
   debugstrip   r   revsN   strip specified revision (optional, can specify revisions without this option)s   REV   f   forcesD   force removal of changesets, discard uncommitted changes (no backup)r   s	   no-backups   do not save backup bundle   nobackups&   do not save backup bundle (DEPRECATED)   ns   ignored  (DEPRECATED)   k   keeps,   do not modify working directory during strip   B   bookmarks.   remove revs only reachable from given bookmarks   BOOKMARK   softs:   simply drop changesets from visible history (EXPERIMENTAL)s1   hg debugstrip [-k] [-f] [-B bookmark] [-r] REV...)helpcategoryc                  ^^"^# [         R                  " U5      nSnUR                  S5      (       d  UR                  S5      (       a  SnTR                  m"[	        U5      UR                  S5      -   n[        [        R                  " TU5      5      nTR                  5          [        UR                  S5      5      nU(       Ga  TR                  nUR                  U5      (       dT  [        R                  " [        S5      SR                  [        U[        UR!                  5       5      -
  5      5      -  5      e0 nUR#                  5        H&  u  pUR%                  U	/ 5      R'                  U5        M(     UR)                  5        HO  n
UR+                  U
5      (       d  M  [,        R.                  " TU
S	   5      nUR1                  [        U5      5        MQ     U(       d  TR3                  5          TR5                  S5       nU Vs/ s H  oS
4PM     nnUR7                  TX5        S
S
S
5        S
S
S
5        [        U5       H   nU R9                  [        S5      U-  5        M"     U(       d  [        R                  " [        S5      5      e[        T"R;                  U5      5      nUR=                  U5      m#UR?                  U5      n[A        U"UU#4S jTRB                  RE                  5        5       5      nU Vs1 s H  nT"RG                  U5      iM     nn[I        TSS
5      nUb  URJ                  (       a  T"RM                  TRO                  S5      5      T#;   ap  SUl(        S	n[S        URJ                  5      n[U        URJ                  5       H  u  nnURF                  U;   d  M  Un  O   URJ                  UU2	 URW                  5         [        U5      nU(       Ga_  UR                  S5      (       GaH  TRB                  RY                  T5         [[        TU5      nTU   nTR]                  SURM                  5       5      n/ nU H%  nUR_                  TU   Ra                  5       5        M'     TRB                  nU V s/ s H'  n URc                  U 5      Rd                  (       a  M%  U PM)     n!n UR_                  U!5        TRB                  Rg                  UURi                  5       U5        TRB                  R9                  TRk                  5       5        [l        Rn                  Rq                  T5        SnS
S
S
5        [s        U TUUUUR                  S5      UUS   S9  S
S
S
5        g	s  snf ! , (       d  f       GNO= f! , (       d  f       GNY= fs  snf s  sn f ! , (       d  f       Nl= f! , (       d  f       g	= f)ao  strip changesets and all their descendants from the repository

The strip command removes the specified changesets and all their
descendants. If the working directory has uncommitted changes, the
operation is aborted unless the --force flag is supplied, in which
case changes will be discarded.

If a parent of the working directory is stripped, then the working
directory will automatically be updated to the most recent
available ancestor of the stripped parent after the operation
completes.

Any stripped changesets are stored in ``.hg/strip-backup`` as a
bundle (see :hg:`help bundle` and :hg:`help unbundle`). They can
be restored by running :hg:`unbundle .hg/strip-backup/BUNDLE`,
where BUNDLE is the bundle file created by the strip. Note that
the local revision numbers will in general be different after the
restore.

Use the --no-backup option to discard the backup bundle once the
operation completes.

Strip is not a history-rewriting operation and can be used on
changesets in the public phase. But if the stripped changesets have
been pushed to a remote repository you will likely pull them again.

Return 0 on success.
Ts	   no_backuprN   FrK   rS   s   bookmark '%s' not found   ,r   Nr2   s   empty revision setc              3  x   >#    U  H/  nUTR                   :g  =(       a    TR                  U5      T;   v   M1     g 7f)N)r"   rev).0pr/   r   strippedrevss     r   	<genexpr>debugstrip.<locals>.<genexpr>   s6      
, :l!::,s   7:r   s   qtiprQ   s   only(., %d)rM   rT   )rC   rB   r   r   rD   ):r   byteskwargsgetr   listsetr   revranger3   r:   issubsetr   Abortr   joinr@   keysitems
setdefaultappendvalues
issupersetr   bookmarkrevsrB   r
   r;   r?   r6   descendantsunion
differenceanyr5   r   r$   getattrr#   rY   lookupapplieddirtylen	enumerate	savedirtychanging_parentsr0   r%   extendfiles	get_entrymaybe_cleanrebuildmanifestr7   mergestatemodr   r4   r9   )$rA   r   r%   optsrC   r   rF   nodetobookmarksmarkr$   marksrsrevsrG   rH   	bmchangesrI   rn   rootsrB   r	rootnodesqstartendistatusentryrE   uctxdescendantrevschangedfilesrY   r5   f
dirchangesr/   r\   s$    `                                @@r   
debugstripr   Y   s   f %DFxx+!6!6	B:((Dz""4./D	-.	I%%i00kk01iiy3y~~7G3H'H IJK  !O'oo/
**44;;DA 0(//1''..$11$aAFKKF, 2 YY[$"2"2;"?24= >IqTII >**4? #@[ !'y 1HHHQ9:XEF !2 ++a 5677".../zz+.,  
]]**,
 

 *//ARWWQZ	/D$%=QYY vvdkk'*+|;!%!))n&/		&:NA{"''94 !" '; IIeCi(i dhhw''//5(t4Dz "&>488:!F!)C ''S	(9: *
  ==''!x/A/A!/D/P/PAx   ##J/%%dDMMO\J##D$;$;$=> ((..t43 66 	((8$g		
s 
H ] !? #@"?[[( 0F 65} 
H s   #C<V1#AV12VU2	U-
U2*V2CV1>VBV1+A*V1A/V $V,V2BV :*V1-U22
V<V
V	V1V  
V.	*V11
V?)F)TTNNF)
__future__r   i18nr    r   r=   r   r   r	   r
   lockmodr   r   r   r   r   r   r   releasecmdtablecommandr   r0   r9   CATEGORY_MAINTENANCEr    r   r   <module>r      sp   "     //


H
%6 
	C@ 	 
 fI
	
 3		
 
lD!$@"AB78		
 
sD!456=>		
 ?@kN	
 KL		
U0b :;--i5lJm5lJr   