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;
62 /// reload the document
66 * doVCCommand - call out to the version control utility
67 * @param cmd the command to execute
68 * @param path the path from which to execute
71 static int doVCCommand(string const & cmd, string const & path);
74 * The master VC file. For RCS this is *,v or RCS/ *,v. master should
79 /// The status of the VC controlled file.
83 * The version of the VC file. I am not sure if this can be a
84 * string or if it must be a float/int.
88 /// The user currently keeping the lock on the VC file.
90 /// The buffer using this VC
96 class RCS : public VCS {
100 RCS(string const & m);
102 /// return the revision file for the given file, if found
103 static string const find_file(string const & file);
105 static void retrieve(string const & file);
107 virtual void registrer(string const & msg);
109 virtual void checkIn(string const & msg);
111 virtual void checkOut();
113 virtual void revert();
115 virtual void undoLast();
117 virtual void getLog(string const &);
119 virtual string const versionString() const {
120 return "RCS: " + version_;
124 virtual void scanMaster();
129 class CVS : public VCS {
133 CVS(string const & m, string const & f);
135 /// return the revision file for the given file, if found
136 static string const find_file(string const & file);
138 virtual void registrer(string const & msg);
140 virtual void checkIn(string const & msg);
142 virtual void checkOut();
144 virtual void revert();
146 virtual void undoLast();
148 virtual void getLog(string const &);
150 virtual string const versionString() const {
151 return "CVS: " + version_;
155 virtual void scanMaster();
160 #endif // VCBACKEND_H