
    6h                       S r SSKJr  SSKJr  SSKJr  SSKJrJ	r	J
r
  0 r\	R                  " \5      rSr\" SSS	/ \" S
5      \" S5      4SSS\" S5      4SSS\" S5      \" S5      4/\" S5      \R                  S9SS j5       rSS jrg)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. You can configure this behavior using the
following option:

    `censor.policy`
        :config-doc:`censor.policy`
    )annotations)_)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           	         UR                  5          UR                  5          [        U UUUU4SU0UD6sS S S 5        sS S S 5        $ ! , (       d  f       O= fS S S 5        g ! , (       d  f       g = f)Ncheck_heads)wlocklock	_docensor)uirepopathrev	tombstoner   optss          ./usr/lib/python3/dist-packages/hgext/censor.pycensorr   6   sW    , 
tyy{
 $
 
 #{{{s!   A!A	A!
A	A!!
A/c           	        U(       d  [         R                  " [        S5      5      eU(       d  [         R                  " [        S5      5      eUS    n[        R                  " Xr45      nUR                  5       (       d  [        UR                  5       5      S:w  a  [         R                  " [        S5      5      eUR                  5       S   nUR                  U5      n	[        U	5      (       d  [         R                  " [        S5      5      e[        R                  " X5      nU(       d  [         R                  " [        S5      5      e[        5       n
U H6  n X   nU
R                  UR                  U5      R                  5       5        M8     U(       a  / nUR                  5       nS	nU[        U5      -  nU R!                  U5        U H8  nUU   nUU;   d  M  UR                  U5      U
;   d  M'  UR#                  U5        M:     U(       ac  S
R%                  U Vs/ s H  n['        UR)                  5       5      PM     sn5      n[         R                  " [        S5      U-  [        S5      S9eSnU R!                  U5        UR+                  5       nWR)                  5       U Vs/ s H  nUR)                  5       PM     sn;   a'  [         R                  " [        S5      [        S5      S9eSnU[        U
5      -  nU R!                  U5        UR-                  S5       nU	R/                  UXS9  S S S 5        g ! [         R                   a#    [         R                  " [        S5      W-  5      ef = fs  snf s  snf ! , (       d  f       g = f)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   X   s   kk!?@AAkk!?@AA:DdG$Ayy{{c!'')n)kk!DEFF779Q<D99T?Dt99kk!ABCCD'Dkk!4566J	N'CNN3;;t,5578  ZZ\
@s:
		#"HhBrzbkk$/:=R  # zzE"BEq5?E"BCH++56A78 
 JCIIcN	B
xxz+1affh++kk01/0
 	

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