On Fri, 25 Nov 2016 19:16:23 +0000, Jun Wu wrote:
> Excerpts from Gregory Szorc's message of 2016-11-25 10:59:42 -0800:
> > I think having the check in offset_type() to catch all consumers is the
> > right place. (Another source of the flag is changegroup data via
> > revlog.addgroup() and cg.deltachunk().)
> > 
> > To clarify, I'm suggesting that instead of truncating "type" like this
> > patch is doing, we should raise ValueError in offset_type(). We should
> > never pass in a too large number and IMO this warrants an exception. This
> > will actively prevent bad data from buggy code being written to a revlog.
> 
> +1. I think raising an Exception is better than dropping the bits silently.
> It does not require moving the check elsewhere, but just change "&=" to an
> if condition and raise an RuntimeError or so.

ValueError or assert sounds better. Dropped from patchwork.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to