Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py

changeset 1297
6347cf782036
parent 1131
7781e396c903
child 1300
9083f6b7ea3b
equal deleted inserted replaced
1295:b3db3070d104 1297:6347cf782036
339 icon=E5MessageBox.Warning) 339 icon=E5MessageBox.Warning)
340 if not res: 340 if not res:
341 return 341 return
342 fname = Utilities.toNativeSeparators(fname) 342 fname = Utilities.toNativeSeparators(fname)
343 343
344 eol = e5App().getObject("Project").getEolString()
344 try: 345 try:
345 f = open(fname, "w", encoding="utf-8") 346 f = open(fname, "w", encoding="utf-8")
346 f.write(self.contents.toPlainText()) 347 f.write(eol.join(self.contents.toPlainText().splitlines()))
347 f.close() 348 f.close()
348 except IOError as why: 349 except IOError as why:
349 E5MessageBox.critical(self, self.trUtf8('Save Diff'), 350 E5MessageBox.critical(self, self.trUtf8('Save Diff'),
350 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.' 351 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.'
351 '<br>Reason: {1}</p>') 352 '<br>Reason: {1}</p>')

eric ide

mercurial