[PATCH] pure/osutil: seek to end of file when appending to posixfile (issue3543)

Adrian Buehlmann adrian at cadifra.com
Mon Jul 16 06:01:19 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1342435981 -7200
# Node ID b22eaf05a368438918b96ab82e9e64fcd181a711
# Parent  f76e2196ee709d0771ccdaa7e456f8f1e7339270
pure/osutil: seek to end of file when appending to posixfile (issue3543)

diff --git a/mercurial/pure/osutil.py b/mercurial/pure/osutil.py
--- a/mercurial/pure/osutil.py
+++ b/mercurial/pure/osutil.py
@@ -156,6 +156,9 @@
             object.__setattr__(self, 'name', name)
             object.__setattr__(self, '_file', f)
 
+            if (flags & _O_APPEND):
+                f.seek(0, os.SEEK_END) # work around issue3543
+
         def __iter__(self):
             return self._file
 


More information about the Mercurial-devel mailing list