
    	^c                        d Z ddlmZ ddlmZ ddlmZmZmZm	Z	 i Z
 ej        e
          ZdZ edddd	 ed
           ed          fddd	 ed           ed          fg ed          ej                  dd            ZddZdS )an  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
revisions if they are allowed by the "censor.policy=ignore" config option.

A few informative commands such as ``hg grep`` will unconditionally
ignore censored data and merely report that it was encountered.
    )_)short)error
logcmdutil	registrarscmutils   ships-with-hg-core   censor   rs   rev    s#   censor file from specified revisions   REV   ts	   tombstones   replacement tombstone datas   TEXTs   -r REV [-t TEXT] [FILE])helpcategoryc           	          |                                 5  |                                5  t          | ||||fi |cd d d            cd d d            S # 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )N)wlocklock	_docensor)uirepopathrev	tombstoneoptss         ./usr/lib/python3/dist-packages/hgext/censor.pycensorr   3   sH     
 A Atyy{{ A AT4i@@4@@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 A A A A A A A A A A A A As3   A,AA,A	A,A	A,,A03A0c                 n   |s!t          j        t          d                    |s!t          j        t          d                    |d          }t          j        ||f          }|                                s%t          |                                          dk    r!t          j        t          d                    |                                d         }|                    |          }t          |          s!t          j        t          d                    t          j
        |||                                          }	 ||         }	n2# t          $ r% t          j        t          d          |z            w xY w	 |	                    |          }
n7# t           j        $ r% t          j        t          d          |z            w xY w|
                                }g }|                                D ]<}||         }||v r.|                    |          |k    r|                    |           =|rRd	                    d
 |D                       }t          j        t          d          |z  t          d                    |                                }|	                                d |D             v r0t          j        t          d          t          d                    |                    d          5 }|                    |||           d d d            d S # 1 swxY w Y   d S )Ns    must specify file path to censors   must specify revision to censor   s%   can only specify an explicit filenamer   s"   cannot censor file with no historys   invalid revision identifier %ss"   file does not exist at revision %ss   , c                 P    g | ]#}t          |                                          $S  )r   node).0cs     r   
<listcomp>z_docensor.<locals>.<listcomp>i   s&    >>>1uQVVXX>>>r   s    cannot censor file in heads (%s)s   clean/delete and commit first)hintc                 6    g | ]}|                                 S r   )r   )r   ps     r   r!   z_docensor.<locals>.<listcomp>p   s     +++1affhh+++r   s   cannot censor working directorys   clean/delete/update firstr	   )r   )r   Abortr   r   matchanypatslenfilesfiler   	revsingler   KeyErrorfilectxLookupErrorfilenodeheadsappendjoinparentsr   transactioncensorrevision)r   r   r   r   r   r   wctxmflogctxfctxfnoder0   headnodehcheadlistwptrs                     r   r   r   G   sk    Bk!?@@AAA Ak!>??@@@:DdTG$$Ayy{{ Gc!''))nn))k!DEEFFF7799Q<D99T??Dt99 Dk!ABBCCC

tS#
.
.
2
2
4
4CF3i F F Fk!=>>DEEEFJ{{4   J J Jk!ABBSHIIIJ MMOOEEJJLL  (^2::"++d++u44LL 
::>>>>>??k122X=344
 
 
 	

 
B
xxzz+++++++k011/00
 
 
 	

 
		)	$	$ <B;;;< < < < < < < < < < < < < < < < < <s*   E /E?F 4GL**L.1L.N)r   r   )__doc__mercurial.i18nr   mercurial.noder   	mercurialr   r   r   r   cmdtablecommand
testedwithCATEGORY_MAINTENANCEr   r   r   r   r   <module>rI      sQ   2                              
)
H
%
%
 #
 	 A455AfII	
 
|S!!$A"B"BAAgJJO	 A !!-  A A A A
0< 0< 0< 0< 0< 0<r   