Author: hwright
Date: Mon Mar 8 20:22:44 2010
New Revision: 920491
URL: http://svn.apache.org/viewvc?rev=920491&view=rev
Log:
JavaHL: Expose two flags as part of ChangePath class.
[ in subversion/bindings/javahl/ ]
* native/EnumMapper.h,
native/EnumMapper.cpp
(mapTristate): New.
* native/LogMessageCallback.cpp
(singleMessage): Update method signature and call for initializing a
ChangePath.
* src/org/apache/subversion/javahl/Tristate.java:
New.
* src/org/apache/subversion/javahl/ChangePath.java
(ChangePath): Update constructor.
(textMods, propMods): New.
(getTextMods, getPropMods): New.
Added:
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/Tristate.java
Modified:
subversion/trunk/subversion/bindings/javahl/native/EnumMapper.cpp
subversion/trunk/subversion/bindings/javahl/native/EnumMapper.h
subversion/trunk/subversion/bindings/javahl/native/LogMessageCallback.cpp
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ChangePath.java
Modified: subversion/trunk/subversion/bindings/javahl/native/EnumMapper.cpp
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/EnumMapper.cpp?rev=920491&r1=920490&r2=920491&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/EnumMapper.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/EnumMapper.cpp Mon Mar
8 20:22:44 2010
@@ -41,6 +41,7 @@
#include "../include/org_apache_subversion_javahl_ConflictDescriptor_Action.h"
#include "../include/org_apache_subversion_javahl_ConflictDescriptor_Reason.h"
#include "../include/org_apache_subversion_javahl_Depth.h"
+#include "../include/org_apache_subversion_javahl_Tristate.h"
/**
* Map a C commit state flag constant to the Java constant.
@@ -512,3 +513,17 @@
return org_apache_subversion_javahl_Operation_merge;
}
}
+
+jint EnumMapper::mapTristate(svn_tristate_t tristate)
+{
+ switch (tristate)
+ {
+ case svn_tristate_unknown:
+ default:
+ return org_apache_subversion_javahl_Tristate_Unknown;
+ case svn_tristate_true:
+ return org_apache_subversion_javahl_Tristate_True;
+ case svn_tristate_false:
+ return org_apache_subversion_javahl_Tristate_False;
+ }
+}
Modified: subversion/trunk/subversion/bindings/javahl/native/EnumMapper.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/EnumMapper.h?rev=920491&r1=920490&r2=920491&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/EnumMapper.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/EnumMapper.h Mon Mar 8
20:22:44 2010
@@ -51,6 +51,7 @@
static jint mapConflictReason(svn_wc_conflict_reason_t reason);
static jint mapDepth(svn_depth_t depth);
static jint mapOperation(svn_wc_operation_t);
+ static jint mapTristate(svn_tristate_t);
};
#endif // ENUM_MAPPER_H
Modified:
subversion/trunk/subversion/bindings/javahl/native/LogMessageCallback.cpp
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/LogMessageCallback.cpp?rev=920491&r1=920490&r2=920491&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/LogMessageCallback.cpp
(original)
+++ subversion/trunk/subversion/bindings/javahl/native/LogMessageCallback.cpp
Mon Mar 8 20:22:44 2010
@@ -99,7 +99,7 @@
{
midCP = env->GetMethodID(clazzCP,
"<init>",
- "(Ljava/lang/String;JLjava/lang/String;CI)V");
+ "(Ljava/lang/String;JLjava/lang/String;CIII)V");
if (JNIUtil::isJavaExceptionThrown())
return SVN_NO_ERROR;
}
@@ -131,8 +131,10 @@
jchar jaction = log_item->action;
jobject cp = env->NewObject(clazzCP, midCP, jpath, jcopyFromRev,
- jcopyFromPath, jaction,
-
EnumMapper::mapNodeKind(log_item->node_kind));
+ jcopyFromPath, jaction,
+ EnumMapper::mapNodeKind(log_item->node_kind),
+ EnumMapper::mapTristate(log_item->text_modified),
+
EnumMapper::mapTristate(log_item->props_modified));
if (JNIUtil::isJavaExceptionThrown())
return SVN_NO_ERROR;
Modified:
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ChangePath.java
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ChangePath.java?rev=920491&r1=920490&r2=920491&view=diff
==============================================================================
---
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ChangePath.java
(original)
+++
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ChangePath.java
Mon Mar 8 20:22:44 2010
@@ -43,13 +43,15 @@
* @param nodeKind the kind of the changed path
*/
public ChangePath(String path, long copySrcRevision, String copySrcPath,
- char action, int nodeKind)
+ char action, int nodeKind, int textMods, int propMods)
{
this.path = path;
this.copySrcRevision = copySrcRevision;
this.copySrcPath = copySrcPath;
this.action = action;
this.nodeKind = nodeKind;
+ this.textMods = textMods;
+ this.propMods = propMods;
}
/** Path of commited item */
@@ -67,6 +69,12 @@
/** The kind of the changed path. */
private int nodeKind;
+ /** Whether the text was modified. */
+ private int textMods;
+
+ /** Whether the properties were modified. */
+ private int propMods;
+
/**
* Retrieve the path to the commited item
* @return the path to the commited item
@@ -111,4 +119,22 @@
{
return nodeKind;
}
+
+ /**
+ * Retrieve whether the text was modified.
+ * @return the text mod state
+ */
+ public int getTextMods()
+ {
+ return textMods;
+ }
+
+ /**
+ * Retrieve whether the properties were modified.
+ * @return the prop mod state
+ */
+ public int getPropMods()
+ {
+ return propMods;
+ }
}
Added:
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/Tristate.java
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/Tristate.java?rev=920491&view=auto
==============================================================================
---
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/Tristate.java
(added)
+++
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/Tristate.java
Mon Mar 8 20:22:44 2010
@@ -0,0 +1,36 @@
+/**
+ * @copyright
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ * @endcopyright
+ */
+
+package org.apache.subversion.javahl;
+
+public final class Tristate
+{
+ /** The state of the thing is not known. */
+ public static final int Unknown = 0;
+
+ /** The state of the thing is false. */
+ public static final int False = 1;
+
+ /** The state of the thing is true. */
+ public static final int True = 2;
+}