commit eed2e2f6557df755c1b7c384487aa8e823cba310
Author: Georg Baum <[email protected]>
Date: Sun Jul 7 09:56:34 2013 +0200
Fix inconsistent version in .lyx files (#7951)
LyX, lyx2lyx and tex2lyx produce now all the same version indicator
consisting
only of the major and minor version. It is not decided yet whether future
development versions will add a -dev suffix, but for 2.1.0 this change fixes
the inconsistencies.
diff --git a/lib/lyx2lyx/lyx2lyx_version.py.in
b/lib/lyx2lyx/lyx2lyx_version.py.in
index e99da0b..d3b6609 100644
--- a/lib/lyx2lyx/lyx2lyx_version.py.in
+++ b/lib/lyx2lyx/lyx2lyx_version.py.in
@@ -16,7 +16,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
-version = "@PACKAGE_VERSION@"
+# Important: Keep the version formatting in sync with LyX and
+# tex2lyx (bug 7951)
+version = "@LYX_MAJOR_VERSION@.@LYX_MINOR_VERSION@"
if __name__ == "__main__":
pass
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 014dcd6..6ef03f6 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -1404,6 +1404,8 @@ bool Buffer::write(ostream & ofs) const
// The top of the file should not be written by params().
// write out a comment in the top of the file
+ // Important: Keep the version formatting in sync with lyx2lyx and
+ // tex2lyx (bug 7951)
ofs << "#LyX " << lyx_version_major << "." << lyx_version_minor
<< " created this file. For more info see http://www.lyx.org/\n"
<< "\\lyxformat " << LYX_FORMAT << "\n"
diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index 9759663..0dda8de 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -21,6 +21,7 @@
#include "Layout.h"
#include "Lexer.h"
#include "TextClass.h"
+#include "version.h"
#include "support/convert.h"
#include "support/FileName.h"
@@ -1040,7 +1041,10 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc)
}
// output the LyX file settings
- os << "#LyX file created by tex2lyx " << PACKAGE_VERSION << "\n"
+ // Important: Keep the version formatting in sync with LyX and
+ // lyx2lyx (bug 7951)
+ os << "#LyX file created by tex2lyx " << lyx_version_major << '.'
+ << lyx_version_minor << '\n'
<< "\\lyxformat " << LYX_FORMAT << '\n'
<< "\\begin_document\n"
<< "\\begin_header\n"
diff --git a/src/tex2lyx/test/CJK.lyx.lyx b/src/tex2lyx/test/CJK.lyx.lyx
index dcd4d5b..5a73840 100644
--- a/src/tex2lyx/test/CJK.lyx.lyx
+++ b/src/tex2lyx/test/CJK.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/CJKutf8.lyx.lyx b/src/tex2lyx/test/CJKutf8.lyx.lyx
index 61071a7..894bb06 100644
--- a/src/tex2lyx/test/CJKutf8.lyx.lyx
+++ b/src/tex2lyx/test/CJKutf8.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/DummyDocument.lyx.lyx
b/src/tex2lyx/test/DummyDocument.lyx.lyx
index 8bb60fc..12f4950 100644
--- a/src/tex2lyx/test/DummyDocument.lyx.lyx
+++ b/src/tex2lyx/test/DummyDocument.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/Dummy~Document.lyx.lyx
b/src/tex2lyx/test/Dummy~Document.lyx.lyx
index 3d70223..4335937 100644
--- a/src/tex2lyx/test/Dummy~Document.lyx.lyx
+++ b/src/tex2lyx/test/Dummy~Document.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
index fd6f4c3..bcf4c0f 100644
--- a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
+++ b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
index 90824d4..c09701a 100644
--- a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
+++ b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/test-insets.lyx.lyx
b/src/tex2lyx/test/test-insets.lyx.lyx
index 608948c..c7ba2a5 100644
--- a/src/tex2lyx/test/test-insets.lyx.lyx
+++ b/src/tex2lyx/test/test-insets.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/test-modules.lyx.lyx
b/src/tex2lyx/test/test-modules.lyx.lyx
index 8cd8b65..4fd4178 100644
--- a/src/tex2lyx/test/test-modules.lyx.lyx
+++ b/src/tex2lyx/test/test-modules.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
index 37d4393..b29f4c1 100644
--- a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
+++ b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/test-structure.lyx.lyx
b/src/tex2lyx/test/test-structure.lyx.lyx
index adcc292..e7de51d 100644
--- a/src/tex2lyx/test/test-structure.lyx.lyx
+++ b/src/tex2lyx/test/test-structure.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/test.lyx.lyx b/src/tex2lyx/test/test.lyx.lyx
index ec4c540..21ecd0a 100644
--- a/src/tex2lyx/test/test.lyx.lyx
+++ b/src/tex2lyx/test/test.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header
diff --git a/src/tex2lyx/test/verbatim.lyx.lyx
b/src/tex2lyx/test/verbatim.lyx.lyx
index 8d7d3ce..f0a1d2b 100644
--- a/src/tex2lyx/test/verbatim.lyx.lyx
+++ b/src/tex2lyx/test/verbatim.lyx.lyx
@@ -1,4 +1,4 @@
-#LyX file created by tex2lyx 2.1.0
+#LyX file created by tex2lyx 2.1
\lyxformat 474
\begin_document
\begin_header