[PATCH 03 of 10] wireproto: don't audit local paths during stream_out

Bryan O'Sullivan bos at serpentine.com
Fri Sep 14 11:48:48 CDT 2012

On Thu, Sep 13, 2012 at 3:03 PM, Mads Kiilerich <mads at kiilerich.com> wrote:

> This commando pattern on the openers internal audit flag seems a bit like
> an unfortunate hack.

The prior two patches pretty clearly make mustaudit a public field.

> Wouldn't it be cleaner to add a 'dontaudit' flag to sopener() or create a
> new opener without audit?


   - Adding a dontaudit flag to __init__ doesn't work because at the time
   of construction, we don't know what the intended use of the opener will be,
   and while we can always avoid auditing reads, we must audit writes.
   - My original unpublished version of this patch *did* create a new
   opener, but that was even more janky: it had to figure out what the current
   opener type was, then create either one or two openers depending on whether
   the existing opener was an fncacheopener or a normal opener.

IOW, I don't think there's a cleaner way to do this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120914/9bcb6449/attachment.html>

More information about the Mercurial-devel mailing list