[PATCH 06 of 14] revlog: introduce flag for punched revisions

Vishakh Harikumar vsh426 at gmail.com
Fri Jul 16 03:42:15 CDT 2010


On Fri, Jul 16, 2010 at 1:29 PM, Nicolas Dumazet <nicdumz at gmail.com> wrote:
> On Fri, 16 Jul 2010 12:45:14 +0530
> Vishakh H <vsh426 at gmail.com> wrote:
>> @@ -1042,7 +1044,8 @@
>>          bins = [self._chunk(r) for r in xrange(base + 1, rev + 1)]
>>          text = mdiff.patches(text, bins)
>>          p1, p2 = self.parents(node)
>> -        if node != hash(text, p1, p2):
>> +        if (node != hash(text, p1, p2) and
>> +            not self.flags(rev, REVLOG_PUNCHED_FLAG)):
>>              raise RevlogError(_("integrity check failed on %s:%d")
>>                                % (self.indexfile, rev))
>
> REVLOG_PUNCHED_FLAG, or REVLOG_KNOWN_FLAGS ?
> If you're checking for integrity, dont you want to include all possible flags?

There arent any flags that will affect the integrity other that the
revision being
punched. So we only want it to raise integrity when non punched revision fails
integrity check. In the future if more such flags are needed, then we can have a
REVLOG_FAILINTEGRITY_FLAGS?

>>
>> @@ -1128,7 +1131,8 @@
>>
>>          # full versions are inserted when the needed deltas
>>          # become comparable to the uncompressed text
>> -        if not curr or dist > len(text) * 2:
>> +        if (not curr or dist > len(text) * 2 or
>> +            self.flags(base, REVLOG_PUNCHED_FLAG)):
>
> is it a punch-specific branch? Again, I'd expect REVLOG_KNOWN_FLAGS here. (But that might be because you're not telling us enough in the commit message?)

What do you mean by 'punch-specific branch'?
And we cant use KNOWN_FLAGS for similar reasons as above.
(this chunk might not be relevant in this patch anymore)

-- 
vsh


More information about the Mercurial-devel mailing list