append-onlyness enforced with file attributes
Kevin Bullock
kbullock+mercurial at ringworld.org
Tue Oct 23 15:29:04 UTC 2012
On Oct 23, 2012, at 7:23 AM, Benito van der Zander wrote:
>> The revlog format was revised [2] for the 0.9 release to mangle
>> ("inline") the contents of the *.d file into the *.i file for smaller
>> revlogs, so there is no *.d file in that case.
> Is it still append-only? I.e. would it work with that attribute set?
As described in the next paragraph, no.
>> However, this change introduced a state transition: from inlined to
>> non-inlined. On that transition, the *.i file is _rewritten_, splitting
>> out the inlined data into a separate *.d file. This is done by writing
>> the new *.i file into a temporary file, deleting the old *.i file and
>> moving (aka renaming) the new file to the old name. Delete and rename
>> will fail if the append-only flag was set for the directory.
>
> Does it break anything if it fails?
> Or could you just remove the attribute and try it again?
I could envision an extension that would change the flag when rewriting .d files and then change it back again, but I'm not sure how deep into core you'd have to punch to make that happen.
pacem in terris / мир / शान्ति / سَلاَم / 平和
Kevin R. Bullock
More information about the Mercurial
mailing list