diff --git a/src/LyXVC.cpp b/src/LyXVC.cpp index c66ce169b0..c53996b698 100644 --- a/src/LyXVC.cpp +++ b/src/LyXVC.cpp @@ -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 diff --git a/src/LyXVC.h b/src/LyXVC.h index 92db82c52c..0d9c826d5a 100644 --- a/src/LyXVC.h +++ b/src/LyXVC.h @@ -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. diff --git a/src/VCBackend.cpp b/src/VCBackend.cpp index fd48b79e8a..e90ddcd876 100644 --- a/src/VCBackend.cpp +++ b/src/VCBackend.cpp @@ -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; diff --git a/src/VCBackend.h b/src/VCBackend.h index e5d03331b5..6e8ef541de 100644 --- a/src/VCBackend.h +++ b/src/VCBackend.h @@ -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_;