4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
7 * \author Lars Gullik Bjønnes
18 /// A simple version control system interface
21 /// the status of the managed file
29 /// register a file for version control
30 virtual void registrer(string const & msg) = 0;
31 /// check in the current revision
32 virtual void checkIn(string const & msg) = 0;
33 /// check out for editing
34 virtual void checkOut() = 0;
35 /// revert current edits
36 virtual void revert() = 0;
38 virtual void undoLast() = 0;
40 * getLog - read the revision log into the given file
41 * @param fname file name to read into
43 virtual void getLog(string const &) = 0;
44 /// return the current version description
45 virtual string const versionString() const = 0;
46 /// return the current version
47 string const & version() const {
50 /// return the user who has locked the file
51 string const & locker() const { return locker_; }
52 /// set the owning buffer
53 void owner(Buffer * b) { owner_ = b; }
54 /// return the owning buffer
55 Buffer * owner() const { return owner_; }
56 /// return the lock status of this file
57 VCStatus status() const { return vcstatus; }
59 /// parse information from the version file
60 virtual void scanMaster() = 0;
63 * doVCCommand - call out to the version control utility
64 * @param cmd the command to execute
65 * @param path the path from which to execute
68 static int doVCCommand(string const & cmd, string const & path);
71 * The master VC file. For RCS this is *,v or RCS/ *,v. master should
76 /// The status of the VC controlled file.
80 * The version of the VC file. I am not sure if this can be a
81 * string or if it must be a float/int.
85 /// The user currently keeping the lock on the VC file.
87 /// The buffer using this VC
93 class RCS : public VCS {
97 RCS(string const & m);
99 /// return the revision file for the given file, if found
100 static string const find_file(string const & file);
102 static void retrieve(string const & file);
104 virtual void registrer(string const & msg);
106 virtual void checkIn(string const & msg);
108 virtual void checkOut();
110 virtual void revert();
112 virtual void undoLast();
114 virtual void getLog(string const &);
116 virtual string const versionString() const {
117 return "RCS: " + version_;
121 virtual void scanMaster();
126 class CVS : public VCS {
130 CVS(string const & m, string const & f);
132 /// return the revision file for the given file, if found
133 static string const find_file(string const & file);
135 virtual void registrer(string const & msg);
137 virtual void checkIn(string const & msg);
139 virtual void checkOut();
141 virtual void revert();
143 virtual void undoLast();
145 virtual void getLog(string const &);
147 virtual string const versionString() const {
148 return "CVS: " + version_;
152 virtual void scanMaster();
157 #endif // VCBACKEND_H