]> git.lyx.org Git - lyx.git/blobdiff - src/vc-backend.C
Fix assertion when inserting text strings via clipboard or ascii file; small
[lyx.git] / src / vc-backend.C
index 8c0a29adf3e64044dea4df4d1504cf0bf018ae87..8d1d6e298977a1e9b956646772706a1ef23ac28d 100644 (file)
@@ -5,6 +5,7 @@
 #endif
 
 #include <fstream>
+using std::ifstream;
 
 #include "vc-backend.h"
 #include "debug.h"
@@ -222,11 +223,11 @@ void CVS::scanMaster()
        string tmpf = "/" + OnlyFilename(file_) + "/";
        lyxerr[Debug::LYXVC] << "\tlooking for `" << tmpf << "'" << endl;
        string line;
+       LRegex reg("/(.*)/(.*)/(.*)/(.*)/(.*)");
        while(getline(ifs, line)) {
                lyxerr[Debug::LYXVC] << "\t  line: " << line << endl;
                if (contains(line, tmpf)) {
                        // Ok extract the fields.
-                       LRegex reg("/(.*)/(.*)/(.*)/(.*)/(.*)");
                        LRegex::SubMatches const & sm = reg.exec(line);
                        //sm[0]; // whole matched string
                        //sm[1]; // filename
@@ -253,14 +254,6 @@ void CVS::scanMaster()
                                locker_ = "Locked";
                                vcstat = LOCKED;
                        }
-#if 0                  
-                       for (LRegex::SubMatches::const_iterator cit = sm.begin();
-                            cit != sm.end(); ++cit) {
-                               if ((*cit).first != string::npos)
-                                       lyxerr << string(line, (*cit).first,
-                                                        (*cit).second) << endl;
-                       }
-#endif
                        break;
                }
        }
@@ -269,19 +262,24 @@ void CVS::scanMaster()
 
 void CVS::registrer(string const & msg)
 {
-       // cvs add
+       doVCCommand("cvs -q add -m \"" + msg + "\" \""
+                   + OnlyFilename(owner_->getFileName()) + "\"");
+       owner_->getUser()->owner()->getLyXFunc()->Dispatch("buffer-reload");
 }
 
 
 void CVS::checkIn(string const & msg)
 {
-       // cvs commit
+       doVCCommand("cvs -q commit -m \"" + msg + "\" \""
+                   + OnlyFilename(owner_->getFileName()) + "\"");
+       owner_->getUser()->owner()->getLyXFunc()->Dispatch("buffer-reload");
 }
 
 
 void CVS::checkOut()
 {
-       // cvs update
+       // cvs update or perhaps for cvs this should be a noop
+       lyxerr << "Sorry not implemented." << endl;
 }
 
 
@@ -289,7 +287,8 @@ void CVS::revert()
 {
        // not sure how to do this...
        // rm file
-       // cvs update  
+       // cvs update
+       lyxerr << "Sorry not implemented." << endl;
 }
 
 
@@ -298,9 +297,11 @@ void CVS::undoLast()
        // merge the current with the previous version
        // in a reverse patch kind of way, so that the
        // result is to revert the last changes.
+       lyxerr << "Sorry not implemented." << endl;
 }
 
 
 void CVS::getLog(string const &)
 {
+       lyxerr << "Sorry not implemented." << endl;
 }