src/eric7/VCS/VersionControl.py

branch
eric7
changeset 10459
5c5ed40d533d
parent 10439
21c28b0f9e41
child 10475
ee41fab001f2
equal deleted inserted replaced
10458:2074b8393649 10459:5c5ed40d533d
295 messages.remove(message) 295 messages.remove(message)
296 messages.insert(0, message) 296 messages.insert(0, message)
297 del messages[noMessages:] 297 del messages[noMessages:]
298 298
299 with contextlib.suppress(TypeError, OSError): 299 with contextlib.suppress(TypeError, OSError):
300 jsonString = json.dumps(messages, indent=2) 300 jsonString = json.dumps(messages, indent=2) + "\n"
301 with open( 301 with open(
302 os.path.join(projectMgmtDir, VersionControl.commitHistoryData), 302 os.path.join(projectMgmtDir, VersionControl.commitHistoryData),
303 "w", 303 "w",
304 ) as f: 304 ) as f:
305 f.write(jsonString) 305 f.write(jsonString)
329 lockFile = QLockFile( 329 lockFile = QLockFile(
330 os.path.join(projectMgmtDir, VersionControl.commitHistoryLock) 330 os.path.join(projectMgmtDir, VersionControl.commitHistoryLock)
331 ) 331 )
332 if lockFile.lock(): 332 if lockFile.lock():
333 with contextlib.suppress(TypeError, OSError): 333 with contextlib.suppress(TypeError, OSError):
334 jsonString = json.dumps([], indent=2) 334 jsonString = json.dumps([], indent=2) + "\n"
335 with open( 335 with open(
336 os.path.join(projectMgmtDir, VersionControl.commitHistoryData), 336 os.path.join(projectMgmtDir, VersionControl.commitHistoryData),
337 "w", 337 "w",
338 ) as f: 338 ) as f:
339 f.write(jsonString) 339 f.write(jsonString)

eric ide

mercurial