# HG changeset patch # User Vadim Gelfer # Date 2006-03-27 16:31:33 # Node ID db1eb0de286a3eccb2ac365ca68a0f296f0e92d7 # Parent 182f500805dbb894fb536b279aed9bd7be6a817f fix appendfile problem on macos. when i open file with mode 'a+' on linux, seek position is 0. on macos seek position is end of file instead. not documented. diff --git a/mercurial/appendfile.py b/mercurial/appendfile.py --- a/mercurial/appendfile.py +++ b/mercurial/appendfile.py @@ -37,7 +37,7 @@ class appendfile(object): fd, self.tmpname = tempfile.mkstemp() self.tmpfp = os.fdopen(fd, 'ab+') self.realfp = fp - self.offset = 0 + self.offset = fp.tell() # real file is not written by anyone else. cache its size so # seek and read can be fast. self.fpsize = os.fstat(fp.fileno()).st_size