]> git.lyx.org Git - features.git/commitdiff
We are completely user unfriendly.
authorPavel Sanda <sanda@lyx.org>
Mon, 21 Jul 2008 11:50:21 +0000 (11:50 +0000)
committerPavel Sanda <sanda@lyx.org>
Mon, 21 Jul 2008 11:50:21 +0000 (11:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25765 a592a061-630c-0410-9148-cb99ea01b6c8

src/VCBackend.cpp

index ae40e5dd6fa0871def97af0232f7cd47501dd61c..7dac4e5f2dad0d6a80942b2ca2c8130b6d497ae1 100644 (file)
 #include "VCBackend.h"
 #include "Buffer.h"
 
+#include "frontends/alert.h"
+
 #include "support/debug.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/Path.h"
 #include "support/Systemcall.h"
@@ -39,6 +42,10 @@ int VCS::doVCCommand(string const & cmd, FileName const & path)
        Systemcall one;
        support::PathChanger p(path);
        int const ret = one.startscript(Systemcall::Wait, cmd);
+       if (ret)
+               frontend::Alert::error(_("Revision control error."),
+                       _("Please check you have installed revision control program.") + "\n"
+                       + from_ascii(cmd));
        return ret;
 }
 
@@ -336,6 +343,9 @@ bool CVS::checkOutEnabled()
 
 void CVS::revert()
 {
+       // This is sensitive operation, so at lest some check before
+       if (doVCCommand("cvs --help", FileName(owner_->filePath())))
+               return;
        // Reverts to the version in CVS repository and
        // gets the updated version from the repository.
        string const fil = quoteName(onlyFilename(owner_->absFileName()));