equal
deleted
inserted
replaced
271 def _writepending(self, tr): |
271 def _writepending(self, tr): |
272 "create a file containing the unfinalized state for pretxnchangegroup" |
272 "create a file containing the unfinalized state for pretxnchangegroup" |
273 if self._delaybuf: |
273 if self._delaybuf: |
274 # make a temporary copy of the index |
274 # make a temporary copy of the index |
275 fp1 = self._realopener(self.indexfile) |
275 fp1 = self._realopener(self.indexfile) |
276 fp2 = self._realopener(self.indexfile + ".a", "w") |
276 pendingfilename = self.indexfile + ".a" |
|
277 # register as a temp file to ensure cleanup on failure |
|
278 tr.registertmp(pendingfilename) |
|
279 # write existing data |
|
280 fp2 = self._realopener(pendingfilename, "w") |
277 fp2.write(fp1.read()) |
281 fp2.write(fp1.read()) |
278 # add pending data |
282 # add pending data |
279 fp2.write("".join(self._delaybuf)) |
283 fp2.write("".join(self._delaybuf)) |
280 fp2.close() |
284 fp2.close() |
281 # switch modes so finalize can simply rename |
285 # switch modes so finalize can simply rename |