]> git.lyx.org Git - lyx.git/blobdiff - src/VCBackend.cpp
Simplify code introduced in r32761.
[lyx.git] / src / VCBackend.cpp
index 70169e5b943ae29e93c945f939761abda59978be..422483347c303bf234c1f5b8ced66a42290218bc 100644 (file)
 
 #include "VCBackend.h"
 #include "Buffer.h"
+#include "LyXFunc.h"
+#include "FuncRequest.h"
 
 #include "frontends/alert.h"
+#include "frontends/Application.h"
 
 #include "support/debug.h"
 #include "support/filetools.h"
@@ -41,7 +44,7 @@ int VCS::doVCCommandCall(string const & cmd, FileName const & path)
        LYXERR(Debug::LYXVC, "doVCCommandCall: " << cmd);
        Systemcall one;
        support::PathChanger p(path);
-       return one.startscript(Systemcall::Wait, cmd);
+       return one.startscript(Systemcall::Wait, cmd, false);
 }
 
 
@@ -270,7 +273,11 @@ void RCS::getLog(FileName const & tmpf)
 
 bool RCS::toggleReadOnlyEnabled()
 {
-       return true;
+       // This got broken somewhere along lfuns dispatch reorganization.
+       // reloadBuffer would be needed after this, but thats problematic
+       // since we are inside Buffer::dispatch.
+       // return true;
+       return false;
 }
 
 
@@ -597,7 +604,7 @@ string SVN::checkIn(string const & msg)
                fileLock(false, tmpf, log);
 
        tmpf.erase();
-       return "SVN: " + log;
+       return log.empty() ? string() : "SVN: " + log;
 }
 
 
@@ -692,7 +699,7 @@ string SVN::checkOut()
        fileLock(true, tmpf, log);
 
        tmpf.erase();
-       return "SVN: " + log;
+       return log.empty() ? string() : "SVN: " + log;
 }
 
 
@@ -725,9 +732,15 @@ string SVN::repoUpdate()
                                "In case of file conflict version of the local directory files "
                                "will be preferred."
                                "\n\nContinue?"), file);
-               int const ret = frontend::Alert::prompt(_("Changes detected"),
+               int ret = frontend::Alert::prompt(_("Changes detected"),
+                               text, 0, 1, _("&Yes"), _("&No"), _("View &Log ..."));
+               if (ret == 2 ) {
+                       dispatch(FuncRequest(LFUN_DIALOG_SHOW, "file " + tmpf.absFilename()));
+                       ret = frontend::Alert::prompt(_("Changes detected"),
                                text, 0, 1, _("&Yes"), _("&No"));
-               if (ret) {
+                       hideDialogs("file", 0);
+               }
+               if (ret == 1 ) {
                        tmpf.erase();
                        return string();
                }