You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gb...@apache.org on 2013/08/21 18:09:52 UTC
svn commit: r1516196 [5/26] - in
/subversion/branches/invoke-diff-cmd-feature: ./ build/ build/ac-macros/
build/generator/ build/generator/swig/ build/generator/templates/
contrib/client-side/emacs/ contrib/hook-scripts/ doc/programmer/ notes/
notes/ht...
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp Wed Aug 21 16:09:43 2013
@@ -50,7 +50,7 @@
#include "ImportFilterCallback.h"
#include "ChangelistCallback.h"
#include "StringArray.h"
-#include "RevpropTable.h"
+#include "PropertyTable.h"
#include "VersionExtended.h"
#include "DiffOptions.h"
#include "svn_version.h"
@@ -384,7 +384,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- RevpropTable revprops(jrevpropTable);
+ PropertyTable revprops(jrevpropTable);
if (JNIUtil::isExceptionThrown())
return;
@@ -498,7 +498,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- RevpropTable revprops(jrevpropTable);
+ PropertyTable revprops(jrevpropTable);
if (JNIUtil::isExceptionThrown())
return;
@@ -539,7 +539,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- RevpropTable revprops(jrevpropTable);
+ PropertyTable revprops(jrevpropTable);
if (JNIUtil::isExceptionThrown())
return;
@@ -577,7 +577,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- RevpropTable revprops(jrevpropTable);
+ PropertyTable revprops(jrevpropTable);
if (JNIUtil::isExceptionThrown())
return;
@@ -610,7 +610,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- RevpropTable revprops(jrevpropTable);
+ PropertyTable revprops(jrevpropTable);
if (JNIUtil::isExceptionThrown())
return;
@@ -660,7 +660,8 @@ JNIEXPORT jlong JNICALL
Java_org_apache_subversion_javahl_SVNClient_doExport
(JNIEnv *env, jobject jthis, jstring jsrcPath, jstring jdestPath,
jobject jrevision, jobject jpegRevision, jboolean jforce,
- jboolean jignoreExternals, jobject jdepth, jstring jnativeEOL)
+ jboolean jignoreExternals, jboolean jignoreKeywords,
+ jobject jdepth, jstring jnativeEOL)
{
JNIEntry(SVNClient, doExport);
SVNClient *cl = SVNClient::getCppObject(jthis);
@@ -690,7 +691,9 @@ Java_org_apache_subversion_javahl_SVNCli
return -1;
return cl->doExport(srcPath, destPath, revision, pegRevision,
- jforce ? true : false, jignoreExternals ? true : false,
+ jforce ? true : false,
+ jignoreExternals ? true : false,
+ jignoreKeywords ? true : false,
EnumMapper::toDepth(jdepth), nativeEOL);
}
@@ -758,7 +761,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- RevpropTable revprops(jrevpropTable);
+ PropertyTable revprops(jrevpropTable);
if (JNIUtil::isExceptionThrown())
return;
@@ -1009,7 +1012,7 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- RevpropTable revprops(jrevpropTable);
+ PropertyTable revprops(jrevpropTable);
if (JNIUtil::isExceptionThrown())
return;
@@ -1631,6 +1634,21 @@ Java_org_apache_subversion_javahl_SVNCli
cl->getClientContext().setConfigDirectory(configDir);
}
+JNIEXPORT void JNICALL
+Java_org_apache_subversion_javahl_SVNClient_setConfigEventHandler
+(JNIEnv *env, jobject jthis, jobject jconfigHandler)
+{
+ JNIEntry(SVNClient, setConfigDirectory);
+ SVNClient *cl = SVNClient::getCppObject(jthis);
+ if (cl == NULL)
+ {
+ JNIUtil::throwError(_("bad C++ this"));
+ return;
+ }
+
+ cl->getClientContext().setConfigCallback(jconfigHandler);
+}
+
JNIEXPORT jstring JNICALL
Java_org_apache_subversion_javahl_SVNClient_getConfigDirectory
(JNIEnv *env, jobject jthis)
@@ -1851,3 +1869,22 @@ Java_org_apache_subversion_javahl_SVNCli
jreverse ? true : false, jignoreWhitespace ? true : false,
jremoveTempfiles ? true : false, &callback);
}
+
+JNIEXPORT jobject JNICALL
+Java_org_apache_subversion_javahl_SVNClient_nativeOpenRemoteSession
+(JNIEnv *env, jobject jthis, jstring jpath, jint jretryAttempts)
+{
+ JNIEntry(SVNClient, openRemoteSession);
+ SVNClient *cl = SVNClient::getCppObject(jthis);
+ if (cl == NULL)
+ {
+ JNIUtil::throwError("bad C++ this");
+ return NULL;
+ }
+
+ JNIStringHolder path(jpath);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
+
+ return cl->openRemoteSession(path, jretryAttempts);
+}
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientException.java
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientException.java?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientException.java (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientException.java Wed Aug 21 16:09:43 2013
@@ -22,6 +22,7 @@
*/
package org.apache.subversion.javahl;
+import java.util.List;
/**
* This exception is thrown whenever something goes wrong in the
@@ -36,7 +37,54 @@ public class ClientException extends Nat
// http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf
// http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/version.html#6678
// http://java.sun.com/javase/6/docs/platform/serialization/spec/version.html#6678
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
+
+ /**
+ * Describes a single error message in a stack of messages
+ * associated with this exception.
+ * @since 1.9
+ */
+ public static final class ErrorMessage
+ {
+ ErrorMessage(int code, String message, boolean generic)
+ {
+ this.code = code;
+ this.message = message;
+ this.generic = generic;
+ }
+
+ /** @return The APR error code associated with the message. */
+ public final int getCode() { return code; }
+
+ /** @return The error message text. */
+ public final String getMessage() { return message; }
+
+ /** @return A flag indicating whether this is a generic
+ message for the APR error code, or a more specific message
+ generated by the native libraries. */
+ public final boolean isGeneric() { return generic; }
+
+ private final int code;
+ private final String message;
+ private final boolean generic;
+ };
+
+ /**
+ * This constructor is only used by the native library.
+ *
+ * @param message A description of the problem.
+ * @param source The error's source.
+ * @param aprError Any associated APR error code for a wrapped
+ * <code>svn_error_t</code>.
+ * @param messageStack The whole stack of error messages
+ * @since 1.9
+ */
+ ClientException(String message, String source, int aprError,
+ List<ErrorMessage> messageStack)
+ {
+ super(message, source, aprError);
+ this.messageStack = messageStack;
+ }
/**
* This constructor is only used by the native library.
@@ -48,7 +96,12 @@ public class ClientException extends Nat
*/
ClientException(String message, String source, int aprError)
{
- super(message, source, aprError);
+ this(message, source, aprError, null);
+ }
+
+ public List<ErrorMessage> getAllMessages()
+ {
+ return messageStack;
}
/**
@@ -68,4 +121,6 @@ public class ClientException extends Nat
return new ClientException(t.getMessage(), null, -1);
}
}
+
+ private final List<ErrorMessage> messageStack;
}
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java Wed Aug 21 16:09:43 2013
@@ -221,6 +221,10 @@ public interface ISVNClient
/**
* Adds a file to the repository.
+ * <p>
+ * <b>Note:</b> Behaves like the 1.8 version with
+ * <code>noAutoProps</code> set to <code>false</code>.
+ *
* @param path path to be added.
* @param depth the depth to recurse into subdirectories
* @param force if adding a directory and recurse true and path is a
@@ -229,7 +233,6 @@ public interface ISVNClient
* ignore patterns
* @param addParents add any intermediate parents to the working copy
* @throws ClientException
- * @note this method behaves like the 1.8 version with noAutoProps=false
*/
void add(String path, Depth depth, boolean force, boolean noIgnores,
boolean addParents)
@@ -399,6 +402,31 @@ public interface ISVNClient
* @param depth how deep to recurse in subdirectories
* @param nativeEOL which EOL characters to use during export
* @throws ClientException
+ * @since 1.9
+ */
+ long doExport(String srcPath, String destPath, Revision revision,
+ Revision pegRevision, boolean force,
+ boolean ignoreExternals, boolean ignoreKeywords,
+ Depth depth, String nativeEOL)
+ throws ClientException;
+
+ /**
+ * Exports the contents of either a subversion repository into a
+ * 'clean' directory (meaning a directory with no administrative
+ * directories).
+ * <p>
+ * <b>Note:</b> Behaves like the 1.9 version with
+ * ignoreKeywords set to false.
+ *
+ * @param srcPath the url of the repository path to be exported
+ * @param destPath a destination path that must not already exist.
+ * @param revision the revsion to be exported
+ * @param pegRevision the revision to interpret srcPath
+ * @param force set if it is ok to overwrite local files
+ * @param ignoreExternals ignore external during export
+ * @param depth how deep to recurse in subdirectories
+ * @param nativeEOL which EOL characters to use during export
+ * @throws ClientException
*/
long doExport(String srcPath, String destPath, Revision revision,
Revision pegRevision, boolean force, boolean ignoreExternals,
@@ -457,6 +485,10 @@ public interface ISVNClient
/**
* Import a file or directory into a repository directory at
* head.
+ * <p>
+ * <b>Note:</b> Behaves like the 1.8 version with noAutoProps
+ * set to false and without the filtering option.
+ *
* @param path the local path
* @param url the target url
* @param depth depth to traverse into subdirectories
@@ -469,8 +501,6 @@ public interface ISVNClient
* @param handler the commit message callback
* @param callback the commit status callback
* @throws ClientException
- * @note this method behaves like the 1.8 version with noAutoProps=false
- * and without the filtering option.
*/
void doImport(String path, String url, Depth depth,
boolean noIgnore, boolean ignoreUnknownNodeTypes,
@@ -513,6 +543,9 @@ public interface ISVNClient
/**
* Merge changes from two paths into a new local path.
+ * <p>
+ * <b>Note:</b> Behaves like the 1.8 version where ignoreAncestry
+ * maps to both ignoreMergeinfo and diffIgnoreAncestry
*
* @param path1 first path or url
* @param revision1 first revision
@@ -525,8 +558,6 @@ public interface ISVNClient
* @param dryRun do not change anything
* @param recordOnly record mergeinfo but do not run merge
* @throws ClientException
- * @note Behaves like the 1.8 where ignoreAncestry maps to
- * both ignoreMergeinfo and diffIgnoreAncestry
*/
void merge(String path1, Revision revision1, String path2,
Revision revision2, String localPath, boolean force, Depth depth,
@@ -557,6 +588,10 @@ public interface ISVNClient
/**
* Merge set of revisions into a new local path.
+ * <p>
+ * <b>Note:</b> Behaves like the 1.8 version where ignoreAncestry
+ * maps to both ignoreMergeinfo and diffIgnoreAncestry
+ *
* @param path path or url
* @param pegRevision revision to interpret path
* @param revisions revisions to merge;
@@ -569,8 +604,6 @@ public interface ISVNClient
* @param dryRun do not change anything
* @param recordOnly record mergeinfo but do not run merge
* @throws ClientException
- * @note Behaves like the 1.8 where ignoreAncestry maps to
- * both ignoreMergeinfo and diffIgnoreAncestry
*/
void merge(String path, Revision pegRevision, List<RevisionRange> revisions,
String localPath, boolean force, Depth depth,
@@ -635,6 +668,10 @@ public interface ISVNClient
/**
* Retrieve either merged or eligible-to-be-merged revisions.
+ * <p>
+ * <b>Note:</b> Behaves like the 1.8 version, with unspecified
+ * revision range.
+ *
* @param kind kind of revisions to receive
* @param pathOrUrl target of merge
* @param pegRevision peg rev for pathOrUrl
@@ -644,7 +681,6 @@ public interface ISVNClient
* @param depth the depth to recurse to
* @param revProps the revprops to retrieve
* @param callback the object to receive the log messages
- * @note Behaves like the 1.8 version, with unspecified revision range.
*/
void getMergeinfoLog(Mergeinfo.LogKind kind, String pathOrUrl,
Revision pegRevision, String mergeSourceUrl,
@@ -1033,6 +1069,12 @@ public interface ISVNClient
void setConfigDirectory(String configDir) throws ClientException;
/**
+ * Set an event handler that will be called every time the
+ * configuration is loaded.
+ */
+ void setConfigEventHandler(ConfigEvent configHandler);
+
+ /**
* Get the configuration directory
* @return the directory
* @throws ClientException
@@ -1145,4 +1187,40 @@ public interface ISVNClient
int stripCount, boolean reverse, boolean ignoreWhitespace,
boolean removeTempfiles, PatchCallback callback)
throws ClientException;
+
+ /**
+ * Open a persistent session to a repository.
+ * <p>
+ * <b>Note:</b> The session object inherits the progress callback,
+ * configuration directory and authentication info.
+ *
+ * @param pathOrUrl A path in a working copy from which the
+ * session URL is derived, or the URL itself.
+ * @throws remote.RetryOpenSession If the session URL was redirected
+ * @throws SubversionException If an URL redirect cycle was detected
+ * @throws ClientException
+ * @since 1.9
+ */
+ ISVNRemote openRemoteSession(String pathOrUrl)
+ throws ClientException, SubversionException;
+
+ /**
+ * Open a persistent session to a repository.
+ * <p>
+ * <b>Note:</b> The session object inherits the progress callback,
+ * configuration directory and authentication info.
+ *
+ * @param pathOrUrl A path in a working copy from which the
+ * session URL is derived, or the URL itself.
+ * @param retryAttempts The number of times to retry the operation
+ * if the given URL is redirected.
+ * @throws IllegalArgumentException If <code>retryAttempts</code>
+ * is not positive
+ * @throws remote.RetryOpenSession If the session URL was redirected
+ * @throws SubversionException If an URL redirect cycle was detected
+ * @throws ClientException
+ * @since 1.9
+ */
+ ISVNRemote openRemoteSession(String pathOrUrl, int retryAttempts)
+ throws ClientException, SubversionException;
}
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java Wed Aug 21 16:09:43 2013
@@ -151,14 +151,14 @@ public class SVNClient implements ISVNCl
clientContext.notify = notify;
}
- public void setConflictResolver(ConflictResolverCallback listener)
+ public void setConflictResolver(ConflictResolverCallback resolver)
{
- clientContext.resolver = listener;
+ clientContext.resolver = resolver;
}
- public void setProgressCallback(ProgressCallback listener)
+ public void setProgressCallback(ProgressCallback progress)
{
- clientContext.listener = listener;
+ clientContext.setProgressCallback(progress);
}
public native void remove(Set<String> paths, boolean force,
@@ -239,9 +239,20 @@ public class SVNClient implements ISVNCl
public native long doExport(String srcPath, String destPath,
Revision revision, Revision pegRevision,
boolean force, boolean ignoreExternals,
+ boolean ignorKeywords,
Depth depth, String nativeEOL)
throws ClientException;
+ public long doExport(String srcPath, String destPath,
+ Revision revision, Revision pegRevision,
+ boolean force, boolean ignoreExternals,
+ Depth depth, String nativeEOL)
+ throws ClientException
+ {
+ return doExport(srcPath, destPath, revision, pegRevision,
+ force, ignoreExternals, false, depth, nativeEOL);
+ }
+
public native long doSwitch(String path, String url, Revision revision,
Revision pegRevision, Depth depth,
boolean depthIsSticky, boolean ignoreExternals,
@@ -562,6 +573,8 @@ public class SVNClient implements ISVNCl
public native void setConfigDirectory(String configDir)
throws ClientException;
+ public native void setConfigEventHandler(ConfigEvent configHandler);
+
public native String getConfigDirectory()
throws ClientException;
@@ -661,16 +674,33 @@ public class SVNClient implements ISVNCl
PatchCallback callback)
throws ClientException;
+ public ISVNRemote openRemoteSession(String pathOrUrl)
+ throws ClientException, SubversionException
+ {
+ return nativeOpenRemoteSession(pathOrUrl, 1);
+ }
+
+ public ISVNRemote openRemoteSession(String pathOrUrl, int retryAttempts)
+ throws ClientException, SubversionException
+ {
+ if (retryAttempts <= 0)
+ throw new IllegalArgumentException(
+ "retryAttempts must be positive");
+ return nativeOpenRemoteSession(pathOrUrl, retryAttempts);
+ }
+
+ private native ISVNRemote nativeOpenRemoteSession(
+ String pathOrUrl, int retryAttempts)
+ throws ClientException, SubversionException;
+
/**
* A private class to hold the contextual information required to
* persist in this object, such as notification handlers.
*/
- private class ClientContext
- implements ClientNotifyCallback, ProgressCallback,
- ConflictResolverCallback
+ private class ClientContext extends OperationContext
+ implements ClientNotifyCallback, ConflictResolverCallback
{
public ClientNotifyCallback notify = null;
- public ProgressCallback listener = null;
public ConflictResolverCallback resolver = null;
public void onNotify(ClientNotifyInformation notifyInfo)
@@ -679,12 +709,6 @@ public class SVNClient implements ISVNCl
notify.onNotify(notifyInfo);
}
- public void onProgress(ProgressEvent event)
- {
- if (listener != null)
- listener.onProgress(event);
- }
-
public ConflictResult resolve(ConflictDescriptor conflict)
throws SubversionException
{
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/Mergeinfo.java
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/Mergeinfo.java?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/Mergeinfo.java (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/Mergeinfo.java Wed Aug 21 16:09:43 2013
@@ -69,6 +69,31 @@ public class Mergeinfo implements java.i
}
/**
+ * The three ways to request mergeinfo affecting a given path
+ * in {@link org.apache.subversion.javahl.ISVNRemote#getMergeinfo}.
+ * @since 1.9
+ */
+ public static enum Inheritance
+ {
+ /** Explicit mergeinfo only. */
+ explicit,
+
+ /**
+ * Explicit mergeinfo, or if that doesn't exist, the inherited
+ * mergeinfo from a target's nearest (path-wise, not history-wise)
+ * ancestor.
+ */
+ inherited,
+
+ /**
+ * Mergeinfo inherited from a target's nearest (path-wise,
+ * not history-wise) ancestor, regardless of whether target
+ * has explicit mergeinfo.
+ */
+ nearest_ancestor;
+ }
+
+ /**
* Add one or more RevisionRange objects to merge info. If the
* merge source is already stored, the list of revisions is
* replaced.
@@ -83,6 +108,11 @@ public class Mergeinfo implements java.i
addRevisionRange(mergeSrc, range);
}
+ public void addRevisions(String mergeSrc, RevisionRangeList ranges)
+ {
+ addRevisions(mergeSrc, ranges.getRanges());
+ }
+
/**
* Add a revision range to the merged revisions for a path. If
* the merge source already has associated revision ranges, add
@@ -131,6 +161,14 @@ public class Mergeinfo implements java.i
}
/**
+ * Like {@link #getReivsionRange}, but returns a {@link RevisionRangeList}.
+ */
+ public RevisionRangeList getRevisionRangeList(String mergeSrc)
+ {
+ return new RevisionRangeList(getRevisionRange(mergeSrc));
+ }
+
+ /**
* Parse the <code>svn:mergeinfo</code> property to populate the
* merge source URLs and revision ranges of this instance.
* @param mergeinfo <code>svn:mergeinfo</code> property value.
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/RevisionRange.java
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/RevisionRange.java?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/RevisionRange.java (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/RevisionRange.java Wed Aug 21 16:09:43 2013
@@ -36,25 +36,35 @@ public class RevisionRange implements Co
// http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf
// http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/version.html#6678
// http://java.sun.com/javase/6/docs/platform/serialization/spec/version.html#6678
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
private Revision from;
private Revision to;
+ private boolean inheritable;
/**
* Creates a new instance. Called by native library.
*/
- @SuppressWarnings("unused")
- private RevisionRange(long from, long to)
+ protected RevisionRange(long from, long to, boolean inheritable)
{
this.from = Revision.getInstance(from);
this.to = Revision.getInstance(to);
+ this.inheritable = inheritable;
+ }
+
+ /** @since 1.9 */
+ public RevisionRange(Revision from, Revision to, boolean inheritable)
+ {
+ this.from = from;
+ this.to = to;
+ this.inheritable = inheritable;
}
public RevisionRange(Revision from, Revision to)
{
this.from = from;
this.to = to;
+ this.inheritable = true;
}
/**
@@ -70,6 +80,11 @@ public class RevisionRange implements Co
return;
}
+ this.inheritable = !revisionElement.endsWith("*");
+ if (!this.inheritable)
+ revisionElement =
+ revisionElement.substring(0, revisionElement.length() - 1);
+
int hyphen = revisionElement.indexOf('-');
if (hyphen > 0)
{
@@ -113,14 +128,20 @@ public class RevisionRange implements Co
return to;
}
+ public boolean isInheritable()
+ {
+ return inheritable;
+ }
+
public String toString()
{
if (from != null && to != null)
{
- if (from.equals(to))
- return from.toString();
- else
- return from.toString() + '-' + to.toString();
+ String rep = (from.equals(to) ? from.toString()
+ : from.toString() + '-' + to.toString());
+ if (!inheritable)
+ return rep + '*';
+ return rep;
}
return super.toString();
}
@@ -138,7 +159,7 @@ public class RevisionRange implements Co
public int hashCode()
{
final int prime = 31;
- int result = 1;
+ int result = (inheritable ? 1 : 2);
result = prime * result + ((from == null) ? 0 : from.hashCode());
result = prime * result + ((to == null) ? 0 : to.hashCode());
return result;
@@ -178,10 +199,12 @@ public class RevisionRange implements Co
return false;
}
- return true;
+ return (inheritable == other.inheritable);
}
/**
+ * <b>Note:</b> Explicitly ignores inheritable state.
+ *
* @param range The RevisionRange to compare this object to.
*/
public int compareTo(RevisionRange range)
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java Wed Aug 21 16:09:43 2013
@@ -45,9 +45,9 @@ public class VersionExtended
/**
* @return The canonical host triplet (arch-vendor-osname) of the
* system where libsvn_subr was compiled.
- *
- * @note On Unix-like systems (includng Mac OS X), this string is
- * the same as the output of the config.guess script for the
+ * <p>
+ * <b>Note:</b> On Unix-like systems (includng Mac OS X), this string
+ * is the same as the output of the config.guess script for the
* underlying Subversion libraries.
*/
public native String getBuildHost();
@@ -60,8 +60,8 @@ public class VersionExtended
/**
* @return The canonical host triplet (arch-vendor-osname) of the
* system where the current process is running.
- *
- * @note This string may not be the same as the output of
+ * <p>
+ * <b>Note:</b> This string may not be the same as the output of
* config.guess on the same system.
*/
public native String getRuntimeHost();
@@ -139,8 +139,8 @@ public class VersionExtended
/**
* @return Iterator for an immutable internal list of #LoadedLib
* describing loaded shared libraries. The the list may be empty.
- *
- * @note On Mac OS X, the loaded frameworks, private frameworks
+ * <p>
+ * <b>Note:</b> On Mac OS X, the loaded frameworks, private frameworks
* and system libraries will not be listed.
*/
public java.util.Iterator<LoadedLib> getLoadedLibs()
@@ -178,7 +178,8 @@ public class VersionExtended
/**
* Implementation of java.util.Iterator#remove().
- * @note Not implemented, all sequences are immutable.
+ * <p>
+ * <b>Note:</b> Not implemented, all sequences are immutable.
*/
public void remove()
{
@@ -219,7 +220,8 @@ public class VersionExtended
/**
* Implementation of java.util.Iterator#remove().
- * @note Not implemented, all sequences are immutable.
+ * <p>
+ * <b>Note:</b> Not implemented, all sequences are immutable.
*/
public void remove()
{
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Wed Aug 21 16:09:43 2013
@@ -251,16 +251,17 @@ public class BasicTests extends SVNTests
public void testMergeinfoParser() throws Throwable
{
String mergeInfoPropertyValue =
- "/trunk:1-300,305,307,400-405\n/branches/branch:308-400";
+ "/trunk:1-300,305*,307,400-405*\n" +
+ "/branches/branch:308-400";
Mergeinfo info = new Mergeinfo(mergeInfoPropertyValue);
Set<String> paths = info.getPaths();
assertEquals(2, paths.size());
List<RevisionRange> trunkRange = info.getRevisionRange("/trunk");
assertEquals(4, trunkRange.size());
assertEquals("1-300", trunkRange.get(0).toString());
- assertEquals("305", trunkRange.get(1).toString());
+ assertEquals("305*", trunkRange.get(1).toString());
assertEquals("307", trunkRange.get(2).toString());
- assertEquals("400-405", trunkRange.get(3).toString());
+ assertEquals("400-405*", trunkRange.get(3).toString());
List<RevisionRange> branchRange =
info.getRevisionRange("/branches/branch");
assertEquals(1, branchRange.size());
@@ -3299,6 +3300,16 @@ public class BasicTests extends SVNTests
}
}
+ private static class CountingProgressListener implements ProgressCallback
+ {
+ public void onProgress(ProgressEvent event)
+ {
+ // TODO: Examine the byte counts from "event".
+ gotProgress = true;
+ }
+ public boolean gotProgress = false;
+ }
+
public void testDataTransferProgressReport() throws Throwable
{
// ### FIXME: This isn't working over ra_local, because
@@ -3308,25 +3319,13 @@ public class BasicTests extends SVNTests
// build the test setup
OneTest thisTest = new OneTest();
- ProgressCallback listener = new ProgressCallback()
- {
- public void onProgress(ProgressEvent event)
- {
- // TODO: Examine the byte counts from "event".
- throw new RuntimeException("Progress reported as expected");
- }
- };
+ CountingProgressListener listener = new CountingProgressListener();
client.setProgressCallback(listener);
// Perform an update to exercise the progress notification.
- try
- {
- update(thisTest);
+ update(thisTest);
+ if (!listener.gotProgress)
fail("No progress reported");
- }
- catch (RuntimeException progressReported)
- {
- }
}
/**
@@ -3745,6 +3744,39 @@ public class BasicTests extends SVNTests
}
/**
+ * Test RevisionRangeList.remove
+ */
+ public void testRevisionRangeListRemove() throws Throwable
+ {
+ RevisionRangeList ranges =
+ new RevisionRangeList(new ArrayList<RevisionRange>());
+ ranges.getRanges()
+ .add(new RevisionRange(Revision.getInstance(1),
+ Revision.getInstance(5),
+ true));
+ ranges.getRanges()
+ .add(new RevisionRange(Revision.getInstance(7),
+ Revision.getInstance(9),
+ false));
+ RevisionRangeList eraser =
+ new RevisionRangeList(new ArrayList<RevisionRange>());
+ eraser.getRanges()
+ .add(new RevisionRange(Revision.getInstance(7),
+ Revision.getInstance(9),
+ true));
+
+ List<RevisionRange> result = ranges.remove(eraser, true).getRanges();
+ assertEquals(2, ranges.getRanges().size());
+ assertEquals(1, eraser.getRanges().size());
+ assertEquals(2, result.size());
+
+ result = ranges.remove(eraser.getRanges(), false);
+ assertEquals(2, ranges.getRanges().size());
+ assertEquals(1, eraser.getRanges().size());
+ assertEquals(1, result.size());
+ }
+
+ /**
* @return <code>file</code> converted into a -- possibly
* <code>canonical</code>-ized -- Subversion-internal path
* representation.
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java Wed Aug 21 16:09:43 2013
@@ -91,8 +91,10 @@ public class RunTests
if (testCases == null || testCases.length == 0)
{
// Add default test suites.
- suite.addTestSuite(SVNReposTests.class);
suite.addTestSuite(BasicTests.class);
+ suite.addTestSuite(UtilTests.class);
+ suite.addTestSuite(SVNRemoteTests.class);
+ suite.addTestSuite(SVNReposTests.class);
}
else
{
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Wed Aug 21 16:09:43 2013
@@ -324,12 +324,12 @@ class SVNTests extends TestCase
public boolean prompt(String realm, String username)
{
- return false;
+ return true;
}
public boolean prompt(String realm, String username, boolean maySave)
{
- return false;
+ return true;
}
public String askQuestion(String realm, String question,
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/INSTALL
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/INSTALL?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/INSTALL (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/INSTALL Wed Aug 21 16:09:43 2013
@@ -232,35 +232,15 @@ BUILDING SWIG BINDINGS FOR SVN ON WINDOW
compile in Release mode. (This is due to pyconfig.h using the
_DEBUG flag too and setting a #pragma comment(lib) value.)
- For Perl support, you also need to add the paths into Visual Studio.
-
- In Visual C++ 6, go to Tools -> Options -> Directories.
-
- In Visual C++ .NET, go to Tools -> Options -> Projects
- -> VC++ Directories.
-
- Add the following paths:
-
- Executable Directories:
-
- For Perl, path to perl.exe
- (for example, C:\Program Files\Perl\bin)
-
- Library Directories:
-
- For Perl, path to perl##.lib
- (for example, C:\Program Files\Perl\lib\CORE)
-
- Include Directories:
-
- For Perl, path to perl.h
- (for example, C:\Program Files\Perl\lib\CORE)
+ Our project generator detects Perl, Ruby and Python installs and will
+ generate the swig projects for these languages if both swig and the
+ language is found.
3. Create the Visual Studio project files via gen-make.py, adding in
the --with-swig parameter to the installed location for SWIG.
Example:
- > gen-make.py -t vcproj --with-swig="C:\Program Files\SWIG-2.0.2"
+ > gen-make.py <other options> --with-swig="C:\Program Files\SWIG-2.0.2"
4. If you haven't already built Subversion, you should do so now.
Instructions are in the main INSTALL file.
@@ -271,6 +251,7 @@ BUILDING SWIG BINDINGS FOR SVN ON WINDOW
__SWIG_PYTHON__
__SWIG_PERL__
+ __SWIG_RUBY__
6. Install the bindings. The procedure varies depending on the language.
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/core.i
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/core.i?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/core.i (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/core.i Wed Aug 21 16:09:43 2013
@@ -514,7 +514,8 @@
else if ($input == Py_None) {
$1 = NULL;
}
- else if (svn_swig_ConvertPtr($input, (void **)&$1, $descriptor(svn_auth_ssl_server_cert_info_t *)) == 0) {
+ else if (svn_swig_py_convert_ptr($input, (void **)&$1,
+ $descriptor(svn_auth_ssl_server_cert_info_t *)) == 0) {
}
else {
PyErr_SetString(PyExc_TypeError, "not a known type");
@@ -644,28 +645,20 @@ typedef int apr_status_t;
#ifdef SWIGPERL
apr_pool_t *current_pool;
-#if SWIG_VERSION <= 0x010324
-%{
-#define SVN_SWIGEXPORT(t) SWIGEXPORT(t)
-%}
-#else
-%{
-#define SVN_SWIGEXPORT(t) SWIGEXPORT t
-%}
-#endif
-
%{
+/* ### Eventually this should go away. This is not thread safe and a very
+ ### good example on HOW NOT TO USE pools */
static apr_pool_t *current_pool = 0;
-SVN_SWIGEXPORT(apr_pool_t *)
-svn_swig_pl_get_current_pool (void)
+static apr_pool_t *
+core_get_current_pool (void)
{
return current_pool;
}
-SVN_SWIGEXPORT(void)
-svn_swig_pl_set_current_pool (apr_pool_t *pool)
+static void
+core_set_current_pool (apr_pool_t *pool)
{
current_pool = pool;
}
@@ -869,10 +862,8 @@ static void svn_auth_set_gnome_keyring_u
#include "svn_private_config.h"
%}
%init %{
-#if defined(SVN_AVOID_CIRCULAR_LINKAGE_AT_ALL_COSTS_HACK)
- svn_swig_pl_bind_current_pool_fns (&svn_swig_pl_get_current_pool,
- &svn_swig_pl_set_current_pool);
-#endif
+ svn_swig_pl__bind_current_pool_fns(&core_get_current_pool,
+ &core_set_current_pool);
%}
#endif
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/include/svn_types.swg
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/include/svn_types.swg?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/include/svn_types.swg (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/include/svn_types.swg Wed Aug 21 16:09:43 2013
@@ -71,8 +71,8 @@
#ifdef SWIGPYTHON
%typemap(argout) SWIGTYPE **OUTPARAM {
- %append_output(svn_swig_NewPointerObj(*$1, $*1_descriptor,
- _global_py_pool, args));
+ %append_output(svn_swig_py_new_pointer_obj(*$1, $*1_descriptor,
+ _global_py_pool, args));
}
#else
%typemap(argout) SWIGTYPE **OUTPARAM {
@@ -508,15 +508,15 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
%typemap(in) POINTER_TYPES
{
- $1 = ($1_ltype)svn_swig_MustGetPtr($input, $descriptor, $svn_argnum);
+ $1 = ($1_ltype)svn_swig_py_must_get_ptr($input, $descriptor, $svn_argnum);
if (PyErr_Occurred()) {
SWIG_fail;
}
}
%typemap(out) POINTER_TYPES
- "$result = svn_swig_NewPointerObj((void*)($1), $descriptor,
- _global_py_pool, args);";
+ "$result = svn_swig_py_new_pointer_obj((void*)($1), $descriptor,
+ _global_py_pool, args);";
%apply POINTER_TYPES { void *, SWIGTYPE *, SWIGTYPE [] };
@@ -635,8 +635,8 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
*/
%typemap(argout) CALLABLE_CALLBACK * {
- %append_output(svn_swig_NewPointerObj($1, $descriptor,
- _global_py_pool, args));
+ %append_output(svn_swig_py_new_pointer_obj($1, $descriptor,
+ _global_py_pool, args));
}
/* Convert the pointer to a function pointer back into a regular
@@ -645,7 +645,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
%typemap(in) CALLABLE_CALLBACK {
$<ype tmp =
- svn_swig_MustGetPtr($input, $&descriptor, $svn_argnum);
+ svn_swig_py_must_get_ptr($input, $&descriptor, $svn_argnum);
if (tmp == NULL || PyErr_Occurred()) {
SWIG_fail;
}
@@ -675,8 +675,8 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
SWIG_fail;
}
*tmp = ($ltype) $1;
- $result = svn_swig_NewPointerObj(tmp, $&1_descriptor,
- py_pool, args);
+ $result = svn_swig_py_new_pointer_obj(tmp, $&1_descriptor,
+ py_pool, args);
}
}
@@ -694,7 +694,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
*tmp = ($ltype) $value;
%set_constant("$symname",
- svn_swig_NewPointerObj(tmp, $&descriptor, NULL, NULL)
+ svn_swig_py_new_pointer_obj(tmp, $&descriptor, NULL, NULL)
);
}
@@ -922,6 +922,12 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
$2 = (void *)baton;
}
#endif
+#ifdef SWIGPERL
+%ignore svn_fs_set_warning_func;
+#endif
+#ifdef SWIGPYTHON
+%ignore svn_fs_set_warning_func;
+#endif
/* -----------------------------------------------------------------------
svn_stream_t interoperability with language native io handles
@@ -997,8 +1003,8 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
/* We don't know the type of this reference, so we'll have to
* treat it as an opaque void pointer.
*/
- $result = svn_swig_NewPointerObj($1, $descriptor,
- _global_py_pool, args);
+ $result = svn_swig_py_new_pointer_obj($1, $descriptor,
+ _global_py_pool, args);
}
}
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c Wed Aug 21 16:09:43 2013
@@ -29,16 +29,20 @@
#include <perl.h>
#include <XSUB.h>
+/* Perl defines a _ macro, but SVN uses it for translations.
+ * So undefine _ after including the Perl headers. */
+#undef _
+
#include <stdarg.h>
#ifdef WIN32
#include <io.h>
#endif
+#include "svn_private_config.h"
#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_opt.h"
#include "svn_time.h"
-#include "svn_private_config.h"
#include "swig_perl_external_runtime.swg"
@@ -50,7 +54,7 @@ static HV *type_cache = NULL;
#define _SWIG_TYPE(name) _swig_perl_type_query(name, 0)
#define POOLINFO _SWIG_TYPE("apr_pool_t *")
-static swig_type_info *_swig_perl_type_query(const char *typename, U32 klen)
+static swig_type_info *_swig_perl_type_query(const char *type_name, U32 klen)
{
SV **type_info;
swig_type_info *tinfo;
@@ -59,13 +63,13 @@ static swig_type_info *_swig_perl_type_q
type_cache = newHV();
if (klen == 0)
- klen = strlen(typename);
+ klen = strlen(type_name);
- if ((type_info = hv_fetch(type_cache, typename, klen, 0)))
+ if ((type_info = hv_fetch(type_cache, type_name, klen, 0)))
return (swig_type_info *) (SvIV(*type_info));
- tinfo = SWIG_TypeQuery(typename);
- hv_store(type_cache, typename, klen, newSViv((IV)tinfo), 0);
+ tinfo = SWIG_TypeQuery(type_name);
+ hv_store(type_cache, type_name, klen, newSViv((IV)tinfo), 0);
return tinfo;
}
@@ -174,16 +178,16 @@ static apr_hash_t *svn_swig_pl_to_hash(S
I32 cnt, retlen;
if (!(source && SvROK(source) && SvTYPE(SvRV(source)) == SVt_PVHV)) {
- return NULL;
+ return NULL;
}
hash = apr_hash_make(pool);
h = (HV *)SvRV(source);
cnt = hv_iterinit(h);
while (cnt--) {
- SV* item = hv_iternextsv(h, &key, &retlen);
- void *val = cv(item, ctx, pool);
- svn_hash_sets(hash, key, val);
+ SV* item = hv_iternextsv(h, &key, &retlen);
+ void *val = cv(item, ctx, pool);
+ svn_hash_sets(hash, apr_pstrmemdup(pool, key, retlen), val);
}
return hash;
@@ -265,8 +269,8 @@ apr_array_header_t *svn_swig_pl_strings_
}
apr_array_header_t *svn_swig_pl_objs_to_array(SV *source,
- swig_type_info *tinfo,
- apr_pool_t *pool)
+ swig_type_info *tinfo,
+ apr_pool_t *pool)
{
return svn_swig_pl_to_array(source,
(pl_element_converter_t)convert_pl_obj,
@@ -351,17 +355,17 @@ static SV *convert_hash(apr_hash_t *hash
hv = newHV();
for (hi = apr_hash_first(NULL, hash); hi; hi = apr_hash_next(hi)) {
- const char *key;
- void *val;
- int klen;
- SV *obj;
-
- apr_hash_this(hi, (void *)&key, NULL, &val);
- klen = strlen(key);
-
- obj = converter_func(val, ctx);
- hv_store(hv, (const char *)key, klen, obj, 0);
- SvREFCNT_inc(obj);
+ const char *key;
+ void *val;
+ int klen;
+ SV *obj;
+
+ apr_hash_this(hi, (void *)&key, NULL, &val);
+ klen = strlen(key);
+
+ obj = converter_func(val, ctx);
+ hv_store(hv, (const char *)key, klen, obj, 0);
+ SvREFCNT_inc(obj);
}
return sv_2mortal(newRV_noinc((SV*)hv));
@@ -381,16 +385,16 @@ SV *svn_swig_pl_convert_hash(apr_hash_t
/* c -> perl array convertors */
static SV *convert_array(const apr_array_header_t *array,
- element_converter_t converter_func, void *ctx)
+ element_converter_t converter_func, void *ctx)
{
AV *list = newAV();
int i;
for (i = 0; i < array->nelts; ++i) {
- void *element = APR_ARRAY_IDX(array, i, void *);
- SV *item = converter_func(element, ctx);
- av_push(list, item);
- SvREFCNT_inc(item);
+ void *element = APR_ARRAY_IDX(array, i, void *);
+ SV *item = converter_func(element, ctx);
+ av_push(list, item);
+ SvREFCNT_inc(item);
}
return sv_2mortal(newRV_noinc((SV*)list));
}
@@ -528,85 +532,85 @@ svn_error_t *svn_swig_pl_callback_thunk(
va_start(ap, fmt);
while (*fp) {
- char *c;
- void *o;
- SV *obj;
- swig_type_info *t;
- svn_string_t *str;
+ char *c;
+ void *o;
+ SV *obj;
+ swig_type_info *t;
+ svn_string_t *str;
- switch (*fp++) {
- case 'O':
+ switch (*fp++) {
+ case 'O':
XPUSHs(va_arg(ap, SV *));
- break;
- case 'S': /* swig object */
+ break;
+ case 'S': /* swig object */
o = va_arg(ap, void *);
t = va_arg(ap, swig_type_info *);
obj = sv_newmortal();
SWIG_MakePtr(obj, o, t, 0);
- XPUSHs(obj);
- break;
+ XPUSHs(obj);
+ break;
- case 's': /* string */
+ case 's': /* string */
c = va_arg(ap, char *);
- XPUSHs(c ? sv_2mortal(newSVpv(c, 0)) : &PL_sv_undef);
- break;
+ XPUSHs(c ? sv_2mortal(newSVpv(c, 0)) : &PL_sv_undef);
+ break;
- case 'i': /* apr_int32_t */
- XPUSHs(sv_2mortal(newSViv(va_arg(ap, apr_int32_t))));
- break;
+ case 'i': /* apr_int32_t */
+ XPUSHs(sv_2mortal(newSViv(va_arg(ap, apr_int32_t))));
+ break;
- case 'u': /* apr_uint32_t */
+ case 'u': /* apr_uint32_t */
XPUSHs(sv_2mortal(newSViv(va_arg(ap, apr_uint32_t))));
- break;
+ break;
- case 'r': /* svn_revnum_t */
- XPUSHs(sv_2mortal(newSViv(va_arg(ap, svn_revnum_t))));
- break;
-
- case 'b': /* svn_boolean_t */
- XPUSHs(sv_2mortal(newSViv(va_arg(ap, svn_boolean_t))));
- break;
-
- case 't': /* svn_string_t */
- str = va_arg(ap, svn_string_t *);
- XPUSHs(str ? sv_2mortal(newSVpv(str->data, str->len))
- : &PL_sv_undef);
- break;
-
- case 'L': /* apr_int64_t */
- /* Pass into perl as a string because some implementations may
- * not be able to handle a 64-bit int. If it's too long to
- * fit in Perl's interal IV size then perl will only make
- * it available as a string. If not then perl will convert
- * it to an IV for us. So this handles the problem gracefully */
- c = malloc(30);
- snprintf(c,30,"%" APR_INT64_T_FMT,va_arg(ap, apr_int64_t));
- XPUSHs(sv_2mortal(newSVpv(c, 0)));
- free(c);
- break;
-
- case 'U': /* apr_uint64_t */
- c = malloc(30);
- snprintf(c,30,"%" APR_UINT64_T_FMT,va_arg(ap, apr_uint64_t));
- XPUSHs(sv_2mortal(newSVpv(c, 0)));
- free(c);
- break;
-
- case 'z': /* apr_size_t */
- if (sizeof(apr_size_t) >= 8)
- {
- c = malloc(30);
- snprintf(c,30,"%" APR_SIZE_T_FMT,va_arg(ap, apr_size_t));
- XPUSHs(sv_2mortal(newSVpv(c, 0)));
- free(c);
- }
- else
- {
- XPUSHs(sv_2mortal(newSViv(va_arg(ap, apr_size_t))));
- }
- break;
- }
+ case 'r': /* svn_revnum_t */
+ XPUSHs(sv_2mortal(newSViv(va_arg(ap, svn_revnum_t))));
+ break;
+
+ case 'b': /* svn_boolean_t */
+ XPUSHs(sv_2mortal(newSViv(va_arg(ap, svn_boolean_t))));
+ break;
+
+ case 't': /* svn_string_t */
+ str = va_arg(ap, svn_string_t *);
+ XPUSHs(str ? sv_2mortal(newSVpv(str->data, str->len))
+ : &PL_sv_undef);
+ break;
+
+ case 'L': /* apr_int64_t */
+ /* Pass into perl as a string because some implementations may
+ * not be able to handle a 64-bit int. If it's too long to
+ * fit in Perl's interal IV size then perl will only make
+ * it available as a string. If not then perl will convert
+ * it to an IV for us. So this handles the problem gracefully */
+ c = malloc(30);
+ snprintf(c,30,"%" APR_INT64_T_FMT,va_arg(ap, apr_int64_t));
+ XPUSHs(sv_2mortal(newSVpv(c, 0)));
+ free(c);
+ break;
+
+ case 'U': /* apr_uint64_t */
+ c = malloc(30);
+ snprintf(c,30,"%" APR_UINT64_T_FMT,va_arg(ap, apr_uint64_t));
+ XPUSHs(sv_2mortal(newSVpv(c, 0)));
+ free(c);
+ break;
+
+ case 'z': /* apr_size_t */
+ if (sizeof(apr_size_t) >= 8)
+ {
+ c = malloc(30);
+ snprintf(c,30,"%" APR_SIZE_T_FMT,va_arg(ap, apr_size_t));
+ XPUSHs(sv_2mortal(newSVpv(c, 0)));
+ free(c);
+ }
+ else
+ {
+ XPUSHs(sv_2mortal(newSViv(va_arg(ap, apr_size_t))));
+ }
+ break;
+ }
}
va_end(ap);
@@ -615,23 +619,23 @@ svn_error_t *svn_swig_pl_callback_thunk(
switch (caller_func) {
case CALL_SV:
count = call_sv(func, call_flags );
- break;
+ break;
case CALL_METHOD:
count = call_method(func, call_flags );
- break;
+ break;
default:
croak("unkonwn calling type");
- break;
+ break;
}
SPAGAIN ;
if (((call_flags & G_SCALAR) && count != 1) ||
- ((call_flags & G_VOID) && count != 0))
+ ((call_flags & G_VOID) && count != 0))
croak("Wrong number of returns");
if (result) {
- *result = POPs;
- SvREFCNT_inc(*result);
+ *result = POPs;
+ SvREFCNT_inc(*result);
}
PUTBACK;
@@ -784,8 +788,8 @@ static svn_error_t * thunk_close_directo
}
static svn_error_t * thunk_absent_directory(const char *path,
- void *parent_baton,
- apr_pool_t *pool)
+ void *parent_baton,
+ apr_pool_t *pool)
{
item_baton *ib = parent_baton;
@@ -847,8 +851,8 @@ static svn_error_t * thunk_window_handle
SvREFCNT_dec(handler);
}
else {
- swig_type_info *tinfo = _SWIG_TYPE("svn_txdelta_window_t *");
- SVN_ERR(svn_swig_pl_callback_thunk(CALL_SV, handler,
+ swig_type_info *tinfo = _SWIG_TYPE("svn_txdelta_window_t *");
+ SVN_ERR(svn_swig_pl_callback_thunk(CALL_SV, handler,
NULL, "S", window, tinfo));
}
@@ -870,30 +874,30 @@ thunk_apply_textdelta(void *file_baton,
"OOsS", ib->editor, ib->baton,
base_checksum, pool, POOLINFO));
if (SvOK(result)) {
- if (SvROK(result) && SvTYPE(SvRV(result)) == SVt_PVAV) {
- swig_type_info *handler_info =
+ if (SvROK(result) && SvTYPE(SvRV(result)) == SVt_PVAV) {
+ swig_type_info *handler_info =
_SWIG_TYPE("svn_txdelta_window_handler_t");
swig_type_info *void_info = _SWIG_TYPE("void *");
- AV *array = (AV *)SvRV(result);
+ AV *array = (AV *)SvRV(result);
- if (SWIG_ConvertPtr(*av_fetch(array, 0, 0),
- (void **)handler, handler_info,0) < 0) {
- croak("Unable to convert from SWIG Type");
- }
- if (SWIG_ConvertPtr(*av_fetch(array, 1, 0),
- h_baton, void_info,0) < 0) {
- croak("Unable to convert from SWIG Type ");
- }
+ if (SWIG_ConvertPtr(*av_fetch(array, 0, 0),
+ (void **)handler, handler_info,0) < 0) {
+ croak("Unable to convert from SWIG Type");
+ }
+ if (SWIG_ConvertPtr(*av_fetch(array, 1, 0),
+ h_baton, void_info,0) < 0) {
+ croak("Unable to convert from SWIG Type ");
+ }
SvREFCNT_dec(result);
- }
- else {
- *handler = thunk_window_handler;
- *h_baton = result;
- }
+ }
+ else {
+ *handler = thunk_window_handler;
+ *h_baton = result;
+ }
}
else {
- *handler = svn_delta_noop_window_handler;
- *h_baton = NULL;
+ *handler = svn_delta_noop_window_handler;
+ *h_baton = NULL;
}
return SVN_NO_ERROR;
@@ -931,8 +935,8 @@ static svn_error_t * thunk_close_file(vo
}
static svn_error_t * thunk_absent_file(const char *path,
- void *parent_baton,
- apr_pool_t *pool)
+ void *parent_baton,
+ apr_pool_t *pool)
{
item_baton *ib = parent_baton;
@@ -958,10 +962,10 @@ static svn_error_t * thunk_abort_edit(vo
void
-svn_delta_wrap_window_handler(svn_txdelta_window_handler_t *handler,
- void **h_baton,
- SV *callback,
- apr_pool_t *pool)
+svn_swig_pl_wrap_window_handler(svn_txdelta_window_handler_t *handler,
+ void **h_baton,
+ SV *callback,
+ apr_pool_t *pool)
{
*handler = thunk_window_handler;
*h_baton = callback;
@@ -969,10 +973,10 @@ svn_delta_wrap_window_handler(svn_txdelt
svn_swig_pl_hold_ref_in_pool(pool, callback);
}
-void svn_delta_make_editor(svn_delta_editor_t **editor,
- void **edit_baton,
- SV *perl_editor,
- apr_pool_t *pool)
+void svn_swig_pl_make_editor(svn_delta_editor_t **editor,
+ void **edit_baton,
+ SV *perl_editor,
+ apr_pool_t *pool)
{
svn_delta_editor_t *thunk_editor = svn_delta_default_editor(pool);
@@ -999,18 +1003,18 @@ void svn_delta_make_editor(svn_delta_edi
}
svn_error_t *svn_swig_pl_thunk_log_receiver(void *baton,
- apr_hash_t *changed_paths,
- svn_revnum_t rev,
- const char *author,
- const char *date,
- const char *msg,
- apr_pool_t *pool)
+ apr_hash_t *changed_paths,
+ svn_revnum_t rev,
+ const char *author,
+ const char *date,
+ const char *msg,
+ apr_pool_t *pool)
{
SV *receiver = baton;
swig_type_info *tinfo = _SWIG_TYPE("svn_log_changed_path_t *");
if (!SvOK(receiver))
- return SVN_NO_ERROR;
+ return SVN_NO_ERROR;
svn_swig_pl_callback_thunk(CALL_SV,
receiver, NULL,
@@ -1029,7 +1033,7 @@ svn_error_t *svn_swig_pl_thunk_log_entry
SV *receiver = baton;
if (!SvOK(receiver))
- return SVN_NO_ERROR;
+ return SVN_NO_ERROR;
svn_swig_pl_callback_thunk(CALL_SV,
receiver, NULL,
@@ -1067,7 +1071,7 @@ svn_error_t *svn_swig_pl_thunk_history_f
SV *func = baton;
if (!SvOK(func))
- return SVN_NO_ERROR;
+ return SVN_NO_ERROR;
svn_swig_pl_callback_thunk(CALL_SV,
func, NULL,
@@ -1085,7 +1089,7 @@ svn_error_t *svn_swig_pl_thunk_authz_fun
SV *func = baton, *result;
if (!SvOK(func))
- return SVN_NO_ERROR;
+ return SVN_NO_ERROR;
svn_swig_pl_callback_thunk(CALL_SV,
func, &result,
@@ -1099,12 +1103,12 @@ svn_error_t *svn_swig_pl_thunk_authz_fun
}
svn_error_t *svn_swig_pl_thunk_commit_callback(svn_revnum_t new_revision,
- const char *date,
- const char *author,
- void *baton)
+ const char *date,
+ const char *author,
+ void *baton)
{
if (!SvOK((SV *)baton))
- return SVN_NO_ERROR;
+ return SVN_NO_ERROR;
svn_swig_pl_callback_thunk(CALL_SV, baton, NULL,
"rss", new_revision, date, author);
@@ -1131,8 +1135,8 @@ svn_error_t *svn_swig_pl_thunk_commit_ca
/* Wrap RA */
static svn_error_t * thunk_open_tmp_file(apr_file_t **fp,
- void *callback_baton,
- apr_pool_t *pool)
+ void *callback_baton,
+ apr_pool_t *pool)
{
SV *result;
swig_type_info *tinfo = _SWIG_TYPE("apr_file_t *");
@@ -1141,7 +1145,7 @@ static svn_error_t * thunk_open_tmp_file
&result, "OS", callback_baton, pool, POOLINFO);
if (SWIG_ConvertPtr(result, (void *)fp, tinfo,0) < 0) {
- croak("Unable to convert from SWIG Type");
+ croak("Unable to convert from SWIG Type");
}
SvREFCNT_dec(result);
@@ -1164,15 +1168,15 @@ svn_error_t *thunk_get_wc_prop(void *bat
/* this is svn_string_t * typemap in */
if (!SvOK(result) || result == &PL_sv_undef) {
- *value = NULL;
+ *value = NULL;
}
else if (SvPOK(result)) {
data = SvPV(result, len);
*value = svn_string_ncreate(data, len, pool);
}
else {
- SvREFCNT_dec(result);
- croak("not a string");
+ SvREFCNT_dec(result);
+ croak("not a string");
}
SvREFCNT_dec(result);
@@ -1180,10 +1184,10 @@ svn_error_t *thunk_get_wc_prop(void *bat
}
-svn_error_t *svn_ra_make_callbacks(svn_ra_callbacks_t **cb,
- void **c_baton,
- SV *perl_callbacks,
- apr_pool_t *pool)
+svn_error_t *svn_swig_pl_make_callbacks(svn_ra_callbacks_t **cb,
+ void **c_baton,
+ SV *perl_callbacks,
+ apr_pool_t *pool)
{
SV *auth_baton;
@@ -1198,7 +1202,7 @@ svn_error_t *svn_ra_make_callbacks(svn_r
if (SWIG_ConvertPtr(auth_baton,
(void **)&(*cb)->auth_baton, _SWIG_TYPE("svn_auth_baton_t *"),0) < 0) {
- croak("Unable to convert from SWIG Type");
+ croak("Unable to convert from SWIG Type");
}
*c_baton = perl_callbacks;
svn_swig_pl_hold_ref_in_pool(pool, perl_callbacks);
@@ -1352,13 +1356,13 @@ svn_error_t *svn_swig_pl_thunk_ssl_clien
/* Thunked version of svn_wc_notify_func_t callback type */
void svn_swig_pl_notify_func(void * baton,
- const char *path,
- svn_wc_notify_action_t action,
- svn_node_kind_t kind,
- const char *mime_type,
- svn_wc_notify_state_t content_state,
- svn_wc_notify_state_t prop_state,
- svn_revnum_t revision)
+ const char *path,
+ svn_wc_notify_action_t action,
+ svn_node_kind_t kind,
+ const char *mime_type,
+ svn_wc_notify_state_t content_state,
+ svn_wc_notify_state_t prop_state,
+ svn_revnum_t revision)
{
if (!SvOK((SV *)baton)) {
return;
@@ -1387,7 +1391,7 @@ svn_error_t *svn_swig_pl_get_commit_log_
if (!SvOK((SV *)baton)) {
*log_msg = apr_pstrdup(pool, "");
- *tmp_file = NULL;
+ *tmp_file = NULL;
return SVN_NO_ERROR;
}
@@ -1405,17 +1409,17 @@ svn_error_t *svn_swig_pl_get_commit_log_
/* client returned undef to us */
*log_msg = NULL;
} else if (SvPOK(SvRV(log_msg_sv))) {
- /* client returned string so get the string and then duplicate
- * it using pool memory */
+ /* client returned string so get the string and then duplicate
+ * it using pool memory */
*log_msg = apr_pstrdup(pool, SvPV_nolen(SvRV(log_msg_sv)));
} else {
croak("Invalid value in log_msg reference, must be undef or a string");
}
if (!SvOK(SvRV(tmp_file_sv))) {
- *tmp_file = NULL;
+ *tmp_file = NULL;
} else if (SvPOK(SvRV(tmp_file_sv))) {
- *tmp_file = apr_pstrdup(pool, SvPV_nolen(SvRV(tmp_file_sv)));
+ *tmp_file = apr_pstrdup(pool, SvPV_nolen(SvRV(tmp_file_sv)));
} else {
croak("Invalid value in tmp_file reference, "
"must be undef or a string");
@@ -1423,9 +1427,9 @@ svn_error_t *svn_swig_pl_get_commit_log_
if (sv_derived_from(result, "_p_svn_error_t")) {
swig_type_info *errorinfo = _SWIG_TYPE("svn_error_t *");
- if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
+ if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
SvREFCNT_dec(result);
- croak("Unable to convert from SWIG Type");
+ croak("Unable to convert from SWIG Type");
}
}
@@ -1476,10 +1480,10 @@ svn_error_t *svn_swig_pl_cancel_func(voi
if (sv_derived_from(result,"_p_svn_error_t")) {
swig_type_info *errorinfo = _SWIG_TYPE("svn_error_t *");
- if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
- SvREFCNT_dec(result);
- croak("Unable to convert from SWIG Type");
- }
+ if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
+ SvREFCNT_dec(result);
+ croak("Unable to convert from SWIG Type");
+ }
} else if (SvIOK(result) && SvIV(result)) {
ret_val = svn_error_create(SVN_ERR_CANCELLED, NULL,
"By cancel callback");
@@ -1575,9 +1579,9 @@ svn_error_t *svn_swig_pl_blame_func(void
if (sv_derived_from(result, "_p_svn_error_t")) {
swig_type_info *errorinfo = _SWIG_TYPE("svn_error_t *");
- if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
+ if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
SvREFCNT_dec(result);
- croak("Unable to convert from SWIG Type");
+ croak("Unable to convert from SWIG Type");
}
}
@@ -1590,7 +1594,7 @@ svn_boolean_t svn_swig_pl_thunk_config_e
{
SV *result;
if (!SvOK((SV *)baton))
- return 0;
+ return 0;
svn_swig_pl_callback_thunk(CALL_SV, baton, &result,
"ss", name, value);
@@ -1601,21 +1605,33 @@ svn_boolean_t svn_swig_pl_thunk_config_e
/* default pool support */
-#if defined(SVN_AVOID_CIRCULAR_LINKAGE_AT_ALL_COSTS_HACK)
-static svn_swig_pl_get_current_pool_t svn_swig_pl_get_current_pool = NULL;
-static svn_swig_pl_set_current_pool_t svn_swig_pl_set_current_pool = NULL;
+static svn_swig_pl_get_current_pool_func_t get_current_pool_cb = NULL;
+static svn_swig_pl_set_current_pool_func_t set_current_pool_cb = NULL;
-void svn_swig_pl_bind_current_pool_fns(svn_swig_pl_get_current_pool_t get,
- svn_swig_pl_set_current_pool_t set)
+void
+svn_swig_pl__bind_current_pool_fns(svn_swig_pl_get_current_pool_func_t get,
+ svn_swig_pl_set_current_pool_func_t set)
{
- svn_swig_pl_get_current_pool = get;
- svn_swig_pl_set_current_pool = set;
+ /* This function should only be called ONCE, otherwise there are two
+ global variables CURRENT_POOL */
+ SVN_ERR_ASSERT_NO_RETURN(get_current_pool_cb == NULL
+ && set_current_pool_cb == NULL);
+
+ get_current_pool_cb = get;
+ set_current_pool_cb = set;
+}
+
+apr_pool_t * svn_swig_pl_get_current_pool()
+{
+ SVN_ERR_ASSERT_NO_RETURN(get_current_pool_cb != NULL);
+ return get_current_pool_cb();
}
-#else
-apr_pool_t *svn_swig_pl_get_current_pool(void);
-void svn_swig_pl_set_current_pool(apr_pool_t *pool);
-#endif
+void svn_swig_pl_set_current_pool(apr_pool_t *pool)
+{
+ SVN_ERR_ASSERT_NO_RETURN(set_current_pool_cb != NULL);
+ set_current_pool_cb(pool);
+}
apr_pool_t *svn_swig_pl_make_pool(SV *obj)
{
@@ -1623,12 +1639,12 @@ apr_pool_t *svn_swig_pl_make_pool(SV *ob
if (obj && sv_isobject(obj)) {
if (sv_derived_from(obj, "SVN::Pool")) {
- obj = SvRV(obj);
- }
- if (sv_derived_from(obj, "_p_apr_pool_t")) {
- SWIG_ConvertPtr(obj, (void **)&pool, POOLINFO, 0);
- return pool;
- }
+ obj = SvRV(obj);
+ }
+ if (sv_derived_from(obj, "_p_apr_pool_t")) {
+ SWIG_ConvertPtr(obj, (void **)&pool, POOLINFO, 0);
+ return pool;
+ }
}
if (!svn_swig_pl_get_current_pool())
@@ -1653,15 +1669,15 @@ static svn_error_t *io_handle_read(void
MAGIC *mg;
if ((mg = SvTIED_mg((SV*)io->io, PERL_MAGIC_tiedscalar))) {
- SV *ret;
- SV *buf = sv_newmortal();
+ SV *ret;
+ SV *buf = sv_newmortal();
- svn_swig_pl_callback_thunk(CALL_METHOD, (void *)"READ", &ret, "OOz",
+ svn_swig_pl_callback_thunk(CALL_METHOD, (void *)"READ", &ret, "OOz",
SvTIED_obj((SV*)io->io, mg),
buf, *len);
- *len = SvIV(ret);
- SvREFCNT_dec(ret);
- memmove(buffer, SvPV_nolen(buf), *len);
+ *len = SvIV(ret);
+ SvREFCNT_dec(ret);
+ memmove(buffer, SvPV_nolen(buf), *len);
}
else
*len = PerlIO_read(IoIFP(io->io), buffer, *len);
@@ -1676,12 +1692,12 @@ static svn_error_t *io_handle_write(void
MAGIC *mg;
if ((mg = SvTIED_mg((SV*)io->io, PERL_MAGIC_tiedscalar))) {
- SV *ret, *pv;
+ SV *ret, *pv;
pv = sv_2mortal(newSVpvn(data, *len));
- svn_swig_pl_callback_thunk(CALL_METHOD, (void *)"WRITE", &ret, "OOz",
+ svn_swig_pl_callback_thunk(CALL_METHOD, (void *)"WRITE", &ret, "OOz",
SvTIED_obj((SV*)io->io, mg), pv, *len);
- *len = SvIV(ret);
- SvREFCNT_dec(ret);
+ *len = SvIV(ret);
+ SvREFCNT_dec(ret);
}
else
*len = PerlIO_write(IoIFP(io->io), data, *len);
@@ -1725,7 +1741,7 @@ svn_error_t *svn_swig_pl_make_stream(svn
if (sv_derived_from(obj, "SVN::Stream"))
svn_swig_pl_callback_thunk(CALL_METHOD, (void *)"svn_stream",
&obj, "O", obj);
- else if (!sv_derived_from(obj, "_p_svn_stream_t"))
+ else if (!sv_derived_from(obj, "_p_svn_stream_t"))
simple_type = 0;
if (simple_type) {
@@ -1735,17 +1751,17 @@ svn_error_t *svn_swig_pl_make_stream(svn
}
if (obj && SvROK(obj) && SvTYPE(SvRV(obj)) == SVt_PVGV &&
- (io = GvIO(SvRV(obj)))) {
- apr_pool_t *pool = svn_swig_pl_get_current_pool();
- io_baton_t *iob = apr_palloc(pool, sizeof(io_baton_t));
- SvREFCNT_inc(obj);
- iob->obj = obj;
- iob->io = io;
- *stream = svn_stream_create(iob, pool);
- svn_stream_set_read(*stream, io_handle_read);
- svn_stream_set_write(*stream, io_handle_write);
- svn_stream_set_close(*stream, io_handle_close);
- apr_pool_cleanup_register(pool, iob, io_handle_cleanup,
+ (io = GvIO(SvRV(obj)))) {
+ apr_pool_t *pool = svn_swig_pl_get_current_pool();
+ io_baton_t *iob = apr_palloc(pool, sizeof(io_baton_t));
+ SvREFCNT_inc(obj);
+ iob->obj = obj;
+ iob->io = io;
+ *stream = svn_stream_create(iob, pool);
+ svn_stream_set_read(*stream, io_handle_read);
+ svn_stream_set_write(*stream, io_handle_write);
+ svn_stream_set_close(*stream, io_handle_close);
+ apr_pool_cleanup_register(pool, iob, io_handle_cleanup,
io_handle_cleanup);
}
@@ -1789,7 +1805,7 @@ apr_file_t *svn_swig_pl_make_file(SV *fi
apr_file_t *apr_file = NULL;
if (!SvOK(file) || file == &PL_sv_undef)
- return NULL;
+ return NULL;
if (SvPOKp(file)) {
apr_file_open(&apr_file, SvPV_nolen(file),
Modified: subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h?rev=1516196&r1=1516195&r2=1516196&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h Wed Aug 21 16:09:43 2013
@@ -29,6 +29,10 @@
#include <perl.h>
#include <XSUB.h>
+/* Perl defines a _ macro, but SVN uses it for translations.
+ * So undefine _ after including the Perl headers. */
+#undef _
+
#include <apr.h>
#include <apr_pools.h>
#include <apr_strings.h>
@@ -55,14 +59,14 @@ extern "C" {
#endif
+typedef apr_pool_t *(*svn_swig_pl_get_current_pool_func_t)(void);
+typedef void (*svn_swig_pl_set_current_pool_func_t)(apr_pool_t *pool);
-#if defined(SVN_AVOID_CIRCULAR_LINKAGE_AT_ALL_COSTS_HACK)
-typedef apr_pool_t *(*svn_swig_pl_get_current_pool_t)(void);
-typedef void (*svn_swig_pl_set_current_pool_t)(apr_pool_t *pool);
+void svn_swig_pl__bind_current_pool_fns(svn_swig_pl_get_current_pool_func_t get,
+ svn_swig_pl_set_current_pool_func_t set);
-void svn_swig_pl_bind_current_pool_fns(svn_swig_pl_get_current_pool_t get,
- svn_swig_pl_set_current_pool_t set);
-#endif
+apr_pool_t * svn_swig_pl_get_current_pool();
+void svn_swig_pl_set_current_pool(apr_pool_t *pool);
apr_pool_t *svn_swig_pl_make_pool(SV *obj);
@@ -79,8 +83,6 @@ svn_error_t *svn_swig_pl_callback_thunk(
SV *svn_swig_pl_prophash_to_hash(apr_hash_t *hash);
SV *svn_swig_pl_convert_hash(apr_hash_t *hash, swig_type_info *tinfo);
-SV *svn_swig_pl_convert_hash_of_revnum_t(apr_hash_t *hash);
-
apr_array_header_t *svn_swig_pl_strings_to_array(SV *source,
apr_pool_t *pool);
@@ -101,9 +103,6 @@ apr_array_header_t *svn_swig_pl_array_to
SV *source, apr_pool_t *pool);
SV *svn_swig_pl_array_to_list(const apr_array_header_t *array);
-/* Formerly used by pre-1.0 APIs. Now unused
-SV *svn_swig_pl_ints_to_list(const apr_array_header_t *array);
-*/
SV *svn_swig_pl_convert_array(const apr_array_header_t *array,
swig_type_info *tinfo);
@@ -158,10 +157,10 @@ svn_error_t *svn_swig_pl_thunk_authz_fun
apr_pool_t *pool);
/* ra callbacks. */
-svn_error_t *svn_ra_make_callbacks(svn_ra_callbacks_t **cb,
- void **c_baton,
- SV *perl_callbacks,
- apr_pool_t *pool);
+svn_error_t *svn_swig_pl_make_callbacks(svn_ra_callbacks_t **cb,
+ void **c_baton,
+ SV *perl_callbacks,
+ apr_pool_t *pool);
/* thunked gnome_keyring_unlock_prompt callback function */
svn_error_t *svn_swig_pl_thunk_gnome_keyring_unlock_prompt(char **keyring_password,
@@ -273,15 +272,15 @@ svn_error_t *svn_swig_pl_blame_func(void
svn_boolean_t svn_swig_pl_thunk_config_enumerator(const char *name, const char *value, void *baton);
/* helper for making the editor */
-void svn_delta_make_editor(svn_delta_editor_t **editor,
- void **edit_baton,
- SV *perl_editor,
- apr_pool_t *pool);
-
-void svn_delta_wrap_window_handler(svn_txdelta_window_handler_t *handler,
- void **h_baton,
- SV *callback,
- apr_pool_t *pool);
+void svn_swig_pl_make_editor(svn_delta_editor_t **editor,
+ void **edit_baton,
+ SV *perl_editor,
+ apr_pool_t *pool);
+
+void svn_swig_pl_wrap_window_handler(svn_txdelta_window_handler_t *handler,
+ void **h_baton,
+ SV *callback,
+ apr_pool_t *pool);
/* svn_stream_t helpers */
svn_error_t *svn_swig_pl_make_stream(svn_stream_t **stream, SV *obj);