Fixed an issue in the various diff dialogs writing the patch.

Tue, 06 Sep 2011 18:33:27 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 06 Sep 2011 18:33:27 +0200
changeset 1297
6347cf782036
parent 1295
b3db3070d104
child 1299
fd5d21389d2b

Fixed an issue in the various diff dialogs writing the patch.

Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py file | annotate | diff | comparison | revisions
diff -r b3db3070d104 -r 6347cf782036 Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py
--- a/Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py	Tue Sep 06 18:18:40 2011 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py	Tue Sep 06 18:33:27 2011 +0200
@@ -14,6 +14,7 @@
     QTextCursor, QLineEdit
 
 from E5Gui import E5MessageBox, E5FileDialog
+from E5Gui.E5Application import e5App
 
 from .Ui_HgDiffDialog import Ui_HgDiffDialog
 
@@ -339,9 +340,10 @@
                 return
         fname = Utilities.toNativeSeparators(fname)
         
+        eol = e5App().getObject("Project").getEolString()
         try:
             f = open(fname, "w", encoding="utf-8")
-            f.write(self.contents.toPlainText())
+            f.write(eol.join(self.contents.toPlainText().splitlines()))
             f.close()
         except IOError as why:
             E5MessageBox.critical(self, self.trUtf8('Save Diff'),
diff -r b3db3070d104 -r 6347cf782036 Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py
--- a/Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py	Tue Sep 06 18:18:40 2011 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py	Tue Sep 06 18:33:27 2011 +0200
@@ -341,9 +341,10 @@
                 return
         fname = Utilities.toNativeSeparators(fname)
         
+        eol = e5App().getObject("Project").getEolString()
         try:
             f = open(fname, "w", encoding="utf-8")
-            f.write(self.contents.toPlainText())
+            f.write(eol.join(self.contents.toPlainText().splitlines()))
             f.close()
         except IOError as why:
             E5MessageBox.critical(self, self.trUtf8('Save Diff'),
diff -r b3db3070d104 -r 6347cf782036 Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py
--- a/Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py	Tue Sep 06 18:18:40 2011 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py	Tue Sep 06 18:33:27 2011 +0200
@@ -300,9 +300,10 @@
                 return
         fname = Utilities.toNativeSeparators(fname)
         
+        eol = e5App().getObject("Project").getEolString()
         try:
             f = open(fname, "w", encoding="utf-8")
-            f.write(self.contents.toPlainText())
+            f.write(eol.join(self.contents.toPlainText().splitlines()))
             f.close()
         except IOError as why:
             E5MessageBox.critical(self, self.trUtf8('Save Diff'),

eric ide

mercurial