]> git.lyx.org Git - lyx.git/blobdiff - src/VCBackend.h
tex2lyx/text.cpp: fix a bug I introduced with [c7a11c1d/lyxgit]
[lyx.git] / src / VCBackend.h
index 6d3903c68698476125b465a436011ac7f9b28abf..970972af48b50db7d233d7647cfb6451dcdce21d 100644 (file)
@@ -33,9 +33,6 @@ public:
                UNLOCKED,
                LOCKED,
                NOLOCKING,
-               /// This file is not in version control, but it could be aded
-               /// (because the path is under version control)
-               UNVERSIONED,
        };
 
        VCS(Buffer * b) : owner_(b) {}
@@ -105,8 +102,8 @@ public:
        virtual bool prepareFileRevisionEnabled() = 0;
 
        /// Check the directory of file and all parent directories
-       /// for the existence of the given pathname
-       static bool checkparentdirs(support::FileName const & file, std::string const & pathname);
+       /// for the existence of repository-info like .git or .svn
+       static bool checkparentdirs(support::FileName const & file, std::string const & vcsdir);
        
 protected:
        /// parse information from the version file
@@ -542,6 +539,27 @@ protected:
        /// Check in files \p f with log \p msg
        LyXVC::CommandResult checkIn(std::vector<support::FileName> const & f,
                                     std::string const & msg, std::string & log);
+
+private:
+       /**
+        * Real code for obtaining file revision info. Fills all file-related caches
+        * and returns true if successfull.
+        * "?" is stored in rev_file_cache_ as a signal if request for obtaining info
+        * was already unsuccessful.
+        */
+       bool getFileRevisionInfo();
+       /// cache for file revision number, "?" if already unsuccessful, isNumber==true
+       std::string rev_file_cache_;
+       /// cache for author of last commit
+       std::string rev_author_cache_;
+       /// cache for date of last commit
+       std::string rev_date_cache_;
+       /// cache for time of last commit
+       std::string rev_time_cache_;
+       /// fills rev_tree_cache_, returns true if successfull.
+       bool getTreeRevisionInfo();
+       /// cache for tree revision number, "?" if already unsuccessful
+       std::string rev_tree_cache_;
 };
 
 } // namespace lyx