
    q&f                        d Z ddlmZ ddlmZ ddlmZmZmZ i Z	 ej                  e	      Z
dZ e
dddg  ed	       ed
      fddd ed      fddd ed       ed      fg ed      e
j                        dd       ZddZy)a  erase file content at a given revision

The censor command instructs Mercurial to erase all content of a file at a given
revision *without updating the changeset hash.* This allows existing history to
remain valid while preventing future clones/pulls from receiving the erased
data.

Typical uses for censor are due to security or legal requirements, including::

 * Passwords, private keys, cryptographic material
 * Licensed data/code/libraries for which the license has expired
 * Personally Identifiable Information or other private data

Censored nodes can interrupt mercurial's typical operation whenever the excised
data needs to be materialized. Some commands, like ``hg cat``/``hg revert``,
simply fail when asked to produce censored data. Others, like ``hg verify`` and
``hg update``, must be capable of tolerating censored data to continue to
function in a meaningful way. Such commands only tolerate censored file
As having a censored version in a checkout is impractical. The current head
revisions of the repository are checked. If the revision to be censored is in
any of them the command will abort.

A few informative commands such as ``hg grep`` will unconditionally
ignore censored data and merely report that it was encountered.
    )_)short)error	registrarscmutils   ships-with-hg-core   censor   rs   revs#   censor file from specified revisions   REV    s   check-headsTs,   check that repository heads are not affected   ts	   tombstones   replacement tombstone datas   TEXTs   -r REV [-t TEXT] [FILE])helpcategoryc           	          |j                         5  |j                         5  t        | ||||fd|i|cd d d        cd d d        S # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Ncheck_heads)wlocklock	_docensor)uirepopathrev	tombstoner   optss          ./usr/lib/python3/dist-packages/hgext/censor.pycensorr   4   so    , 
 	
tyy{ 	

 $
 
	
 	
 	
 	
 	
 	
 	
s!   AA	AA	AA%c           	         |st        j                  t        d            |st        j                  t        d            |d    }t        j                  ||f      }|j                         st        |j                               dk7  rt        j                  t        d            |j                         d   }|j                  |      }	t        |	      st        j                  t        d            t        j                  ||      }|st        j                  t        d            t               }
|D ]6  }	 ||   }|
j                  |j                  |      j                                8 |rg }|j                         }d	}|t        |      z  }| j!                  |       |D ]1  }||   }||v s|j                  |      |
v s!|j#                  |       3 |rbd
j%                  |D cg c]  }t'        |j)                                c}      }t        j                  t        d      |z  t        d            d}| j!                  |       |j+                         }j)                         |D cg c]  }|j)                          c}v r)t        j                  t        d      t        d            d}|t        |
      z  }| j!                  |       |j-                  d      5 }|	j/                  ||
|       d d d        y # t         j                  $ r" t        j                  t        d      z        w xY wc c}w c c}w # 1 sw Y   y xY w)Ns    must specify file path to censors    must specify revisions to censor   s%   can only specify an explicit filenamer   s"   cannot censor file with no historys   no matching revisionss"   file does not exist at revision %ss.   checking for the censored content in %d heads
s   , s    cannot censor file in heads (%s)s   clean/delete and commit first)hints;   checking for the censored content in the working directory
s   cannot censor working directorys   clean/delete/update firsts   censoring %d file revisions
r   )r   )r   Abortr   r   matchanypatslenfilesfilerevrangesetaddfilectxfilenodeLookupErrorheadsstatusappendjoinr   nodeparentstransactioncensorrevision)r   r   r   revsr   r   r   wctxmflog
file_nodesrctxr)   
repo_headsmsgheadnodehccheadlistwpptrs                          r   r   r   V   s   kk!?@AAkk!?@AA:DdTG$Ayy{c!'')n)kk!DEFF779Q<D99T?Dt9kk!ABCCD$'Dkk!4566J N	Nq'CNN3;;t,5578N ZZ\
@s:
		#" 	!HhBrzbkk$/:=R 	! zzE"Bq5?"BCH++56A78 
 JCIIcN	B
xxz+1affh++kk01/0
 	

 +C3z?CIIcN			)	$ AB
i@A AA    	N++a EFLMM	N #C ,A As$   :3L+ M 4M*M
5L=
MN) r
   T)__doc__mercurial.i18nr   mercurial.noder   	mercurialr   r   r   cmdtablecommand
testedwithCATEGORY_MAINTENANCEr   r   rA   r
   r   <module>rJ      s   6     
)

H
%
 #
 	 45fI	
 =>		
 
|S!$A"BAgJO   !--'*

+*

9Ar
   