#include "support/TempFile.h"
#include <fstream>
+#include <iomanip>
#include <sstream>
using namespace std;
if (owner_)
owner_->setBusy(false);
- if (ret && reportError)
+ if (ret && reportError) {
+ docstring rcsmsg;
+ if (prefixIs(cmd, "ci "))
+ rcsmsg = "\n" + _("Perhaps the RCS package is not installed on your system?");
frontend::Alert::error(_("Revision control error."),
bformat(_("Some problem occurred while running the command:\n"
- "'%1$s'."),
+ "'%1$s'.") + rcsmsg,
from_utf8(cmd)));
+ }
return ret;
}
bool RCS::undoLastEnabled()
{
- return true;
+ return owner_->hasReadonlyFlag();
}
return rev_date_cache_;
case LyXVC::Time:
return rev_time_cache_;
- default: ;
+ default:
+ break;
}
return string();
if (contains(line, tmpf)) {
// Ok extract the fields.
smatch sm;
-
- // false positive from coverity
- // coverity[CHECKED_RETURN]
- regex_match(line, sm, reg);
+ if (!regex_match(line, sm, reg)) {
+ LYXERR(Debug::LYXVC, "\t Cannot parse line. Skipping.");
+ continue;
+ }
//sm[0]; // whole matched string
//sm[1]; // filename
return rev_date_cache_;
case LyXVC::Time:
return rev_time_cache_;
- default: ;
+ default:
+ break;
}
}
return string();
return rev_date_cache_;
case LyXVC::Time:
return rev_time_cache_;
- default: ;
-
+ default:
+ break;
}
return string();
return rev_date_cache_;
case LyXVC::Time:
return rev_time_cache_;
- default: ;
-
+ default:
+ break;
}
return string();
}
doVCCommand("git describe --abbrev --dirty --long > " + quoteName(tmpf.toFilesystemEncoding()),
- FileName(owner_->filePath()));
+ FileName(owner_->filePath()),
+ false); //git describe returns $?=128 when no tag found (but git repo still exists)
if (tmpf.empty())
return false;