a —+«b¬ã @s¨dZddlmZddlmZddlmZddlmZm Z m Z m Z iZ e   e ¡Z dZe ddd d ed ƒed ƒfd dd edƒedƒfgedƒe jdddd„ƒZddd„ZdS)anerase 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. é)Úabsolute_import)Ú_)Úshort)ÚerrorÚ logcmdutilÚ registrarÚscmutilsships-with-hg-coreócensorórsrevós#censor file from specified revisionsREVóts tombstonesreplacement tombstone datasTEXTs-r REV [-t TEXT] [FILE])Z helpcategoryc Ksz| ¡^| ¡6t|||||fi|¤ŽWdƒWdƒS1sN0YWdƒn1sl0YdS)N)ZwlockÚlockÚ _docensor)ÚuiÚrepoÚpathÚrevÚ tombstoneÚopts©rú2/usr/lib64/python3.9/site-packages/hgext/censor.pyÚcensor4srcKsú|st tdƒ¡‚|s$t tdƒ¡‚|d}t ||f¡}| ¡sRt| ¡ƒdkr`t tdƒ¡‚| ¡d}| |¡}t|ƒsŒt tdƒ¡‚t   |||¡  ¡}z ||} Wn$t yÎt tdƒ|¡‚Yn0z|   |¡} Wn(tjyt tdƒ|¡‚Yn0|  ¡} g} | ¡D]2} || }||vr| |¡| kr|  |¡q| r„d  d d „| Dƒ¡}tjtd ƒ|td ƒd‚| ¡}|  ¡dd „|Dƒvrºtjtdƒtdƒd‚| d¡ }|j|| |dWdƒn1sì0YdS)Ns must specify file path to censorsmust specify revision to censorés%can only specify an explicit filenamers"cannot censor file with no historysinvalid revision identifier %ss"file does not exist at revision %ss, cSsg|]}t| ¡ƒ‘qSr)rÚnode)Ú.0ÚcrrrÚ jr z_docensor..s cannot censor file in heads (%s)sclean/delete and commit first)ÚhintcSsg|] }| ¡‘qSr)r)rÚprrrrqr scannot censor working directorysclean/delete/update firstr )r)rZAbortrrÚmatchZanypatsÚlenÚfilesÚfilerZ revsinglerÚKeyErrorZfilectxÚ LookupErrorZfilenodeÚheadsÚappendÚjoinÚparentsrZ transactionZcensorrevision)rrrrrrZwctxÚmZflogÚctxZfctxZfnoder%ZheadnodeZhcZheadlistZwpÚtrrrrrHsR      þþ rN)r r )r r )Ú__doc__Z __future__rZmercurial.i18nrZmercurial.noderZ mercurialrrrrZcmdtableZcommandZ testedwithZCATEGORY_MAINTENANCErrrrrrÚs,    ûø ó