mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
SVN file revision number
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33424 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
59d0045a72
commit
22b98a7ca4
@ -844,6 +844,40 @@ bool SVN::undoLastEnabled()
|
||||
}
|
||||
|
||||
|
||||
string SVN::getFileRevisionInfo(){
|
||||
FileName tmpf = FileName::tempName("lyxvcout");
|
||||
|
||||
doVCCommand("svn info --xml " + quoteName(onlyFilename(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
|
||||
if (tmpf.empty())
|
||||
return string();
|
||||
|
||||
ifstream ifs(tmpf.toFilesystemEncoding().c_str());
|
||||
string line;
|
||||
// commit log part
|
||||
bool c = false;
|
||||
string rev;
|
||||
|
||||
while (ifs) {
|
||||
getline(ifs, line);
|
||||
LYXERR(Debug::LYXVC, line);
|
||||
if (prefixIs(line, "<commit"))
|
||||
c = true;
|
||||
if (c && prefixIs(line, " revision=\"") && suffixIs(line, "\">")) {
|
||||
string l1 = subst(line, "revision=\"", "");
|
||||
string l2 = subst(l1, "\">", "");
|
||||
if (isStrInt(l2))
|
||||
rev = l2;
|
||||
}
|
||||
}
|
||||
ifs.close();
|
||||
tmpf.erase();
|
||||
return rev;
|
||||
}
|
||||
|
||||
|
||||
void SVN::getLog(FileName const & tmpf)
|
||||
{
|
||||
doVCCommand("svn log " + quoteName(onlyFilename(owner_->absFileName()))
|
||||
|
@ -254,6 +254,8 @@ public:
|
||||
|
||||
virtual bool toggleReadOnlyEnabled();
|
||||
|
||||
std::string getFileRevisionInfo();
|
||||
|
||||
protected:
|
||||
virtual void scanMaster();
|
||||
/// Check for messages in svn output. Returns error.
|
||||
|
Loading…
Reference in New Issue
Block a user