You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/02/09 17:46:21 UTC
svn commit: r1658462 [2/31] - in /subversion/branches/move-tracking-2: ./
build/ build/generator/ build/generator/templates/ notes/ subversion/
subversion/bindings/cxxhl/include/svncxxhl/
subversion/bindings/javahl/native/ subversion/bindings/javahl/na...
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_list.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_list.hpp?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_list.hpp (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_list.hpp Mon Feb 9 16:46:16 2015
@@ -24,56 +24,89 @@
#ifndef SVN_JAVAHL_JNIWRAPPER_LIST_HPP
#define SVN_JAVAHL_JNIWRAPPER_LIST_HPP
-#include <algorithm>
-#include <vector>
-
#include "jni_env.hpp"
#include "jni_object.hpp"
+#include "jni_iterator.hpp"
namespace Java {
/**
* Non-template base for an immutable type-safe Java list.
*
- * Converts the list to a @c std::vector of @c jobject references.
- *
* @since New in 1.9.
*/
-class BaseList : public Object
+class BaseImmutableList : public Object
{
- typedef std::vector<jobject> ovector;
-
public:
/**
* Returns the number of elements in the list.
*/
jint length() const
{
- return jint(m_contents.size());
+ return m_env.CallIntMethod(m_jthis, impl().m_mid_size);
+ }
+
+ /**
+ * Checks if the list is empty.
+ */
+ bool is_empty() const
+ {
+ return (length() == 0);
}
protected:
/**
- * Constructs the list wrapper, converting the contents to an
- * @c std::vector.
+ * Constructs the list wrapper
*/
- explicit BaseList(Env env, jobject jlist)
- : Object(env, ClassCache::get_list(env), jlist),
- m_contents(convert_to_vector(env, m_jthis))
+ explicit BaseImmutableList(Env env, jobject jlist)
+ : Object(env, ClassCache::get_list(env), jlist)
{}
/**
- * Returns the object reference at @a index.
- * @throw std::out_of_range if the index value is not valid.
+ * Constructor used by BaseList
*/
- jobject operator[](jint index) const
+ explicit BaseImmutableList(Env env, const Object::ClassImpl* pimpl)
+ : Object(env, pimpl)
+ {}
+
+ /**
+ * Clears the contents of the list.
+ */
+ void clear()
{
- return m_contents[ovector::size_type(index)];
+ m_env.CallVoidMethod(m_jthis, impl().m_mid_clear);
}
- const ovector m_contents;
+ /**
+ * Appends @a obj to the end of the list.
+ */
+ void add(jobject obj)
+ {
+ m_env.CallVoidMethod(m_jthis, impl().m_mid_add, obj);
+ }
+
+ /**
+ * Returns the object reference at @a index.
+ * @throw std::out_of_range if the index value is not valid.
+ */
+ jobject operator[](jint index) const;
+
+ /**
+ * Iterator used by subclasses.
+ */
+ class Iterator : public BaseIterator
+ {
+ friend class BaseImmutableList;
+ explicit Iterator(Env env, jobject jiterator)
+ : BaseIterator(env, jiterator)
+ {}
+ };
+
+ /**
+ * Returns an iterator instance.
+ */
+ Iterator get_iterator() const;
-private:
/**
* This object's implementation details.
*/
@@ -89,11 +122,15 @@ private:
const MethodID m_mid_size;
const MethodID m_mid_get;
+ const MethodID m_mid_add;
+ const MethodID m_mid_clear;
+ const MethodID m_mid_iter;
};
+private:
+ friend class Iterator;
friend class ClassCacheImpl;
static const char* const m_class_name;
- static ovector convert_to_vector(Env env, jobject jlist);
const ClassImpl& impl() const
{
@@ -107,15 +144,14 @@ private:
* @since New in 1.9.
*/
template <typename T, typename NativeT=jobject>
-class List : public BaseList
+class ImmutableList : public BaseImmutableList
{
public:
/**
- * Constructs the list wrapper, converting the contents to an
- * @c std::vector.
+ * Constructs the list wrapper.
*/
- explicit List(Env env, jobject jlist)
- : BaseList(env, jlist)
+ explicit ImmutableList(Env env, jobject jlist)
+ : BaseImmutableList(env, jlist)
{}
/**
@@ -124,7 +160,7 @@ public:
*/
T operator[](jint index) const
{
- return T(m_env, NativeT(BaseList::operator[](index)));
+ return T(m_env, NativeT(BaseImmutableList::operator[](index)));
}
/**
@@ -135,29 +171,11 @@ public:
template<typename F>
F for_each(F function) const
{
- const FunctorAdapter<F> adapter(m_env, function);
- std::for_each(m_contents.begin(), m_contents.end(), adapter);
+ Iterator iter(get_iterator());
+ while (iter.has_next())
+ function(T(m_env, NativeT(iter.next())));
return function;
}
-
-private:
- template<typename F>
- struct FunctorAdapter
- {
- explicit FunctorAdapter(const Env& env, F& function)
- : m_env(env),
- m_function(function)
- {}
-
- void operator()(const jobject& obj) const
- {
- const T item(m_env, NativeT(obj));
- m_function(item);
- }
-
- const Env& m_env;
- F& m_function;
- };
};
/**
@@ -165,7 +183,7 @@ private:
*
* @since New in 1.9.
*/
-class BaseMutableList : public Object
+class BaseList : public BaseImmutableList
{
public:
/**
@@ -173,66 +191,40 @@ public:
*/
void clear()
{
- m_env.CallVoidMethod(m_jthis, impl().m_mid_clear);
- }
-
- /**
- * Returns the number of elements in the list.
- */
- jint length() const
- {
- return m_env.CallIntMethod(m_jthis, impl().m_mid_size);
- }
-
- /**
- * Checks if the list is empty.
- */
- bool is_empty() const
- {
- return (length() == 0);
+ BaseImmutableList::clear();
}
protected:
/**
- * Constructs the list wrapper, deriving the class from @a jlist.
+ * Constructs the list wrapper, treating @a jlist as a @c java.util.List.
*/
- explicit BaseMutableList(Env env, jobject jlist)
- : Object(env, ClassCache::get_array_list(env), jlist)
+ explicit BaseList(Env env, jobject jlist)
+ : BaseImmutableList(env, jlist)
{}
/**
* Constructs and wraps an empty list of type @c java.util.ArrayList
* with initial allocation size @a length.
*/
- explicit BaseMutableList(Env env, jint length)
- : Object(env, ClassCache::get_array_list(env))
+ explicit BaseList(Env env, jint length)
+ : BaseImmutableList(env, ClassCache::get_array_list(env))
{
set_this(env.NewObject(get_class(), impl().m_mid_ctor, length));
}
-
/**
* Appends @a obj to the end of the list.
*/
void add(jobject obj)
{
- m_env.CallBooleanMethod(m_jthis, impl().m_mid_add, obj);
- }
-
- /**
- * Returns the object reference at @a index.
- * @note Throws a Java exception if the index value is not valid.
- */
- jobject operator[](jint index) const
- {
- return m_env.CallObjectMethod(m_jthis, impl().m_mid_get, index);
+ BaseImmutableList::add(obj);
}
private:
/**
* This object's implementation details.
*/
- class ClassImpl : public Object::ClassImpl
+ class ClassImpl : public BaseImmutableList::ClassImpl
{
friend class ClassCacheImpl;
@@ -243,10 +235,6 @@ private:
virtual ~ClassImpl();
const MethodID m_mid_ctor;
- const MethodID m_mid_add;
- const MethodID m_mid_clear;
- const MethodID m_mid_get;
- const MethodID m_mid_size;
};
friend class ClassCacheImpl;
@@ -264,39 +252,53 @@ private:
* @since New in 1.9.
*/
template <typename T, typename NativeT=jobject>
-class MutableList : public BaseMutableList
+class List : public BaseList
{
public:
/**
* Constructs the list wrapper, deriving the class from @a jlist.
*/
- explicit MutableList(Env env, jobject jlist)
- : BaseMutableList(env, jlist)
+ explicit List(Env env, jobject jlist)
+ : BaseList(env, jlist)
{}
/**
* Constructs and wraps an empty list of type @c java.util.ArrayList
* with initial allocation size @a length.
*/
- explicit MutableList(Env env, jint length_ = 0)
- : BaseMutableList(env, length_)
+ explicit List(Env env, jint length_ = 0)
+ : BaseList(env, length_)
{}
/**
+ * Returns a wrapper object for the object reference at @a index.
+ * @throw std::out_of_range if the index value is not valid.
+ */
+ T operator[](jint index) const
+ {
+ return T(m_env, NativeT(BaseList::operator[](index)));
+ }
+
+ /**
* Appends @a obj to the end of the list.
*/
void add(const T& obj)
{
- BaseMutableList::add(obj.get());
+ BaseList::add(obj.get());
}
/**
- * Returns a wrapper object for the object reference at @a index.
- * @note Throws a Java exception if the index value is not valid.
+ * Iterates over the items in the list, calling @a function for
+ * each item.
+ * @see std::for_each
*/
- T operator[](jint index) const
+ template<typename F>
+ F for_each(F function) const
{
- return T(m_env, NativeT(BaseMutableList::operator[](index)));
+ Iterator iter(get_iterator());
+ while (iter.has_next())
+ function(T(m_env, NativeT(iter.next())));
+ return function;
}
};
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_object.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_object.hpp?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_object.hpp (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_object.hpp Mon Feb 9 16:46:16 2015
@@ -171,6 +171,9 @@ public:
JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(throwable);
JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(string);
+ JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(exc_index_out_of_bounds);
+ JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(exc_no_such_element);
+
JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(list);
JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(array_list);
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp Mon Feb 9 16:46:16 2015
@@ -30,123 +30,81 @@
namespace Java {
-// Class Java::BaseMap
+// Class Java::BaseImmutableMap
-const char* const BaseMap::m_class_name = "java/util/Map";
+const char* const BaseImmutableMap::m_class_name = "java/util/Map";
-BaseMap::ClassImpl::ClassImpl(Env env, jclass cls)
+BaseImmutableMap::ClassImpl::ClassImpl(Env env, jclass cls)
: Object::ClassImpl(env, cls),
+ m_mid_put(env.GetMethodID(cls, "put",
+ "(Ljava/lang/Object;Ljava/lang/Object;)"
+ "Ljava/lang/Object;")),
+ m_mid_clear(env.GetMethodID(cls, "clear", "()V")),
+ m_mid_has_key(env.GetMethodID(cls, "containsKey",
+ "(Ljava/lang/Object;)Z")),
+ m_mid_get(env.GetMethodID(cls, "get",
+ "(Ljava/lang/Object;)Ljava/lang/Object;")),
m_mid_size(env.GetMethodID(cls, "size", "()I")),
m_mid_entry_set(env.GetMethodID(cls, "entrySet", "()Ljava/util/Set;"))
{}
-BaseMap::ClassImpl::~ClassImpl() {}
-
-const char* const BaseMap::Set::m_class_name = "java/util/Set";
-
-BaseMap::Set::ClassImpl::ClassImpl(Env env, jclass cls)
- : Object::ClassImpl(env, cls),
- m_mid_iterator(env.GetMethodID(cls, "iterator",
- "()Ljava/util/Iterator;"))
-{}
-
-BaseMap::Set::ClassImpl::~ClassImpl() {}
+BaseImmutableMap::ClassImpl::~ClassImpl() {}
-const char* const BaseMap::Iterator::m_class_name = "java/util/Iterator";
+jobject BaseImmutableMap::operator[](const std::string& index) const
+{
+ const String key(m_env, index);
+ if (!m_env.CallBooleanMethod(m_jthis, impl().m_mid_has_key, key.get()))
+ {
+ std::string msg(_("Map does not contain key: "));
+ msg += index;
+ throw std::out_of_range(msg.c_str());
+ }
+ return m_env.CallObjectMethod(m_jthis, impl().m_mid_get, key.get());
+}
-BaseMap::Iterator::ClassImpl::ClassImpl(Env env, jclass cls)
- : Object::ClassImpl(env, cls),
- m_mid_has_next(env.GetMethodID(cls, "hasNext", "()Z")),
- m_mid_next(env.GetMethodID(cls, "next", "()Ljava/lang/Object;"))
-{}
+BaseImmutableMap::Iterator BaseImmutableMap::get_iterator() const
+{
+ const jobject jentry_set =
+ m_env.CallObjectMethod(m_jthis, impl().m_mid_entry_set);
+ const jobject jiterator =
+ m_env.CallObjectMethod(jentry_set, Set::impl(m_env).m_mid_iterator);
+ return Iterator(m_env, jiterator);
+}
-BaseMap::Iterator::ClassImpl::~ClassImpl() {}
+// Class Java::BaseImmutableMap::Entry
-const char* const BaseMap::Entry::m_class_name = "java/util/Map$Entry";
+const char* const BaseImmutableMap::Entry::m_class_name = "java/util/Map$Entry";
-BaseMap::Entry::ClassImpl::ClassImpl(Env env, jclass cls)
+BaseImmutableMap::Entry::ClassImpl::ClassImpl(Env env, jclass cls)
: Object::ClassImpl(env, cls),
m_mid_get_key(env.GetMethodID(cls, "getKey", "()Ljava/lang/Object;")),
m_mid_get_value(env.GetMethodID(cls, "getValue", "()Ljava/lang/Object;"))
{}
-BaseMap::Entry::ClassImpl::~ClassImpl() {}
+BaseImmutableMap::Entry::ClassImpl::~ClassImpl() {}
+// Class Java::BaseImmutableMap::Set
-jobject BaseMap::operator[](const std::string& index) const
-{
- somap::const_iterator it = m_contents.find(index);
- if (it == m_contents.end())
- {
- std::string msg(_("Map does not contain key: "));
- msg += index;
- throw std::out_of_range(msg.c_str());
- }
- return it->second;
-}
+const char* const BaseImmutableMap::Set::m_class_name = "java/util/Set";
-BaseMap::somap BaseMap::convert_to_map(Env env, jobject jmap)
-{
- const ClassImpl* pimpl =
- dynamic_cast<const ClassImpl*>(ClassCache::get_map(env));
+BaseImmutableMap::Set::ClassImpl::ClassImpl(Env env, jclass cls)
+ : Object::ClassImpl(env, cls),
+ m_mid_iterator(env.GetMethodID(cls, "iterator",
+ "()Ljava/util/Iterator;"))
+{}
- if (!env.CallIntMethod(jmap, pimpl->m_mid_size))
- return somap();
+BaseImmutableMap::Set::ClassImpl::~ClassImpl() {}
- // Get an iterator over the map's entry set
- const jobject entries = env.CallObjectMethod(jmap, pimpl->m_mid_entry_set);
- const jobject iterator = env.CallObjectMethod(entries,
- Set::impl(env).m_mid_iterator);
-
- const Iterator::ClassImpl& iterimpl = Iterator::impl(env);
- const Entry::ClassImpl& entimpl = Entry::impl(env);
-
- // Yterate over the map, filling the native map
- somap contents;
- while (env.CallBooleanMethod(iterator, iterimpl.m_mid_has_next))
- {
- const jobject entry =
- env.CallObjectMethod(iterator, iterimpl.m_mid_next);
- const String keystr(
- env, jstring(env.CallObjectMethod(entry, entimpl.m_mid_get_key)));
- const jobject value(
- env.CallObjectMethod(entry, entimpl.m_mid_get_value));
- const String::Contents key(keystr);
- contents.insert(somap::value_type(key.c_str(), value));
- }
- return contents;
-}
-// Class Java::BaseMutableMap
+// Class Java::BaseMap
-const char* const BaseMutableMap::m_class_name = "java/util/HashMap";
+const char* const BaseMap::m_class_name = "java/util/HashMap";
-BaseMutableMap::ClassImpl::ClassImpl(Env env, jclass cls)
- : Object::ClassImpl(env, cls),
- m_mid_ctor(env.GetMethodID(cls, "<init>", "(I)V")),
- m_mid_put(env.GetMethodID(cls, "put",
- "(Ljava/lang/Object;Ljava/lang/Object;)"
- "Ljava/lang/Object;")),
- m_mid_clear(env.GetMethodID(cls, "clear", "()V")),
- m_mid_has_key(env.GetMethodID(cls, "containsKey",
- "(Ljava/lang/Object;)Z")),
- m_mid_get(env.GetMethodID(cls, "get",
- "(Ljava/lang/Object;)Ljava/lang/Object;")),
- m_mid_size(env.GetMethodID(cls, "size", "()I"))
+BaseMap::ClassImpl::ClassImpl(Env env, jclass cls)
+ : BaseImmutableMap::ClassImpl(env, cls),
+ m_mid_ctor(env.GetMethodID(cls, "<init>", "(I)V"))
{}
-BaseMutableMap::ClassImpl::~ClassImpl() {}
-
-jobject BaseMutableMap::operator[](const std::string& index) const
-{
- const String key(m_env, index);
- if (!m_env.CallBooleanMethod(m_jthis, impl().m_mid_has_key, key.get()))
- {
- std::string msg(_("Map does not contain key: "));
- msg += index;
- throw std::out_of_range(msg.c_str());
- }
- return m_env.CallObjectMethod(m_jthis, impl().m_mid_get, key.get());
-}
+BaseMap::ClassImpl::~ClassImpl() {}
} // namespace Java
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp Mon Feb 9 16:46:16 2015
@@ -24,54 +24,76 @@
#ifndef SVN_JAVAHL_JNIWRAPPER_STRING_MAP_HPP
#define SVN_JAVAHL_JNIWRAPPER_STRING_MAP_HPP
-#include <map>
#include <string>
-#include <algorithm>
#include "jni_env.hpp"
#include "jni_object.hpp"
+#include "jni_iterator.hpp"
namespace Java {
/**
* Non-template base for an immutable type-safe Java map with String keys.
*
- * Converts the map to a @c std::map containing @c jobject references.
- *
* @since New in 1.9.
*/
-class BaseMap : public Object
+class BaseImmutableMap : public Object
{
- typedef std::map<std::string, jobject> somap;
-
public:
/**
* Returns the number of elements in the map.
*/
jint length() const
{
- return jint(m_contents.size());
+ return m_env.CallIntMethod(m_jthis, impl().m_mid_size);
+ }
+
+ /**
+ * Checks if the map is empty.
+ */
+ bool is_empty() const
+ {
+ return (length() == 0);
}
protected:
/**
- * Constructs the map wrapper, converting the contents to an
- * @c std::map.
+ * Constructs the map wrapper.
*/
- explicit BaseMap(Env env, jobject jmap)
- : Object(env, ClassCache::get_map(env), jmap),
- m_contents(convert_to_map(env, m_jthis))
+ explicit BaseImmutableMap(Env env, jobject jmap)
+ : Object(env, ClassCache::get_map(env), jmap)
{}
/**
+ * Constructor used by BaseMap.
+ */
+ explicit BaseImmutableMap(Env env, const Object::ClassImpl* pimpl)
+ : Object(env, pimpl)
+ {}
+
+ /**
+ * Clears the contents of the map.
+ */
+ void clear()
+ {
+ m_env.CallVoidMethod(m_jthis, impl().m_mid_clear);
+ }
+
+ /**
+ * Inserts @a obj identified by @a key into the map.
+ */
+ void put(const std::string& key, jobject obj)
+ {
+ m_env.CallObjectMethod(m_jthis, impl().m_mid_put,
+ String(m_env, key).get(), obj);
+ }
+
+ /**
* Returns the object reference identified by @a index.
* @throw std::out_of_range if there is no such element.
*/
jobject operator[](const std::string& index) const;
- const somap m_contents;
-
-private:
/**
* This object's implementation details.
*/
@@ -85,6 +107,10 @@ private:
public:
virtual ~ClassImpl();
+ const MethodID m_mid_put;
+ const MethodID m_mid_clear;
+ const MethodID m_mid_has_key;
+ const MethodID m_mid_get;
const MethodID m_mid_size;
const MethodID m_mid_entry_set;
};
@@ -96,35 +122,38 @@ private:
friend class ClassCacheImpl;
static const char* const m_class_name;
- static somap convert_to_map(Env env, jobject jmap);
- struct Set
+ class Iterator : public BaseIterator
{
- /**
- * This object's implementation details.
- */
- class ClassImpl : public Object::ClassImpl
- {
- friend class ClassCacheImpl;
+ friend class BaseImmutableMap;
+ explicit Iterator(Env env, jobject jiterator)
+ : BaseIterator(env, jiterator)
+ {}
+ };
- protected:
- explicit ClassImpl(Env env, jclass cls);
+ Iterator get_iterator() const;
- public:
- virtual ~ClassImpl();
+ class Entry : public Object
+ {
+ public:
+ explicit Entry(Env env, jobject jentry)
+ : Object(env, ClassCache::get_map_entry(env), jentry)
+ {}
- const MethodID m_mid_iterator;
- };
+ const std::string key() const
+ {
+ const jstring jkey =
+ jstring(m_env.CallObjectMethod(m_jthis, impl().m_mid_get_key));
+ const String::Contents key(String(m_env, jkey));
+ return std::string(key.c_str());
+ }
- static const char* const m_class_name;
- static const ClassImpl& impl(Env env)
+ jobject value() const
{
- return *dynamic_cast<const ClassImpl*>(ClassCache::get_set(env));
+ return m_env.CallObjectMethod(m_jthis, impl().m_mid_get_value);
}
- };
- struct Iterator
- {
+ private:
/**
* This object's implementation details.
*/
@@ -138,18 +167,20 @@ private:
public:
virtual ~ClassImpl();
- const MethodID m_mid_has_next;
- const MethodID m_mid_next;
+ const MethodID m_mid_get_key;
+ const MethodID m_mid_get_value;
};
+ friend class ClassCacheImpl;
static const char* const m_class_name;
- static const ClassImpl& impl(Env env)
+ const ClassImpl& impl() const
{
- return *dynamic_cast<const ClassImpl*>(ClassCache::get_iterator(env));
+ return *dynamic_cast<const ClassImpl*>(m_impl);
}
};
- struct Entry
+private:
+ struct Set
{
/**
* This object's implementation details.
@@ -164,14 +195,13 @@ private:
public:
virtual ~ClassImpl();
- const MethodID m_mid_get_key;
- const MethodID m_mid_get_value;
+ const MethodID m_mid_iterator;
};
static const char* const m_class_name;
static const ClassImpl& impl(Env env)
{
- return *dynamic_cast<const ClassImpl*>(ClassCache::get_map_entry(env));
+ return *dynamic_cast<const ClassImpl*>(ClassCache::get_set(env));
}
};
};
@@ -182,15 +212,15 @@ private:
* @since New in 1.9.
*/
template <typename T, typename NativeT=jobject>
-class Map : public BaseMap
+class ImmutableMap : public BaseImmutableMap
{
public:
/**
* Constructs the map wrapper, converting the contents to an
* @c std::map.
*/
- explicit Map(Env env, jobject jmap)
- : BaseMap(env, jmap)
+ explicit ImmutableMap(Env env, jobject jmap)
+ : BaseImmutableMap(env, jmap)
{}
/**
@@ -199,7 +229,7 @@ public:
*/
T operator[](const std::string& index) const
{
- return T(m_env, NativeT(BaseMap::operator[](index)));
+ return T(m_env, NativeT(BaseImmutableMap::operator[](index)));
}
/**
@@ -207,37 +237,22 @@ public:
* each item.
* @see std::for_each
* @note Unlike std::for_each, which invokes the functor with a
- * single @c value_type argument, this iterator adapts it to cal
- * @a function with separate @c const references to the key and
- * value.
+ * single @c value_type argument, this iterator calls
+ * @a function with separate @c const references to the key
+ * and value.
*/
template<typename F>
F for_each(F function) const
{
- const FunctorAdapter<F> adapter(m_env, function);
- std::for_each(m_contents.begin(), m_contents.end(), adapter);
+ Iterator iter(get_iterator());
+ while (iter.has_next())
+ {
+ Entry entry(m_env, iter.next());
+ const std::string& key(entry.key());
+ function(key, T(m_env, NativeT(entry.value())));
+ }
return function;
}
-
-private:
- template<typename F>
- struct FunctorAdapter
- {
- explicit FunctorAdapter(const Env& env, F& function)
- : m_env(env),
- m_function(function)
- {}
-
- void operator()(const std::pair<std::string, jobject>& item) const
- {
- const std::string& key(item.first);
- const T value(m_env, NativeT(item.second));
- m_function(key, value);
- }
-
- const Env& m_env;
- F& m_function;
- };
};
/**
@@ -245,7 +260,7 @@ private:
*
* @since New in 1.9.
*/
-class BaseMutableMap : public Object
+class BaseMap : public BaseImmutableMap
{
public:
/**
@@ -253,64 +268,32 @@ public:
*/
void clear()
{
- m_env.CallVoidMethod(m_jthis, impl().m_mid_clear);
- }
-
- /**
- * Returns the number of elements in the map.
- */
- jint length() const
- {
- return m_env.CallIntMethod(m_jthis, impl().m_mid_size);
- }
-
- /**
- * Checks if the map is empty.
- */
- bool is_empty() const
- {
- return (length() == 0);
+ BaseImmutableMap::clear();
}
protected:
/**
- * Constructs the map wrapper, deriving the class from @a jmap.
+ * Constructs the map wrapper, treating @a jmap as a @c java.util.Map.
*/
- explicit BaseMutableMap(Env env, jobject jmap)
- : Object(env, ClassCache::get_hash_map(env), jmap)
+ explicit BaseMap(Env env, jobject jmap)
+ : BaseImmutableMap(env, jmap)
{}
/**
* Constructs and wraps an empty map of type @c java.util.HashMap
* with initial allocation size @a length.
*/
- explicit BaseMutableMap(Env env, jint length)
- : Object(env, ClassCache::get_hash_map(env))
+ explicit BaseMap(Env env, jint length)
+ : BaseImmutableMap(env, ClassCache::get_hash_map(env))
{
set_this(env.NewObject(get_class(), impl().m_mid_ctor, length));
}
-
- /**
- * Inserts @a obj identified by @a key into the map.
- */
- void put(const std::string& key, jobject obj)
- {
- m_env.CallObjectMethod(m_jthis, impl().m_mid_put,
- String(m_env, key).get(), obj);
- }
-
- /**
- * Returns the object reference identified by @a index.
- * @throw std::out_of_range if there is no such element.
- */
- jobject operator[](const std::string& index) const;
-
private:
/**
* This object's implementation details.
*/
- class ClassImpl : public Object::ClassImpl
+ class ClassImpl : public BaseImmutableMap::ClassImpl
{
friend class ClassCacheImpl;
@@ -321,11 +304,6 @@ private:
virtual ~ClassImpl();
const MethodID m_mid_ctor;
- const MethodID m_mid_put;
- const MethodID m_mid_clear;
- const MethodID m_mid_has_key;
- const MethodID m_mid_get;
- const MethodID m_mid_size;
};
const ClassImpl& impl() const
@@ -343,22 +321,22 @@ private:
* @since New in 1.9.
*/
template <typename T, typename NativeT=jobject>
-class MutableMap : public BaseMutableMap
+class Map : public BaseMap
{
public:
/**
* Constructs the map wrapper, deriving the class from @a jmap.
*/
- explicit MutableMap(Env env, jobject jmap)
- : BaseMutableMap(env, jmap)
+ explicit Map(Env env, jobject jmap)
+ : BaseMap(env, jmap)
{}
/**
* Constructs and wraps an empty map of type @c java.util.HashMap
* with initial allocation size @a length.
*/
- explicit MutableMap(Env env, jint length = 0)
- : BaseMutableMap(env, length)
+ explicit Map(Env env, jint length = 0)
+ : BaseMap(env, length)
{}
/**
@@ -366,7 +344,7 @@ public:
*/
void put(const std::string& key, const T& obj)
{
- BaseMutableMap::put(key, obj.get());
+ BaseMap::put(key, obj.get());
}
/**
@@ -375,7 +353,29 @@ public:
*/
T operator[](const std::string& index) const
{
- return T(m_env, NativeT(BaseMutableMap::operator[](index)));
+ return T(m_env, NativeT(BaseMap::operator[](index)));
+ }
+
+ /**
+ * Iterates over the items in the map, calling @a function for
+ * each item.
+ * @see std::for_each
+ * @note Unlike std::for_each, which invokes the functor with a
+ * single @c value_type argument, this iterator calls
+ * @a function with separate @c const references to the key
+ * and value.
+ */
+ template<typename F>
+ F for_each(F function) const
+ {
+ Iterator iter(get_iterator());
+ while (iter.has_next())
+ {
+ Entry entry(m_env, iter.next());
+ const std::string& key(entry.key());
+ function(key, T(m_env, NativeT(entry.value())));
+ }
+ return function;
}
};
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp Mon Feb 9 16:46:16 2015
@@ -439,7 +439,7 @@ Java_org_apache_subversion_javahl_SVNCli
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNClient_revert
(JNIEnv *env, jobject jthis, jobject jpaths, jobject jdepth,
- jobject jchangelists, jboolean jclear_changelists)
+ jobject jchangelists, jboolean jclear_changelists, jboolean jmetadata_only)
{
JNIEntry(SVNClient, revert);
SVNClient *cl = SVNClient::getCppObject(jthis);
@@ -459,7 +459,7 @@ Java_org_apache_subversion_javahl_SVNCli
return;
cl->revert(paths, EnumMapper::toDepth(jdepth),
- changelists, bool(jclear_changelists));
+ changelists, bool(jclear_changelists), bool(jmetadata_only));
}
JNIEXPORT void JNICALL
@@ -1646,7 +1646,8 @@ JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNClient_blame
(JNIEnv *env, jobject jthis, jstring jpath, jobject jpegRevision,
jobject jrevisionStart, jobject jrevisionEnd, jboolean jignoreMimeType,
- jboolean jincludeMergedRevisions, jobject jblameCallback)
+ jboolean jincludeMergedRevisions, jobject jblameCallback,
+ jobject jdiffOptions)
{
JNIEntry(SVNClient, blame);
SVNClient *cl = SVNClient::getCppObject(jthis);
@@ -1671,10 +1672,15 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
+ DiffOptions options(jdiffOptions);
+ if (JNIUtil::isExceptionThrown())
+ return;
+
BlameCallback callback(jblameCallback);
cl->blame(path, pegRevision, revisionStart, revisionEnd,
jignoreMimeType ? true : false,
- jincludeMergedRevisions ? true : false, &callback);
+ jincludeMergedRevisions ? true : false, &callback,
+ options);
}
JNIEXPORT void JNICALL
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_Version.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_Version.cpp?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_Version.cpp (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_Version.cpp Mon Feb 9 16:46:16 2015
@@ -28,12 +28,19 @@
#include "JNIStackElement.h"
#include "svn_version.h"
+namespace {
+const svn_version_t* javahl_version()
+{
+ SVN_VERSION_BODY;
+}
+} //anonymous namespace
+
JNIEXPORT jint JNICALL
Java_org_apache_subversion_javahl_types_Version_getMajor(JNIEnv *env,
jobject jthis)
{
JNIEntry(Version, getMajor);
- return SVN_VER_MAJOR;
+ return javahl_version()->major;
}
JNIEXPORT jint JNICALL
@@ -41,7 +48,7 @@ Java_org_apache_subversion_javahl_types_
jobject jthis)
{
JNIEntry(Version, getMinor);
- return SVN_VER_MINOR;
+ return javahl_version()->minor;
}
JNIEXPORT jint JNICALL
@@ -49,7 +56,7 @@ Java_org_apache_subversion_javahl_types_
jobject jthis)
{
JNIEntry(Version, getPatch);
- return SVN_VER_PATCH;
+ return javahl_version()->patch;
}
JNIEXPORT jstring JNICALL
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.cpp?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.cpp (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.cpp Mon Feb 9 16:46:16 2015
@@ -41,8 +41,10 @@
#include "JNICriticalSection.h"
#include "svn_auth.h"
+#include "svn_base64.h"
#include "svn_config.h"
#include "svn_hash.h"
+#include "svn_x509.h"
#include "svn_private_config.h"
@@ -140,41 +142,14 @@ jobject build_credential(Java::Env env,
else if (0 == strcmp(cred_kind, SVN_AUTH_CRED_SSL_SERVER_TRUST))
{
entry = static_cast<svn_string_t*>(
- svn_hash_gets(cred, SVN_CONFIG_AUTHN_HOSTNAME_KEY));
- const char* hostname = (entry ? entry->data : NULL);
-
- entry = static_cast<svn_string_t*>(
- svn_hash_gets(cred, SVN_CONFIG_AUTHN_FINGERPRINT_KEY));
- const char* fingerprint = (entry ? entry->data : NULL);
-
- entry = static_cast<svn_string_t*>(
- svn_hash_gets(cred, SVN_CONFIG_AUTHN_VALID_FROM_KEY));
- const char* valid_from = (entry ? entry->data : NULL);
-
- entry = static_cast<svn_string_t*>(
- svn_hash_gets(cred, SVN_CONFIG_AUTHN_VALID_UNTIL_KEY));
- const char* valid_until = (entry ? entry->data : NULL);
-
- entry = static_cast<svn_string_t*>(
- svn_hash_gets(cred, SVN_CONFIG_AUTHN_ISSUER_DN_KEY));
- const char* issuer = (entry ? entry->data : NULL);
-
- entry = static_cast<svn_string_t*>(
svn_hash_gets(cred, SVN_CONFIG_AUTHN_ASCII_CERT_KEY));
- const char* der = (entry ? entry->data : NULL);
+ const char* ascii_cert = (entry ? entry->data : NULL);
entry = static_cast<svn_string_t*>(
svn_hash_gets(cred, SVN_CONFIG_AUTHN_FAILURES_KEY));
jint failflags = (!entry ? 0 : jint(apr_atoi64(entry->data)));
- info = JavaHL::AuthnCallback
- ::SSLServerCertInfo(env,
- Java::String(env, hostname),
- Java::String(env, fingerprint),
- Java::String(env, valid_from),
- Java::String(env, valid_until),
- Java::String(env, issuer),
- Java::String(env, der)).get();
+ info = JavaHL::AuthnCallback::SSLServerCertInfo(env, ascii_cert).get();
failures = JavaHL::AuthnCallback
::SSLServerCertFailures(env, failflags).get();
}
@@ -368,7 +343,20 @@ Java_org_apache_subversion_javahl_util_C
const char* const m_text_pattern;
const ::Java::Env m_env;
- ::Java::MutableList<JavaHL::Credential> m_credentials;
+ ::Java::List<JavaHL::Credential> m_credentials;
+
+ bool match_array(const char* pattern,
+ const apr_array_header_t* hostnames)
+ {
+ for (int i = 0; i < hostnames->nelts; ++i)
+ {
+ const char* const hostname =
+ APR_ARRAY_IDX(hostnames, i, const char*);
+ if (!apr_fnmatch(pattern, hostname, 0))
+ return true;
+ }
+ return false;
+ }
public:
explicit Callback(::Java::Env ctor_env,
@@ -411,25 +399,41 @@ Java_org_apache_subversion_javahl_util_C
svn_hash_gets(cb_cred_hash, SVN_CONFIG_AUTHN_PASSTYPE_KEY));
const char* const store = (entry ? entry->data : NULL);
- entry = static_cast<svn_string_t*>(
- svn_hash_gets(cb_cred_hash, SVN_CONFIG_AUTHN_HOSTNAME_KEY));
- const char* const hostname = (entry ? entry->data : NULL);
-
- entry = static_cast<svn_string_t*>(
- svn_hash_gets(cb_cred_hash, SVN_CONFIG_AUTHN_FINGERPRINT_KEY));
- const char* const fingerprint = (entry ? entry->data : NULL);
+ const svn_string_t* ascii_cert = static_cast<svn_string_t*>(
+ svn_hash_gets(cb_cred_hash, SVN_CONFIG_AUTHN_ASCII_CERT_KEY));
- entry = static_cast<svn_string_t*>(
- svn_hash_gets(cb_cred_hash, SVN_CONFIG_AUTHN_VALID_FROM_KEY));
- const char* const valid_from = (entry ? entry->data : NULL);
-
- entry = static_cast<svn_string_t*>(
- svn_hash_gets(cb_cred_hash, SVN_CONFIG_AUTHN_VALID_UNTIL_KEY));
- const char* const valid_until = (entry ? entry->data : NULL);
-
- entry = static_cast<svn_string_t*>(
- svn_hash_gets(cb_cred_hash, SVN_CONFIG_AUTHN_ISSUER_DN_KEY));
- const char* const issuer = (entry ? entry->data : NULL);
+ /* Parsed certificate data. */
+ const char* subject = NULL;
+ const char* issuer = NULL;
+ const char* fingerprint = NULL;
+ const apr_array_header_t* hostnames = NULL;
+
+ if (ascii_cert)
+ {
+ const svn_string_t* const der =
+ svn_base64_decode_string(ascii_cert, cb_scratch_pool);
+ svn_x509_certinfo_t* certinfo;
+ svn_error_t* err = svn_x509_parse_cert(
+ &certinfo, der->data, der->len,
+ cb_scratch_pool, cb_scratch_pool);
+ if (err)
+ {
+ // Ignore credentials that can't be parsed.
+ svn_error_clear(err);
+ return SVN_NO_ERROR;
+ }
+ else
+ {
+ subject = svn_x509_certinfo_get_subject(
+ certinfo, cb_scratch_pool);
+ issuer = svn_x509_certinfo_get_issuer(
+ certinfo, cb_scratch_pool);
+ fingerprint = svn_checksum_to_cstring_display(
+ svn_x509_certinfo_get_digest(certinfo),
+ cb_scratch_pool);
+ hostnames = svn_x509_certinfo_get_hostnames(certinfo);
+ }
+ }
bool match = (m_realm_pattern
&& !apr_fnmatch(m_realm_pattern, cb_realmstring, 0));
@@ -441,8 +445,8 @@ Java_org_apache_subversion_javahl_util_C
if (!match && m_hostname_pattern)
match = (match
- || (hostname
- && !apr_fnmatch(m_hostname_pattern, hostname, 0)));
+ || (hostnames
+ && match_array(m_hostname_pattern, hostnames)));
if (!match && m_text_pattern)
match = (match
@@ -450,16 +454,14 @@ Java_org_apache_subversion_javahl_util_C
&& !apr_fnmatch(m_text_pattern, username, 0))
|| (store
&& !apr_fnmatch(m_text_pattern, store, 0))
- || (hostname
- && !apr_fnmatch(m_text_pattern, hostname, 0))
+ || (subject
+ && !apr_fnmatch(m_text_pattern, subject, 0))
+ || (issuer
+ && !apr_fnmatch(m_text_pattern, issuer, 0))
|| (fingerprint
&& !apr_fnmatch(m_text_pattern, fingerprint, 0))
- || (valid_from
- && !apr_fnmatch(m_text_pattern, valid_from, 0))
- || (valid_until
- && !apr_fnmatch(m_text_pattern, valid_until, 0))
- || (issuer
- && !apr_fnmatch(m_text_pattern, issuer, 0)));
+ || (hostnames
+ && match_array(m_text_pattern, hostnames)));
if (match)
m_credentials.add(
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp Mon Feb 9 16:46:16 2015
@@ -291,7 +291,7 @@ Java_org_apache_subversion_javahl_util_P
pool.getPool()));
}
- Java::MutableList<JavaHL::ExternalItem> items(env, externals->nelts);
+ Java::List<JavaHL::ExternalItem> items(env, externals->nelts);
for (jint i = 0; i < externals->nelts; ++i)
{
// References to the newly created external items are stored
@@ -323,7 +323,7 @@ Java_org_apache_subversion_javahl_util_P
{
const Java::Env env(jenv);
- const Java::List<JavaHL::ExternalItem> items(env, jitems);
+ const Java::ImmutableList<JavaHL::ExternalItem> items(env, jitems);
const Java::String parent_dir(env, jparent_dir);
// Using a "global" iteration pool since we don't keep a context
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp Mon Feb 9 16:46:16 2015
@@ -118,6 +118,8 @@ Java_org_apache_subversion_javahl_util_S
jstring jurl, jstring jrepos_root_url,
jobject jdate, jstring jauthor)
{
+ typedef Java::Map<Java::ByteArray, jbyteArray> ByteArrayMap;
+
SVN_JAVAHL_JNI_TRY(SubstLib, buildKeywords)
{
const Java::Env env(jenv);
@@ -130,8 +132,7 @@ Java_org_apache_subversion_javahl_util_S
env, pool, jkeywords_value, jrevision,
jurl, jrepos_root_url, jdate, jauthor);
- Java::MutableMap<Java::ByteArray, jbyteArray>
- keywords(env, jint(apr_hash_count(kw)));
+ ByteArrayMap keywords(env, jint(apr_hash_count(kw)));
for (apr_hash_index_t* hi = apr_hash_first(pool.getPool(), kw);
hi; hi = apr_hash_next(hi))
{
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java Mon Feb 9 16:46:16 2015
@@ -71,13 +71,26 @@ public class ConflictDescriptor
*/
private ConflictVersion srcRightVersion;
- /** This constructor should only be called from JNI code. */
- public ConflictDescriptor(String path, Kind conflictKind, NodeKind nodeKind,
+ // Information about property conflicts. New in 1.9
+ private String propRejectAbspath;
+ private byte[] propValueBase;
+ private byte[] propValueWorking;
+ private byte[] propValueIncomingOld;
+ private byte[] propValueIncomingNew;
+
+
+ // Private constructor, only called from the JNI code.
+ private ConflictDescriptor(String path, Kind conflictKind, NodeKind nodeKind,
String propertyName, boolean isBinary, String mimeType,
Action action, Reason reason, Operation operation,
String basePath, String theirPath,
String myPath, String mergedPath,
- ConflictVersion srcLeft, ConflictVersion srcRight)
+ ConflictVersion srcLeft, ConflictVersion srcRight,
+ String propRejectAbspath, byte[] propValueBase,
+ byte[] propValueWorking,
+ byte[] propValueIncomingOld,
+ byte[] propValueIncomingNew)
+
{
this.path = path;
this.conflictKind = conflictKind;
@@ -94,6 +107,28 @@ public class ConflictDescriptor
this.operation = operation;
this.srcLeftVersion = srcLeft;
this.srcRightVersion = srcRight;
+ this.propRejectAbspath = propRejectAbspath;
+ this.propValueBase = propValueBase;
+ this.propValueWorking = propValueWorking;
+ this.propValueIncomingOld = propValueIncomingOld;
+ this.propValueIncomingNew = propValueIncomingNew;
+ }
+
+ /**
+ * This constructor should only be called from JNI code.
+ * @deprecated
+ */
+ @Deprecated
+ public ConflictDescriptor(String path, Kind conflictKind, NodeKind nodeKind,
+ String propertyName, boolean isBinary, String mimeType,
+ Action action, Reason reason, Operation operation,
+ String basePath, String theirPath,
+ String myPath, String mergedPath,
+ ConflictVersion srcLeft, ConflictVersion srcRight)
+ {
+ this(path, conflictKind, nodeKind, propertyName, isBinary, mimeType,
+ action, reason, operation, basePath, theirPath, myPath, mergedPath,
+ srcLeft, srcRight, null, null, null, null, null);
}
public String getPath()
@@ -171,6 +206,32 @@ public class ConflictDescriptor
return srcRightVersion;
}
+ public String getPropRejectAbspath()
+ {
+ return propRejectAbspath;
+ }
+
+ public byte[] getPropValueBase()
+ {
+ return propValueBase;
+ }
+
+ public byte[] getPropValueWorking()
+ {
+ return propValueWorking;
+ }
+
+ public byte[] getPropValueIncomingOld()
+ {
+ return propValueIncomingOld;
+ }
+
+ public byte[] getPropValueIncomingNew()
+ {
+ return propValueIncomingNew;
+ }
+
+
/**
* Rich man's enum for <code>svn_wc_conflict_kind_t</code>.
*/
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java Mon Feb 9 16:46:16 2015
@@ -261,12 +261,15 @@ public interface ISVNClient
* @param changelists changelists to filter by
* @param clearChangelists If set, will clear changelist association
* from the reverted paths.
+ * @param metadataOnly Revert just the metadata (including conflict data)
+ * and not the working files/dirs
* @throws ClientException
* @since 1.9
*/
void revert(Set<String> paths, Depth depth,
Collection<String> changelists,
- boolean clearChangelists)
+ boolean clearChangelists,
+ boolean metadataOnly)
throws ClientException;
/**
@@ -1323,12 +1326,28 @@ public interface ISVNClient
* information
* @param callback callback to receive the file content and the other
* information
+ * @param options additional options for controlling the output
* @throws ClientException
+ * @since 1.9
*/
void blame(String path, Revision pegRevision, Revision revisionStart,
Revision revisionEnd, boolean ignoreMimeType,
boolean includeMergedRevisions,
- BlameCallback callback) throws ClientException;
+ BlameCallback callback, DiffOptions options)
+ throws ClientException;
+
+ /**
+ * Retrieve the content together with the author, the revision and the date
+ * of the last change of each line
+ * <p>
+ * Behaves like the 1.9 version with <code>options</code> set to
+ * their default values.
+ */
+ void blame(String path, Revision pegRevision, Revision revisionStart,
+ Revision revisionEnd, boolean ignoreMimeType,
+ boolean includeMergedRevisions,
+ BlameCallback callback)
+ throws ClientException;
/**
* Set directory for the configuration information, taking the
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRemote.java Mon Feb 9 16:46:16 2015
@@ -599,13 +599,15 @@ public interface ISVNRemote
private FileRevision(String path, long revision,
boolean resultOfMerge,
Map<String, byte[]> revisionProperties,
- Map<String, byte[]> propertiesDelta)
+ Map<String, byte[]> propertiesDelta,
+ boolean textDelta)
{
this.path = path;
this.revision = revision;
this.resultOfMerge = resultOfMerge;
this.revisionProperties = revisionProperties;
this.propertiesDelta = propertiesDelta;
+ this.textDelta = textDelta;
}
/**
@@ -643,11 +645,17 @@ public interface ISVNRemote
return propertiesDelta;
}
+ /**
+ * @return A flag indicating that this revision has a text delta.
+ */
+ public boolean hasTextDelta() { return textDelta; }
+
private String path;
private long revision;
private boolean resultOfMerge;
private Map<String, byte[]> revisionProperties;
private Map<String, byte[]> propertiesDelta;
+ private boolean textDelta;
}
/**
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java Mon Feb 9 16:46:16 2015
@@ -194,21 +194,22 @@ public class SVNClient implements ISVNCl
public native void revert(Set<String> paths, Depth depth,
Collection<String> changelists,
- boolean clearChangelists)
+ boolean clearChangelists,
+ boolean metadataOnly)
throws ClientException;
public void revert(Set<String> paths, Depth depth,
Collection<String> changelists)
throws ClientException
{
- revert(paths, depth, changelists, false);
+ revert(paths, depth, changelists, false, false);
}
public void revert(String path, Depth depth,
Collection<String> changelists)
throws ClientException
{
- revert(Collections.singleton(path), depth, changelists, false);
+ revert(Collections.singleton(path), depth, changelists, false, false);
}
public native void add(String path, Depth depth, boolean force,
@@ -651,11 +652,23 @@ public class SVNClient implements ISVNCl
boolean ignoreExternals)
throws ClientException;
+ public void blame(String path, Revision pegRevision,
+ Revision revisionStart,
+ Revision revisionEnd, boolean ignoreMimeType,
+ boolean includeMergedRevisions,
+ BlameCallback callback)
+ throws ClientException
+ {
+ blame(path, pegRevision, revisionStart, revisionEnd, ignoreMimeType,
+ includeMergedRevisions, callback, null);
+ }
+
public native void blame(String path, Revision pegRevision,
Revision revisionStart,
Revision revisionEnd, boolean ignoreMimeType,
boolean includeMergedRevisions,
- BlameCallback callback)
+ BlameCallback callback,
+ DiffOptions options)
throws ClientException;
public native void setConfigDirectory(String configDir)
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNUtil.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNUtil.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNUtil.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNUtil.java Mon Feb 9 16:46:16 2015
@@ -466,11 +466,12 @@ public class SVNUtil
* otherwise, only those credentials that have a username,
* and where the username matches the pattern, will be
* returned.
- * @param hostnamePattern A glob pattern for the hostname (CN) of
- * a server certificate; if <code>null</code>, all credntials
- * will be considered; otherwise, only those credentials
- * that have a server certificate with a hostname that
- * matches the pattern will be returned.
+ * @param hostnamePattern A glob pattern for the hostnames of a
+ * server certificate; if <code>null</code>, all
+ * credntials will be considered; otherwise, only
+ * those credentials that have a server certificate
+ * with a hostname that matches the pattern will be
+ * returned.
* @param textPattern A glob pattern that must match any textual
* information in a credential, for example, a realm,
* username, certificate details, etc; passwords, passphrases
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/AuthnCallback.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/AuthnCallback.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/AuthnCallback.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/AuthnCallback.java Mon Feb 9 16:46:16 2015
@@ -23,6 +23,8 @@
package org.apache.subversion.javahl.callback;
+import java.util.Date;
+import java.util.List;
import java.util.logging.Logger;
/**
@@ -243,74 +245,84 @@ public interface AuthnCallback
private static final long serialVersionUID = 1L;
/**
- * @return The primary CN of the certificate.
+ * @return The subject of the certificate.
*/
- public String getHostname()
+ public String getSubject()
{
- return hostname;
+ return subject;
}
/**
- * @return The text representation of the certificate fingerprint.
+ * @return The certificate issuer.
*/
- public String getFingerprint()
+ public String getIssuer()
{
- return fingerprint;
+ return issuer;
}
/**
- * @return The text represent representation of the date from
- * which the certificate is valid.
+ * @return The from which the certificate is valid.
*/
- public String getValidFrom()
+ public Date getValidFrom()
{
return validFrom;
}
/**
- * @return The text represent representation of the date after
- * which the certificate is no longer valid.
+ * @return The date after which the certificate is no longer valid.
*/
- public String getValidUntil()
+ public Date getValidTo()
{
- return validUntil;
+ return validTo;
}
/**
- * @return The DN of the certificate issuer.
+ * @return The certificate fingerprint.
*/
- public String getIssuer()
+ public byte[] getFingerprint()
{
- return issuer;
+ return fingerprint;
}
/**
- * @return the Base64-encoded DER representation of the certificate.
+ * @return A list of host names that the certificate represents.
*/
- public String getDER()
+ public List<String> getHostnames()
{
- return der;
+ return hostnames;
+ }
+
+ /**
+ * @return the Base64-encoded raw certificate data.
+ */
+ public String getCert()
+ {
+ return asciiCert;
}
/* This private constructor is used by the native implementation. */
- private SSLServerCertInfo(String hostname, String fingerprint,
- String validFrom, String validUntil,
- String issuer, String der)
+ private SSLServerCertInfo(String subject, String issuer,
+ long validFrom, long validTo,
+ byte[] fingerprint,
+ List<String> hostnames,
+ String asciiCert)
{
- this.hostname = hostname;
- this.fingerprint = fingerprint;
- this.validFrom = validFrom;
- this.validUntil = validUntil;
+ this.subject = subject;
this.issuer = issuer;
- this.der = der;
+ this.validFrom = new Date(validFrom);
+ this.validTo = new Date(validTo);
+ this.fingerprint = fingerprint;
+ this.hostnames = hostnames;
+ this.asciiCert = asciiCert;
}
- private String hostname;
- private String fingerprint;
- private String validFrom;
- private String validUntil;
+ private String subject;
private String issuer;
- private String der;
+ private Date validFrom;
+ private Date validTo;
+ private byte[] fingerprint;
+ private List<String> hostnames;
+ private String asciiCert;
}
/**
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/util/ConfigLib.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/util/ConfigLib.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/util/ConfigLib.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/src/org/apache/subversion/javahl/util/ConfigLib.java Mon Feb 9 16:46:16 2015
@@ -81,48 +81,6 @@ public class ConfigLib
return nativeRemoveCredential(configDir, kind.toString(), realm);
}
- ///** @see SVNUtil.addCredential */
- //public SVNUtil.Credential addCredential(String configDir,
- // SVNUtil.Credential credential,
- // boolean replace)
- // throws ClientException, SubversionException
- //{
- // final SVNUtil.Credential.Kind kind = credential.getKind();
- //
- // final String username =
- // ((kind == SVNUtil.Credential.Kind.username
- // || kind == SVNUtil.Credential.Kind.simple)
- // ? credential.getUsername() : null);
- //
- // final String password =
- // (kind == SVNUtil.Credential.Kind.simple
- // ? credential.getPassword() : null);
- //
- // final AuthnCallback.SSLServerCertInfo sci =
- // (kind == SVNUtil.Credential.Kind.sslServer
- // ? credential.getServerCertInfo() : null);
- //
- // final AuthnCallback.SSLServerCertFailures scf =
- // (kind == SVNUtil.Credential.Kind.sslServer
- // ? credential.getServerCertFailures() : null);
- //
- // final String passphrase =
- // (kind == SVNUtil.Credential.Kind.sslClientPassphrase
- // ? credential.getClientCertPassphrase() : null);
- //
- // return nativeAddCredential(configDir, kind.toString(),
- // credential.getRealm(),
- // username, password,
- // (sci != null ? sci.getHostname() : null),
- // (sci != null ? sci.getFingerprint() : null),
- // (sci != null ? sci.getValidFrom() : null),
- // (sci != null ? sci.getValidUntil() : null),
- // (sci != null ? sci.getIssuer() : null),
- // (sci != null ? sci.getDER() : null),
- // (scf != null ? scf.getFailures() : 0),
- // passphrase);
- //}
-
/** @see SVNUtil.searchCredentials */
public List<SVNUtil.Credential>
searchCredentials(String configDir,
@@ -151,22 +109,6 @@ public class ConfigLib
String realm)
throws ClientException, SubversionException;
- //private native SVNUtil.Credential
- // nativeAddCredential(String configDir,
- // String kind,
- // String realm,
- // String username,
- // String password,
- // String serverCertHostname,
- // String serverCertFingerprint,
- // String serverCertValidFrom,
- // String serverCertValidUntil,
- // String serverCertIssuer,
- // String serverCertDER,
- // int serverCertFailures,
- // String clientCertPassphrase)
- // throws ClientException, SubversionException;
-
private native List<SVNUtil.Credential>
nativeSearchCredentials(String configDir,
String kind,
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Mon Feb 9 16:46:16 2015
@@ -259,7 +259,7 @@ public class BasicTests extends SVNTests
tempclient.dispose();
// create Y and Y/Z directories in the repository
- addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.none,
+ addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.dir,
CommitItemStateFlags.Add);
Set<String> urls = new HashSet<String>(1);
urls.add(thisTest.getUrl() + "/Y");
@@ -1004,9 +1004,9 @@ public class BasicTests extends SVNTests
OneTest thisTest = new OneTest();
// create Y and Y/Z directories in the repository
- addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.none,
+ addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.dir,
CommitItemStateFlags.Add);
- addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y/Z", NodeKind.none,
+ addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y/Z", NodeKind.dir,
CommitItemStateFlags.Add);
Set<String> urls = new HashSet<String>(2);
urls.add(thisTest.getUrl() + "/Y");
@@ -3885,11 +3885,46 @@ public class BasicTests extends SVNTests
false, false, callback);
assertEquals(1, callback.numberOfLines());
BlameCallbackImpl.BlameLine line = callback.getBlameLine(0);
- if (line != null)
- {
- assertEquals(1, line.getRevision());
- assertEquals("jrandom", line.getAuthor());
+ assertNotNull(line);
+ assertEquals(1, line.getRevision());
+ assertEquals("jrandom", line.getAuthor());
+ assertEquals("This is the file 'iota'.", line.getLine());
+ }
+
+ /**
+ * Test blame with diff options.
+ * @since 1.9
+ */
+ public void testBlameWithDiffOptions() throws Throwable
+ {
+ OneTest thisTest = new OneTest();
+ // Modify the file iota, making only whitespace changes.
+ File iota = new File(thisTest.getWorkingCopy(), "iota");
+ FileOutputStream stream = new FileOutputStream(iota, false);
+ stream.write("This is the file 'iota'.\t".getBytes());
+ stream.close();
+ Set<String> srcPaths = new HashSet<String>(1);
+ srcPaths.add(thisTest.getWCPath());
+ try {
+ client.username("rayjandom");
+ client.commit(srcPaths, Depth.infinity, false, false, null, null,
+ new ConstMsg("Whitespace-only change in /iota"), null);
+ } finally {
+ client.username("jrandom");
}
+
+ // Run blame on the result
+ BlameCallbackImpl callback = new BlameCallbackImpl();
+ client.blame(thisTest.getWCPath() + "/iota", Revision.HEAD,
+ Revision.getInstance(1), Revision.HEAD,
+ false, false, callback,
+ new DiffOptions(DiffOptions.Flag.IgnoreWhitespace));
+ assertEquals(1, callback.numberOfLines());
+ BlameCallbackImpl.BlameLine line = callback.getBlameLine(0);
+ assertNotNull(line);
+ assertEquals(1, line.getRevision());
+ assertEquals("jrandom", line.getAuthor());
+ assertEquals("This is the file 'iota'.\t", line.getLine());
}
/**
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java Mon Feb 9 16:46:16 2015
@@ -1398,6 +1398,7 @@ public class SVNRemoteTests extends SVNT
ISVNRemote.FileRevision rev = result.get(0);
assertEquals("/iota", rev.getPath());
assertFalse(rev.isResultOfMerge());
+ assertTrue(rev.hasTextDelta());
}
// This test is a result of a threading bug that was identified in
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Mon Feb 9 16:46:16 2015
@@ -257,10 +257,11 @@ class SVNTests extends TestCase
greekRepos = new File(localTmp, "repos");
greekDump = new File(localTmp, "greek_dump");
admin.create(greekRepos, true,false, null, this.fsType);
- addExpectedCommitItem(greekFiles.getAbsolutePath(), null, null,
- NodeKind.none, CommitItemStateFlags.Add);
+ addExpectedCommitItem(greekFiles.getAbsolutePath(),
+ makeReposUrl(greekRepos).toString(), null,
+ NodeKind.dir, CommitItemStateFlags.Add);
client.doImport(greekFiles.getAbsolutePath(),
- makeReposUrl(greekRepos).toString(),
+ makeReposUrl(greekRepos).toString(),
Depth.infinity, false, false, null,
new MyCommitMessage(), null);
admin.dump(greekRepos, new FileOutputStream(greekDump),
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.java Mon Feb 9 16:46:16 2015
@@ -627,16 +627,41 @@ public class UtilTests extends SVNTests
private static final String util_cred_ssl_server =
"K 10\n" +
"ascii_cert\n" +
- "V 12\n" +
- "NotTelling==\n" +
+ "V 1616\n" +
+ "MIIEtzCCA5+gAwIBAgIQWGBOrapkezd+BWVsAtmtmTANBgkqhkiG9w0BAQsFADA8" +
+ "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMVGhhd3RlLCBJbmMuMRYwFAYDVQQDEw1U" +
+ "aGF3dGUgU1NMIENBMB4XDTE0MDQxMTAwMDAwMFoXDTE2MDQwNzIzNTk1OVowgYsx" +
+ "CzAJBgNVBAYTAlVTMREwDwYDVQQIEwhNYXJ5bGFuZDEUMBIGA1UEBxQLRm9yZXN0" +
+ "IEhpbGwxIzAhBgNVBAoUGkFwYWNoZSBTb2Z0d2FyZSBGb3VuZGF0aW9uMRcwFQYD" +
+ "VQQLFA5JbmZyYXN0cnVjdHVyZTEVMBMGA1UEAxQMKi5hcGFjaGUub3JnMIIBIjAN" +
+ "BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Tq4mH+stRoxe4xth8tUCgLt+P4L" +
+ "D/JWZz4a2IecaaAk57vIlTxEyP16fUShUfxVJnD0KV11zv2qaEUXNaA6hKd4H/oB" +
+ "u2OyGev+quRM+aFCjWqASkXt7fLGsIkHAwP3XwBVBpARbcXJeCjCBxqaYrQqS8LT" +
+ "wfPUD9eYncGlQ+ixb3Bosy7TmkWKeLsRdS90cAO/rdgQ8OI7kLT/1tr5GpF9RmXo" +
+ "RnVqMP+U0zGd/BNNSneg7emb7TxLzxeMKZ7QbF4MZi8RRN11spvx8/f92CiYrGGu" +
+ "y67VdOGPaomYc+VZ2syLwduHGK40ADrEK3+MQpsRFB0dM08j9bhpr5A44wIDAQAB" +
+ "o4IBYzCCAV8wFwYDVR0RBBAwDoIMKi5hcGFjaGUub3JnMAkGA1UdEwQCMAAwQgYD" +
+ "VR0gBDswOTA3BgpghkgBhvhFAQc2MCkwJwYIKwYBBQUHAgEWG2h0dHBzOi8vd3d3" +
+ "LnRoYXd0ZS5jb20vY3BzLzAOBgNVHQ8BAf8EBAMCBaAwHwYDVR0jBBgwFoAUp6KD" +
+ "uzRFQD381TBPErk+oQGf9tswOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDovL3N2ci1v" +
+ "di1jcmwudGhhd3RlLmNvbS9UaGF3dGVPVi5jcmwwHQYDVR0lBBYwFAYIKwYBBQUH" +
+ "AwEGCCsGAQUFBwMCMGkGCCsGAQUFBwEBBF0wWzAiBggrBgEFBQcwAYYWaHR0cDov" +
+ "L29jc3AudGhhd3RlLmNvbTA1BggrBgEFBQcwAoYpaHR0cDovL3N2ci1vdi1haWEu" +
+ "dGhhd3RlLmNvbS9UaGF3dGVPVi5jZXIwDQYJKoZIhvcNAQELBQADggEBAF52BLvl" +
+ "x5or9/aO7+cPhxuPxwiNRgbvHdCakD7n8vzjNyct9fKp6/XxB6GQiTZ0nZPJOyIu" +
+ "Pi1QDLKOXvaPeLKDBilL/+mrn/ev3s/aRQSrUsieKDoQnqtmlxEHc/T3+Ni/RZob" +
+ "PD4GzPuNKpK3BIc0fk/95T8R1DjBSQ5/clvkzOKtcl3VffAwnHiE9TZx9js7kZwO" +
+ "b9nOKX8DFao3EpQcS7qn63Ibzbq5A6ry8ZNRQSIJK/xlCAWoyUd1uxnqGFnus8wb" +
+ "9RVZJQe8YvyytBjgbE3QjnfPOxoEJA3twupnPmH+OCTM6V3TZqpRZj/sZ5rtIQ++" +
+ "hI5FdJWUWVSgnSw=\n" +
"K 8\n" +
"failures\n" +
"V 1\n" +
"8\n" +
"K 15\n" +
"svn:realmstring\n" +
- "V 27\n" +
- "https://svn.example.com:443\n" +
+ "V 26\n" +
+ "https://svn.apache.org:443\n" +
"END\n";
private static final String util_cred_ssl_client_passphrase =
@@ -717,9 +742,12 @@ public class UtilTests extends SVNTests
/* one SSL server trust credential */
cred = SVNUtil.getCredential(configDir,
SVNUtil.Credential.Kind.sslServer,
- "https://svn.example.com:443");
+ "https://svn.apache.org:443");
assertNotNull(cred);
- assertEquals(cred.getServerCertInfo().getDER(), "NotTelling==");
+ assertEquals(cred.getServerCertInfo().getSubject(),
+ "C=US, ST=Maryland, L=Forest Hill, " +
+ "O=Apache Software Foundation, OU=Infrastructure, " +
+ "CN=*.apache.org");
/* one SSL client passphrase credential */
cred = SVNUtil.getCredential(configDir,
@@ -764,10 +792,16 @@ public class UtilTests extends SVNTests
assertNotNull(creds);
assertEquals(creds.size(), 2);
+ /* search with match on subvject */
+ creds = SVNUtil.searchCredentials(configDir, null,
+ null, null, "\\*.apache.org", null);
+ assertNotNull(creds);
+ assertEquals(creds.size(), 1);
+
/* search with match on realm */
creds = SVNUtil.searchCredentials(configDir, null,
"*example*", null, null, null);
assertNotNull(creds);
- assertEquals(creds.size(), 4);
+ assertEquals(creds.size(), 3);
}
}
Modified: subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java Mon Feb 9 16:46:16 2015
@@ -232,8 +232,9 @@ class SVNTests extends TestCase
greekDump = new File(localTmp, "greek_dump");
admin.create(greekRepos.getAbsolutePath(), true,false, null,
this.fsType);
- addExpectedCommitItem(greekFiles.getAbsolutePath(), null, null,
- NodeKind.none, CommitItemStateFlags.Add);
+ addExpectedCommitItem(greekFiles.getAbsolutePath(),
+ makeReposUrl(greekRepos).toString(), null,
+ NodeKind.dir, CommitItemStateFlags.Add);
client.doImport(greekFiles.getAbsolutePath(), makeReposUrl(greekRepos),
null, true );
admin.dump(greekRepos.getAbsolutePath(), new FileOutputer(greekDump),
Modified: subversion/branches/move-tracking-2/subversion/bindings/swig/core.i
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/swig/core.i?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/swig/core.i (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/swig/core.i Mon Feb 9 16:46:16 2015
@@ -800,10 +800,11 @@ core_set_current_pool (apr_pool_t *pool)
#endif
#ifdef SWIGPYTHON
-# The auth baton depends on the providers, so we preserve a
-# reference to them inside the wrapper. This way, if all external
-# references to the providers are gone, they will still be alive,
-# keeping the baton valid.
+/* The auth baton depends on the providers, so we preserve a
+ reference to them inside the wrapper. This way, if all external
+ references to the providers are gone, they will still be alive,
+ keeping the baton valid.
+ */
%feature("pythonappend") svn_auth_open %{
val.__dict__["_deps"] = list(args[0])
%}
Modified: subversion/branches/move-tracking-2/subversion/bindings/swig/ruby/test/test_client.rb
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/swig/ruby/test/test_client.rb?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/swig/ruby/test/test_client.rb (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/swig/ruby/test/test_client.rb Mon Feb 9 16:46:16 2015
@@ -2243,8 +2243,8 @@ class SvnClientTest < Test::Unit::TestCa
items = nil
ctx.cp(path, repos_uri2)
- assert_equal([nil], items.collect {|item| item.wcprop_changes})
- assert_equal([nil], items.collect {|item| item.incoming_prop_changes})
+ assert_equal([[]], items.collect {|item| item.wcprop_changes})
+ assert_equal([[]], items.collect {|item| item.incoming_prop_changes})
assert_equal([nil], items.collect {|item| item.outgoing_prop_changes})
end
end
Modified: subversion/branches/move-tracking-2/subversion/bindings/swig/svn_delta.i
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/swig/svn_delta.i?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/bindings/swig/svn_delta.i (original)
+++ subversion/branches/move-tracking-2/subversion/bindings/swig/svn_delta.i Mon Feb 9 16:46:16 2015
@@ -205,11 +205,11 @@ void _ops_get(int *num_ops, const svn_tx
%include svn_delta_h.swg
#ifdef SWIGPYTHON
-%pythoncode {
+%pythoncode %{
# This function is for backwards compatibility only.
# Use svn_txdelta_window_t.ops instead.
svn_txdelta_window_t_ops_get = svn_txdelta_window_t._ops_get
-}
+%}
#endif
#ifdef SWIGRUBY
Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_auth_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_auth_private.h?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_auth_private.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_auth_private.h Mon Feb 9 16:46:16 2015
@@ -231,6 +231,14 @@ svn_auth__ssl_client_cert_pw_set(svn_boo
svn_boolean_t non_interactive,
apr_pool_t *pool);
+/* Apply the specified configuration for connecting with SERVER_NAME
+ to the auth baton */
+svn_error_t *
+svn_auth__apply_config_for_server(svn_auth_baton_t *ab,
+ apr_hash_t *config,
+ const char *server_name,
+ apr_pool_t *scratch_pool);
+
#if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN)
/**
* Set @a *provider to an authentication provider that implements
Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_ra_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_ra_private.h?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_ra_private.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_ra_private.h Mon Feb 9 16:46:16 2015
@@ -40,6 +40,33 @@
extern "C" {
#endif /* __cplusplus */
+
+
+/**
+ * Open a new ra session @a *new_session to the same repository as an existing
+ * ra session @a old_session, copying the callbacks, auth baton, etc. from the
+ * old session. This essentially limits the lifetime of the new, duplicated
+ * session to the lifetime of the old session. If the new session should
+ * outlive the new session, creating a new session using svn_ra_open4() is
+ * recommended.
+ *
+ * If @a session_url is not NULL, parent the new session at session_url. Note
+ * that @a session_url MUST BE in the same repository as @a old_session or an
+ * error will be returned. When @a session_url NULL the same session root
+ * will be used.
+ *
+ * Allocate @a new_session in @a result_pool. Perform temporary allocations
+ * in @a scratch_pool.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_ra__dup_session(svn_ra_session_t **new_session,
+ svn_ra_session_t *old_session,
+ const char *session_url,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/* Equivalent to svn_ra__assert_capable_server()
for SVN_RA_CAPABILITY_MERGEINFO. */
svn_error_t *
Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_repos_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_repos_private.h?rev=1658462&r1=1658461&r2=1658462&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_repos_private.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_repos_private.h Mon Feb 9 16:46:16 2015
@@ -293,6 +293,51 @@ svn_repos__adjust_mergeinfo_property(svn
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* A header entry.
+ *
+ * (The headers are currently declared here to be of type apr_array_header_t
+ * with svn_repos__dumpfile_header_entry_t entries, but the types could
+ * instead be made opaque.)
+ */
+typedef struct svn_repos__dumpfile_header_entry_t {
+ const char *key, *val;
+} svn_repos__dumpfile_header_entry_t;
+
+/* Create an empty set of headers.
+ */
+apr_array_header_t *
+svn_repos__dumpfile_headers_create(apr_pool_t *pool);
+
+/* Push the header (KEY, VAL) onto HEADERS.
+ *
+ * Duplicate the key and value into HEADERS's pool.
+ */
+void
+svn_repos__dumpfile_header_push(apr_array_header_t *headers,
+ const char *key,
+ const char *val);
+
+/* Push the header (KEY, val = VAL_FMT ...) onto HEADERS.
+ *
+ * Duplicate the key and value into HEADERS's pool.
+ */
+void
+svn_repos__dumpfile_header_pushf(apr_array_header_t *headers,
+ const char *key,
+ const char *val_fmt,
+ ...)
+ __attribute__((format(printf, 3, 4)));
+
+/* Write to STREAM the headers in HEADERS followed by a blank line.
+ *
+ * HEADERS is an array of struct {const char *key, *val;}.
+ */
+svn_error_t *
+svn_repos__dump_headers(svn_stream_t *stream,
+ apr_array_header_t *headers,
+ svn_boolean_t terminate,
+ apr_pool_t *scratch_pool);
+
/* Write a revision record to DUMP_STREAM for revision REVISION with revision
* properies REVPROPS, creating appropriate headers.
*
@@ -318,6 +363,34 @@ svn_repos__dump_revision_record(svn_stre
svn_boolean_t props_section_always,
apr_pool_t *scratch_pool);
+/* Output node headers and props.
+ *
+ * Output HEADERS, content length headers, blank line, and
+ * then PROPS_STR (if non-null) to DUMP_STREAM.
+ *
+ * HEADERS is an array of headers as struct {const char *key, *val;}.
+ * Write them all in the given order.
+ *
+ * PROPS_STR is the property content block, including a terminating
+ * 'PROPS_END\n' line. Iff PROPS_STR is non-null, write a
+ * Prop-content-length header and the prop content block.
+ *
+ * Iff HAS_TEXT is true, write a Text-content length, using the value
+ * TEXT_CONTENT_LENGTH.
+ *
+ * Write a Content-length header, its value being the sum of the
+ * Prop- and Text- content length headers, if props and/or text are present
+ * or if CONTENT_LENGTH_ALWAYS is true.
+ */
+svn_error_t *
+svn_repos__dump_node_record(svn_stream_t *dump_stream,
+ apr_array_header_t *headers,
+ svn_stringbuf_t *props_str,
+ svn_boolean_t has_text,
+ svn_filesize_t text_content_length,
+ svn_boolean_t content_length_always,
+ apr_pool_t *scratch_pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */