forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubversion2.h
175 lines (151 loc) · 6.91 KB
/
subversion2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright : (C) 2009 by Eran Ifrah
// file name : subversion2.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifndef __Subversion2__
#define __Subversion2__
#include "plugin.h"
#include "svninfo.h"
#include "commitmessagescache.h"
#include "svncommand.h"
#include "svnsettingsdata.h"
#include "project.h"
#include "cl_command_event.h"
class SubversionView;
class SvnConsole;
class wxMenu;
class wxMenuItem;
class Subversion2 : public IPlugin
{
private:
SubversionView* m_subversionView;
SvnConsole* m_subversionConsole;
wxMenuItem* m_explorerSepItem;
wxMenuItem* m_projectSepItem;
SvnCommand m_simpleCommand;
SvnCommand m_diffCommand;
SvnCommand m_blameCommand;
double m_svnClientVersion;
CommitMessagesCache m_commitMessagesCache;
bool m_skipRemoveFilesDlg;
protected:
void OnSettings(wxCommandEvent &event);
public:
void EditSettings();
protected:
///////////////////////////////////////////////////////////
// File Explorer event handlers
///////////////////////////////////////////////////////////
void OnCommit (wxCommandEvent &event);
void OnUpdate (wxCommandEvent &event);
void OnAdd (wxCommandEvent &event);
void OnDelete (wxCommandEvent &event);
void OnRevert (wxCommandEvent &event);
void OnRevertToRevision (wxCommandEvent &event);
void OnDiff (wxCommandEvent &event);
void OnPatch (wxCommandEvent &event);
void OnLog (wxCommandEvent &event);
void OnBlame (wxCommandEvent &event);
void OnIgnoreFile (wxCommandEvent &event);
void OnIgnoreFilePattern(wxCommandEvent &event);
void OnSelectAsView (wxCommandEvent &event);
void OnSwitchURL (wxCommandEvent &event);
void OnLockFile (wxCommandEvent &event);
void OnUnLockFile (wxCommandEvent &event);
void OnRename (wxCommandEvent& event);
void OnSync (wxCommandEvent &event);
///////////////////////////////////////////////////////////
// IDE events
///////////////////////////////////////////////////////////
void OnGetCompileLine (clBuildEvent &event);
void OnWorkspaceConfigChanged(wxCommandEvent &event);
void OnFileRemoved (clCommandEvent &event);
wxMenu* CreateFileExplorerPopMenu();
bool IsSubversionViewDetached ();
wxMenu* CreateProjectPopMenu();
public:
void DoGetSvnInfoSync(SvnInfo& svnInfo, const wxString &workingDirectory);
void DoSwitchURL (const wxString &workingDirectory, const wxString &sourceUrl, wxCommandEvent &event);
void DoLockFile (const wxString &workingDirectory, const wxArrayString &fullpaths, wxCommandEvent &event, bool lock);
void DoRename (const wxString &workingDirectory, const wxString &oldname, const wxString &newname, wxCommandEvent &event);
void DoCommit (const wxArrayString& files, const wxString &workingDirectory, wxCommandEvent &event);
public:
Subversion2(IManager *manager);
~Subversion2();
//--------------------------------------------
//Abstract methods
//--------------------------------------------
virtual clToolBar *CreateToolBar(wxWindow *parent);
virtual void CreatePluginMenu(wxMenu *pluginsMenu);
virtual void HookPopupMenu(wxMenu *menu, MenuType type);
virtual void UnPlug();
SvnConsole *GetConsole() ;
IManager *GetManager() {
return m_mgr;
}
SubversionView *GetSvnView() {
return m_subversionView;
}
SvnSettingsData GetSettings();
void SetSettings(SvnSettingsData& ssd);
wxString GetSvnExeName(bool nonInteractive = true);
wxString GetSvnExeNameNoConfigDir(bool nonInteractive = true);
wxString GetUserConfigDir();
void RecreateLocalSvnConfigFile();
void Patch(bool dryRun, const wxString &workingDirectory, wxEvtHandler *owner, int id);
void IgnoreFiles(const wxArrayString& files, bool pattern);
void Blame(wxCommandEvent& event, const wxArrayString &files);
void SetSvnClientVersion(double svnClientVersion) {
this->m_svnClientVersion = svnClientVersion;
}
double GetSvnClientVersion() const {
return m_svnClientVersion;
}
CommitMessagesCache& GetCommitMessagesCache() {
return m_commitMessagesCache;
}
bool LoginIfNeeded (wxCommandEvent &event, const wxString &workingDirectory, wxString& loginString);
bool GetNonInteractiveMode(wxCommandEvent &event);
bool IsPathUnderSvn (const wxString &path);
void ChangeLog (const wxString &path, const wxString &fullpath, wxCommandEvent &event);
void FinishSyncProcess(ProjectPtr& proj,
const wxString& workDir,
bool excludeBin,
const wxString& excludeExtensions,
const wxString& output);
protected:
void DoInitialize();
void DoSetSSH();
void DoGetSvnVersion();
wxArrayString DoGetSvnStatusQuiet(const wxString &wd);
bool NormalizeDir(wxString& wd);
std::vector<wxString> GetLocalAddsDels(const wxString& wd);
std::vector<wxString> GetFilesMarkedBinary(const wxString& wd);
std::vector<wxString> RemoveExcludeExts(const std::vector<wxString>& aryInFiles, const wxString& excludeExtensions);
wxString DoGetFileExplorerItemFullPath();
wxString DoGetFileExplorerItemPath();
wxArrayString DoGetFileExplorerFiles();
wxString DoGetFileExplorerFilesAsString();
wxArrayString DoGetFileExplorerFilesToCommitRelativeTo(const wxString &wd);
};
#endif //Subversion2