Menu

[r1112]: / trunk / src / SVN.h  Maximize  Restore  History

Download this file

142 lines (116 with data), 6.2 kB

  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
// CommitMonitor - simple checker for new commits in svn repositories
// Copyright (C) 2007, 2009-2012, 2015 - Stefan Kueng
// 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.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
#pragma once
#include <vector>
#include <map>
#include "SCCS.h"
/*
#include "apr_general.h"
#include "svn_pools.h"
#include "svn_client.h"
#include "svn_path.h"
#include "svn_wc.h"
#include "svn_utf.h"
#include "svn_config.h"
#include "svn_error_codes.h"
#include "svn_subst.h"
#include "svn_repos.h"
#include "svn_time.h"
#include "SVNPool.h"
#include "UnicodeUtils.h"
#include "Registry.h"
#include "SerializeUtils.h"
#include "ProgressDlg.h"
*/
#include <string>
class SVN : public SCCS
{
public:
SVN(void);
~SVN(void);
void SetAuthInfo(const std::wstring& username, const std::wstring& pwd);
bool GetFile(std::wstring sUrl, std::wstring sFile);
/**
* returns the info for the \a path.
* \param path a path or an url
* \param pegrev the peg revision to use
* \param revision the revision to get the info for
* \param recurse if TRUE, then GetNextFileInfo() returns the info also
* for all children of \a path.
*/
std::wstring GetRootUrl(const std::wstring& path);
size_t GetFileCount() {return m_arInfo.size();}
svn_revnum_t GetHEADRevision(const std::wstring& repo, const std::wstring& url);
bool GetLog(const std::wstring& repo, const std::wstring& url, svn_revnum_t startrev, svn_revnum_t endrev);
//map<svn_revnum_t,SVNLogEntry> m_logs; ///< contains the gathered log information
bool Diff(const std::wstring& url1, svn_revnum_t pegrevision, svn_revnum_t revision1,
svn_revnum_t revision2, bool ignoreancestry, bool nodiffdeleted,
bool ignorecontenttype, const std::wstring& options, bool bAppend,
const std::wstring& outputfile, const std::wstring& errorfile);
static std::wstring GetOptionsString(bool bIgnoreEOL, bool bIgnoreSpaces, bool bIgnoreAllSpaces);
std::wstring CanonicalizeURL(const std::wstring& url);
std::wstring GetLastErrorMsg();
/**
* Sets and clears the progress info which is shown during lengthy operations.
* \param pProgressDlg the CProgressDlg object to show the progress info on.
* \param bShowProgressBar set to true if the progress bar should be shown. Only makes
* sense if the total amount of the progress is known beforehand. Otherwise the
* progressbar is always "empty".
*/
void SetAndClearProgressInfo(CProgressDlg * pProgressDlg, bool bShowProgressBar = false);
private:
apr_pool_t * parentpool; ///< the main memory pool
apr_pool_t * pool; ///< 'root' memory pool
svn_client_ctx_t * m_pctx; ///< pointer to client context
svn_auth_baton_t * auth_baton;
std::vector<SCCSInfoData> m_arInfo; ///< contains all gathered info structs.
unsigned int m_pos; ///< the current position of the vector.
SVNProgress m_SVNProgressMSG;
HWND m_progressWnd;
CProgressDlg * m_pProgressDlg;
bool m_progressWndIsCProgress;
bool m_bShowProgressBar;
apr_off_t progress_total;
apr_off_t progress_averagehelper;
apr_off_t progress_lastprogress;
apr_off_t progress_lasttotal;
DWORD progress_lastTicks;
std::vector<apr_off_t> progress_vector;
std::wstring password;
private:
static svn_error_t * cancel(void *baton);
static svn_error_t * infoReceiver(void* baton, const char * path,
const svn_client_info2_t* info, apr_pool_t * pool);
static svn_error_t * logReceiver(void *baton, svn_log_entry_t *log_entry, apr_pool_t *pool);
static svn_error_t* sslserverprompt(svn_auth_cred_ssl_server_trust_t **cred_p,
void *baton, const char *realm,
apr_uint32_t failures,
const svn_auth_ssl_server_cert_info_t *cert_info,
svn_boolean_t may_save, apr_pool_t *pool);
static svn_error_t* sslclientprompt(svn_auth_cred_ssl_client_cert_t **cred,
void *baton, const char * realm,
svn_boolean_t may_save, apr_pool_t *pool);
static svn_error_t* sslpwprompt(svn_auth_cred_ssl_client_cert_pw_t **cred,
void *baton, const char * realm,
svn_boolean_t may_save, apr_pool_t *pool);
static svn_error_t* svn_auth_plaintext_prompt(svn_boolean_t *may_save_plaintext,
const char *realmstring, void *baton,
apr_pool_t *pool);
static svn_error_t* svn_auth_plaintext_passphrase_prompt(svn_boolean_t *may_save_plaintext,
const char *realmstring, void *baton,
apr_pool_t *pool);
static void progress_func(apr_off_t progress, apr_off_t total,
void *baton, apr_pool_t *pool);
};
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.