commit 89985bebf92e8342514f2a17e88792093ed8c50d
Author: Stephan Witt <[email protected]>
Date:   Sat Feb 20 07:32:56 2016 +0100

    #9940 VCS now toggles buffer read-only state if locking is not active and 
it is enabled by VC backend

diff --git a/src/LyXVC.cpp b/src/LyXVC.cpp
index 4dbcfd2..d480311 100644
--- a/src/LyXVC.cpp
+++ b/src/LyXVC.cpp
@@ -328,7 +328,13 @@ string LyXVC::toggleReadOnly()
                return log;
        }
        case VCS::NOLOCKING:
-               break;
+               Buffer * b = vcs->owner();
+               bool const newstate = !b->isReadonly();
+               string result = "LyXVC: toggle to ";
+               result += (newstate ? "readonly" : "readwrite");
+               LYXERR(Debug::LYXVC, result);
+               b->setReadonly(newstate);
+               return result;
        }
        return string();
 }
diff --git a/src/VCBackend.cpp b/src/VCBackend.cpp
index 6350766..e0d9b4c 100644
--- a/src/VCBackend.cpp
+++ b/src/VCBackend.cpp
@@ -2254,7 +2254,7 @@ bool GIT::prepareFileRevisionEnabled()
 
 bool GIT::toggleReadOnlyEnabled()
 {
-       return false;
+       return true;
 }
 
 

Reply via email to