Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py

branch
5_1_x
changeset 1298
090b37850a89
parent 882
34b86be88bf0
child 1301
a2b0aceba6a2
equal deleted inserted replaced
1296:c4574e31bfc4 1298:090b37850a89
337 icon = E5MessageBox.Warning) 337 icon = E5MessageBox.Warning)
338 if not res: 338 if not res:
339 return 339 return
340 fname = Utilities.toNativeSeparators(fname) 340 fname = Utilities.toNativeSeparators(fname)
341 341
342 eol = e5App().getObject("Project").getEolString()
342 try: 343 try:
343 f = open(fname, "w", encoding = "utf-8") 344 f = open(fname, "w", encoding = "utf-8")
344 f.write(self.contents.toPlainText()) 345 f.write(eol.join(self.contents.toPlainText().splitlines()))
345 f.close() 346 f.close()
346 except IOError as why: 347 except IOError as why:
347 E5MessageBox.critical(self, self.trUtf8('Save Diff'), 348 E5MessageBox.critical(self, self.trUtf8('Save Diff'),
348 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.' 349 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.'
349 '<br>Reason: {1}</p>') 350 '<br>Reason: {1}</p>')

eric ide

mercurial