You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2013/05/10 16:58:56 UTC
svn commit: r1481041 [4/38] - in /subversion/branches/master-passphrase: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
contrib/client-side/svncopy/ contrib/hook-scripts/
contrib/server-side/fsfsfixer/ contrib/server-side/fsfsfi...
Modified: subversion/branches/master-passphrase/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java (original)
+++ subversion/branches/master-passphrase/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java Fri May 10 14:58:47 2013
@@ -795,6 +795,7 @@ public class SVNClient implements SVNCli
/**
* @since 1.5
*/
+ @SuppressWarnings("unchecked")
public void remove(String[] paths, String message, boolean force,
boolean keepLocal, Map revpropTable)
throws ClientException
@@ -964,6 +965,7 @@ public class SVNClient implements SVNCli
/**
* @since 1.5
*/
+ @SuppressWarnings("unchecked")
public long commit(String[] paths, String message, int depth,
boolean noUnlock, boolean keepChangelist,
String[] changelists, Map revpropTable)
@@ -998,6 +1000,7 @@ public class SVNClient implements SVNCli
/**
* @since 1.7
*/
+ @SuppressWarnings("unchecked")
public void copy(CopySource[] sources, String destPath, String message,
boolean copyAsChild, boolean makeParents,
boolean ignoreExternals, Map revpropTable)
@@ -1031,6 +1034,7 @@ public class SVNClient implements SVNCli
* boolean, boolean, Map)} instead.
* @since 1.5
*/
+ @SuppressWarnings("unchecked")
public void copy(CopySource[] sources, String destPath, String message,
boolean copyAsChild, boolean makeParents,
Map revpropTable)
@@ -1057,6 +1061,7 @@ public class SVNClient implements SVNCli
/**
* @since 1.5
*/
+ @SuppressWarnings("unchecked")
public void move(String[] srcPaths, String destPath, String message,
boolean force, boolean moveAsChild,
boolean makeParents, Map revpropTable)
@@ -1106,6 +1111,7 @@ public class SVNClient implements SVNCli
/**
* @since 1.5
*/
+ @SuppressWarnings("unchecked")
public void mkdir(String[] paths, String message,
boolean makeParents, Map revpropTable)
throws ClientException
@@ -1306,6 +1312,7 @@ public class SVNClient implements SVNCli
/**
* @since 1.5
*/
+ @SuppressWarnings("unchecked")
public void doImport(String path, String url, String message,
int depth, boolean noIgnore,
boolean ignoreUnknownNodeTypes, Map revpropTable)
@@ -1888,6 +1895,7 @@ public class SVNClient implements SVNCli
/**
* @since 1.5
*/
+ @SuppressWarnings("unchecked")
public void propertySet(String path, String name, String value, int depth,
String[] changelists, boolean force,
Map revpropTable)
Modified: subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Fri May 10 14:58:47 2013
@@ -131,6 +131,91 @@ public class BasicTests extends SVNTests
}
/**
+ * Test SVNClient.getVersionExtended().
+ * @throws Throwable
+ */
+ public void testVersionExtendedQuiet() throws Throwable
+ {
+ try
+ {
+ VersionExtended vx = client.getVersionExtended(false);
+ String result = vx.getBuildDate();
+ if (result == null || result.trim().length() == 0)
+ throw new Exception("Build date empty");
+ result = vx.getBuildTime();
+ if (result == null || result.trim().length() == 0)
+ throw new Exception("Build time empty");
+ result = vx.getBuildHost();
+ if (result == null || result.trim().length() == 0)
+ throw new Exception("Build host empty");
+ result = vx.getCopyright();
+ if (result == null || result.trim().length() == 0)
+ throw new Exception("Copyright empty");
+ }
+ catch (Exception e)
+ {
+ fail("VersionExtended should always be available unless the " +
+ "native libraries failed to initialize: " + e);
+ }
+ }
+
+ /**
+ * Test SVNClient.getVersionExtended().
+ * @throws Throwable
+ */
+ public void testVersionExtendedVerbose() throws Throwable
+ {
+ try
+ {
+ VersionExtended vx = client.getVersionExtended(true);
+ String result = vx.getRuntimeHost();
+ if (result == null || result.trim().length() == 0)
+ throw new Exception("Runtime host empty");
+
+ // OS name is allowed to be null, but not empty
+ result = vx.getRuntimeOSName();
+ if (result != null && result.trim().length() == 0)
+ throw new Exception("Runtime OS name empty");
+
+ java.util.Iterator<VersionExtended.LinkedLib> ikl;
+ ikl = vx.getLinkedLibs();
+ if (ikl.hasNext())
+ {
+ VersionExtended.LinkedLib lib = ikl.next();
+ result = lib.getName();
+ if (result == null || result.trim().length() == 0)
+ throw new Exception("Linked lib name empty");
+ result = lib.getCompiledVersion();
+ if (result == null || result.trim().length() == 0)
+ throw new Exception("Linked lib compiled version empty");
+ // Runtime version is allowed to be null, but not empty
+ result = lib.getRuntimeVersion();
+ if (result != null && result.trim().length() == 0)
+ throw new Exception("Linked lib runtime version empty");
+ }
+
+ java.util.Iterator<VersionExtended.LoadedLib> ill;
+ ill = vx.getLoadedLibs();
+ if (ill.hasNext())
+ {
+ VersionExtended.LoadedLib lib = ill.next();
+ result = lib.getName();
+ if (result == null || result.trim().length() == 0)
+ throw new Exception("Loaded lib name empty");
+ // Version is allowed to be null, but not empty
+ result = lib.getVersion();
+ if (result != null && result.trim().length() == 0)
+ throw new Exception("Loaded lib version empty");
+ }
+ }
+ catch (Exception e)
+ {
+ fail("VersionExtended should always be available unless the " +
+ "native libraries failed to initialize: " + e);
+ }
+ }
+
+ /**
* Test the JNIError class functionality
* @throws Throwable
*/
@@ -711,6 +796,49 @@ public class BasicTests extends SVNTests
}
/**
+ * Test property inheritance.
+ * @throws Throwable
+ */
+ public void testInheritedProperties() throws Throwable
+ {
+ OneTest thisTest = new OneTest();
+ WC wc = thisTest.getWc();
+
+ String adirPath = fileToSVNPath(new File(thisTest.getWCPath(),
+ "/A"),
+ false);
+ String alphaPath = fileToSVNPath(new File(thisTest.getWCPath(),
+ "/A/B/E/alpha"),
+ false);
+
+ String propval = "ybg";
+ setprop(adirPath, "ahqrtz", propval.getBytes());
+
+ final Map<String, Collection<InheritedProplistCallback.InheritedItem>> ipropMaps =
+ new HashMap<String, Collection<InheritedProplistCallback.InheritedItem>>();
+
+ client.properties(alphaPath, null, null, Depth.empty, null,
+ new InheritedProplistCallback () {
+ public void singlePath(
+ String path, Map<String, byte[]> props,
+ Collection<InheritedProplistCallback.InheritedItem> iprops)
+ { ipropMaps.put(path, iprops); }
+ });
+ Collection<InheritedProplistCallback.InheritedItem> iprops = ipropMaps.get(alphaPath);
+ for (InheritedProplistCallback.InheritedItem item : iprops)
+ {
+ for (String key : item.properties.keySet())
+ {
+ assertEquals("ahqrtz", key);
+ assertEquals(propval, new String(item.properties.get(key)));
+ }
+ }
+
+ wc.setItemPropStatus("A", Status.Kind.modified);
+ thisTest.checkStatus();
+ }
+
+ /**
* Test the basic SVNClient.update functionality.
* @throws Throwable
*/
@@ -899,7 +1027,21 @@ public class BasicTests extends SVNTests
}
client.move(srcPaths,
new File(thisTest.getWorkingCopy(), "A/B/F").getPath(),
- false, true, false, null, null, null);
+ false, true, false, false, false, null, null, null);
+
+ MyStatusCallback statusCallback = new MyStatusCallback();
+ String statusPath = fileToSVNPath(new File(thisTest.getWCPath() + "/A/B"), true);
+ client.status(statusPath, Depth.infinity, false, false, false, true,
+ null, statusCallback);
+ Status[] statusList = statusCallback.getStatusArray();
+ assertEquals(statusPath + "/F/alpha",
+ statusList[0].getMovedToAbspath());
+ assertEquals(statusPath + "/F/beta",
+ statusList[1].getMovedToAbspath());
+ assertEquals(statusPath + "/E/alpha",
+ statusList[2].getMovedFromAbspath());
+ assertEquals(statusPath + "/E/beta",
+ statusList[3].getMovedFromAbspath());
// Commit the changes, and check the state of the WC.
checkCommitRevision(thisTest,
@@ -2394,6 +2536,43 @@ public class BasicTests extends SVNTests
}
/**
+ * Test merge with automatic source and revision determination
+ * (e.g. 'svn merge -g) with implied revision range.
+ * @throws Throwable
+ * @since 1.8
+ */
+ public void testMergeUsingHistoryImpliedRange() throws Throwable
+ {
+ OneTest thisTest = setupAndPerformMerge();
+
+ // Test that getMergeinfo() returns null.
+ assertNull(client.getMergeinfo(new File(thisTest.getWCPath(), "A")
+ .toString(), Revision.HEAD));
+
+ // Merge and commit some changes (r4).
+ appendText(thisTest, "A/mu", "xxx", 4);
+ checkCommitRevision(thisTest, "wrong revision number from commit", 4,
+ thisTest.getWCPathSet(), "log msg", Depth.infinity,
+ false, false, null, null);
+
+ String branchPath = thisTest.getWCPath() + "/branches/A";
+ String modUrl = thisTest.getUrl() + "/A";
+ client.merge(modUrl, Revision.HEAD, null,
+ branchPath, true, Depth.infinity, false, false, false);
+
+ // commit the changes so that we can verify merge
+ addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
+ "branches/A", NodeKind.dir,
+ CommitItemStateFlags.PropMods);
+ addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl().toString(),
+ "branches/A/mu", NodeKind.file,
+ CommitItemStateFlags.TextMods);
+ checkCommitRevision(thisTest, "wrong revision number from commit", 5,
+ thisTest.getWCPathSet(), "log msg", Depth.infinity,
+ false, false, null, null);
+ }
+
+ /**
* Test reintegrating a branch with trunk
* (e.g. 'svn merge --reintegrate').
* @throws Throwable
@@ -2649,7 +2828,7 @@ public class BasicTests extends SVNTests
}
/**
- * Test the {@link SVNClientInterface.diff()} APIs.
+ * Test the {@link ISVNClient.diff()} APIs.
* @since 1.5
*/
public void testDiff()
@@ -2884,6 +3063,132 @@ public class BasicTests extends SVNTests
}
+ /**
+ * Test the {@link ISVNClient.diff()} with {@link DiffOptions}.
+ * @since 1.8
+ */
+ public void testDiffOptions()
+ throws SubversionException, IOException
+ {
+ OneTest thisTest = new OneTest(true);
+ File diffOutput = new File(super.localTmp, thisTest.testName);
+ final String NL = System.getProperty("line.separator");
+ final String sepLine =
+ "===================================================================" + NL;
+ final String underSepLine =
+ "___________________________________________________________________" + NL;
+ final String iotaPath = thisTest.getWCPath().replace('\\', '/') + "/iota";
+ final String wcPath = fileToSVNPath(new File(thisTest.getWCPath()),
+ false);
+ final String expectedDiffHeader =
+ "Index: iota" + NL + sepLine +
+ "--- iota\t(revision 1)" + NL +
+ "+++ iota\t(working copy)" + NL;
+
+ // make edits to iota
+ PrintWriter writer = new PrintWriter(new FileOutputStream(iotaPath));
+ writer.print("This is the file 'iota'.");
+ writer.flush();
+ writer.close();
+
+ try
+ {
+ final String expectedDiffOutput = expectedDiffHeader +
+ "@@ -1 +1 @@" + NL +
+ "-This is the file 'iota'." + NL +
+ "\\ No newline at end of file" + NL +
+ "+This is the file 'iota'." + NL +
+ "\\ No newline at end of file" + NL;
+
+ client.diff(iotaPath, Revision.BASE, iotaPath, Revision.WORKING,
+ wcPath, new FileOutputStream(diffOutput.getPath()),
+ Depth.infinity, null,
+ false, false, false, false, false, false, null);
+ assertFileContentsEquals(
+ "Unexpected diff output with no options in file '" +
+ diffOutput.getPath() + '\'',
+ expectedDiffOutput, diffOutput);
+ diffOutput.delete();
+ }
+ catch (ClientException e)
+ {
+ fail(e.getMessage());
+ }
+
+ try
+ {
+ final String expectedDiffOutput = "";
+
+ client.diff(iotaPath, Revision.BASE, iotaPath, Revision.WORKING,
+ wcPath, new FileOutputStream(diffOutput.getPath()),
+ Depth.infinity, null,
+ false, false, false, false, false, false,
+ new DiffOptions(DiffOptions.Flag.IgnoreWhitespace));
+ assertFileContentsEquals(
+ "Unexpected diff output with Flag.IgnoreWhitespace in file '" +
+ diffOutput.getPath() + '\'',
+ expectedDiffOutput, diffOutput);
+ diffOutput.delete();
+ }
+ catch (ClientException e)
+ {
+ fail("Using Flag.IgnoreWhitespace: "
+ + e.getMessage());
+ }
+
+ try
+ {
+ final String expectedDiffOutput = "";
+
+ client.diff(iotaPath, Revision.BASE, iotaPath, Revision.WORKING,
+ wcPath, diffOutput.getPath(), Depth.infinity, null,
+ false, false, false, false, false, false,
+ new DiffOptions(DiffOptions.Flag.IgnoreSpaceChange));
+ assertFileContentsEquals(
+ "Unexpected diff output with Flag.IgnoreSpaceChange in file '" +
+ diffOutput.getPath() + '\'',
+ expectedDiffOutput, diffOutput);
+ diffOutput.delete();
+ }
+ catch (ClientException e)
+ {
+ fail("Using Flag.IgnoreSpaceChange: "
+ + e.getMessage());
+ }
+
+ // make edits to iota
+ writer = new PrintWriter(new FileOutputStream(iotaPath));
+ writer.print("This is the file 'io ta'.");
+ writer.flush();
+ writer.close();
+
+ try
+ {
+ final String expectedDiffOutput = expectedDiffHeader +
+ "@@ -1 +1 @@" + NL +
+ "-This is the file 'iota'." + NL +
+ "\\ No newline at end of file" + NL +
+ "+This is the file 'io ta'." + NL +
+ "\\ No newline at end of file" + NL;
+
+ client.diff(iotaPath, Revision.BASE, iotaPath, Revision.WORKING,
+ wcPath, diffOutput.getPath(), Depth.infinity, null,
+ false, false, false, false, false, false,
+ new DiffOptions(DiffOptions.Flag.IgnoreSpaceChange));
+ assertFileContentsEquals(
+ "Unexpected diff output with Flag.IgnoreSpaceChange in file '" +
+ diffOutput.getPath() + '\'',
+ expectedDiffOutput, diffOutput);
+ diffOutput.delete();
+ }
+ catch (ClientException e)
+ {
+ fail("Using Flag.IgnoreSpaceChange: "
+ + e.getMessage());
+ }
+ }
+
+
private void assertFileContentsEquals(String msg, String expected,
File actual)
throws IOException
@@ -3062,7 +3367,7 @@ public class BasicTests extends SVNTests
}
client.move(srcPaths,
new File(thisTest.getWorkingCopy(), "A/B/F").getPath(),
- false, true, false, null, null, null);
+ false, true, false, false, false, null, null, null);
// Commit the changes, and check the state of the WC.
checkCommitRevision(thisTest,
@@ -3103,6 +3408,7 @@ public class BasicTests extends SVNTests
ConflictDescriptor conflict = conflicts.iterator().next();
assertNotNull("Conflict should not be null", conflict);
+ assertNotNull("Repository UUID must be set", conflict.getSrcLeftVersion().getReposUUID());
assertEquals(conflict.getSrcLeftVersion().getNodeKind(), NodeKind.file);
assertEquals(conflict.getSrcLeftVersion().getReposURL() + "/" +
@@ -3111,6 +3417,8 @@ public class BasicTests extends SVNTests
if (conflict.getSrcRightVersion() != null)
{
+ assertEquals(conflict.getSrcLeftVersion().getReposUUID(),
+ conflict.getSrcRightVersion().getReposUUID());
assertEquals(conflict.getSrcRightVersion().getNodeKind(), NodeKind.none);
assertEquals(conflict.getSrcRightVersion().getReposURL(), tcTest.getUrl().toString());
assertEquals(conflict.getSrcRightVersion().getPegRevision(), 2L);
Modified: subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java (original)
+++ subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java Fri May 10 14:58:47 2013
@@ -34,7 +34,7 @@ import java.net.URI;
import java.util.Map;
/**
- * This class is used for testing the SVNAdmin class
+ * This class is used for testing the ISVNRepos interface
*
* More methodes for testing are still needed
*/
@@ -50,7 +50,7 @@ public class SVNReposTests extends SVNTe
}
/**
- * Test the basic SVNAdmin.create functionality
+ * Test the basic ISVNRepos.create functionality
* @throws SubversionException
*/
public void testCreate()
@@ -100,10 +100,26 @@ public class SVNReposTests extends SVNTe
admin.pack(thisTest.getRepository(), null);
}
+ /* Check that the freeze() callback gets invoked. */
+ private class FreezeAction implements ReposFreezeAction
+ {
+ int invoked = 0;
+ public void invoke() { ++invoked; }
+ }
+
+ public void testFreeze()
+ throws SubversionException, IOException
+ {
+ OneTest thisTest = new OneTest(false);
+ FreezeAction action = new FreezeAction();
+ admin.freeze(action, thisTest.getRepository());
+ assertEquals("expect freeze callback to be invoked once", 1, action.invoked);
+ }
+
public void testLoadRepo()
throws SubversionException, IOException
{
- /* Make sure SVNAdmin.load() works, with a repo dump file known
+ /* Make sure ISVNRepos.load() works, with a repo dump file known
* to provoke bug 2979
*/
// makes repos with nothing in it
Modified: subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Fri May 10 14:58:47 2013
@@ -148,12 +148,12 @@ class SVNTests extends TestCase
* Username to use in tests
*/
protected final static String USERNAME = "jrandom";
-
+
/**
* Password to use in tests
*/
protected final static String PASSWORD = "rayjandom";
-
+
/**
* Create a JUnit <code>TestCase</code> instance.
*/
Modified: subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java Fri May 10 14:58:47 2013
@@ -2176,6 +2176,7 @@ public class BasicTests extends SVNTests
* are no revisions to return.
* @since 1.5
*/
+ @SuppressWarnings("unchecked")
private long[] getMergeinfoRevisions(int kind, String pathOrUrl,
Revision pegRevision,
String mergeSourceUrl,
@@ -3242,6 +3243,7 @@ public class BasicTests extends SVNTests
* @throws Throwable
* @since 1.5
*/
+ @SuppressWarnings("unchecked")
public void testCommitRevprops() throws Throwable
{
@@ -3348,6 +3350,7 @@ public class BasicTests extends SVNTests
// change made to this class.
private static final long serialVersionUID = 1L;
+ @SuppressWarnings("unchecked")
public void onSummary(DiffSummary descriptor)
{
super.put(descriptor.getPath(), descriptor);
@@ -3357,6 +3360,7 @@ public class BasicTests extends SVNTests
private class MyChangelistCallback extends HashMap
implements ChangelistCallback
{
+ @SuppressWarnings("unchecked")
public void doChangelist(String path, String changelist)
{
if (super.containsKey(path))
Modified: subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/RunTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/RunTests.java?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/RunTests.java (original)
+++ subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/RunTests.java Fri May 10 14:58:47 2013
@@ -47,6 +47,7 @@ public class RunTests
*
* @return The complete test suite.
*/
+ @SuppressWarnings("unchecked")
public static TestSuite suite()
{
TestSuite suite = new SVNTestSuite();
@@ -75,9 +76,8 @@ public class RunTests
Constructor ctor =
clazz.getDeclaredConstructor(argTypes);
methodName = methodName.substring(i + 1);
- String[] args = { methodName };
testCases[testCaseIndex++] =
- (TestCase) ctor.newInstance(args);
+ (TestCase) ctor.newInstance(methodName);
}
catch (Exception e)
{
Modified: subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java Fri May 10 14:58:47 2013
@@ -438,6 +438,7 @@ class SVNTests extends TestCase
* @param stateFlags expected commit state flags
* (see CommitItemStateFlags)
*/
+ @SuppressWarnings("unchecked")
protected void addExpectedCommitItem(String workingCopyPath,
String baseUrl,
String itemPath,
Modified: subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/WC.java
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/WC.java?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/WC.java (original)
+++ subversion/branches/master-passphrase/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/WC.java Fri May 10 14:58:47 2013
@@ -627,6 +627,7 @@ public class WC
* @param path the path of the item.
* @param content the content of the item. A null signals a directory.
*/
+ @SuppressWarnings("unchecked")
private Item(String path, String content)
{
myPath = path;
@@ -639,6 +640,7 @@ public class WC
* @param source the copy source.
* @param owner the WC of the copy
*/
+ @SuppressWarnings("unchecked")
private Item(Item source, WC owner)
{
myPath = source.myPath;
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/INSTALL
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/INSTALL?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/INSTALL (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/INSTALL Fri May 10 14:58:47 2013
@@ -368,7 +368,7 @@ USING SWIG BINDINGS
3. The APIs available within each module are broadly the same as the
corresponding C APIs except:
- * omit the module prefix (for example, 'svn_client_')
+ * you may omit the module prefix (for example, 'svn_client_')
* pool arguments are optional
* using Python exceptions instead of returning svn_error_t
* returning a tuple of outputs instead of return-by-pointer
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/core.i
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/core.i?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/core.i (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/core.i Fri May 10 14:58:47 2013
@@ -251,6 +251,30 @@
%ignore svn_opt_args_to_target_array;
+/* svn_cmdline.h */
+%ignore svn_cmdline_auth_plaintext_passphrase_prompt;
+%ignore svn_cmdline_auth_plaintext_prompt;
+%ignore svn_cmdline_auth_simple_prompt;
+%ignore svn_cmdline_auth_ssl_client_cert_prompt;
+%ignore svn_cmdline_auth_ssl_client_cert_pw_prompt;
+%ignore svn_cmdline_auth_ssl_server_trust_prompt;
+%ignore svn_cmdline_auth_username_prompt;
+%ignore svn_cmdline_cstring_from_utf8;
+%ignore svn_cmdline_cstring_from_utf8_fuzzy;
+%ignore svn_cmdline_cstring_to_utf8;
+%ignore svn_cmdline_fflush;
+%ignore svn_cmdline_fprintf;
+%ignore svn_cmdline_fputs;
+%ignore svn_cmdline_handle_exit_error;
+%ignore svn_cmdline_output_encoding;
+%ignore svn_cmdline_path_local_style_from_utf8;
+%ignore svn_cmdline_printf;
+%ignore svn_cmdline_prompt_baton2_t;
+%ignore svn_cmdline_prompt_baton_t;
+%ignore svn_cmdline_prompt_user2;
+%ignore svn_cmdline_prompt_user;
+%ignore svn_cmdline_setup_auth_baton;
+
/* Ugliness because the constants are typedefed and SWIG ignores them
as a result. */
%constant svn_revnum_t SWIG_SVN_INVALID_REVNUM = -1;
@@ -331,19 +355,22 @@
};
#endif
-
/* -----------------------------------------------------------------------
- handle the default value of svn_config_get().and the
- config directory of svn_config_read_auth_data() and
- svn_config_write_auth_data().
+ allowable null values
*/
%apply const char *MAY_BE_NULL {
+ /* svn_config_get */
const char *default_value,
- const char *config_dir,
+ /* svn_config_read_auth_data */
+ const char *config_dir,
+ /* svn_diff_file_output_merge */
const char *conflict_original,
const char *conflict_modified,
const char *conflict_latest,
- const char *conflict_separator
+ const char *conflict_separator,
+ /* svn_cmdline_create_auth_baton */
+ const char *username,
+ const char *password
};
/* -----------------------------------------------------------------------
@@ -705,6 +732,15 @@ svn_swig_pl_set_current_pool (apr_pool_t
%authprompt_callback_typemap(ssl_client_cert_pw)
%authprompt_callback_typemap(gnome_keyring_unlock)
+#ifdef SWIGPYTHON
+/* pl and rb aren't yet implemented */
+%callback_typemap_maybenull(svn_config_auth_walk_func_t walk_func,
+ void *walk_baton,
+ svn_swig_py_config_auth_walk_func,
+ svn_swig_pl_config_auth_walk_func,
+ svn_swig_rb_config_auth_walk_func)
+#endif
+
/* -----------------------------------------------------------------------
* For all the various functions that set a callback baton create a reference
* for the baton (which in this case is an SV pointing to the callback)
@@ -778,6 +814,7 @@ svn_swig_pl_set_current_pool (apr_pool_t
#pragma SWIG nowarn=+305
%include svn_opt_h.swg
+%include svn_cmdline_h.swg
%include svn_auth_h.swg
%include svn_config_h.swg
%include svn_utf_h.swg
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/include/svn_containers.swg
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/include/svn_containers.swg?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/include/svn_containers.swg (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/include/svn_containers.swg Fri May 10 14:58:47 2013
@@ -265,6 +265,27 @@
#endif
+#ifdef SWIGPERL
+%typemap(in) apr_hash_t *PROPHASH
+ (apr_pool_t *_global_pool = NULL)
+{
+ if (_global_pool == NULL)
+ _global_pool = svn_swig_pl_make_pool((SV *)NULL);
+ $1 = svn_swig_pl_hash_to_prophash($input, _global_pool);
+}
+%typemap(out) apr_hash_t *PROPHASH
+{
+ %append_output(svn_swig_pl_prophash_to_hash($1));
+}
+
+%typemap(out) apr_hash_t *changed_paths2
+{
+ %append_output(
+ ($1) ? svn_swig_pl_convert_hash($1, $descriptor(svn_log_changed_path2_t *))
+ : &PL_sv_undef);
+}
+#endif
+
#ifdef SWIGRUBY
%typemap(in) apr_hash_t *PROPHASH
{
@@ -291,7 +312,6 @@
}
#endif
-#if defined(SWIGPYTHON) || defined(SWIGRUBY)
%apply apr_hash_t *PROPHASH {
apr_hash_t *target_props,
apr_hash_t *source_props,
@@ -300,7 +320,6 @@
apr_hash_t *revprop_table,
apr_hash_t *revprops
};
-#endif
#ifdef SWIGRUBY
%typemap(out) apr_hash_t *CHANGED_PATH_HASH
@@ -421,6 +440,19 @@
*/
/* -----------------------------------------------------------------------
+ Output of apr_array_header_t * <svn_prop_inherited_item_t *>
+*/
+#ifdef SWIGPYTHON
+%typemap(argout) apr_array_header_t **OUTPUT_OF_PROP_INHERITED_ITEM {
+ %append_output(svn_swig_py_propinheriteditemarray_to_dict(*$1));
+}
+
+%apply apr_array_header_t **OUTPUT_OF_PROP_INHERITED_ITEM {
+ apr_array_header_t **inherited_props
+};
+#endif
+
+/* -----------------------------------------------------------------------
Output of apr_array_header_t * <svn_prop_t *>
*/
#ifdef SWIGRUBY
@@ -571,6 +603,10 @@
$1 = (apr_array_header_t *) svn_swig_pl_strings_to_array($input,
_global_pool);
}
+%typemap(in) const apr_array_header_t *STRINGLIST_MAY_BE_NULL {
+ $1 = SvOK($input) ? (apr_array_header_t *) svn_swig_pl_strings_to_array(
+ $input, _global_pool) : NULL;
+}
#endif
#ifdef SWIGRUBY
%typemap(in) const apr_array_header_t *STRINGLIST {
@@ -599,7 +635,7 @@
apr_array_header_t *preserved_exts
};
-#ifdef SWIGRUBY
+#if defined(SWIGPERL) || defined(SWIGRUBY)
%apply const apr_array_header_t *STRINGLIST_MAY_BE_NULL {
apr_array_header_t *revprops
};
@@ -748,6 +784,12 @@
}
#endif
+#ifdef SWIGPERL
+%typemap(in) apr_array_header_t *REVISION_RANGE_LIST {
+ $1 = svn_swig_pl_array_to_apr_array_revision_range($input, _global_pool);
+}
+#endif
+
#ifdef SWIGRUBY
%typemap(in) apr_array_header_t *REVISION_RANGE_LIST {
$1 = svn_swig_rb_array_to_apr_array_revision_range($input, _global_pool);
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/include/svn_types.swg
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/include/svn_types.swg?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/include/svn_types.swg (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/include/svn_types.swg Fri May 10 14:58:47 2013
@@ -708,28 +708,10 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
svn_repos_get_logs()
*/
-#ifdef SWIGPYTHON
-%typemap(in) (svn_log_message_receiver_t receiver,
- void *receiver_baton) {
- $1 = svn_swig_py_log_receiver;
- $2 = (void *)$input;
-}
-#endif
-#ifdef SWIGPERL
-%typemap(in) (svn_log_message_receiver_t receiver,
- void *receiver_baton) {
- $1 = svn_swig_pl_thunk_log_receiver;
- $2 = (void *)$input;
-}
-#endif
-
-#ifdef SWIGRUBY
-%typemap(in) (svn_log_message_receiver_t receiver,
- void *receiver_baton) {
- $1 = svn_swig_rb_log_receiver;
- $2 = (void *)svn_swig_rb_make_baton($input, _global_svn_swig_rb_pool);
-}
-#endif
+%callback_typemap(svn_log_message_receiver_t receiver, void *receiver_baton,
+ svn_swig_py_log_receiver,
+ svn_swig_pl_thunk_log_receiver,
+ svn_swig_rb_log_receiver)
/* -----------------------------------------------------------------------
Callback: svn_log_entry_receiver_t
@@ -738,21 +720,10 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
svn_repos_get_logs4()
*/
-#ifdef SWIGPYTHON
-%typemap(in) (svn_log_entry_receiver_t receiver,
- void *receiver_baton) {
- $1 = svn_swig_py_log_entry_receiver;
- $2 = (void *)$input;
-}
-#endif
-
-#ifdef SWIGRUBY
-%typemap(in) (svn_log_entry_receiver_t receiver, void *receiver_baton)
-{
- $1 = svn_swig_rb_log_entry_receiver;
- $2 = (void *)svn_swig_rb_make_baton($input, _global_svn_swig_rb_pool);
-}
-#endif
+%callback_typemap(svn_log_entry_receiver_t receiver, void *receiver_baton,
+ svn_swig_py_log_entry_receiver,
+ svn_swig_pl_thunk_log_entry_receiver,
+ svn_swig_rb_log_entry_receiver)
/* -----------------------------------------------------------------------
Callback: svn_commit_callback_t
@@ -906,6 +877,39 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
#endif
/* -----------------------------------------------------------------------
+ Callback: svn_repos_freeze_func_t
+*/
+#ifdef SWIGPYTHON
+%typemap(in) (svn_repos_freeze_func_t freeze_func, void *freeze_baton)
+{
+ $1 = svn_swig_py_repos_freeze_func;
+ $2 = (void *)$input;
+}
+#endif
+
+/* -----------------------------------------------------------------------
+ Callback: svn_fs_freeze_func_t
+*/
+#ifdef SWIGPYTHON
+%typemap(in) (svn_fs_freeze_func_t freeze_func, void *freeze_baton)
+{
+ $1 = svn_swig_py_fs_freeze_func;
+ $2 = (void *)$input;
+}
+#endif
+
+/* -----------------------------------------------------------------------
+ Callback: svn_proplist_receiver2_t
+*/
+#ifdef SWIGPYTHON
+%typemap(in) (svn_proplist_receiver2_t receiver, void *receiver_baton)
+{
+ $1 = svn_swig_py_proplist_receiver2;
+ $2 = (void *)$input;
+}
+#endif
+
+/* -----------------------------------------------------------------------
Callback: svn_fs_warning_callback_t
*/
@@ -1169,7 +1173,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
*/
#ifdef SWIGPERL
%typemap(in) svn_opt_revision_t * (svn_opt_revision_t rev) {
- $1 = svn_swig_pl_set_revision(&rev, $input);
+ $1 = svn_swig_pl_set_revision(&rev, $input, TRUE);
}
#endif
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c Fri May 10 14:58:47 2013
@@ -34,6 +34,7 @@
#include <io.h>
#endif
+#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_opt.h"
#include "svn_time.h"
@@ -97,6 +98,71 @@ static void *convert_pl_revnum_t(SV *val
return (void *)result;
}
+static void *convert_pl_svn_string_t(SV *value, void *dummy, apr_pool_t *pool)
+{
+ svn_string_t *result = apr_palloc(pool, sizeof(svn_string_t));
+ /* just the in typemap for svn_string_t */
+ result->data = SvPV(value, result->len);
+ return (void *)result;
+}
+
+/* Convert a revision range and return a svn_opt_revision_range_t*.
+ * Value can be:
+ * - a _p_svn_opt_revision_range_t object
+ * - a reference to a two-element array, [start, end],
+ * where start and end is anything accepted by svn_swig_pl_set_revision
+ * If value is not acceptable and *(svn_boolean_t *)ctx is FALSE,
+ * convert_pl_revision_range returns NULL, otherwise it croak()s.
+ */
+static void *convert_pl_revision_range(SV *value, void *ctx, apr_pool_t *pool)
+{
+ svn_boolean_t croak_on_error = *(svn_boolean_t *)ctx;
+
+ if (sv_isobject(value) && sv_derived_from(value, "_p_svn_opt_revision_range_t")) {
+ svn_opt_revision_range_t *range;
+ /* this will assign to range */
+ SWIG_ConvertPtr(value, (void **)&range, _SWIG_TYPE("svn_opt_revision_range_t *"), 0);
+ return range;
+ }
+
+ if (SvROK(value)
+ && SvTYPE(SvRV(value)) == SVt_PVAV
+ && av_len((AV *)SvRV(value)) == 1) {
+ /* value is a two-element ARRAY */
+ AV* array = (AV *)SvRV(value);
+ svn_opt_revision_t temp_start, temp_end;
+ svn_opt_revision_t *start, *end;
+ svn_opt_revision_range_t *range;
+
+ /* Note: Due to how svn_swig_pl_set_revision works,
+ * either the passed in svn_opt_revision_t is modified
+ * (and the original pointer returned) or a different pointer
+ * is returned. svn_swig_pl_set_revision may return NULL
+ * only if croak_on_error is FALSE.
+ */
+ start = svn_swig_pl_set_revision(&temp_start,
+ *av_fetch(array, 0, 0), croak_on_error);
+ if (start == NULL)
+ return NULL;
+ end = svn_swig_pl_set_revision(&temp_end,
+ *av_fetch(array, 1, 0), croak_on_error);
+ if (end == NULL)
+ return NULL;
+
+ /* allocate a new range and copy in start and end fields */
+ range = apr_palloc(pool, sizeof(*range));
+ range->start = *start;
+ range->end = *end;
+ return range;
+ }
+
+ if (croak_on_error)
+ croak("unknown revision range: "
+ "must be an array of length 2 whose elements are acceptable "
+ "as opt_revision_t or a _p_svn_opt_revision_range_t object");
+ return NULL;
+}
+
/* perl -> c hash convertors */
static apr_hash_t *svn_swig_pl_to_hash(SV *source,
pl_element_converter_t cv,
@@ -117,7 +183,7 @@ static apr_hash_t *svn_swig_pl_to_hash(S
while (cnt--) {
SV* item = hv_iternextsv(h, &key, &retlen);
void *val = cv(item, ctx, pool);
- apr_hash_set(hash, key, APR_HASH_KEY_STRING, val);
+ svn_hash_sets(hash, key, val);
}
return hash;
@@ -155,6 +221,11 @@ apr_hash_t *svn_swig_pl_objs_to_hash_of_
NULL, pool);
}
+apr_hash_t *svn_swig_pl_hash_to_prophash(SV *source, apr_pool_t *pool)
+{
+ return svn_swig_pl_to_hash(source, convert_pl_svn_string_t, NULL, pool);
+}
+
/* perl -> c array convertors */
static const
apr_array_header_t *svn_swig_pl_to_array(SV *source,
@@ -203,6 +274,42 @@ const apr_array_header_t *svn_swig_pl_ob
tinfo, pool);
}
+/* Convert a single revision range or an array of revisions ranges
+ * Note: We can't simply use svn_swig_pl_to_array() as is, since
+ * it immediatley checks whether source is an array reference and then
+ * proceeds to treat this as the "array of ..." case. But a revision range
+ * may be specified as a (two-element) array. Hence we first try to
+ * convert source as a single revision range. Failing that and if it's
+ * an array we then call svn_swig_pl_to_array(). Otherwise we croak().
+ */
+const apr_array_header_t *svn_swig_pl_array_to_apr_array_revision_range(
+ SV *source, apr_pool_t *pool)
+{
+ svn_boolean_t croak_on_error = FALSE;
+ svn_opt_revision_range_t *range;
+
+ if (range = convert_pl_revision_range(source, &croak_on_error, pool)) {
+ apr_array_header_t *temp = apr_array_make(pool, 1,
+ sizeof(svn_opt_revision_range_t *));
+ temp->nelts = 1;
+ APR_ARRAY_IDX(temp, 0, svn_opt_revision_range_t *) = range;
+ return temp;
+ }
+
+ if (SvROK(source) && SvTYPE(SvRV(source)) == SVt_PVAV) {
+ croak_on_error = TRUE;
+ return svn_swig_pl_to_array(source, convert_pl_revision_range,
+ &croak_on_error, pool);
+ }
+
+ croak("must pass a single revision range or a reference to an array of revision ranges");
+
+ /* This return is actually unreachable because of the croak above,
+ * however, Visual Studio's compiler doesn't like if all paths don't have
+ * a return and errors out otherwise. */
+ return NULL;
+}
+
/* element convertors for c -> perl */
typedef SV *(*element_converter_t)(void *value, void *ctx);
@@ -312,11 +419,16 @@ SV *svn_swig_pl_revnums_to_list(const ap
{
return convert_array(array, (element_converter_t)convert_svn_revnum_t,
NULL);
-}
+}
/* perl -> c svn_opt_revision_t conversion */
-svn_opt_revision_t *svn_swig_pl_set_revision(svn_opt_revision_t *rev, SV *source)
+svn_opt_revision_t *svn_swig_pl_set_revision(svn_opt_revision_t *rev,
+ SV *source,
+ svn_boolean_t croak_on_error)
{
+#define maybe_croak(argv) do { if (croak_on_error) croak argv; \
+ else return NULL; } while (0)
+
if (source == NULL || source == &PL_sv_undef || !SvOK(source)) {
rev->kind = svn_opt_revision_unspecified;
}
@@ -347,33 +459,34 @@ svn_opt_revision_t *svn_swig_pl_set_revi
char *end = strchr(input,'}');
if (!end)
- croak("unknown opt_revision_t string \"%s\": "
- "missing closing brace for \"{DATE}\"", input);
+ maybe_croak(("unknown opt_revision_t string \"%s\": "
+ "missing closing brace for \"{DATE}\"", input));
*end = '\0';
err = svn_parse_date (&matched, &tm, input + 1, apr_time_now(),
svn_swig_pl_make_pool ((SV *)NULL));
if (err) {
svn_error_clear (err);
- croak("unknown opt_revision_t string \"{%s}\": "
- "internal svn_parse_date error", input + 1);
+ maybe_croak(("unknown opt_revision_t string \"{%s}\": "
+ "internal svn_parse_date error", input + 1));
}
if (!matched)
- croak("unknown opt_revision_t string \"{%s}\": "
- "svn_parse_date failed to parse it", input + 1);
+ maybe_croak(("unknown opt_revision_t string \"{%s}\": "
+ "svn_parse_date failed to parse it", input + 1));
rev->kind = svn_opt_revision_date;
rev->value.date = tm;
} else
- croak("unknown opt_revision_t string \"%s\": must be one of "
- "\"BASE\", \"HEAD\", \"WORKING\", \"COMMITTED\", "
- "\"PREV\" or a \"{DATE}\"", input);
+ maybe_croak(("unknown opt_revision_t string \"%s\": must be one of "
+ "\"BASE\", \"HEAD\", \"WORKING\", \"COMMITTED\", "
+ "\"PREV\" or a \"{DATE}\"", input));
} else
- croak("unknown opt_revision_t type: must be undef, a number, "
- "a string (one of \"BASE\", \"HEAD\", \"WORKING\", "
- "\"COMMITTED\", \"PREV\" or a \"{DATE}\") "
- "or a _p_svn_opt_revision_t object");
+ maybe_croak(("unknown opt_revision_t type: must be undef, a number, "
+ "a string (one of \"BASE\", \"HEAD\", \"WORKING\", "
+ "\"COMMITTED\", \"PREV\" or a \"{DATE}\") "
+ "or a _p_svn_opt_revision_t object"));
return rev;
+#undef maybe_croak
}
/* put the va_arg in stack and invoke caller_func with func.
@@ -910,6 +1023,24 @@ svn_error_t *svn_swig_pl_thunk_log_recei
return SVN_NO_ERROR;
}
+svn_error_t *svn_swig_pl_thunk_log_entry_receiver(void *baton,
+ svn_log_entry_t *log_entry,
+ apr_pool_t *pool)
+{
+ SV *receiver = baton;
+
+ if (!SvOK(receiver))
+ return SVN_NO_ERROR;
+
+ svn_swig_pl_callback_thunk(CALL_SV,
+ receiver, NULL,
+ "SS",
+ log_entry, _SWIG_TYPE("svn_log_entry_t *"),
+ pool, POOLINFO);
+
+ return SVN_NO_ERROR;
+}
+
svn_error_t * svn_swig_pl_thunk_client_diff_summarize_func(
const svn_client_diff_summarize_t *diff,
void *baton,
@@ -982,7 +1113,7 @@ svn_error_t *svn_swig_pl_thunk_commit_ca
return SVN_NO_ERROR;
}
-svn_error_t *svn_swig_pl_thunk_commit_callback2(const svn_commit_info_t *commit_info,
+svn_error_t *svn_swig_pl_thunk_commit_callback2(const svn_commit_info_t *commit_info,
void *baton,
apr_pool_t *pool)
{
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h Fri May 10 14:58:47 2013
@@ -93,9 +93,12 @@ apr_hash_t *svn_swig_pl_objs_to_hash_by_
apr_pool_t *pool);
apr_hash_t *svn_swig_pl_objs_to_hash_of_revnum_t(SV *source,
apr_pool_t *pool);
+apr_hash_t *svn_swig_pl_hash_to_prophash(SV *source, apr_pool_t *pool);
const apr_array_header_t *svn_swig_pl_objs_to_array(SV *source,
swig_type_info *tinfo,
apr_pool_t *pool);
+const apr_array_header_t *svn_swig_pl_array_to_apr_array_revision_range(
+ 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
@@ -106,10 +109,12 @@ SV *svn_swig_pl_convert_array(const apr_
SV *svn_swig_pl_revnums_to_list(const apr_array_header_t *array);
-svn_opt_revision_t *svn_swig_pl_set_revision(svn_opt_revision_t *rev, SV *source);
+svn_opt_revision_t *svn_swig_pl_set_revision(svn_opt_revision_t *rev,
+ SV *source,
+ svn_boolean_t croak_on_error);
-/* thunked log receiver function. */
-svn_error_t * svn_swig_pl_thunk_log_receiver(void *py_receiver,
+/* thunked log_message receiver function. */
+svn_error_t * svn_swig_pl_thunk_log_receiver(void *baton,
apr_hash_t *changed_paths,
svn_revnum_t rev,
const char *author,
@@ -117,6 +122,11 @@ svn_error_t * svn_swig_pl_thunk_log_rece
const char *msg,
apr_pool_t *pool);
+/* thunked log_entry receiver function. */
+svn_error_t * svn_swig_pl_thunk_log_entry_receiver(void *baton,
+ svn_log_entry_t *log_entry,
+ apr_pool_t *pool);
+
/* thunked diff summarize callback. */
svn_error_t * svn_swig_pl_thunk_client_diff_summarize_func(
const svn_client_diff_summarize_t *diff,
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/Client.pm
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/Client.pm?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/Client.pm (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/Client.pm Fri May 10 14:58:47 2013
@@ -12,8 +12,8 @@ BEGIN {
checkout2 checkout update4 update3 update2 update switch2 switch
add4 add3 add2 add mkdir4 mkdir3 mkdir2 mkdir delete3 delete2
delete import3 import2 import commit4 commit3 commit2
- commit status4 status3 status2 status log4 log3 log2 log blame4
- blame3 blame2 blame diff4 diff3 diff2 diff diff_peg4
+ commit status4 status3 status2 status log5 log4 log3 log2 log
+ blame4 blame3 blame2 blame diff4 diff3 diff2 diff diff_peg4
diff_peg3 diff_peg2 diff_peg diff_summarize2
diff_summarize diff_summarize_peg2 diff_summarize_peg
merge3 merge2 merge merge_peg3 merge_peg2 merge_peg
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/Core.pm
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/Core.pm?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/Core.pm (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/Core.pm Fri May 10 14:58:47 2013
@@ -698,6 +698,47 @@ no previous history.
=cut
+package _p_svn_log_changed_path2_t;
+use SVN::Base qw(Core svn_log_changed_path2_t_);
+
+=head2 svn_log_changed_path2_t
+
+An object to represent a path that changed for a log entry.
+
+=over 4
+
+=item $lcp-E<gt>action()
+
+'A'dd, 'D'elete, 'R'eplace, 'M'odify
+
+=item $lcp-E<gt>copyfrom_path()
+
+Source path of copy, or C<undef> if there isn't any previous revision
+history.
+
+=item $lcp-E<gt>copyfrom_rev()
+
+Source revision of copy, or C<$SVN::Core::INVALID_REVNUM> if there is
+no previous history.
+
+=item $lcp-E<gt>node_kind()
+
+The type of the node, a C<$SVN::Node> enum; may be C<$SVN::Node::unknown>.
+
+=item $lcp-E<gt>text_modified()
+
+Is the text modified, a C<SVN::Tristate> enum,
+may be C<$SVN::Tristate::unknown>.
+
+=item $lcp-E<gt>props_modified()
+
+Are properties modified, a C<SVN::Tristate> enum,
+may be C<$SVN::Tristate::unknown>.
+
+=back
+
+=cut
+
package SVN::Node;
use SVN::Base qw(Core svn_node_);
@@ -710,6 +751,20 @@ $SVN::Node::dir, $SVN::Node::unknown.
=cut
+package SVN::Tristate;
+use SVN::Base qw(Core svn_tristate_);
+
+=head2 svn_tristate_t - SVN::Tristate
+
+An enum of the following constants:
+
+$SVN::Tristate::true, $SVN::Tristate::false, $SVN::Tristate::unknown
+
+Note that these true/false values have nothing to do with Perl's concept
+of truth. In fact, each constant would evaluate to true in a boolean context.
+
+=cut
+
package SVN::Depth;
use SVN::Base qw(Core svn_depth_);
@@ -772,11 +827,56 @@ use SVN::Base qw(Core svn_opt_revision_t
=head2 svn_opt_revision_t
+A revision, specified in one of C<SVN::Core::opt_revision_*> ways.
+
+=over 4
+
+=item $rev-E<gt>kind()
+
+An enum denoting how the revision C<$rev> was specified. One of
+C<$VN::Core::opt_revision_unspecified>,
+C<$VN::Core::opt_revision_number>,
+C<$VN::Core::opt_revision_date>,
+C<$VN::Core::opt_revision_committed>,
+C<$VN::Core::opt_revision_previous>,
+C<$VN::Core::opt_revision_base>,
+C<$VN::Core::opt_revision_working>
+or C<$SVN::Core::opt_revision_head>.
+
+=item $rev-E<gt>value()
+
+Extra data about the revision. Only relevant if C<$rev-E<gt>kind> is
+C<$VN::Core::opt_revision_number> (where it contains the revision number)
+or C<$VN::Core::opt_revision_date> (where it contains a date).
+
+=back
+
=cut
package _p_svn_opt_revision_value_t;
use SVN::Base qw(Core svn_opt_revision_value_t_);
+package _p_svn_opt_revision_range_t;
+use SVN::Base qw(Core svn_opt_revision_range_t_);
+
+=head2 svn_opt_revision_range_t
+
+An object representing a range of revisions.
+
+=over 4
+
+=item $range-E<gt>start()
+
+The first revision in the range, a C<_p_svn_opt_revision_t> object.
+
+=item $range-E<gt>end()
+
+The last revision in the range, a C<_p_svn_opt_revision_t> object.
+
+=back
+
+=cut
+
package _p_svn_config_t;
use SVN::Base qw(Core svn_config_);
@@ -848,12 +948,48 @@ Error message from the post-commit hook,
=item $commit-E<gt>repos_root()
-Repoistory root, may be undef if unknown.
+Repository root, may be C<undef> if unknown.
=back
=cut
+package _p_svn_log_entry_t;
+use SVN::Base qw(Core svn_log_entry_t_);
+
+=head2 svn_log_entry_t
+
+=item $entry-E<gt>revision()
+
+The revision of the commit.
+
+=item $entry-E<gt>revprops()
+
+A reference to a hash of requested revision properties,
+which may be C<undef> if it would contain no revprops.
+
+=item $entry-E<gt>has_children()
+
+Whether or not this message has children.
+
+=item $entry-E<gt>changed_paths2()
+
+A reference to hash containing as keys every path committed in
+C<$entry-E<gt>revision()>; the values are C<_p_svn_log_changed_path2_t>
+objects.
+
+=item $entry-E<gt>non_inheritable()
+
+Whether C<$entry-E<gt>revision()> should be interpreted as non-inheritable
+in the same sense of C<_p_svn_merge_range_t>.
+
+=item $entry-E<gt>subtractive_merge()
+
+Whether C<$entry-E<gt>revision()> is a merged revision resulting
+from a reverse merge.
+
+=cut
+
package _p_svn_auth_cred_simple_t;
use SVN::Base qw(Core svn_auth_cred_simple_t_);
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/t/3client.t
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/t/3client.t?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/t/3client.t (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/perl/native/t/3client.t Fri May 10 14:58:47 2013
@@ -20,7 +20,7 @@
#
#
-use Test::More tests => 223;
+use Test::More tests => 297;
use strict;
# shut up about variables that are only used once.
@@ -346,69 +346,255 @@ isa_ok($svn_error, '_p_svn_error_t',
$svn_error->clear(); #don't leak this
# test getting the log
-# TEST
+
+sub test_log_message_receiver {
+ my ($changed_paths,$revision,
+ $author,$date,$message,$pool) = @_;
+ # TEST
+ isa_ok($changed_paths,'HASH',
+ 'changed_paths param is a HASH');
+ # TEST
+ isa_ok($changed_paths->{'/dir1/new'},
+ '_p_svn_log_changed_path_t',
+ 'Hash value is a _p_svn_log_changed_path_t');
+ # TEST
+ is($changed_paths->{'/dir1/new'}->action(),'A',
+ 'action returns A for add');
+ # TEST
+ is($changed_paths->{'/dir1/new'}->copyfrom_path(),undef,
+ 'copyfrom_path returns undef as it is not a copy');
+ # TEST
+ is($changed_paths->{'/dir1/new'}->copyfrom_rev(),
+ $SVN::Core::INVALID_REVNUM,
+ 'copyfrom_rev is set to INVALID as it is not a copy');
+ # TEST
+ is($revision,$current_rev,
+ 'revision param matches current rev');
+ # TEST
+ is($author,$username,
+ 'author param matches expected username');
+ # TEST
+ ok($date,'date param is defined');
+ # TEST
+ is($message,'Add new',
+ 'message param is the expected value');
+ # TEST
+ isa_ok($pool,'_p_apr_pool_t',
+ 'pool param is _p_apr_pool_t');
+}
+
+# TEST log range $current_rev:$current_rev
is($ctx->log("$reposurl/dir1/new",$current_rev,$current_rev,1,0,
- sub
- {
- my ($changed_paths,$revision,
- $author,$date,$message,$pool) = @_;
- # TEST
- isa_ok($changed_paths,'HASH',
- 'changed_paths param is a HASH');
- # TEST
- isa_ok($changed_paths->{'/dir1/new'},
- '_p_svn_log_changed_path_t',
- 'Hash value is a _p_svn_log_changed_path_t');
- # TEST
- is($changed_paths->{'/dir1/new'}->action(),'A',
- 'action returns A for add');
- # TEST
- is($changed_paths->{'/dir1/new'}->copyfrom_path(),undef,
- 'copyfrom_path returns undef as it is not a copy');
- # TEST
- is($changed_paths->{'/dir1/new'}->copyfrom_rev(),
- $SVN::Core::INVALID_REVNUM,
- 'copyfrom_rev is set to INVALID as it is not a copy');
- # TEST
- is($revision,$current_rev,
- 'revision param matches current rev');
- # TEST
- is($author,$username,
- 'author param matches expected username');
- # TEST
- ok($date,'date param is defined');
- # TEST
- is($message,'Add new',
- 'message param is the expected value');
- # TEST
- isa_ok($pool,'_p_apr_pool_t',
- 'pool param is _p_apr_pool_t');
- }),
+ \&test_log_message_receiver),
undef,
'log returns undef');
+# TEST log2 range $current_rev:0 limit=1
+is($ctx->log2("$reposurl/dir1/new",$current_rev,0,1,1,0,
+ \&test_log_message_receiver),
+ undef,
+ 'log2 returns undef');
+# TEST log3 range $current_rev:0 limit=1
+is($ctx->log3("$reposurl/dir1/new",'HEAD',$current_rev,0,1,1,0,
+ \&test_log_message_receiver),
+ undef,
+ 'log3 returns undef');
+
+my @new_paths = qw( dir1/new dir1/new2 dir1/new3 dir1/new4 );
+$ctx->log3([ $reposurl, @new_paths ],
+ 'HEAD',$current_rev,0,1,1,0, sub {
+ my ($changed_paths,$revision,$author,$date,$message,$pool) = @_;
+ # TEST
+ is_deeply([sort keys %$changed_paths],
+ [sort map { "/$_" } @new_paths],
+ "changed_paths for multiple targets");
+});
+
+sub get_full_log {
+ my ($start, $end) = @_;
+ my @log;
+ $ctx->log($reposurl, $start, $end, 1, 0, sub {
+ my ($changed_paths, $revision, $author, $date, $msg, undef) = @_;
+ # "unpack" the values of the $changed_paths hash
+ # (_p_svn_log_changed_path_t objects) so that
+ # we can use is_deeply() to compare results
+ my %hash;
+ while (my ($path, $changed) = each %$changed_paths) {
+ foreach (qw( action copyfrom_path copyfrom_rev )) {
+ $hash{$path}{$_} = $changed->$_()
+ }
+ }
+ push @log, [ \%hash, $revision, $author, $date, $msg ];
+ });
+ return \@log;
+}
+
+# TEST
+my $full_log = get_full_log('HEAD',1);
+is(scalar @$full_log, $current_rev, "history up to 'HEAD'");
# TEST
my $opt_revision_head = SVN::_Core::new_svn_opt_revision_t();
$opt_revision_head->kind($SVN::Core::opt_revision_head);
-is_deeply(get_log2($opt_revision_head), # got
- get_log2("HEAD")); # expected
+is_deeply(get_full_log($opt_revision_head,1), # got
+ $full_log, # expected
+ "history up to svn_opt_revision_t of kind head");
+
+# TEST
+is_deeply(get_full_log($current_rev,1), # got
+ $full_log, # expected
+ "history up to number $current_rev");
+
# TEST
my $opt_revision_number = SVN::_Core::new_svn_opt_revision_t();
$opt_revision_number->kind($SVN::Core::opt_revision_number);
$opt_revision_number->value->number($current_rev);
-is_deeply(get_log2($opt_revision_number), # got
- get_log2($current_rev)); # expected
+is_deeply(get_full_log($opt_revision_number,1), # got
+ $full_log, # expected
+ "history up to svn_opt_revision_t of kind number and value $current_rev");
-sub get_log2 {
- my ($rev) = @_;
- my @log;
- $ctx->log2($reposurl, $rev, $rev, 0, 0, 0, sub {
- my (undef, $revision, $author, $date, $msg, undef) = @_;
- push @log, [ $revision, $author, $date, $msg ];
+sub test_log_entry_receiver {
+ my ($log_entry,$pool) = @_;
+ # TEST
+ isa_ok($log_entry, '_p_svn_log_entry_t',
+ 'log_entry param');
+ # TEST
+ isa_ok($pool,'_p_apr_pool_t',
+ 'pool param');
+ # TEST
+ is($log_entry->revision,$current_rev,
+ 'log_entry->revision matches current rev');
+
+ my $revprops = $log_entry->revprops;
+ # TEST
+ isa_ok($revprops,'HASH',
+ 'log_entry->revprops');
+ # TEST
+ is($revprops->{"svn:author"},$username,
+ 'svn:author revprop matches expected username');
+ # TEST
+ ok($revprops->{"svn:date"},'svn:date revprop is defined');
+ # TEST
+ is($revprops->{"svn:log"},'Add new',
+ 'svn:log revprop is the expected value');
+
+ my $changed_paths = $log_entry->changed_paths2;
+ # TEST
+ isa_ok($changed_paths,'HASH',
+ 'log_entry->changed_paths2');
+ # TEST
+ isa_ok($changed_paths->{'/dir1/new'},
+ '_p_svn_log_changed_path2_t',
+ 'log_entry->changed_paths2 value');
+ # TEST
+ is($changed_paths->{'/dir1/new'}->action(),'A',
+ 'action returns A for add');
+ # TEST
+ is($changed_paths->{'/dir1/new'}->node_kind(),$SVN::Node::file,
+ 'node_kind returns $SVN::Node::file');
+ # TEST
+ is($changed_paths->{'/dir1/new'}->text_modified(),$SVN::Tristate::true,
+ 'text_modified returns true');
+ # TEST
+ is($changed_paths->{'/dir1/new'}->props_modified(),$SVN::Tristate::false,
+ 'props_modified returns false');
+ # TEST
+ is($changed_paths->{'/dir1/new'}->copyfrom_path(),undef,
+ 'copyfrom_path returns undef as it is not a copy');
+ # TEST
+ is($changed_paths->{'/dir1/new'}->copyfrom_rev(),
+ $SVN::Core::INVALID_REVNUM,
+ 'copyfrom_rev is set to INVALID as it is not a copy');
+}
+
+# TEST
+is($ctx->log4("$reposurl/dir1/new",
+ 'HEAD',$current_rev,0,1, # peg rev, start rev, end rev, limit
+ 1,1,0, # discover_changed_paths, strict_node_history, include_merged_revisions
+ undef, # revprops
+ \&test_log_entry_receiver),
+ undef,
+ 'log4 returns undef');
+
+# TEST
+is($ctx->log5("$reposurl/dir1/new",
+ 'HEAD',[$current_rev,0],1, # peg rev, rev ranges, limit
+ 1,1,0, # discover_changed_paths, strict_node_history, include_merged_revisions
+ undef, # revprops
+ \&test_log_entry_receiver),
+ undef,
+ 'log5 returns undef');
+
+# test the different forms to specify revision ranges
+sub get_revs {
+ my ($rev_ranges) = @_;
+ my @revs;
+ $ctx->log5($reposurl, 'HEAD', $rev_ranges, 0, 0, 0, 0, undef, sub {
+ my ($log_entry,$pool) = @_;
+ push @revs, $log_entry->revision;
});
- return \@log;
+ return \@revs;
}
+my $top = SVN::_Core::new_svn_opt_revision_range_t();
+$top->start('HEAD');
+$top->end('HEAD');
+my $bottom = SVN::_Core::new_svn_opt_revision_range_t();
+$bottom->start(1);
+$bottom->end($current_rev-1);
+
+# TEST
+is_deeply(get_revs($top),
+ [ $current_rev ], 'single svn_opt_revision_range_t');
+# TEST
+is_deeply(get_revs([$top]),
+ [ $current_rev ], 'list of svn_opt_revision_range_t');
+# TEST
+is_deeply(get_revs(['HEAD', 'HEAD']),
+ [ $current_rev ], 'single [start, end]');
+# TEST
+is_deeply(get_revs([['HEAD', 'HEAD']]),
+ [ $current_rev ], 'list of [start, end]');
+# TEST
+is_deeply(get_revs([$current_rev, $current_rev]),
+ [ $current_rev ], 'single [start, end]');
+# TEST
+is_deeply(get_revs([[$current_rev, $current_rev]]),
+ [ $current_rev ], 'list of [start, end]');
+# TEST
+is_deeply(get_revs([1, 'HEAD']),
+ [ 1..$current_rev ], 'single [start, end]');
+# TEST
+is_deeply(get_revs([[1, 'HEAD']]),
+ [ 1..$current_rev ], 'list of [start, end]');
+# TEST
+is_deeply(get_revs([1, $opt_revision_head]),
+ [ 1..$current_rev ], 'single [start, end]');
+# TEST
+is_deeply(get_revs([[1, $opt_revision_head]]),
+ [ 1..$current_rev ], 'list of [start, end]');
+# TEST
+is_deeply(get_revs($bottom),
+ [ 1..$current_rev-1 ], 'single svn_opt_revision_range_t');
+# TEST
+is_deeply(get_revs([$bottom]),
+ [ 1..$current_rev-1 ], 'list of svn_opt_revision_range_t');
+# TEST
+is_deeply(get_revs([1, $current_rev-1]),
+ [ 1..$current_rev-1 ], 'single [start, end]');
+# TEST
+is_deeply(get_revs([[1, $current_rev-1]]),
+ [ 1..$current_rev-1 ], 'list of [start, end]');
+# TEST
+is_deeply(get_revs([[1, $current_rev-1], $top]),
+ [ 1..$current_rev ], 'mixed list of ranges');
+# TEST
+is_deeply(get_revs([$bottom, ['HEAD', 'HEAD']]),
+ [ 1..$current_rev ], 'mixed list of ranges');
+# TEST
+is_deeply(get_revs([$bottom, $top]),
+ [ 1..$current_rev ], 'mixed list of ranges');
+
+
# TEST
is($ctx->update($wcpath,'HEAD',1),$current_rev,
'Return from update is the current rev');
@@ -461,8 +647,7 @@ is($ctx->status($wcpath, undef, sub {
' the correct path.');
# TEST
isa_ok($wc_status,'_p_svn_wc_status_t',
- 'wc_stats param is a' .
- ' _p_svn_wc_status_t');
+ 'wc_stats param');
# TEST
is($wc_status->text_status(),
$SVN::Wc::Status::normal,
@@ -783,7 +968,7 @@ my($pl) = $ctx->proplist($reposurl,$curr
isa_ok($pl,'ARRAY','proplist returns an ARRAY');
# TEST
isa_ok($pl->[0], '_p_svn_client_proplist_item_t',
- 'array element is a _p_svn_client_proplist_item_t');
+ 'proplist array element');
# TEST
is($pl->[0]->node_name(),"$reposurl/dir1",
'node_name is the expected value');
@@ -874,8 +1059,7 @@ is($ctx->blame("$reposurl/foo",'HEAD','H
}
# TEST
isa_ok($pool,'_p_apr_pool_t',
- 'pool param is ' .
- '_p_apr_pool_t');
+ 'pool param');
}),
undef,
'blame returns undef');
@@ -902,7 +1086,7 @@ my ($dirents) = $ctx->ls($reposurl,"$cur
isa_ok($dirents, 'HASH','ls returns a HASH');
# TEST
isa_ok($dirents->{'dir1'},'_p_svn_dirent_t',
- 'hash value is a _p_svn_dirent_t');
+ 'dirents hash value');
# TEST
is($dirents->{'dir1'}->kind(),$SVN::Core::node_dir,
'kind() returns a dir node');
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/python/README
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/python/README?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/python/README (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/python/README Fri May 10 14:58:47 2013
@@ -5,6 +5,25 @@ TRANSLATING PARAMETER LISTS
The argument-reductions laws of the SWIG bindings something go like
this:
+ - The module prefix can be omitted. o:
+
+ void *some_C_function = svn_client_foo;
+
+ becomes:
+
+ import svn.client
+ func = svn.client.foo
+
+ However, the following two alternatives also work:
+
+ # Fully-qualified C name
+ import svn.client
+ func = svn.client.svn_client_foo
+
+ # Star-import imports just svn_* names, not bare 'foo' names.
+ from svn.client import *
+ func = svn_client_foo
+
- Python functions don't return errors. They throw exceptions.
Which means that...
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c Fri May 10 14:58:47 2013
@@ -35,6 +35,7 @@
#include <apr_portable.h>
#include <apr_thread_proc.h>
+#include "svn_hash.h"
#include "svn_client.h"
#include "svn_string.h"
#include "svn_opt.h"
@@ -547,6 +548,19 @@ static PyObject *convert_svn_string_t(vo
return PyString_FromStringAndSize((void *)s->data, s->len);
}
+/* Convert a C string into a Python String object (or a reference to
+ Py_None if CSTRING is NULL). */
+static PyObject *cstring_to_pystring(const char *cstring)
+{
+ if (! cstring)
+ {
+ PyObject *retval = Py_None;
+ Py_INCREF(Py_None);
+ return retval;
+ }
+ return PyString_FromString(cstring);
+}
+
static PyObject *convert_svn_client_commit_item3_t(void *value, void *ctx)
{
PyObject *list;
@@ -558,30 +572,9 @@ static PyObject *convert_svn_client_comm
list = PyList_New(9);
- if (item->path)
- path = PyString_FromString(item->path);
- else
- {
- path = Py_None;
- Py_INCREF(Py_None);
- }
-
- if (item->url)
- url = PyString_FromString(item->url);
- else
- {
- url = Py_None;
- Py_INCREF(Py_None);
- }
-
- if (item->copyfrom_url)
- cf_url = PyString_FromString(item->copyfrom_url);
- else
- {
- cf_url = Py_None;
- Py_INCREF(Py_None);
- }
-
+ path = cstring_to_pystring(item->path);
+ url = cstring_to_pystring(item->url);
+ cf_url = cstring_to_pystring(item->copyfrom_url);
kind = PyInt_FromLong(item->kind);
rev = PyInt_FromLong(item->revision);
cf_rev = PyInt_FromLong(item->copyfrom_rev);
@@ -708,6 +701,51 @@ PyObject *svn_swig_py_mergeinfo_catalog_
return convert_hash(hash, convert_mergeinfo_hash, type, py_pool);
}
+PyObject *
+svn_swig_py_propinheriteditemarray_to_dict(const apr_array_header_t *array)
+{
+ PyObject *dict = PyDict_New();
+ int i;
+
+ if (dict == NULL)
+ return NULL;
+
+ for (i = 0; i < array->nelts; ++i)
+ {
+ svn_prop_inherited_item_t *prop_inherited_item
+ = APR_ARRAY_IDX(array, i, svn_prop_inherited_item_t *);
+ apr_hash_t *prop_hash = prop_inherited_item->prop_hash;
+ PyObject *py_key, *py_value;
+
+ py_key = PyString_FromString(prop_inherited_item->path_or_url);
+ if (py_key == NULL)
+ goto error;
+
+ py_value = svn_swig_py_prophash_to_dict(prop_hash);
+ if (py_value == NULL)
+ {
+ Py_DECREF(py_key);
+ goto error;
+ }
+
+ if (PyDict_SetItem(dict, py_key, py_value) == -1)
+ {
+ Py_DECREF(py_value);
+ Py_DECREF(py_key);
+ goto error;
+ }
+
+ Py_DECREF(py_value);
+ Py_DECREF(py_key);
+ }
+
+ return dict;
+
+ error:
+ Py_DECREF(dict);
+ return NULL;
+}
+
PyObject *svn_swig_py_proparray_to_dict(const apr_array_header_t *array)
{
PyObject *dict = PyDict_New();
@@ -743,7 +781,15 @@ PyObject *svn_swig_py_proparray_to_dict(
}
}
- PyDict_SetItem(dict, py_key, py_value);
+ if (PyDict_SetItem(dict, py_key, py_value) == -1)
+ {
+ Py_DECREF(py_key);
+ Py_DECREF(py_value);
+ goto error;
+ }
+
+ Py_DECREF(py_key);
+ Py_DECREF(py_value);
}
return dict;
@@ -786,6 +832,7 @@ PyObject *svn_swig_py_locationhash_to_di
}
if (PyDict_SetItem(dict, key, value) == -1)
{
+ Py_DECREF(key);
Py_DECREF(value);
Py_DECREF(dict);
return NULL;
@@ -845,7 +892,11 @@ PyObject *svn_swig_py_c_strings_to_list(
if (ob == NULL)
goto error;
if (PyList_Append(list, ob) == -1)
+ {
+ Py_DECREF(ob);
goto error;
+ }
+ Py_DECREF(ob);
}
return list;
@@ -959,7 +1010,7 @@ apr_hash_t *svn_swig_py_stringhash_from_
Py_DECREF(keys);
return NULL;
}
- apr_hash_set(hash, propname, APR_HASH_KEY_STRING, propval);
+ svn_hash_sets(hash, propname, propval);
}
Py_DECREF(keys);
return hash;
@@ -1002,7 +1053,7 @@ apr_hash_t *svn_swig_py_mergeinfo_from_d
Py_DECREF(keys);
return NULL;
}
- apr_hash_set(hash, pathname, APR_HASH_KEY_STRING, ranges);
+ svn_hash_sets(hash, pathname, ranges);
}
Py_DECREF(keys);
return hash;
@@ -1079,7 +1130,7 @@ apr_hash_t *svn_swig_py_prophash_from_di
Py_DECREF(keys);
return NULL;
}
- apr_hash_set(hash, propname, APR_HASH_KEY_STRING, propval);
+ svn_hash_sets(hash, propname, propval);
}
Py_DECREF(keys);
return hash;
@@ -1132,7 +1183,7 @@ apr_hash_t *svn_swig_py_path_revs_hash_f
return NULL;
}
- apr_hash_set(hash, path, APR_HASH_KEY_STRING, revnum);
+ svn_hash_sets(hash, path, revnum);
}
Py_DECREF(keys);
return hash;
@@ -1181,7 +1232,7 @@ apr_hash_t *svn_swig_py_struct_ptr_hash_
Py_DECREF(keys);
return NULL;
}
- apr_hash_set(hash, c_key, APR_HASH_KEY_STRING, struct_ptr);
+ svn_hash_sets(hash, c_key, struct_ptr);
}
Py_DECREF(keys);
return hash;
@@ -2586,6 +2637,139 @@ svn_error_t *svn_swig_py_repos_history_f
return err;
}
+static svn_error_t *
+freeze_func(void *baton,
+ apr_pool_t *pool)
+{
+ PyObject *receiver = baton;
+ PyObject *py_pool;
+ PyObject *result;
+ svn_error_t *err = SVN_NO_ERROR;
+
+ if ((receiver == NULL) || (receiver == Py_None))
+ return SVN_NO_ERROR;
+
+ svn_swig_py_acquire_py_lock();
+
+ py_pool = make_ob_pool(pool);
+ if (py_pool == NULL)
+ {
+ err = callback_exception_error();
+ goto finished;
+ }
+
+ result = PyObject_CallFunction(receiver, (char *)"O", py_pool);
+ if (result == NULL)
+ {
+ err = callback_exception_error();
+ }
+ else
+ {
+ if (result != Py_None)
+ err = callback_bad_return_error("Not None");
+ Py_DECREF(result);
+ }
+
+ Py_DECREF(py_pool);
+
+finished:
+ svn_swig_py_release_py_lock();
+ return err;
+}
+
+svn_error_t *svn_swig_py_repos_freeze_func(void *baton,
+ apr_pool_t *pool)
+{
+ return freeze_func(baton, pool);
+}
+
+svn_error_t *svn_swig_py_fs_freeze_func(void *baton,
+ apr_pool_t *pool)
+{
+ return freeze_func(baton, pool);
+}
+
+svn_error_t *svn_swig_py_proplist_receiver2(void *baton,
+ const char *path,
+ apr_hash_t *prop_hash,
+ apr_array_header_t *inherited_props,
+ apr_pool_t *pool)
+{
+ PyObject *receiver = baton;
+ PyObject *py_pool;
+ PyObject *py_props;
+ PyObject *py_iprops;
+ PyObject *result;
+ svn_error_t *err = SVN_NO_ERROR;
+
+ if ((receiver == NULL) || (receiver == Py_None))
+ return SVN_NO_ERROR;
+
+ svn_swig_py_acquire_py_lock();
+
+ py_pool = make_ob_pool(pool);
+ if (py_pool == NULL)
+ {
+ err = callback_exception_error();
+ goto finished;
+ }
+
+ if (prop_hash)
+ {
+ py_props = svn_swig_py_prophash_to_dict(prop_hash);
+ if (py_props == NULL)
+ {
+ err = type_conversion_error("apr_hash_t *");
+ Py_DECREF(py_pool);
+ goto finished;
+ }
+ }
+ else
+ {
+ py_props = Py_None;
+ Py_INCREF(Py_None);
+ }
+
+ if (inherited_props)
+ {
+ py_iprops = svn_swig_py_propinheriteditemarray_to_dict(inherited_props);
+ if (py_iprops == NULL)
+ {
+ err = type_conversion_error("apr_array_header_t *");
+ Py_DECREF(py_props);
+ Py_DECREF(py_pool);
+ goto finished;
+ }
+ }
+ else
+ {
+ py_iprops = Py_None;
+ Py_INCREF(Py_None);
+ }
+
+ result = PyObject_CallFunction(receiver,
+ (char *)"sOOO",
+ path, py_props, py_iprops, py_pool);
+ if (result == NULL)
+ {
+ err = callback_exception_error();
+ }
+ else
+ {
+ if (result != Py_None)
+ err = callback_bad_return_error("Not None");
+ Py_DECREF(result);
+ }
+
+ Py_DECREF(py_props);
+ Py_DECREF(py_iprops);
+ Py_DECREF(py_pool);
+
+finished:
+ svn_swig_py_release_py_lock();
+ return err;
+}
+
svn_error_t *svn_swig_py_log_receiver(void *baton,
apr_hash_t *changed_paths,
@@ -3113,6 +3297,64 @@ svn_swig_py_auth_ssl_client_cert_pw_prom
return err;
}
+svn_error_t *
+svn_swig_py_config_auth_walk_func(svn_boolean_t *delete_cred,
+ void *walk_baton,
+ const char *cred_kind,
+ const char *realmstring,
+ apr_hash_t *hash,
+ apr_pool_t *scratch_pool)
+{
+ PyObject *function = walk_baton;
+ PyObject *result;
+ PyObject *py_scratch_pool, *py_hash;
+ svn_error_t *err = SVN_NO_ERROR;
+
+ *delete_cred = FALSE;
+
+ if (function == NULL || function == Py_None)
+ return SVN_NO_ERROR;
+
+ svn_swig_py_acquire_py_lock();
+
+ py_scratch_pool = make_ob_pool(scratch_pool);
+ if (py_scratch_pool == NULL)
+ {
+ err = callback_exception_error();
+ goto finished;
+ }
+ py_hash = svn_swig_py_prophash_to_dict(hash);
+ if (py_hash == NULL)
+ {
+ Py_DECREF(py_scratch_pool);
+ err = callback_exception_error();
+ goto finished;
+ }
+
+ if ((result = PyObject_CallFunction(function, (char *)"ssOO",
+ cred_kind, realmstring,
+ py_hash, py_scratch_pool)) == NULL)
+ {
+ err = callback_exception_error();
+ }
+ else
+ {
+ if (PyInt_Check(result))
+ *delete_cred = PyInt_AsLong(result) ? TRUE : FALSE;
+ else if (PyLong_Check(result))
+ *delete_cred = PyLong_AsLong(result) ? TRUE : FALSE;
+ else
+ err = callback_bad_return_error("Not an integer");
+ Py_DECREF(result);
+ }
+ Py_DECREF(py_hash);
+ Py_DECREF(py_scratch_pool);
+
+finished:
+ svn_swig_py_release_py_lock();
+ return err;
+}
+
/* svn_ra_callbacks_t */
static svn_error_t *
ra_callbacks_open_tmp_file(apr_file_t **fp,
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h Fri May 10 14:58:47 2013
@@ -215,6 +215,13 @@ apr_array_header_t *svn_swig_py_proparra
SVN_SWIG_SWIGUTIL_EXPORT
PyObject *svn_swig_py_proparray_to_dict(const apr_array_header_t *array);
+/* helper function to convert a 'apr_array_header_t *' of
+ 'svn_prop_inherited_item_t' to a Python dictionary mapping strings
+ to dictionary. */
+SVN_SWIG_SWIGUTIL_EXPORT
+PyObject *
+svn_swig_py_propinheriteditemarray_to_dict(const apr_array_header_t *array);
+
/* helper function to convert a Python dictionary mapping strings to
strings into an apr_hash_t mapping const char *'s to svn_string_t's,
allocated in POOL. */
@@ -399,6 +406,24 @@ svn_error_t *svn_swig_py_log_entry_recei
svn_log_entry_t *log_entry,
apr_pool_t *pool);
+/* thunked repos freeze function */
+SVN_SWIG_SWIGUTIL_EXPORT
+svn_error_t *svn_swig_py_repos_freeze_func(void *baton,
+ apr_pool_t *pool);
+
+/* thunked fs freeze function */
+SVN_SWIG_SWIGUTIL_EXPORT
+svn_error_t *svn_swig_py_fs_freeze_func(void *baton,
+ apr_pool_t *pool);
+
+/* thunked proplist receiver2 function */
+SVN_SWIG_SWIGUTIL_EXPORT
+svn_error_t *svn_swig_py_proplist_receiver2(void *baton,
+ const char *path,
+ apr_hash_t *prop_hash,
+ apr_array_header_t *inherited_props,
+ apr_pool_t *pool);
+
/* thunked info receiver function */
SVN_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_py_info_receiver_func(void *py_receiver,
@@ -481,6 +506,15 @@ svn_error_t *svn_swig_py_auth_ssl_client
svn_boolean_t may_save,
apr_pool_t *pool);
+/* auth cleanup callback */
+SVN_SWIG_SWIGUTIL_EXPORT
+svn_error_t *svn_swig_py_config_auth_walk_func(svn_boolean_t *delete_cred,
+ void *walk_baton,
+ const char *cred_kind,
+ const char *realmstring,
+ apr_hash_t *hash,
+ apr_pool_t *scratch_pool);
+
SVN_SWIG_SWIGUTIL_EXPORT
void
svn_swig_py_setup_ra_callbacks(svn_ra_callbacks2_t **callbacks,
Modified: subversion/branches/master-passphrase/subversion/bindings/swig/python/tests/checksum.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/bindings/swig/python/tests/checksum.py?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/bindings/swig/python/tests/checksum.py (original)
+++ subversion/branches/master-passphrase/subversion/bindings/swig/python/tests/checksum.py Fri May 10 14:58:47 2013
@@ -42,7 +42,7 @@ def suite():
if __name__ == '__main__':
runner = unittest.TextTestRunner()
runner.run(suite())
-
+
Propchange: subversion/branches/master-passphrase/subversion/bindings/swig/python/tests/checksum.py
------------------------------------------------------------------------------
svn:eol-style = native