diff mercurial/dispatch.py @ 22595:244478687edd

error: add CensoredNodeError, will be thrown when content deliberately erased This change introduces the error plus a corresponding catch in dispatch, to provide localized error messages. The verb "censor" is used in this commit and all following to refer to erasing the content of a revlog revision (filelog, for now) without recalculating node IDs, leaving that revision invalid. Further work must be done to safely share such revision data with compliant clients. I find the analogy to censorship straightforward; for less politically charged options, consider "erase", "excise", "expunge", or "blackhole".
author Mike Edgar <adgar@google.com>
date Wed, 03 Sep 2014 15:59:03 -0400
parents c828b61e0635
children 41c03b7592ed
line wrap: on
line diff
--- a/mercurial/dispatch.py	Tue Sep 30 16:01:19 2014 -0700
+++ b/mercurial/dispatch.py	Wed Sep 03 15:59:03 2014 -0400
@@ -193,6 +193,8 @@
             ui.warn(_(" empty string\n"))
         else:
             ui.warn("\n%r\n" % util.ellipsis(inst.args[1]))
+    except error.CensoredNodeError, inst:
+        ui.warn(_("abort: file censored %s!\n") % inst)
     except error.RevlogError, inst:
         ui.warn(_("abort: %s!\n") % inst)
     except error.SignalInterrupt: