subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1000598 - in /subversion/branches/object-model/subversion/bindings: c++/include/Types.h javahl/native/ClientContext.cpp javahl/native/ClientContext.h javahl/native/SVNClient.cpp
Date Thu, 23 Sep 2010 20:02:09 GMT
Author: hwright
Date: Thu Sep 23 20:02:08 2010
New Revision: 1000598

URL: http://svn.apache.org/viewvc?rev=1000598&view=rev
Log:
On the object-model branch:
Subscribe the JavaHL notifier to notifications coming from the C++ bindings.

* subversion/bindings/javahl/native/SVNClient.cpp
  (SVNClient): Subscribe the notifier.

* subversion/bindings/javahl/native/ClientContext.h
  (getNotifier, notify): New.

* subversion/bindings/javahl/native/ClientContext.cpp
  (Notifier, notify, getNotify): New.

* subversion/bindings/c++/include/Types.h
  (to_c): New.

Modified:
    subversion/branches/object-model/subversion/bindings/c++/include/Types.h
    subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.cpp
    subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.h
    subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp

Modified: subversion/branches/object-model/subversion/bindings/c++/include/Types.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Types.h?rev=1000598&r1=1000597&r2=1000598&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Types.h (original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Types.h Thu Sep 23 20:02:08
2010
@@ -130,6 +130,12 @@ class ClientNotifyInfo
       m_pool.clear();
       m_notify = svn_wc_dup_notify(that.m_notify, m_pool.pool());
     }
+
+    // ### This is only temporary
+    inline const svn_wc_notify_t * to_c() const
+    {
+      return m_notify;
+    }
 };
 
 }

Modified: subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.cpp?rev=1000598&r1=1000597&r2=1000598&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.cpp Thu
Sep 23 20:02:08 2010
@@ -36,6 +36,25 @@
 #include "EnumMapper.h"
 #include "CommitMessage.h"
 
+#include "Types.h"
+
+class Notifier : public SVN::Callback::ClientNotifier
+{
+  private:
+    ClientContext &m_ctx;
+
+  public:
+    Notifier(ClientContext &ctx)
+      : m_ctx(ctx)
+    {
+    }
+    
+    void notify(const SVN::ClientNotifyInfo &info)
+    {
+      m_ctx.notify(info);
+    }
+};
+
 
 ClientContext::ClientContext(jobject jsvnclient)
     : m_prompter(NULL)
@@ -263,6 +282,13 @@ ClientContext::checkCancel(void *cancelB
 }
 
 void
+ClientContext::notify(const SVN::ClientNotifyInfo &info)
+{
+  SVN::Pool pool;
+  notify(m_jctx, info.to_c(), pool.pool());
+}
+
+void
 ClientContext::notify(void *baton,
                       const svn_wc_notify_t *notify,
                       apr_pool_t *pool)
@@ -458,3 +484,11 @@ ClientContext::javaResultToC(jobject jre
   env->PopLocalFrame(NULL);
   return result;
 }
+
+SVN::Callback::ClientNotifier *
+ClientContext::getNotifier()
+{
+  SVN::Callback::ClientNotifier *notifier = new Notifier(*this);
+
+  return notifier;
+}

Modified: subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.h?rev=1000598&r1=1000597&r2=1000598&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.h (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.h Thu
Sep 23 20:02:08 2010
@@ -36,6 +36,8 @@
 #include "JNIPool.h"
 #include "JNIStringHolder.h"
 
+#include "Callback.h"
+
 class Prompter;
 class CommitMessage;
 
@@ -88,6 +90,9 @@ class ClientContext
    * specified location.
    */
   void setConfigDirectory(const char *configDir);
+
+  SVN::Callback::ClientNotifier *getNotifier();
+  void notify(const SVN::ClientNotifyInfo &info);
 };
 
 #endif // CLIENTCONTEXT_H

Modified: subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp?rev=1000598&r1=1000597&r2=1000598&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp Thu Sep
23 20:02:08 2010
@@ -73,6 +73,7 @@ SVNClient::SVNClient(jobject jthis_in)
     : context(jthis_in),
       m_client()
 {
+  m_client.subscribeNotifier(context.getNotifier());
 }
 
 SVNClient::~SVNClient()



Mime
View raw message