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) {}
+ VCS(Buffer * b) : vcstatus(NOLOCKING), owner_(b) {}
virtual ~VCS() {}
/// register a file for version control
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
/// 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