Mercurial > hg
diff contrib/wix/templates.wxs @ 27430:e240e914d226 stable
revlog: seek to end of file before writing (issue4943)
Revlogs were recently refactored to open file handles in "a+" and use a
persistent file handle for reading and writing. This drastically
reduced the number of file handles being opened.
Unfortunately, it appears that some versions of Solaris lose the file
offset when performing a write after the handle has been seeked.
The simplest workaround is to seek to EOF on files opened in a+ mode
before writing to them, which is what this patch does.
Ideally, this code would exist in the vfs layer. However, this would
require creating a proxy class for file objects in order to provide a
custom implementation of write(). This would add overhead. Since
revlogs are the only files we open in a+ mode, the one-off workaround
in revlog.py should be sufficient.
This patch appears to have little to no impact on performance on my
Linux machine.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 17 Dec 2015 17:16:02 -0800 |
parents | 29ca5b764f88 |
children | 2f63ae140c93 |