We need public API

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33446 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Pavel Sanda 2010-02-12 12:16:34 +00:00
parent 09ef9c67ef
commit 7929cad343
4 changed files with 68 additions and 8 deletions

View File

@ -313,5 +313,15 @@ bool LyXVC::undoLastEnabled() const
return vcs && vcs->undoLastEnabled();
}
bool LyXVC::prepareFileRevision(int rev, std::string & f)
{
return vcs && vcs->prepareFileRevision(rev, f);
}
bool LyXVC::prepareFileRevisionEnabled()
{
return vcs && vcs->prepareFileRevisionEnabled();
}
} // namespace lyx

View File

@ -104,6 +104,16 @@ public:
void undoLast();
/// Does the current VC supports this operation?
bool undoLastEnabled() const;
/**
* Prepare revision rev of the file into newly created temporary file
* and save the filename into parameter f.
* Parameter rev can be either revision number or negative number
* which is interpreted as how many revision back from the current
* one do we want. rev=0 is reserved for the last (committed) revision.
*/
bool prepareFileRevision(int rev, std::string & f);
/// Does the current VC supports this operation?
bool prepareFileRevisionEnabled();
/**
* Generate a log file and return the filename.

View File

@ -290,6 +290,18 @@ string RCS::revisionInfo(LyXVC::RevisionInfo const info)
}
bool RCS::prepareFileRevision(int, std::string &)
{
return false;
}
bool RCS::prepareFileRevisionEnabled()
{
return false;
}
/////////////////////////////////////////////////////////////////////
//
// CVS
@ -493,6 +505,18 @@ string CVS::revisionInfo(LyXVC::RevisionInfo const info)
}
bool CVS::prepareFileRevision(int, std::string &)
{
return false;
}
bool CVS::prepareFileRevisionEnabled()
{
return false;
}
/////////////////////////////////////////////////////////////////////
//
// SVN
@ -1014,6 +1038,13 @@ bool SVN::prepareFileRevision(int rev, string & f)
}
bool SVN::prepareFileRevisionEnabled()
{
return true;
}
bool SVN::toggleReadOnlyEnabled()
{
return false;

View File

@ -78,6 +78,11 @@ public:
virtual bool toggleReadOnlyEnabled() = 0;
/// Return revision info specified by the argument.
virtual std::string revisionInfo(LyXVC::RevisionInfo const info) = 0;
virtual bool prepareFileRevision(int rev, std::string & f) = 0;
virtual bool prepareFileRevisionEnabled() = 0;
protected:
/// parse information from the version file
virtual void scanMaster() = 0;
@ -152,6 +157,10 @@ public:
virtual std::string revisionInfo(LyXVC::RevisionInfo const info);
virtual bool prepareFileRevision(int rev, std::string & f);
virtual bool prepareFileRevisionEnabled();
protected:
virtual void scanMaster();
private:
@ -209,6 +218,10 @@ public:
virtual std::string revisionInfo(LyXVC::RevisionInfo const info);
virtual bool prepareFileRevision(int rev, std::string & f);
virtual bool prepareFileRevisionEnabled();
protected:
virtual void scanMaster();
@ -265,6 +278,10 @@ public:
virtual std::string revisionInfo(LyXVC::RevisionInfo const info);
virtual bool prepareFileRevision(int rev, std::string & f);
virtual bool prepareFileRevisionEnabled();
protected:
virtual void scanMaster();
/// Check for messages in svn output. Returns error.
@ -275,14 +292,6 @@ protected:
bool isLocked() const;
/// acquire/release write lock for the current file
void fileLock(bool lock, support::FileName const & tmpf, std::string & status);
/**
* Prepare revision rev of the file into newly created temporary file
* and save the filename into parameter f.
* Parameter rev can be either revision number or negative number
* which is interpreted as how many revision back from the current
* one do we want. rev=0 is reserved for the last (committed) revision.
*/
bool prepareFileRevision(int rev, std::string & f);
private:
support::FileName file_;