#pragma implementation
#endif
-#include <unistd.h>
-
-#include "frontends/Alert.h"
#include "lyxvc.h"
#include "vc-backend.h"
#include "debug.h"
#include "buffer.h"
#include "BufferView.h"
#include "gettext.h"
+#include "frontends/LyXView.h"
+#include "lyxfunc.h"
+
+#include "frontends/Alert.h"
+
#include "support/filetools.h"
#include "support/lyxlib.h"
-#include "LyXView.h"
-#include "lyxfunc.h"
+
+#include <unistd.h>
using std::endl;
using std::pair;
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_);
}