]> git.lyx.org Git - lyx.git/blobdiff - src/VCBackend.cpp
Routines for calculating numerical labels for BibTeX citations.
[lyx.git] / src / VCBackend.cpp
index 331d6e87b1884c8b44e65f0d5ff87d2ccdfe7834..5d8e33d4eaeb0951c70c6e357e22e80456729b6f 100644 (file)
@@ -273,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;
 }
 
 
@@ -516,6 +520,8 @@ FileName const SVN::findFile(FileName const & file)
 void SVN::scanMaster()
 {
        locker_.clear();
+       // vcstatus code is somewhat superflous, until we want
+       // to implement read-only toggle for svn.
        vcstatus = NOLOCKING;
        if (checkLockMode()) {
                if (isLocked()) {
@@ -523,7 +529,7 @@ void SVN::scanMaster()
                        vcstatus = LOCKED;
                } else {
                        locker_ = "Unlocked";
-                       vcstatus = LOCKED;
+                       vcstatus = UNLOCKED;
                }
        }
 }
@@ -563,9 +569,8 @@ bool SVN::checkLockMode()
 
 bool SVN::isLocked() const
 {
-       //refresh file info
-       FileName file(file_.absFilename());
-       return !file.isReadOnly();
+       file_.refresh();
+       return !file_.isReadOnly();
 }
 
 
@@ -600,7 +605,7 @@ string SVN::checkIn(string const & msg)
                fileLock(false, tmpf, log);
 
        tmpf.erase();
-       return "SVN: " + log;
+       return log.empty() ? string() : "SVN: " + log;
 }
 
 
@@ -644,7 +649,7 @@ void SVN::fileLock(bool lock, FileName const & tmpf, string &status)
        if (!locked_mode_ || (isLocked() == lock))
                return;
 
-       string arg = lock ? "lock " : "unlock ";
+       string const arg = lock ? "lock " : "unlock ";
        doVCCommand("svn "+ arg + quoteName(onlyFilename(owner_->absFileName()))
                    + " > " + quoteName(tmpf.toFilesystemEncoding()),
                    FileName(owner_->filePath()));
@@ -689,13 +694,13 @@ string SVN::checkOut()
                frontend::Alert::error(_("Revision control error."),
                        bformat(_("Error when updating from repository.\n"
                                "You have to manually resolve the conflicts NOW!\n'%1$s'.\n\n"
-                               "After pressing OK, LyX will try to reopen resolved document."),
+                               "After pressing OK, LyX will try to reopen the resolved document."),
                        from_local8bit(res)));
 
        fileLock(true, tmpf, log);
 
        tmpf.erase();
-       return "SVN: " + log;
+       return log.empty() ? string() : "SVN: " + log;
 }
 
 
@@ -729,7 +734,7 @@ string SVN::repoUpdate()
                                "will be preferred."
                                "\n\nContinue?"), file);
                int ret = frontend::Alert::prompt(_("Changes detected"),
-                               text, 0, 1, _("&Yes"), _("&No"), _("View &Log"));
+                               text, 0, 1, _("&Yes"), _("&No"), _("View &Log ..."));
                if (ret == 2 ) {
                        dispatch(FuncRequest(LFUN_DIALOG_SHOW, "file " + tmpf.absFilename()));
                        ret = frontend::Alert::prompt(_("Changes detected"),