4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
19 /// A simple version control system interface
22 /// the status of the managed file
30 /// register a file for version control
31 virtual void registrer(std::string const & msg) = 0;
32 /// check in the current revision
33 virtual void checkIn(std::string const & msg) = 0;
34 /// check out for editing
35 virtual void checkOut() = 0;
36 /// revert current edits
37 virtual void revert() = 0;
39 virtual void undoLast() = 0;
41 * getLog - read the revision log into the given file
42 * @param fname file name to read into
44 virtual void getLog(std::string const &) = 0;
45 /// return the current version description
46 virtual std::string const versionString() const = 0;
47 /// return the current version
48 std::string const & version() const {
51 /// return the user who has locked the file
52 std::string const & locker() const { return locker_; }
53 /// set the owning buffer
54 void owner(Buffer * b) { owner_ = b; }
55 /// return the owning buffer
56 Buffer * owner() const { return owner_; }
57 /// return the lock status of this file
58 VCStatus status() const { return vcstatus; }
60 /// parse information from the version file
61 virtual void scanMaster() = 0;
64 * doVCCommand - call out to the version control utility
65 * @param cmd the command to execute
66 * @param path the path from which to execute
69 static int doVCCommand(std::string const & cmd, std::string const & path);
72 * The master VC file. For RCS this is *,v or RCS/ *,v. master should
77 /// The status of the VC controlled file.
81 * The version of the VC file. I am not sure if this can be a
82 * string or if it must be a float/int.
86 /// The user currently keeping the lock on the VC file.
88 /// The buffer using this VC
94 class RCS : public VCS {
98 RCS(std::string const & m);
100 /// return the revision file for the given file, if found
101 static std::string const find_file(std::string const & file);
103 static void retrieve(std::string const & file);
105 virtual void registrer(std::string const & msg);
107 virtual void checkIn(std::string const & msg);
109 virtual void checkOut();
111 virtual void revert();
113 virtual void undoLast();
115 virtual void getLog(std::string const &);
117 virtual std::string const versionString() const {
118 return "RCS: " + version_;
122 virtual void scanMaster();
127 class CVS : public VCS {
131 CVS(std::string const & m, std::string const & f);
133 /// return the revision file for the given file, if found
134 static std::string const find_file(std::string const & file);
136 virtual void registrer(std::string const & msg);
138 virtual void checkIn(std::string const & msg);
140 virtual void checkOut();
142 virtual void revert();
144 virtual void undoLast();
146 virtual void getLog(std::string const &);
148 virtual std::string const versionString() const {
149 return "CVS: " + version_;
153 virtual void scanMaster();
158 #endif // VCBACKEND_H