rgheck wrote:
> Good. I've been thinking about working on this for a while and just had too 
> many other things to do....

unfortunately this is not working, since statusbar is going to be rewriten
at the end of each lfun by the lfun name itself (besides other messages which
are rewritten). dont know what more can be done.
pavel
diff --git a/src/VCBackend.cpp b/src/VCBackend.cpp
index f784305..623df97 100644
--- a/src/VCBackend.cpp
+++ b/src/VCBackend.cpp
@@ -12,6 +12,8 @@
 
 #include "VCBackend.h"
 #include "Buffer.h"
+#include "FuncRequest.h"
+#include "LyXFunc.h"
 
 #include "frontends/alert.h"
 
@@ -36,17 +38,37 @@ using boost::smatch;
 namespace lyx {
 
 
-int VCS::doVCCommand(string const & cmd, FileName const & path)
+int VCS::doVCCommand(string cmd, FileName const & path, bool outputLog)
 {
        LYXERR(Debug::LYXVC, "doVCCommand: " << cmd);
        Systemcall one;
        support::PathChanger p(path);
+       FileName tmpf = FileName::tempName("lyxvcout");
+       if (outputLog){
+               if (tmpf.empty())
+                       LYXERR(Debug::LYXVC, "Could not generate logfile " << 
tmpf);
+               else
+                       cmd += " > " + tmpf.absFilename();
+       }
+
        int const ret = one.startscript(Systemcall::Wait, cmd);
        if (ret)
                frontend::Alert::error(_("Revision control error."),
                        bformat(_("Please check you have installed the program 
called in\n"
                                  "'%1$s'."),
                        from_ascii(cmd)));
+
+       if (outputLog && !tmpf.empty()){
+               string msg,tmpmsg;
+               ifstream ifs(tmpf.toFilesystemEncoding().c_str());
+               while (ifs){
+                       getline(ifs,tmpmsg);
+                       LYXERR(Debug::LYXVC, "doVCCOutput: " << tmpmsg);
+                       msg += tmpmsg;
+               }
+               lyx::dispatch(FuncRequest(LFUN_MESSAGE, msg));
+               tmpf.erase();
+       }
        return ret;
 }
 
@@ -89,8 +111,8 @@ FileName const RCS::findFile(FileName const & file)
 void RCS::retrieve(FileName const & file)
 {
        LYXERR(Debug::LYXVC, "LyXVC::RCS: retrieve.\n\t" << file);
-       VCS::doVCCommand("co -q -r " + quoteName(file.toFilesystemEncoding()),
-                        FileName());
+       doVCCommand("co -q -r " + quoteName(file.toFilesystemEncoding()),
+                        FileName(), true);
 }
 
 
@@ -160,7 +182,7 @@ void RCS::registrer(string const & msg)
        cmd += msg;
        cmd += "\" ";
        cmd += quoteName(onlyFilename(owner_->absFileName()));
-       doVCCommand(cmd, FileName(owner_->filePath()));
+       doVCCommand(cmd, FileName(owner_->filePath()), true);
 }
 
 
@@ -168,7 +190,7 @@ void RCS::checkIn(string const & msg)
 {
        doVCCommand("ci -q -u -m\"" + msg + "\" "
                    + quoteName(onlyFilename(owner_->absFileName())),
-                   FileName(owner_->filePath()));
+                   FileName(owner_->filePath()), true);
 }
 
 bool RCS::checkInEnabled()
@@ -180,7 +202,7 @@ void RCS::checkOut()
 {
        owner_->markClean();
        doVCCommand("co -q -l " + 
quoteName(onlyFilename(owner_->absFileName())),
-                   FileName(owner_->filePath()));
+                   FileName(owner_->filePath()), true);
 }
 
 
@@ -194,7 +216,7 @@ void RCS::revert()
 {
        doVCCommand("co -f -u" + version() + " "
                    + quoteName(onlyFilename(owner_->absFileName())),
-                   FileName(owner_->filePath()));
+                   FileName(owner_->filePath()), true);
        // We ignore changes and just reload!
        owner_->markClean();
 }
@@ -205,7 +227,7 @@ void RCS::undoLast()
        LYXERR(Debug::LYXVC, "LyXVC: undoLast");
        doVCCommand("rcs -o" + version() + " "
                    + quoteName(onlyFilename(owner_->absFileName())),
-                   FileName(owner_->filePath()));
+                   FileName(owner_->filePath()), true);
 }
 
 
@@ -219,7 +241,7 @@ void RCS::getLog(FileName const & tmpf)
 {
        doVCCommand("rlog " + quoteName(onlyFilename(owner_->absFileName()))
                    + " > " + tmpf.toFilesystemEncoding(),
-                   FileName(owner_->filePath()));
+                   FileName(owner_->filePath()), false);
 }
 
 
@@ -311,7 +333,7 @@ void CVS::registrer(string const & msg)
 {
        doVCCommand("cvs -q add -m \"" + msg + "\" "
                    + quoteName(onlyFilename(owner_->absFileName())),
-                   FileName(owner_->filePath()));
+                   FileName(owner_->filePath()), true);
 }
 
 
@@ -319,7 +341,7 @@ void CVS::checkIn(string const & msg)
 {
        doVCCommand("cvs -q commit -m \"" + msg + "\" "
                    + quoteName(onlyFilename(owner_->absFileName())),
-                   FileName(owner_->filePath()));
+                   FileName(owner_->filePath()), true);
 }
 
 
@@ -345,14 +367,14 @@ bool CVS::checkOutEnabled()
 void CVS::revert()
 {
        // This is sensitive operation, so at lest some check before
-       if (doVCCommand("cvs --help", FileName(owner_->filePath())))
+       if (doVCCommand("cvs --help", FileName(owner_->filePath()), false));
                return;
        // Reverts to the version in CVS repository and
        // gets the updated version from the repository.
        string const fil = quoteName(onlyFilename(owner_->absFileName()));
 
        doVCCommand("rm -f " + fil + "; cvs update " + fil,
-                   FileName(owner_->filePath()));
+                   FileName(owner_->filePath()), true);
        owner_->markClean();
 }
 
@@ -376,7 +398,7 @@ void CVS::getLog(FileName const & tmpf)
 {
        doVCCommand("cvs log " + quoteName(onlyFilename(owner_->absFileName()))
                    + " > " + tmpf.toFilesystemEncoding(),
-                   FileName(owner_->filePath()));
+                   FileName(owner_->filePath()), false);
 }
 
 
diff --git a/src/VCBackend.h b/src/VCBackend.h
index 43e1027..c7183dc 100644
--- a/src/VCBackend.h
+++ b/src/VCBackend.h
@@ -75,7 +75,7 @@ protected:
         * @param path the path from which to execute
         * @return exit status
         */
-       static int doVCCommand(std::string const & cmd, support::FileName const 
& path);
+       static int doVCCommand(std::string cmd, support::FileName const & path, 
bool outputLog);
 
        /**
         * The master VC file. For RCS this is *,v or RCS/ *,v. master should

Reply via email to