Patchwork [2,of,2,v3] verify: report censored nodes if configured policy is abort

login
register
mail settings
Submitter adgar@google.com
Date Oct. 14, 2014, 8:22 p.m.
Message ID <efe6a691c3e3b868a4c6.1413318163@adgar.nyc.corp.google.com>
Download mbox | patch
Permalink /patch/6253/
State Accepted
Headers show

Comments

adgar@google.com - Oct. 14, 2014, 8:22 p.m.
# HG changeset patch
# User Mike Edgar <adgar@google.com>
# Date 1413317764 14400
#      Tue Oct 14 16:16:04 2014 -0400
# Node ID efe6a691c3e3b868a4c6e57c30e894a1d580cfbf
# Parent  35378c7c4440e27bd1569ec55d18e0f036209eca
verify: report censored nodes if configured policy is abort
Matt Mackall - Oct. 14, 2014, 9:08 p.m.
On Tue, 2014-10-14 at 16:22 -0400, adgar@google.com wrote:
> # HG changeset patch
> # User Mike Edgar <adgar@google.com>
> # Date 1413317764 14400
> #      Tue Oct 14 16:16:04 2014 -0400
> # Node ID efe6a691c3e3b868a4c6e57c30e894a1d580cfbf
> # Parent  35378c7c4440e27bd1569ec55d18e0f036209eca
> verify: report censored nodes if configured policy is abort

Nice, these are queued for default.

Patch

diff -r 35378c7c4440 -r efe6a691c3e3 mercurial/verify.py
--- a/mercurial/verify.py	Tue Oct 14 15:46:16 2014 -0400
+++ b/mercurial/verify.py	Tue Oct 14 16:16:04 2014 -0400
@@ -267,6 +267,9 @@ 
                     if len(fl.revision(n)) != fl.size(i):
                         err(lr, _("unpacked size is %s, %s expected") %
                             (l, fl.size(i)), f)
+            except error.CensoredNodeError:
+                if ui.config("censor", "policy", "abort") == "abort":
+                    err(lr, _("censored file data"), f)
             except Exception, inst:
                 exc(lr, _("unpacking %s") % short(n), inst, f)