diff --git a/src/LyXVC.h b/src/LyXVC.h index 00b889f982..b4cef3c910 100644 --- a/src/LyXVC.h +++ b/src/LyXVC.h @@ -123,10 +123,7 @@ public: /// Is the document under administration by VCS? bool inUse() const; - /// FIXME Either rename or kill, we have revisionInfo now. - /// Returns the version number. - //std::string const & version() const; - /// Returns the version number. + /// Returns the RCS + version number for messages std::string const versionString() const; /** diff --git a/src/VCBackend.cpp b/src/VCBackend.cpp index 9e0156b04e..dd3aa9b9cf 100644 --- a/src/VCBackend.cpp +++ b/src/VCBackend.cpp @@ -4,6 +4,7 @@ * Licence details can be found in the file COPYING. * * \author Lars Gullik Bjønnes + * \author Pavel Sanda * * Full author contact details are available in file CREDITS. */ @@ -240,7 +241,7 @@ bool RCS::lockingToggleEnabled() void RCS::revert() { - doVCCommand("co -f -u" + version() + " " + doVCCommand("co -f -u" + version_ + " " + quoteName(onlyFilename(owner_->absFileName())), FileName(owner_->filePath())); // We ignore changes and just reload! @@ -251,7 +252,7 @@ void RCS::revert() void RCS::undoLast() { LYXERR(Debug::LYXVC, "LyXVC: undoLast"); - doVCCommand("rcs -o" + version() + " " + doVCCommand("rcs -o" + version_ + " " + quoteName(onlyFilename(owner_->absFileName())), FileName(owner_->filePath())); } @@ -483,8 +484,10 @@ bool CVS::toggleReadOnlyEnabled() } -string CVS::revisionInfo(LyXVC::RevisionInfo const) +string CVS::revisionInfo(LyXVC::RevisionInfo const info) { + if (info == LyXVC::File) + return version_; return string(); } diff --git a/src/VCBackend.h b/src/VCBackend.h index 50cec8c770..c43846ed5a 100644 --- a/src/VCBackend.h +++ b/src/VCBackend.h @@ -5,6 +5,7 @@ * Licence details can be found in the file COPYING. * * \author Lars Gullik Bjønnes + * \author Pavel Sanda * * Full author contact details are available in file CREDITS. */ @@ -66,8 +67,6 @@ public: virtual void getLog(support::FileName const &) = 0; /// return the current version description virtual std::string const versionString() const = 0; - /// return the current version - std::string const & version() const { return version_; } /// return the user who has locked the file std::string const & locker() const { return locker_; } /// set the owning buffer @@ -104,12 +103,6 @@ protected: /// The status of the VC controlled file. VCStatus vcstatus; - /** - * The version of the VC file. I am not sure if this can be a - * string or if it must be a float/int. - */ - std::string version_; - /// The user currently keeping the lock on the VC file. std::string locker_; /// The buffer using this VC @@ -165,6 +158,12 @@ public: protected: virtual void scanMaster(); +private: + /** + * The version of the VC file. I am not sure if this can be a + * string or if it must be a float/int. + */ + std::string version_; }; @@ -217,6 +216,8 @@ protected: private: support::FileName file_; + // revision number from scanMaster + std::string version_; }; @@ -257,7 +258,7 @@ public: virtual void getLog(support::FileName const &); virtual std::string const versionString() const { - return "SVN: " + version_; + return "SVN: " + rev_file_cache_; } virtual bool toggleReadOnlyEnabled();