]> git.lyx.org Git - lyx.git/blobdiff - src/VCBackend.cpp
GuiPainter.cpp: correct attempt from r35491
[lyx.git] / src / VCBackend.cpp
index 390b3ce4e5c3694dad4061d8930bb8f75f2202ec..100da4f302c7a4699212a2a1cfe546713bcac083 100644 (file)
@@ -293,8 +293,12 @@ bool RCS::prepareFileRevision(string const &revis, string & f)
 
        if (isStrInt(rev)) {
                int back = convert<int>(rev);
-               if (back > 0)
-                       return false;
+               // if positive use as the last number in the whole revision string
+               if (back > 0) {
+                       string base;
+                       rsplit(version_, base , '.' );
+                       rev = base + "." + rev;
+               }
                if (back == 0)
                        rev = version_;
                // we care about the last number from revision string
@@ -312,7 +316,7 @@ bool RCS::prepareFileRevision(string const &revis, string & f)
                }
        }
 
-       FileName tmpf = FileName::tempName("lyxvcrev");
+       FileName tmpf = FileName::tempName("lyxvcrev_" + rev + "_");
        if (tmpf.empty()) {
                LYXERR(Debug::LYXVC, "Could not generate logfile " << tmpf);
                return N_("Error: Could not generate logfile.");
@@ -1058,13 +1062,14 @@ bool SVN::prepareFileRevision(string const & revis, string & f)
                        return false;
        }
 
-       FileName tmpf = FileName::tempName("lyxvcrev");
+       string revname = convert<string>(rev);
+       FileName tmpf = FileName::tempName("lyxvcrev_" + revname + "_");
        if (tmpf.empty()) {
                LYXERR(Debug::LYXVC, "Could not generate logfile " << tmpf);
                return N_("Error: Could not generate logfile.");
        }
 
-       doVCCommand("svn cat -r " + convert<string>(rev) + " "
+       doVCCommand("svn cat -r " + revname + " "
                      + quoteName(onlyFileName(owner_->absFileName()))
                      + " > " + quoteName(tmpf.toFilesystemEncoding()),
                FileName(owner_->filePath()));