lyxerr.debug("LyXVC::scanMaster: current lex text: `"
+token+"'", Error::LYXVC);
if (token.empty()) continue; elseif (token == "head") { // get version here
lex.next();
LString tmv = lex.GetString();
tmv.strip(';');
version = tmv;
} elseif (token.contains("access")
|| token.contains("symbols")
|| token.contains("strict")) { // nothing
} elseif (token.contains("locks")) { // get locker here if (token.contains(";")) {
locker = "Unlocked";
vcstat = UNLOCKED; continue;
}
LString tmpt, s1, s2; do {
lex.next();
tmpt = lex.GetString();
s1 = tmpt;
s1.strip(';'); // tmp is now in the format <user>:<version>
s1.split(s2, ':'); // s2 is user, and s1 is version if (s1 == version) {
locker = s2;
vcstat = LOCKED; break;
}
} while (!tmpt.contains(";"));
} elseif (token == "comment") { // we don't need to read any further than this.
read_enough = true;
} else { // unexpected
lyxerr.debug("LyXVC::scanMaster(): unexpected token", Error::LYXVC);
}
}
}
// // I will probably add some backend_xxxx functions later to perform the // version control system specific commands. Something like: // void backend_revert(<params>) { // if (backend == "RCS") { // } else if (backend == "CVS") { // } else if (backend == "SCCS") { // } // // But for 0.12 we will only support RCS. //
void LyXVC::registrer()
{ // If the document is changed, we might want to save it if (!_owner->isLyxClean() &&
AskQuestion(_("Changes in document:"),
MakeDisplayPath(_owner->getFileName(),50),
_("Save document and proceed?"))) {
MenuWrite(_owner);
}
// Maybe the save fails, or we answered "no". In both cases, // the document will be dirty, and we abort. if (!_owner->isLyxClean()) { return;
}
void LyXVC::checkIn()
{ // If the document is changed, we might want to save it if (!_owner->isLyxClean() &&
AskQuestion(_("Changes in document:"),
MakeDisplayPath(_owner->getFileName(),50),
_("Save document and proceed?"))) {
MenuWrite(_owner);
}
// Maybe the save fails, or we answered "no". In both cases, // the document will be dirty, and we abort. if (!_owner->isLyxClean()) { return;
}
void LyXVC::revert()
{
lyxerr.debug("LyXVC: revert", Error::LYXVC); // Here we should check if the buffer is dirty. And if it is // we should warn the user that reverting will discard all // changes made since the last check in. if (AskQuestion(_("When you revert, you will loose all changes made"),
_("to the document since the last check in."),
_("Do you still want to do it?"))) {
doVCCommand("co -f -u" + getVersion() + ' '
+ OnlyFilename(_owner->getFileName())); // We ignore changes and just reload!
_owner->markLyxClean();
_owner->getUser()->getOwner()->
getLyXFunc()->Dispatch("buffer-reload");
}
}
// This is a hack anyway so I'll put it here in the mean time. void LyXVC::logClose(FL_OBJECT *obj, long)
{
LyXVC *This = (LyXVC*)obj->form->u_vdata;
fl_hide_form(This->browser->LaTeXLog);
}
void LyXVC::showLog()
{ // This I really don't like, but we'll look at this problem // in 0.13. Then we can make a clean solution. #if 0 if (gsworking()) {
WriteAlert(_("Sorry, can't do this while" " pictures are being rendered."),
_("Please wait a few seconds for" " this to finish and try again."),
_("(or kill runaway gs processes" " by hand and try again.)")); return;
} extern pid_t isp_pid; // from spellchecker.C if(isp_pid != -1) {
WriteAlert(_("Can't do this while the" " spellchecker is running."),
_("Stop the spellchecker first.")); return;
} #endif
LString tmpf = tmpnam(NULL);
doVCCommand("rlog "
+ OnlyFilename(_owner->getFileName()) + " > " + tmpf);
viewLog(tmpf);
unlink(tmpf.c_str());
}
int LyXVC::doVCCommand(LString const & cmd)
{
lyxerr.debug("doVCCommand: " + cmd, Error::LYXVC);
Systemcalls one;
PathPush(_owner->filepath); int ret = one.Startscript(Systemcalls::System, cmd);
PathPop(); return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.