[PATCH 1 of 5 RFC] error: Add metadata attribute to CensoredNodeError

adgar at google.com adgar at google.com
Wed Oct 15 15:05:11 CDT 2014


# HG changeset patch
# User Mike Edgar <adgar at google.com>
# Date 1410735479 14400
#      Sun Sep 14 18:57:59 2014 -0400
# Node ID 2f20191b7d5f96b9f58080350b2099fb03e11efa
# Parent  61e93650a9a2f720a0d8b833d793b7fdfa4a0547
error: Add metadata attribute to CensoredNodeError

This attribute will be used to construct appropriate changegroup
deltas, preserving the censorship tombstone data, while still
treating censored nodes as an exceptional case in all code paths.

diff -r 61e93650a9a2 -r 2f20191b7d5f mercurial/error.py
--- a/mercurial/error.py	Wed Sep 03 16:34:29 2014 -0400
+++ b/mercurial/error.py	Sun Sep 14 18:57:59 2014 -0400
@@ -120,6 +120,7 @@
 class CensoredNodeError(RevlogError):
     """error raised when content verification fails on a censored node"""
 
-    def __init__(self, filename, node):
+    def __init__(self, filename, node, metadata):
+        self.metadata = metadata
         from node import short
         RevlogError.__init__(self, '%s:%s' % (filename, short(node)))
diff -r 61e93650a9a2 -r 2f20191b7d5f mercurial/filelog.py
--- a/mercurial/filelog.py	Wed Sep 03 16:34:29 2014 -0400
+++ b/mercurial/filelog.py	Sun Sep 14 18:57:59 2014 -0400
@@ -101,7 +101,7 @@
             super(filelog, self).checkhash(text, p1, p2, node, rev=rev)
         except error.RevlogError:
             if _censoredtext(text):
-                raise error.CensoredNodeError(self.indexfile, node)
+                raise error.CensoredNodeError(self.indexfile, node, text)
             raise
 
     def _file(self, f):


More information about the Mercurial-devel mailing list