<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 9, 2015 at 10:37 PM, Pierre-Yves David <span dir="ltr"><<a href="mailto:pierre-yves.david@ens-lyon.org" target="_blank" class="cremed">pierre-yves.david@ens-lyon.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On 03/09/2015 12:56 PM, Mike Edgar wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
# HG changeset patch<br>
# User Mike Edgar <<a href="mailto:adgar@google.com" target="_blank" class="cremed">adgar@google.com</a>><br>
# Date 1421266568 18000<br>
#      Wed Jan 14 15:16:08 2015 -0500<br>
# Node ID 816f69e12902d419421bb148705f7b<u></u>c65e0f7774<br>
# Parent  02d7b5cd373bbb4e8263dad9bfbf9c<u></u>4c3b0e4e3a<br>
revlog: addgroup checks if incoming deltas add censored revs, sets flag bit<br>
<br>
A censored revision stored in a revlog should have the censored revlog index<br>
flag bit set. This implies we must know if a revision is censored before we<br>
add it to the revlog. When adding revisions from exchanged deltas, we would<br>
prefer to determine this flag without decoding every single full text.<br>
<br>
This change introduces a heuristic based on assumptions around the Mercurial<br>
delta format and filelog metadata. Since deltas which produce a censored<br>
revision must be full-replacement deltas, we can read the delta's first bytes<br>
to check the filelog metadata. Since "censored" is the alphabetically first<br>
filelog metadata key, censored filelog revisions have a well-known prefix we<br>
can look for.<br>
<br>
For more on the design and background of the censorship feature, see:<br>
<a href="http://mercurial.selenic.com/wiki/CensorPlan" target="_blank" class="cremed">http://mercurial.selenic.com/<u></u>wiki/CensorPlan</a><br>
</blockquote>
<br>
<br></span>
This approach looks like like a recipe for disaster. (expecially the one relying on "censored" being the first entry by alphabetical order.<br></blockquote><div><br></div><div>Agreed it's suboptimal. Perhaps I could parse all the metadata, line-by-line, instead? That might make this a precise approach and not just a heuristic.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What do you miss in the protocol to makes it happen ? as far as I understand the censored feature requires bundle2 to be used. Bundle2 is not the default yet so you have a windows for protocol improvement.<br></blockquote><div><br></div><div>Bundle2 is not required, and in fact supporting older clients which don't have bundle2 support is an explicit design goal. What's missing is changegroups don't transfer the "flags" of a revision (since those flags were unused until the censorship design).</div><div><br></div><div>A changegroup v3 could add a 16-bit flags field which obviates this heuristic for new clients and servers, but supporting mercurial back to 1.x is in scope for censorship.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Though?<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Pierre-Yves David<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div style="line-height:1.5em;padding-top:10px;margin-top:10px;color:rgb(85,85,85);font-family:sans-serif"><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(213,15,37);border-right-color:rgb(213,15,37);border-bottom-color:rgb(213,15,37);border-left-color:rgb(213,15,37);padding-top:2px;margin-top:2px">Michael Edgar |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(51,105,232);border-right-color:rgb(51,105,232);border-bottom-color:rgb(51,105,232);border-left-color:rgb(51,105,232);padding-top:2px;margin-top:2px"> Software Engineer |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(0,153,57);border-right-color:rgb(0,153,57);border-bottom-color:rgb(0,153,57);border-left-color:rgb(0,153,57);padding-top:2px;margin-top:2px"> <a href="mailto:adgar@google.com" target="_blank" class="cremed">adgar@google.com</a> |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(238,178,17);border-right-color:rgb(238,178,17);border-bottom-color:rgb(238,178,17);border-left-color:rgb(238,178,17);padding-top:2px;margin-top:2px"> 518-496-6958</span></div><font face="Times" size="3"><br></font></div>
</div></div>