return true;
}
+
bool VCS::checkparentdirs(FileName const & file, std::string const & pathname)
{
FileName dirname = file.onlyPath();
FileName tocheck = FileName(addName(dirname.absFileName(),pathname));
+ LYXERR(Debug::LYXVC, "check file: " << tocheck.absFileName());
bool result = tocheck.exists();
while ( !result && !dirname.empty() ) {
- dirname = dirname.parentPath();
+ //this construct because of #8295
+ dirname = FileName(dirname.absFileName()).parentPath();
+ LYXERR(Debug::LYXVC, "check directory: " << dirname.absFileName());
tocheck = FileName(addName(dirname.absFileName(),pathname));
result = tocheck.exists();
}
//
/////////////////////////////////////////////////////////////////////
-RCS::RCS(FileName const & m)
+RCS::RCS(FileName const & m, Buffer * b) : VCS(b)
{
master_ = m;
scanMaster();
}
-void RCS::retrieve(FileName const & file)
+bool RCS::retrieve(FileName const & file)
{
LYXERR(Debug::LYXVC, "LyXVC::RCS: retrieve.\n\t" << file);
- doVCCommandCall("co -q -r " + quoteName(file.toFilesystemEncoding()),
- FileName());
+ // The caller ensures that file does not exists, so no need to check that.
+ return doVCCommandCall("co -q -r " + quoteName(file.toFilesystemEncoding()),
+ FileName()) == 0;
}
//
/////////////////////////////////////////////////////////////////////
-CVS::CVS(FileName const & m, FileName const & f)
+CVS::CVS(FileName const & m, Buffer * b) : VCS(b)
{
master_ = m;
- file_ = f;
have_rev_info_ = false;
scanMaster();
}
LYXERR(Debug::LYXVC, "LyXVC::CVS: scanMaster. \n Checking: " << master_);
// Ok now we do the real scan...
ifstream ifs(master_.toFilesystemEncoding().c_str());
- string name = onlyFileName(file_.absFileName());
+ string name = onlyFileName(owner_->absFileName());
string tmpf = '/' + name + '/';
LYXERR(Debug::LYXVC, "\tlooking for `" << tmpf << '\'');
string line;
//sm[4]; // options
//sm[5]; // tag or tagdate
- if (file_.isReadableFile()) {
- time_t mod = file_.lastModified();
+ FileName file(owner_->absFileName());
+ if (file.isReadableFile()) {
+ time_t mod = file.lastModified();
string mod_date = rtrim(asctime(gmtime(&mod)), "\n");
LYXERR(Debug::LYXVC, "Date in Entries: `" << file_date
<< "'\nModification date of file: `" << mod_date << '\'');
- if (file_.isReadOnly()) {
+ if (file.isReadOnly()) {
// readonly checkout is unlocked
vcstatus = UNLOCKED;
} else {
}
+bool CVS::retrieve(FileName const & file)
+{
+ LYXERR(Debug::LYXVC, "LyXVC::CVS: retrieve.\n\t" << file);
+ // The caller ensures that file does not exists, so no need to check that.
+ return doVCCommandCall("cvs -q update " + quoteName(file.toFilesystemEncoding()),
+ file.onlyPath()) == 0;
+}
+
+
string const CVS::getTarget(OperationMode opmode) const
{
switch(opmode) {
//
/////////////////////////////////////////////////////////////////////
-SVN::SVN(FileName const & m, FileName const & f)
+SVN::SVN(FileName const & m, Buffer * b) : VCS(b)
{
- owner_ = 0;
master_ = m;
- file_ = f;
locked_mode_ = 0;
scanMaster();
}
}
LYXERR(Debug::LYXVC, "Detecting locking mode...");
- if (doVCCommandCall("svn proplist " + quoteName(file_.onlyFileName())
+ if (doVCCommandCall("svn proplist " + quoteName(onlyFileName(owner_->absFileName()))
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
- file_.onlyPath()))
+ FileName(owner_->filePath())))
return false;
ifstream ifs(tmpf.toFilesystemEncoding().c_str());
bool SVN::isLocked() const
{
- file_.refresh();
- return !file_.isReadOnly();
+ FileName file(owner_->absFileName());
+ file.refresh();
+ return !file.isReadOnly();
+}
+
+
+bool SVN::retrieve(FileName const & file)
+{
+ LYXERR(Debug::LYXVC, "LyXVC::SVN: retrieve.\n\t" << file);
+ // The caller ensures that file does not exists, so no need to check that.
+ return doVCCommandCall("svn update -q --non-interactive " + quoteName(file.onlyFileName()),
+ file.onlyPath()) == 0;
}