
    6hw(                       S r 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  0 r\R&                  " \5      r0 r\R*                  " \5      r\" SSSS9  \" SS	SS9  S
r SS jr\" SSSS\" S5      4SSS\" S5      4SSS\" S5      \" S5      4/\R0                  -   \R2                  -   \R4                  -   \R6                  -   \" S5      \R8                  S9S 5       rS r\" S/ \R8                  SS9S 5       rg) aH  uncommit part or all of a local changeset (EXPERIMENTAL)

This command undoes the effect of a local commit, returning the affected
files to their uncommitted state. This means that files modified, added or
removed in the changeset will be left unchanged, and so will remain modified,
added and removed in the working directory.
    )annotations)_)cmdutilcommandscontextcopieserrorobsutilpathutilpycompat	registrarrewriteutilscmutil   experimental   uncommitondirtywdirF)default   uncommit.keeps   ships-with-hg-coreNc                &  ^ UR                  5       n[        UR                  5       5      nU V	s1 s H  o" U	5      (       d  M  U	iM     n
n	U
(       d  gU(       d  UR                  5       R                  5       $ X-
  n[        R
                  " Xq5      mTR                  5        VVs0 s H  u  pX;   d  M  X_M     snnmUS4U4S jjnU(       d$  U R                  R                  [        S5      5        Uc  UR                  5       nU(       d  UR                  5       nU(       d  UR                  5       n[        R                  " U UR                  5       U R                  /UUUUUUR!                  5       S9nU R#                  U5      $ s  sn	f s  snnf )zjRecommit ctx with changed files not in match. Return the new
node identifier, or None if nothing changed.
N c                   > X#;  a  g X2   n[         R                  " U UUR                  5       UR                  5       UR	                  5       UR                  5       TR                  U5      S9nU$ )N)
copysource)r   
memfilectxpathdataislinkisexecget)repomemctxr   
contentctxredirectfctxmctxcopieds          0/usr/lib/python3/dist-packages/hgext/uncommit.py	filectxfn"_commitfiltered.<locals>.filectxfnV   sa    !!!IIKIIKKKMKKMzz$'
     s   note: keeping empty commit
parentstextfilesr&   userdateextra)p1setr,   node	copiesmod
pathcopiesitemsuistatusr   descriptionr-   r.   r   r   nullidr/   	commitctx)r   ctxmatch
keepcommitmessager-   r.   baseinitialfilesfexcluder,   dstsrcr&   newr$   s                   @r%   _commitfilteredrF   >   s?    668Dsyy{#L&3,Q%(q,G3  vvx}}"E!!$,F'-||~F~83hch~FF14r  q89://#xxzxxz
..dkk*iik	C >>#e 4 Gs   FF%F4F   uncommitr(   s   keeps(   allow an empty commit after uncommittings   allow-dirty-working-copys'   allow uncommit with outstanding changes   ns   notes   store a note on uncommits   TEXTs   [OPTION]... [FILE]...)helpcategoryc                 
   [         R                  " U5        [         R                  " X5        UR                  5          UR	                  5          UR                  5       nUR                  UR                  UR                  UR                  4u  pVpx[        [        XV-   U-   U-   5      [        U5      -  5      n	US   =(       d    UR                  R                  SS5      n
U
(       d,  U(       a  U	(       a  [         R                  " U[        S5      S9  US   n[         R"                  " XR%                  5       /S5        ['        UR)                  5       5      S:  a  [*        R,                  " [        S	5      5      e[.        R0                  " X[2        R4                  " U5      5      nUR7                  5       (       GaK  UR                  UR9                  5       US
S9n[        UR                  5      [        UR                  5      -  [        UR                  5      -  n[        UR7                  5       5      U-
  nU(       a*  U[:        R<                  " U5       Vs1 s H  nUiM     sn-  n[?        U5       H  nUUR@                  ;   a  [        S5      nO7URB                  RE                  U5      (       a  [        S5      nO[        S5      n[*        R,                  " [        S5      [.        RF                  " U5      " U5      -  US9e   URI                  S5         US   (       d  US   (       d  URK                  5       US'   [         RL                  " U [2        R4                  " U5      5      nUnU(       d6  URO                  S5      b  URO                  S5      nOU R                  SS5      n[Q        UUUUUURO                  S5      URO                  S5      S9nUc4  U R                  [        S5      5         SSS5        SSS5        SSS5        g0 nUUR9                  5       RS                  5       :w  a  U4UURS                  5       '   OSUURS                  5       '   URT                  RW                  U5         [.        RX                  " XU   U5        SSS5        [.        RZ                  " UUSS
S9  SSS5        SSS5        SSS5        gs  snf ! , (       d  f       NC= f! , (       d  f       N5= f! , (       d  f       N>= f! , (       d  f       g= f)an  uncommit part or all of a local changeset

This command undoes the effect of a local commit, returning the affected
files to their uncommitted state. This means that files modified or
deleted in the changeset will be left unchanged, and so will remain
modified in the working directory.

If no files are specified, the commit will be pruned, unless --keep is
given.
allow_dirty_working_copyr   r   s/   requires --allow-dirty-working-copy to uncommit)hint   .rG      s   cannot uncommit merge changesetT)	listcleans0   file was not changed in working directory parents.   file was untracked in working directory parents   file does not exists   cannot uncommit "%s"r>   logfilekeepNr   r-   r.   )r>   r-   r.   s   nothing to uncommit
r   fixphase).r   check_note_sizeresolve_commit_optionswlocklockr7   modifiedaddedremoveddeletedanyr1   r6   
configboolbailifchangedr   r   precheckrevlenr*   r	   
InputErrorr   r<   r   byteskwargsr,   r0   r   dirssortedcleanwvfsexistsgetuipathfntransactionr8   
logmessager   rF   r2   dirstatechanging_parentsmovedirstatecleanupnodes)r6   r   patsoptsstmardisdirtypathallowdirtywcopyoldr<   seligiblebadfilesrA   rL   r>   r=   newidmappings                         r%   uncommitr   |   s   < D!""2,	tyy{[[][["((BJJ

B
a#aeai!m,s4y89&
 IWW1GH 	 !!IJ 4jTGGI;<s{{}!""1%G#HIIc)=)=d)CD ;;==

3668Ud
;A177|c!**o5AIIFH5;;=)H4H
 h(?@(?1Q(?@@H%<KD YY%%a((NOD34D&&-.1D1DT1J11MM  & k*OtI"%//"3Y((X-A-A$-GHGJ88F#/!%&!1J!#')9"J $XXf%XXf%E }		!4561 +_ #R G'',h
# ')
#//5$$T;> 6   wdKK +_ #< Af 65E +*_ #{s{   S?H	S.S
#B4S.CS4S.<S?A'S4S	S.S.6S?S.
SS
S+'S..
S<	8S??
Tc              #     #    U R                  5       R                  R                  R                  U R	                  5       S5       H*  n[
        R                  " U R                  5       U5      v   M,     g7f)zFyields the obsolete markers marking the given changeset as a successorr   N)r   obsstorepredecessorsr   r2   r
   marker)r;   r   s     r%   predecessormarkersr      sL     
##0044SXXZDnnSXXZ.. Es   A2A4   unamendT)rI   	helpbasicc                  ^^ UR                  5       nUR                  5          UR                  5          UR                  S5         US   m[        R
                  " UTR                  5       /S5        [        TR                  5       5      S:  a  [        R                  " [        S5      5      eSn[        U4S jU 5       5      (       d  [        R                  " [        S5      5      e[        [        T5      5      n[        U5      S:w  a-  [        S5      n[        R                  " U[        U5      -  5      eUS	   R                  5       nX7   mTR!                  5       nTR#                  5       US
'   U4S jn	[$        R&                  " UTR)                  5       TR+                  5       4TR-                  5       TR/                  5       U	TR1                  5       TR3                  5       US9n
UR5                  U
5      nX   nUR6                  nUR9                  U5         [:        R<                  " X5        SSS5        TR?                  5       U40n[:        R@                  " XSSS9  SSS5        SSS5        SSS5        g! , (       d  f       NP= f! , (       d  f       N0= f! , (       d  f       N9= f! , (       d  f       g= f)a  undo the most recent amend operation on a current changeset

This command will roll back to the previous version of a changeset,
leaving working directory in state in which it was before running
`hg amend` (e.g. files modified as part of an amend will be
marked as modified `hg status`)
r   rM   rN   s   cannot unamend merge changeset)s   amend_source   unamend_sourcec              3  H   >#    U  H  oTR                  5       ;   v   M     g 7fN)r/   ).0keycurctxs     r%   	<genexpr>unamend.<locals>.<genexpr>  s     BMS&,,.(Ms   "sA   working copy parent was not created by 'hg amend' or 'hg unamend's:   changeset must have one predecessor, found %i predecessorsr   r   c                H   >  TR                  U5      $ ! [         a     g f = fr   )filectxKeyError)r   ctx_r   predctxs      r%   r&   unamend.<locals>.filectxfn)  s)    t,, s    
!!r)   NTrR   )!
unfilteredrV   rW   rj   r   r_   r`   ra   r*   r	   rb   r   r\   listr   prednoder/   hexr   r   r0   p2r8   r,   r-   r.   r:   rl   rm   r   rn   r2   ro   )r6   r   rq   unfiexpected_keysmarkerser   extrasr&   newctxnewprednode
newpredctxrl   r~   r   r   s                  @@r%   unamendr      s    ??D	tyy{D$4$4Z$@dTFJJL>:>v~~ 1$""1%F#GHH<BMBBB""$  )&12w<1OPA""1s7|#3441:&&(. $*JJL !	 ZZ\7::<0$$&--/	
 nnV,&
==&&t,  2 - ;;=;.1TJFq %A{h -,i %A$@{{sS   J1J GJI>	41J%J -J1>
JJ
JJ  
J.	*J11
J?)NNN) __doc__
__future__r   mercurial.i18nr   	mercurialr   r   r   r   r3   r	   r
   r   r   r   r   r   cmdtablecommandconfigtable
configitem
testedwithrF   walkopts
commitoptscommitopts2commitopts3CATEGORY_CHANGE_MANAGEMENTr   r   r   r   r(   r%   <module>r      s{   #     


H
%!!+.
 

  #
 AE;| 		gtQJKL'89		
 
wQ:;QwZH	 
    33#&bL'&bLJ/ 	33	BGBGr(   