Avoid 00changelog.i corruption

Ingo Proetel proetel at aicas.de
Tue Jul 21 06:30:58 CDT 2009


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).

Cheers,
Ingo

-- 
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0

USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt



More information about the Mercurial mailing list