[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

new conflict API

From: Ben Collins-Sussman <sussman_at_red-bean.com>
Date: 2007-10-14 23:15:49 CEST

I committed the new conflict-callback API. It has less cruft and now
is ready for dealing with property conflicts. Nothing actually *uses*
the property-conflict part yet, but at least 'make check' still
passes... and hand-tests show interactive conflict prompting working
as usual.

I'm aware that my commit broke JavaHL. I spent 10 minutes trying to
update JavaHL, but there's some serious background I'm missing. I was
able to grok how to add new fields to the conflict_description_t, but
what's much harder now is that the callback is returning a structure
rather than an enum. And that structure must be created with a C
constructor. I'll post my half-patch here, and maybe dlr (or other
javahl person) can finish the job?

Index: subversion/bindings/javahl/native/ConflictResolverCallback.cpp
===================================================================
--- subversion/bindings/javahl/native/ConflictResolverCallback.cpp (revision
27179)
+++ subversion/bindings/javahl/native/ConflictResolverCallback.cpp (working
copy)
@@ -73,7 +73,7 @@
 }

 svn_error_t *
-ConflictResolverCallback::resolveConflict(svn_wc_conflict_result_t *result,
+ConflictResolverCallback::resolveConflict(svn_wc_conflict_result_t **result,
                                           const svn_wc_conflict_description_t *
                                           desc,
                                           void *baton,
@@ -86,7 +86,7 @@
 }

 svn_error_t *
-ConflictResolverCallback::resolve(svn_wc_conflict_result_t *result,
+ConflictResolverCallback::resolve(svn_wc_conflict_result_t **result,
                                   const svn_wc_conflict_description_t *desc,
                                   apr_pool_t *pool)
 {
@@ -131,6 +131,9 @@
   jstring jpath = JNIUtil::makeJString(desc->path);
   if (JNIUtil::isJavaExceptionThrown())
     return SVN_NO_ERROR;
+ jstring jpropertyName = JNIUtil::makeJString(desc->property_name);
+ if (JNIUtil::isJavaExceptionThrown())
+ return SVN_NO_ERROR;
   jstring jmimeType = JNIUtil::makeJString(desc->mime_type);
   if (JNIUtil::isJavaExceptionThrown())
     return SVN_NO_ERROR;
@@ -150,6 +153,8 @@
   // Instantiate the conflict descriptor.
   jobject jdesc = env->NewObject(clazz, ctor, jpath,
                                  EnumMapper::mapNodeKind(desc->node_kind),
+ EnumMapper::mapConflictKind(desc->kind),
+ jpropertyName,
                                  (jboolean) desc->is_binary, jmimeType,
                                  EnumMapper::mapConflictAction(desc->action),
                                  EnumMapper::mapConflictReason(desc->reason),
@@ -176,6 +181,9 @@
   env->DeleteLocalRef(jpath);
   if (JNIUtil::isJavaExceptionThrown())
     return SVN_NO_ERROR;
+ env->DeleteLocalRef(jpropertyName);
+ if (JNIUtil::isJavaExceptionThrown())
+ return SVN_NO_ERROR;
   env->DeleteLocalRef(jmimeType);
   if (JNIUtil::isJavaExceptionThrown())
     return SVN_NO_ERROR;
Index: subversion/bindings/javahl/native/EnumMapper.cpp
===================================================================
--- subversion/bindings/javahl/native/EnumMapper.cpp (revision 27179)
+++ subversion/bindings/javahl/native/EnumMapper.cpp (working copy)
@@ -374,6 +374,19 @@
     }
 }

+jint EnumMapper::mapConflictKind(svn_wc_conflict_kind_t kind)
+{
+ switch (kind)
+ {
+ case svn_wc_conflict_kind_text:
+ default:
+ return org_tigris_subversion_javahl_ConflictDescriptor_Kind_text;
+
+ case svn_wc_conflict_kind_property:
+ return org_tigris_subversion_javahl_ConflictDescriptor_Kind_property;
+ }
+}
+
 jint EnumMapper::mapConflictAction(svn_wc_conflict_action_t action)
 {
   switch (action)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Oct 14 23:16:00 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.