[commit] r2334 - trunk/Tests/svngui
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Wed Sep 4 05:52:50 CDT 2013
Author: volgy
Date: Wed Sep 4 05:52:50 2013
New Revision: 2334
Log:
Modified:
trunk/Tests/svngui/SVNClient.cpp
trunk/Tests/svngui/SVNClient.h
trunk/Tests/svngui/svnguiDoc.cpp
Modified: trunk/Tests/svngui/SVNClient.cpp
==============================================================================
--- trunk/Tests/svngui/SVNClient.cpp Tue Sep 3 17:21:58 2013 (r2333)
+++ trunk/Tests/svngui/SVNClient.cpp Wed Sep 4 05:52:50 2013 (r2334)
@@ -75,8 +75,8 @@
{
char buf[SVN_ERROR_MSG_MAX];
- svn_err_best_message(svnError, buf, sizeof(buf));
- return CString(buf);
+ const char *ret = svn_err_best_message(svnError, buf, sizeof(buf));
+ return CString(ret);
}
CSVNClient::CSVNClient() : isInitialized(false), ctx(NULL), pool(NULL)
@@ -364,8 +364,10 @@
bool CSVNFile::isTracked()
{
//TODO: implement this
-
- SVNTHROW(svn_client_status5(NULL, client->ctx, filePath, NULL, svn_depth_empty, FALSE, FALSE, FALSE, FALSE, TRUE, NULL, cbStatus, this, client->pool));
+ CStringA filePathA(filePath);
+ const char* fpath = filePathA.GetString();
+ SVNTHROW(svn_client_info3(filePathA, NULL, NULL, svn_depth_empty, FALSE, FALSE, NULL, cbInfo, this, client->ctx, client->pool));
+ SVNTHROW(svn_client_status5(NULL, client->ctx, filePathA, NULL, svn_depth_empty, FALSE, FALSE, FALSE, FALSE, TRUE, NULL, cbStatus, this, client->pool));
return false;
}
@@ -390,3 +392,24 @@
{
}
+svn_error_t* CSVNFile::cbStatus(void *baton, const char *path, const svn_client_status_t *status, apr_pool_t *scratch_pool)
+{
+ CSVNFile* self = (CSVNFile*)baton;
+ CString fpath(path);
+
+ if (fpath != self->filePath) {
+ return svn_error_create(SVN_ERR_BAD_FILENAME, NULL, "Unexpected file path.");
+ }
+ return SVN_NO_ERROR;
+}
+
+svn_error_t* CSVNFile::cbInfo(void *baton, const char *abspath_or_url, const svn_client_info2_t *info, apr_pool_t *scratch_pool)
+{
+ CSVNFile* self = (CSVNFile*)baton;
+ CString fpath(abspath_or_url);
+
+ if (fpath != self->filePath) {
+ return svn_error_create(SVN_ERR_BAD_FILENAME, NULL, "Unexpected file path.");
+ }
+ return SVN_NO_ERROR;
+}
\ No newline at end of file
Modified: trunk/Tests/svngui/SVNClient.h
==============================================================================
--- trunk/Tests/svngui/SVNClient.h Tue Sep 3 17:21:58 2013 (r2333)
+++ trunk/Tests/svngui/SVNClient.h Wed Sep 4 05:52:50 2013 (r2334)
@@ -10,6 +10,7 @@
class CSVNError
{
friend class CSVNClient;
+ friend class CSVNFile;
private:
CSVNError(svn_error_t* e);
@@ -32,6 +33,7 @@
// Callbacks
static svn_error_t* cbStatus(void *baton, const char *path, const svn_client_status_t *status, apr_pool_t *scratch_pool);
+ static svn_error_t* cbInfo(void *baton, const char *abspath_or_url, const svn_client_info2_t *info, apr_pool_t *scratch_pool);
public:
virtual ~CSVNFile();
Modified: trunk/Tests/svngui/svnguiDoc.cpp
==============================================================================
--- trunk/Tests/svngui/svnguiDoc.cpp Tue Sep 3 17:21:58 2013 (r2333)
+++ trunk/Tests/svngui/svnguiDoc.cpp Wed Sep 4 05:52:50 2013 (r2334)
@@ -159,8 +159,13 @@
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
- svnFile = theApp.svn.embraceFile(lpszPathName);
-
+ try {
+ svnFile = theApp.svn.embraceFile(lpszPathName);
+ svnFile->isTracked();
+ }
+ catch (CSVNError e) {
+ theApp.Log(e.msg());
+ }
return TRUE;
}
More information about the gme-commit
mailing list