00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef SVN_HPP
00016 #define SVN_HPP
00017
00018 #include <qobject.h>
00019 #include <qtextbrowser.h>
00020 #include <qprocess.h>
00021 #include <qmessagebox.h>
00022 #include <qvbox.h>
00023 #include <qdialog.h>
00024 #include <qlabel.h>
00025 #include <qtextcodec.h>
00026 #include <qapplication.h>
00027 #include <qlineedit.h>
00028 #include <qcursor.h>
00029 #include <qeventloop.h>
00030
00031 class Principal;
00032
00033 class Svn : public QObject {
00034
00035 Q_OBJECT
00036
00037 public:
00038
00039 enum {SC_WAIT = 0x0001, SC_APPEND_USER_PASS=0x0002, SC_HIDE=0x0004,
00040 SC_DISABLE_CURSOR_CHANGE=0x0008, SC_REFRESH = 0x0010};
00041
00045 Svn(Principal* parent);
00049 void common(QString command);
00056 int update(const QString& revision = "");
00062 int log(const QString& filename, bool is_verbouse, bool stop_on_copy, QStringList& out_txt);
00063
00068 int status();
00069
00075 int info(const QString& filename, QStringList& out_txt, bool hideOutput = false);
00076
00083 int commit(const QString& wd, QString msg);
00084
00090 int cleanup(QString& wd);
00098 int revert(const QString& filename, bool recursive);
00105 int resolve(const QString& filename);
00112 int add(const QString& filename, bool recursive);
00119 int del(const QString filename);
00123 int copy(QString& src, const QString &dst, const QString& msg, const QString& rev="");
00127 int move(const QString& src, const QString &dst, const QString& msg, const QString& rev="");
00133 int switch_cmd(const QString& url, const QString &rev, bool non_recursive);
00138 int merge(const QString& file_dir_name, const QString& first, const QString &second, const QString& wcpath, bool use_rev, bool non_recursive, bool dryrun);
00142 int diff(const QString& file_dir_name_1, const QString& file_dir_name_2,
00143 const QString& rev, bool use_external_cmd, bool non_recursive, bool notice_ancestry,
00144 const QString& extensions, QStringList& out_txt);
00148 int cat(const QString& filename, const QString& rev, QStringList& out_txt);
00154 int blame(const QString& filename, const QString& rev, QStringList& out_txt);
00159 int checkout(const QString &rev = "" , bool non_recursive = false);
00164 int export_cmd(const QString& url, const QString& local_path, const QString &rev);
00169 int import(const QString& url, const QString& local_path, QString msg, bool non_recursive);
00177 int mkdir(const QString& dir);
00181 int proplist(const QString& filename, const QString& rev, QStringList& out_txt);
00185 int propset(const QString& filename, const QString& rev, const QString& key, const QString &value);
00189 int propdel(const QString& filename, const QString& rev, const QString& key);
00195 int list(const QString& url, const QString& rev, QStringList& out_txt, bool is_hide=false,
00196 bool recursive = true, bool dont_change_cursor = false);
00197
00198 void setSvn(QString svn);
00199
00205 int getLastRev();
00206
00207 public slots:
00208
00209 void readFromStdout();
00210 void readFromStderr();
00211 void procFinished();
00212 public:
00213 bool needs_refresh_;
00214 bool isRunning() { return proc->isRunning(); }
00215 QString getLastCommand();
00216
00217 private:
00221 int execCommand(unsigned int flags, QStringList* out_list = NULL);
00225 QString showCommand();
00226
00227 private:
00228 Principal* caller;
00229 QProcess *proc;
00230 QTextBrowser* out_win_;
00231 QStringList out_text_;
00232 bool show_enable_, is_hide_all_;
00233 bool is_refreshable_command_, is_ready_for_last_command_;
00234 QString svn_;
00235 QWidget *parent_;
00236 QString diff_cmd_;
00237 bool disable_cursor_change_;
00238 };
00239
00240 #endif