##// END OF EJS Templates
obsolete: add seek to end of file before calling tell (issue3543)
Adrian Buehlmann -
r17195:48c23287 default
parent child Browse files
Show More
@@ -51,7 +51,7 b' The header is followed by the markers. E'
51 51 additional encoding. Keys cannot contain '\0' or ':' and values
52 52 cannot contain '\0'.
53 53 """
54 import struct
54 import os, struct
55 55 from mercurial import util, base85
56 56 from i18n import _
57 57
@@ -195,6 +195,12 b' class obsstore(object):'
195 195 if marker not in self._all:
196 196 f = self.sopener('obsstore', 'ab')
197 197 try:
198 # Whether the file's current position is at the begin or at
199 # the end after opening a file for appending is implementation
200 # defined. So we must seek to the end before calling tell(),
201 # or we may get a zero offset for non-zero sized files on
202 # some platforms (issue3543).
203 f.seek(0, os.SEEK_END)
198 204 offset = f.tell()
199 205 transaction.add('obsstore', offset)
200 206 if offset == 0:
General Comments 0
You need to be logged in to leave comments. Login now