Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py

branch
5_1_x
changeset 1301
a2b0aceba6a2
parent 1298
090b37850a89
child 1320
e94577f27c3e
equal deleted inserted replaced
1298:090b37850a89 1301:a2b0aceba6a2
290 return 290 return
291 fname = Utilities.toNativeSeparators(fname) 291 fname = Utilities.toNativeSeparators(fname)
292 292
293 eol = e5App().getObject("Project").getEolString() 293 eol = e5App().getObject("Project").getEolString()
294 try: 294 try:
295 f = open(fname, "w", encoding = "utf-8") 295 f = open(fname, "w", encoding = "utf-8", newline = "")
296 f.write(eol.join(self.contents.toPlainText().splitlines())) 296 f.write(eol.join(self.contents.toPlainText().splitlines()))
297 f.close() 297 f.close()
298 except IOError as why: 298 except IOError as why:
299 E5MessageBox.critical(self, self.trUtf8('Save Diff'), 299 E5MessageBox.critical(self, self.trUtf8('Save Diff'),
300 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.' 300 self.trUtf8('<p>The patch file <b>{0}</b> could not be saved.'

eric ide

mercurial