]> git.lyx.org Git - lyx.git/blobdiff - src/lyxvc.C
more guii moving around.
[lyx.git] / src / lyxvc.C
index 38d9278dd793f627af57e426f1c386313bda761b..98c8edd01061d0586a5b18d8c9a4af457c38ba22 100644 (file)
@@ -10,7 +10,7 @@
 #include "buffer.h"
 #include "BufferView.h"
 #include "gettext.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
 #include "lyxfunc.h"
 
 #include "frontends/Alert.h"
@@ -76,10 +76,24 @@ void LyXVC::buffer(Buffer * buf)
 void LyXVC::registrer()
 {
        // it is very likely here that the vcs is not created yet...
-       // so... we use RCS as default, later this should perhaps be
-       // a lyxrc option.
        if (!vcs) {
-               vcs = new RCS(owner_->fileName());
+               string const cvs_entries = "CVS/Entries";
+
+               if (IsFileReadable(cvs_entries)) {
+                       lyxerr[Debug::LYXVC]
+                               << "LyXVC: registering "
+                               << MakeDisplayPath(owner_->fileName())
+                               << " with CVS" << endl;
+                       vcs = new CVS(cvs_entries, owner_->fileName());
+
+               } else {
+                       lyxerr[Debug::LYXVC]
+                               << "LyXVC: registering "
+                               << MakeDisplayPath(owner_->fileName())
+                               << " with RCS" << endl;
+                       vcs = new RCS(owner_->fileName());
+               }
+
                vcs->owner(owner_);
        }