On Thu, Mar 13, 2003 at 10:43:34AM +0000, John Levon wrote:
> 
> Hmm OK, so lyx2lyx copes with versions its never asked to output in.
> 
> So, feel free to bump the number add an empty file, only to remove it
> later, despite the fact everyone's fixed all their documents in the time
> we've been having this silly argument.

We can use the suggestion I gave in a previous mail (always run lyx2lyx in
the development LyX), or use the following patch which doesn't require
new files for lyx2lyx.
Index: src/buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.431
diff -u -p -r1.431 buffer.C
--- src/buffer.C        12 Mar 2003 11:52:22 -0000      1.431
+++ src/buffer.C        13 Mar 2003 11:15:51 -0000
@@ -115,7 +115,7 @@ extern BufferList bufferlist;
 
 namespace {
 
-const int LYX_FORMAT = 222;
+const int LYX_FORMAT = 223;
 
 } // namespace anon
 
Index: lib/lyx2lyx/lyx2lyx
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx2lyx,v
retrieving revision 1.7
diff -u -p -r1.7 lyx2lyx
--- lib/lyx2lyx/lyx2lyx 10 Feb 2003 10:27:46 -0000      1.7
+++ lib/lyx2lyx/lyx2lyx 13 Mar 2003 11:15:52 -0000
@@ -37,7 +37,7 @@ opt.quiet = 0
 
 format = re.compile(r"(\d)[\.,]?(\d\d)")
 fileformat = re.compile(r"\\lyxformat\s*(\S*)")
-lst_ft = ["210", "215", "216", "217", "218", "220", "221", "222"]
+lst_ft = ["210", "215", "216", "217", "218", "220", "221", "223"]
 
 def usage():
     print """Usage: lyx2lyx [options] file1
@@ -105,10 +105,17 @@ def lyxformat(fmt):
     else:
         sys.stderr.write(fmt + ": " + error.invalid_format)
         sys.exit(2)
-    if fmt not in lst_ft:
-        sys.stderr.write(fmt + ": " + error.format_not_supported)
-        sys.exit(1)
-    return fmt
+
+    if fmt in lst_ft:
+        return fmt
+
+    x = int(fmt)
+    if x < int(lst_ft[-1]) and x > int(lst_ft[-2]):
+        sys.stderr.write("lyx2lyx: A development version file.\n")
+        return lst_ft[-2]
+
+    sys.stderr.write(fmt + ": " + error.format_not_supported)
+    sys.exit(1)
 
 def read_file(file, header, body):
     """Reads a file into the header and body parts"""

Reply via email to