return owner_ && !owner_->isReadonly();
}
+bool RCS::isCheckInWithConfirmation()
+{
+ //FIXME diff
+ return true;
+}
+
string RCS::checkOut()
{
string RCS::lockingToggle()
{
+ //FIXME this might be actually possible, study rcs -U, rcs -L.
+ //State should be easy to get inside scanMaster.
+ //It would fix #4370 and make rcs/svn usage even more closer.
lyxerr << "Sorry, not implemented." << endl;
return string();
}
}
+bool RCS::isRevertWithConfirmation()
+{
+ //FIXME owner && diff ?
+ return true;
+}
+
+
void RCS::undoLast()
{
LYXERR(Debug::LYXVC, "LyXVC: undoLast");
{
switch(opmode) {
case Directory:
- return quoteName(owner_->filePath());
+ // in client server mode CVS does not like full path operand for directory operation
+ // since LyX switches to the repo dir "." is good enough as target
+ return ".";
case File:
return quoteName(onlyFileName(owner_->absFileName()));
}
}
+bool CVS::isCheckInWithConfirmation()
+{
+ CvsStatus status = getStatus();
+ return status == LocallyModified || status == LocallyAdded;
+}
+
+
string CVS::checkOut()
{
if (vcstatus != NOLOCKING && edit())
}
+bool CVS::isRevertWithConfirmation()
+{
+ CvsStatus status = getStatus();
+ return !owner_->isClean() || status == LocallyModified || status == NeedsMerge;
+}
+
+
void CVS::revert()
{
// Reverts to the version in CVS repository and
owner_->markClean();
break;
}
- case LocallyAdded:
+ case LocallyAdded: {
+ docstring const file = owner_->fileName().displayName(20);
frontend::Alert::error(_("Revision control error."),
- _("The current file is not in repository.\n"
- "You have to check in the first revision before you can revert.")) ;
+ bformat(_("The document %1$s is not in repository.\n"
+ "You have to check in the first revision before you can revert."),
+ file)) ;
break;
- default:
+ }
+ default: {
+ docstring const file = owner_->fileName().displayName(20);
frontend::Alert::error(_("Revision control error."),
- bformat(_("Bad status when checking in changes.\n"
- "\n'%1$s'\n\n"),
- toString(status)));
+ bformat(_("Cannot revert document %1$s to repository version.\n"
+ "The status '%2$s' is unexpected."),
+ file, toString(status)));
break;
+ }
}
}
}
+bool SVN::isCheckInWithConfirmation()
+{
+ //FIXME diff
+ return true;
+}
+
+
// FIXME Correctly return code should be checked instead of this.
// This would need another solution than just plain startscript.
// Hint from Andre': QProcess::readAllStandardError()...
void SVN::revert()
{
- // Reverts to the version in CVS repository and
+ // Reverts to the version in SVN repository and
// gets the updated version from the repository.
string const fil = quoteName(onlyFileName(owner_->absFileName()));
}
+bool SVN::isRevertWithConfirmation()
+{
+ //FIXME owner && diff
+ return true;
+}
+
+
void SVN::undoLast()
{
// merge the current with the previous version