Avoid 00changelog.i corruption

Douglas Philips dgou at mac.com
Tue Jul 21 11:41:54 CDT 2009


On 2009 Jul 21, at 7:30 AM, Ingo Proetel wrote:
> Matt Mackall wrote:
>>
>> There are lots of places we append to files, is this the only one
>> affected? Are the nuls at the end of the file or somewhere else?
>>
> Yes, there are several places where this could happen. So probably a  
> more general solution is required:
> A new class 'appender' util.py could be used to create a copy of the  
> original file and return a special sub class of
> posixfile. This subclass would forward the written data to the copy  
> and on close() do the rename.
>
> In most of the other places opener(xxx , 'a') would be replaced with  
> appender(xxx).

Given all the pain that Windows causes with open files and the  
veritable panoply of virus checking software that grabs a hold of  
files as soon as they're created, this doesn't seem like an obviously  
good idea.

-Doug



More information about the Mercurial mailing list