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

login
register
mail settings
Submitter adgar@google.com
Date Oct. 15, 2014, 8:05 p.m.
Message ID <2f20191b7d5f96b9f580.1413403511@adgar.nyc.corp.google.com>
Download mbox | patch
Permalink /patch/6293/
State Deferred
Headers show

Comments

adgar@google.com - Oct. 15, 2014, 8:05 p.m.
# HG changeset patch
# User Mike Edgar <adgar@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.
Pierre-Yves David - Oct. 17, 2014, 9:38 p.m.
On 10/15/2014 01:05 PM, adgar@google.com wrote:
> # HG changeset patch
> # User Mike Edgar <adgar@google.com>
> # Date 1410735479 14400
> #      Sun Sep 14 18:57:59 2014 -0400
> # Node ID 2f20191b7d5f96b9f58080350b2099fb03e11efa
> # Parent  61e93650a9a2f720a0d8b833d793b7fdfa4a0547
> error: Add metadata attribute to CensoredNodeError

Dropping this series since it is RFC and we are close to the freeze. 
Also, running the test would have spotted that:

   error: Add metadata attribute to CensoredNodeError

is an invalid first line for description. Add should be uncapitalized.
Matt Mackall - Oct. 18, 2014, 7:52 p.m.
On Wed, 2014-10-15 at 16:05 -0400, adgar@google.com wrote:
> # HG changeset patch
> # User Mike Edgar <adgar@google.com>
> # Date 1410735479 14400
> #      Sun Sep 14 18:57:59 2014 -0400
> # Node ID 2f20191b7d5f96b9f58080350b2099fb03e11efa
> # Parent  61e93650a9a2f720a0d8b833d793b7fdfa4a0547
> error: Add metadata attribute to CensoredNodeError

Please resend post-3.2.

Patch

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):