You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/10/16 00:57:09 UTC
svn commit: r1532583 [3/10] - in /subversion/branches/fsfs-improvements: ./
build/ac-macros/ build/generator/ build/generator/templates/ build/win32/
contrib/client-side/emacs/ notes/ subversion/bindings/javahl/native/
subversion/bindings/javahl/src/or...
Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/Version.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/Version.java?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/Version.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/Version.java Tue Oct 15 22:57:03 2013
@@ -23,6 +23,8 @@
package org.apache.subversion.javahl.types;
+import org.apache.subversion.javahl.NativeResources;
+
/**
* Encapsulates version information about the underlying native
* libraries. Basically a wrapper for <a
@@ -31,6 +33,14 @@ package org.apache.subversion.javahl.typ
public class Version
{
/**
+ * Load the required native library.
+ */
+ static
+ {
+ NativeResources.loadNativeLibrary();
+ }
+
+ /**
* @return The full version string for the loaded JavaHL library,
* as defined by <code>MAJOR.MINOR.PATCH INFO</code>.
*/
Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java Tue Oct 15 22:57:03 2013
@@ -23,6 +23,8 @@
package org.apache.subversion.javahl.types;
+import org.apache.subversion.javahl.NativeResources;
+
/**
* Encapsulates information about the compile-time and run-time
* properties of the Subversion libraries.
@@ -31,6 +33,14 @@ package org.apache.subversion.javahl.typ
public class VersionExtended
{
/**
+ * Load the required native library.
+ */
+ static
+ {
+ NativeResources.loadNativeLibrary();
+ }
+
+ /**
* @return The date when the libsvn_subr library was compiled, in
* the format defined by the C standard macro #__DATE__.
*/
Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/util/DiffLib.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/util/DiffLib.java?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/util/DiffLib.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/apache/subversion/javahl/util/DiffLib.java Tue Oct 15 22:57:03 2013
@@ -43,42 +43,10 @@ public class DiffLib
NativeResources.loadNativeLibrary();
}
- /** @see ISVNUtil.FileDiff */
- public void FileDiff(String originalFile,
- String modifiedFile,
- SVNUtil.DiffOptions diffOptions,
-
- String originalHeader,
- String modifiedHeader,
- String headerEncoding,
- String relativeToDir,
-
- OutputStream resultStream)
- throws ClientException
- {
- nativeFileDiff(originalFile, modifiedFile,
-
- // Interpret the diff options
- (diffOptions == null
- ? SVNUtil.DiffOptions.IgnoreSpace.none.ordinal()
- : diffOptions.ignoreSpace.ordinal()),
- (diffOptions == null ? false
- : diffOptions.ignoreEolStyle),
- (diffOptions == null ? false
- : diffOptions.showCFunction),
-
- originalHeader, modifiedHeader, headerEncoding,
- relativeToDir, resultStream);
- }
-
- private native
- void nativeFileDiff(String originalFile,
+ /** @see ISVNUtil.fileDiff */
+ public boolean fileDiff(String originalFile,
String modifiedFile,
-
- // Interpreted diff options
- int ignoreSpace,
- boolean ignoreEolStyle,
- boolean showCFunction,
+ SVNUtil.DiffOptions diffOptions,
String originalHeader,
String modifiedHeader,
@@ -86,61 +54,93 @@ public class DiffLib
String relativeToDir,
OutputStream resultStream)
- throws ClientException;
-
- /** @see ISVNUtil.FileMerge */
- public void FileMerge(String originalFile,
- String modifiedFile,
- String latestFile,
- SVNUtil.DiffOptions diffOptions,
-
- String conflictOriginal,
- String conflictModified,
- String conflictLatest,
- String conflistSeparator,
- SVNUtil.ConflictDisplayStyle conflictStyle,
-
- OutputStream resultStream)
throws ClientException
{
- nativeFileMerge(originalFile, modifiedFile, latestFile,
+ return nativeFileDiff(originalFile, modifiedFile,
- // Interpret the diff options
- (diffOptions == null
- ? SVNUtil.DiffOptions.IgnoreSpace.none.ordinal()
- : diffOptions.ignoreSpace.ordinal()),
- (diffOptions == null ? false
- : diffOptions.ignoreEolStyle),
- (diffOptions == null ? false
- : diffOptions.showCFunction),
+ // Interpret the diff options
+ (diffOptions == null
+ ? SVNUtil.DiffOptions.IgnoreSpace.none.ordinal()
+ : diffOptions.ignoreSpace.ordinal()),
+ (diffOptions == null ? false
+ : diffOptions.ignoreEolStyle),
+ (diffOptions == null ? false
+ : diffOptions.showCFunction),
- conflictOriginal, conflictModified, conflictLatest,
- conflistSeparator,
-
- // Interpret the conflict style
- conflictStyle.ordinal(),
-
- resultStream);
+ originalHeader, modifiedHeader, headerEncoding,
+ relativeToDir, resultStream);
}
private native
- void nativeFileMerge(String originalFile,
+ boolean nativeFileDiff(String originalFile,
+ String modifiedFile,
+
+ // Interpreted diff options
+ int ignoreSpace,
+ boolean ignoreEolStyle,
+ boolean showCFunction,
+
+ String originalHeader,
+ String modifiedHeader,
+ String headerEncoding,
+ String relativeToDir,
+
+ OutputStream resultStream)
+ throws ClientException;
+
+ /** @see ISVNUtil.fileMerge */
+ public boolean fileMerge(String originalFile,
String modifiedFile,
String latestFile,
-
- // Interpreted diff options
- int ignoreSpace,
- boolean ignoreEolStyle,
- boolean showCFunction,
+ SVNUtil.DiffOptions diffOptions,
String conflictOriginal,
String conflictModified,
String conflictLatest,
String conflistSeparator,
-
- // Interpreted conflict display style
- int conflictStyle,
+ SVNUtil.ConflictDisplayStyle conflictStyle,
OutputStream resultStream)
+ throws ClientException
+ {
+ return nativeFileMerge(originalFile, modifiedFile, latestFile,
+
+ // Interpret the diff options
+ (diffOptions == null
+ ? SVNUtil.DiffOptions.IgnoreSpace.none.ordinal()
+ : diffOptions.ignoreSpace.ordinal()),
+ (diffOptions == null ? false
+ : diffOptions.ignoreEolStyle),
+ (diffOptions == null ? false
+ : diffOptions.showCFunction),
+
+ conflictOriginal, conflictModified,
+ conflictLatest, conflistSeparator,
+
+ // Interpret the conflict style
+ conflictStyle.ordinal(),
+
+ resultStream);
+ }
+
+ private native
+ boolean nativeFileMerge(String originalFile,
+ String modifiedFile,
+ String latestFile,
+
+ // Interpreted diff options
+ int ignoreSpace,
+ boolean ignoreEolStyle,
+ boolean showCFunction,
+
+ String conflictOriginal,
+ String conflictModified,
+ String conflictLatest,
+ String conflistSeparator,
+
+ // Interpreted conflict display style
+ int conflictStyle,
+
+ OutputStream resultStream)
throws ClientException;
}
Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Path.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Path.java?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Path.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/src/org/tigris/subversion/javahl/Path.java Tue Oct 15 22:57:03 2013
@@ -31,14 +31,6 @@ package org.tigris.subversion.javahl;
public class Path
{
/**
- * Load the required native library.
- */
- static
- {
- org.apache.subversion.javahl.NativeResources.loadNativeLibrary();
- }
-
- /**
* A valid path is a UTF-8 string without any control characters.
*
* @return Whether Subversion can store the path in a repository.
Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Tue Oct 15 22:57:03 2013
@@ -33,6 +33,9 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
import java.text.ParseException;
import java.util.Collection;
import java.util.Arrays;
@@ -3776,6 +3779,106 @@ public class BasicTests extends SVNTests
assertEquals(1, result.size());
}
+ private class Tunnel extends Thread implements TunnelAgent
+ {
+ public boolean checkTunnel(String name)
+ {
+ return name.equals("test");
+ }
+
+ public void openTunnel(ReadableByteChannel request,
+ WritableByteChannel response,
+ String name, String user,
+ String hostname, int port)
+ {
+ this.request = request;
+ this.response = response;
+ start();
+ }
+
+ public void closeTunnel(String name, String user,
+ String hostname, int port)
+ throws Throwable
+ {
+ request.close();
+ join();
+ response.close();
+ }
+
+ private ReadableByteChannel request;
+ private WritableByteChannel response;
+
+ public void run()
+ {
+
+ int index = 0;
+ byte[] raw_data = new byte[1024];
+ ByteBuffer data = ByteBuffer.wrap(raw_data);
+ while(index < commands.length && request.isOpen()) {
+ try {
+ byte[] command = commands[index++];
+ response.write(ByteBuffer.wrap(command));
+ } catch (IOException ex) {
+ break;
+ }
+
+ try {
+ data.clear();
+ request.read(data);
+ } catch (Throwable ex) {}
+ }
+
+ try {
+ response.close();
+ request.close();
+ } catch (Throwable t) {}
+ }
+
+ private final byte[][] commands = new byte[][]{
+ // Initial capabilities negotiation
+ ("( success ( 2 2 ( ) " +
+ "( edit-pipeline svndiff1 absent-entries commit-revprops " +
+ "depth log-revprops atomic-revprops partial-replay " +
+ "inherited-props ephemeral-txnprops file-revs-reverse " +
+ ") ) ) ").getBytes(),
+
+ // Response for successful connection
+ ("( success ( ( ANONYMOUS EXTERNAL ) " +
+ "36:e3c8c113-03ba-4ec5-a8e6-8fc555e57b91 ) ) ").getBytes(),
+
+ // Response to authentication request
+ ("( success ( ) ) ( success ( " +
+ "36:e3c8c113-03ba-4ec5-a8e6-8fc555e57b91 " +
+ "24:svn+test://localhost/foo ( mergeinfo ) ) ) ").getBytes(),
+
+ // Response to revprop request
+ ("( success ( ( ) 0: ) ) ( success ( ( 4:fake ) ) ) ").getBytes()
+ };
+ }
+
+ /**
+ * Test tunnel handling.
+ */
+ public void testTunnelAgent() throws Throwable
+ {
+ byte[] revprop;
+ SVNClient cl = new SVNClient();
+ try {
+ cl.notification2(new MyNotifier());
+ cl.setPrompt(new DefaultPromptUserPassword());
+ cl.username(USERNAME);
+ cl.setProgressCallback(new DefaultProgressListener());
+ cl.setConfigDirectory(conf.getAbsolutePath());
+
+ cl.setTunnelAgent(new Tunnel());
+ revprop = cl.revProperty("svn+test://localhost/foo", "svn:log",
+ Revision.getInstance(0L));
+ } finally {
+ cl.dispose();
+ }
+ assertEquals("fake", new String(revprop));
+ }
+
/**
* @return <code>file</code> converted into a -- possibly
* <code>canonical</code>-ized -- Subversion-internal path
@@ -4002,8 +4105,8 @@ public class BasicTests extends SVNTests
{
final List<Info> infos = new ArrayList<Info>();
- client.info2(pathOrUrl, revision, pegRevision, depth, changelists,
- new InfoCallback () {
+ client.info2(pathOrUrl, revision, pegRevision, depth, true, true,
+ changelists, new InfoCallback () {
public void singleInfo(Info info)
{ infos.add(info); }
});
Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java Tue Oct 15 22:57:03 2013
@@ -68,14 +68,12 @@ public class SVNRemoteTests extends SVNT
thisTest = new OneTest();
}
- public static ISVNRemote getSession(String url, String configDirectory,
- ConfigEvent configHandler)
+ public static ISVNRemote getSession(String url, String configDirectory)
{
try
{
RemoteFactory factory = new RemoteFactory();
factory.setConfigDirectory(configDirectory);
- factory.setConfigEventHandler(configHandler);
factory.setUsername(USERNAME);
factory.setPassword(PASSWORD);
factory.setPrompt(new DefaultPromptUserPassword());
@@ -92,7 +90,7 @@ public class SVNRemoteTests extends SVNT
private ISVNRemote getSession()
{
- return getSession(getTestRepoUrl(), super.conf.getAbsolutePath(), null);
+ return getSession(getTestRepoUrl(), super.conf.getAbsolutePath());
}
/**
@@ -111,9 +109,10 @@ public class SVNRemoteTests extends SVNT
try
{
session = new RemoteFactory(
- super.conf.getAbsolutePath(), null,
+ super.conf.getAbsolutePath(),
USERNAME, PASSWORD,
- new DefaultPromptUserPassword(), null)
+ new DefaultPromptUserPassword(),
+ null, null)
.openRemoteSession(getTestRepoUrl());
}
catch (ClientException ex)
@@ -130,6 +129,44 @@ public class SVNRemoteTests extends SVNT
session.dispose();
}
+ public void testSessionGC() throws Exception
+ {
+ int svnErrorCode = 0;
+ try {
+ try {
+ String prefix = getTestRepoUrl().substring(
+ 0, 1 + getTestRepoUrl().lastIndexOf("/"));
+ new RemoteFactory(
+ super.conf.getAbsolutePath(),
+ USERNAME, PASSWORD,
+ new DefaultPromptUserPassword(),
+ null, null)
+ .openRemoteSession(prefix + "repositorydoesnotexisthere");
+ }
+ finally
+ {
+ for(int i = 0; i < 100; i++)
+ {
+ Runtime.getRuntime().gc(); // GC should run finalize
+
+ // Do something
+ byte[] memEater = new byte[1024 * 1024];
+ Arrays.fill(memEater, (byte) i);
+
+ // Do some more javahl activity (this url is OK)
+ final ISVNRemote session = getSession();
+ session.getLatestRevision();
+ session.dispose();
+ }
+ }
+ }
+ catch (ClientException ex)
+ {
+ svnErrorCode = ex.getAllMessages().get(0).getCode();
+ }
+ assertEquals(180001, svnErrorCode);
+ }
+
public void testDatedRev() throws Exception
{
ISVNRemote session = getSession();
@@ -633,48 +670,6 @@ public class SVNRemoteTests extends SVNT
assertTrue(Arrays.equals(contents, checkcontents.toByteArray()));
}
- // public void testEditorRotate() throws Exception
- // {
- // ISVNRemote session = getSession();
- //
- // ArrayList<ISVNEditor.RotatePair> rotation =
- // new ArrayList<ISVNEditor.RotatePair>(3);
- // rotation.add(new ISVNEditor.RotatePair("A/B", 1));
- // rotation.add(new ISVNEditor.RotatePair("A/C", 1));
- // rotation.add(new ISVNEditor.RotatePair("A/D", 1));
- //
- // CommitContext cc =
- // new CommitContext(session, "Rotate A/B -> A/C -> A/D");
- // try {
- // // No alter-dir of A is needed, children remain the same.
- // cc.editor.rotate(rotation);
- // cc.editor.complete();
- // } finally {
- // cc.editor.dispose();
- // }
- //
- // assertEquals(2, cc.getRevision());
- // assertEquals(2, session.getLatestRevision());
- //
- // HashMap<String, DirEntry> dirents = new HashMap<String, DirEntry>();
- // HashMap<String, byte[]> properties = new HashMap<String, byte[]>();
- //
- // // A/B is now what used to be A/D, so A/B/H must exist
- // session.getDirectory(Revision.SVN_INVALID_REVNUM, "A/B",
- // DirEntry.Fields.all, dirents, properties);
- // assertEquals(dirents.get("H").getPath(), "H");
- //
- // // A/C is now what used to be A/B, so A/C/F must exist
- // session.getDirectory(Revision.SVN_INVALID_REVNUM, "A/C",
- // DirEntry.Fields.all, dirents, properties);
- // assertEquals(dirents.get("F").getPath(), "F");
- //
- // // A/D is now what used to be A/C and must be empty
- // session.getDirectory(Revision.SVN_INVALID_REVNUM, "A/D",
- // DirEntry.Fields.all, dirents, properties);
- // assertTrue(dirents.isEmpty());
- // }
-
// Sanity check so that we don't forget about unimplemented methods.
public void testEditorNotImplemented() throws Exception
{
@@ -704,13 +699,6 @@ public class SVNRemoteTests extends SVNT
}
assertEquals("Not implemented: CommitEditor.alterSymlink", exmsg);
- // try {
- // exmsg = "";
- // cc.editor.rotate(rotation);
- // } catch (RuntimeException ex) {
- // exmsg = ex.getMessage();
- // }
- // assertEquals("Not implemented: CommitEditor.rotate", exmsg);
} finally {
cc.editor.dispose();
}
@@ -810,10 +798,13 @@ public class SVNRemoteTests extends SVNT
}
};
- ISVNRemote session = getSession(getTestRepoUrl(),
- super.conf.getAbsolutePath(),
- handler);
- session.getLatestRevision(); // Make sure the configuration gets loaded
+ try {
+ SVNUtil.setConfigEventHandler(handler);
+ ISVNRemote session = getSession();
+ session.getLatestRevision();
+ } finally {
+ SVNUtil.setConfigEventHandler(null);
+ }
}
private static class RemoteStatusReceiver implements RemoteStatus
Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Tue Oct 15 22:57:03 2013
@@ -173,6 +173,17 @@ class SVNTests extends TestCase
private void init()
{
+ String disableCredStore = System.getProperty("test.disablecredstore");
+ if (disableCredStore != null)
+ {
+ try {
+ SVNUtil.disableNativeCredentialsStore();
+ } catch(Throwable ex) {
+ System.err.println("*** ERROR: Could not disable" +
+ " the native credentials store");
+ }
+ }
+
// if not already set, get a usefull value for rootDir
if (rootDirectoryName == null)
rootDirectoryName = System.getProperty("test.rootdir");
@@ -344,7 +355,7 @@ class SVNTests extends TestCase
}
}
- private static class DefaultProgressListener implements ProgressCallback
+ protected static class DefaultProgressListener implements ProgressCallback
{
public void onProgress(ProgressEvent event)
Modified: subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.java?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.java (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/javahl/tests/org/apache/subversion/javahl/UtilTests.java Tue Oct 15 22:57:03 2013
@@ -35,6 +35,8 @@ import org.junit.Assert;
*/
public class UtilTests extends SVNTests
{
+ private final static String NL = System.getProperty("line.separator");
+
/**
* Base name of all our tests.
*/
@@ -85,14 +87,15 @@ public class UtilTests extends SVNTests
writeFileContents(modified, "\nmodified\n\n");
ByteArrayOutputStream result = new ByteArrayOutputStream();
- SVNUtil.FileDiff(original.getAbsolutePath(),
- modified.getAbsolutePath(),
- null, "original", "modified", "UTF-8", null,
- result);
-
- final byte[] expected = ("--- original\n" +
- "+++ modified\n" +
- "@@ -3,7 +3,7 @@\n" +
+ boolean diffs = SVNUtil.fileDiff(original.getAbsolutePath(),
+ modified.getAbsolutePath(),
+ null, "original", "modified", "UTF-8",
+ null, result);
+ assertTrue(diffs);
+
+ final byte[] expected = ("--- original" + NL +
+ "+++ modified" + NL +
+ "@@ -3,7 +3,7 @@" + NL +
" 3\n 4\n \n" +
"-original\n" +
"+modified\n" +
@@ -111,16 +114,17 @@ public class UtilTests extends SVNTests
writeFileContents(latest, "\nlatest\n\n");
ByteArrayOutputStream result = new ByteArrayOutputStream();
- SVNUtil.FileMerge(original.getAbsolutePath(),
- modified.getAbsolutePath(),
- latest.getAbsolutePath(),
- null,
- "||||||| base",
- "<<<<<<< branch",
- ">>>>>>> local",
- "=======",
- SVNUtil.ConflictDisplayStyle.modified_original_latest,
- result);
+ boolean conflicts = SVNUtil.fileMerge(original.getAbsolutePath(),
+ modified.getAbsolutePath(),
+ latest.getAbsolutePath(),
+ null,
+ "||||||| base",
+ "<<<<<<< branch",
+ ">>>>>>> local",
+ "=======",
+ SVNUtil.ConflictDisplayStyle.modified_original_latest,
+ result);
+ assertTrue(conflicts);
final byte[] expected = ("1\n2\n3\n4\n\n" +
"<<<<<<< branch\n" +
@@ -129,8 +133,8 @@ public class UtilTests extends SVNTests
"original\n" +
"=======\n" +
"latest\n" +
- ">>>>>>> local\n\n" +
- "N-3\nN-2\nN-1\nN\n").getBytes();
+ ">>>>>>> local\n" +
+ "\nN-3\nN-2\nN-1\nN\n").getBytes();
Assert.assertArrayEquals(expected, result.toByteArray());
}
}
Modified: subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/test_fs.rb
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/test_fs.rb?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/test_fs.rb (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/test_fs.rb Tue Oct 15 22:57:03 2013
@@ -209,10 +209,14 @@ class SvnFsTest < Test::Unit::TestCase
ctx.commit(@wc_path)
end
- assert_raises(Svn::Error::FsNoSuchTransaction) do
+ assert_raises(Svn::Error::FsMalformedTxnId) do
@fs.open_txn("NOT-EXIST")
end
+ assert_raises(Svn::Error::FsNoSuchTransaction) do
+ @fs.open_txn("9-9")
+ end
+
start_time = Time.now
txn1 = @fs.transaction
assert_equal([Svn::Core::PROP_REVISION_DATE], txn1.proplist.keys)
Modified: subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/util.rb
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/util.rb?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/util.rb (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/util.rb Tue Oct 15 22:57:03 2013
@@ -79,6 +79,7 @@ module SvnTestUtil
@wc_path = File.join(@tmp_path, "wc")
@import_path = File.join(@tmp_path, "import")
@repos_path = File.join(@tmp_path, "repos")
+ @svnserve_pid_file = File.join(@tmp_path, "svnserve.pid")
@full_repos_path = File.expand_path(@repos_path)
@repos_uri = "file://#{@full_repos_path.sub(/^\/?/, '/')}"
Modified: subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/windows_util.rb
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/windows_util.rb?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/windows_util.rb (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/test/windows_util.rb Tue Oct 15 22:57:03 2013
@@ -34,149 +34,31 @@ module SvnTestUtil
end
end
- def service_control(command, args={})
- args = args.collect do |key, value|
- "#{key}= #{Svnserve.escape_value(value)}"
- end.join(" ")
- result = `sc #{command} #{service_name} #{args}`
- if result.match(/FAILED/)
- raise "Failed to #{command} #{service_name}: #{args}"
- end
- /^\s*STATE\s*:\s\d+\s*(.*?)\s*$/ =~ result
- $1
- end
-
- def grant_everyone_full_access(dir)
- dir = dir.tr(File::SEPARATOR, File::ALT_SEPARATOR)
- `cacls #{Svnserve.escape_value(dir)} /T /E /P Everyone:F`
- end
-
- def service_exists?
- begin
- service_control("query")
- true
- rescue
- false
- end
- end
-
- def service_stopped?
- "STOPPED" == service_control("query") rescue true
- end
-
def setup_svnserve
@svnserve_port = @svnserve_ports.last
@repos_svnserve_uri = "svn://#{@svnserve_host}:#{@svnserve_port}"
- grant_everyone_full_access(@full_repos_path)
@@service_created ||= begin
@@service_created = true
- service_control('stop') unless service_stopped?
- service_control('delete') if service_exists?
-
- svnserve_dir = File.expand_path("svnserve")
- FileUtils.mkdir_p(svnserve_dir)
- at_exit do
- service_control('stop') unless service_stopped?
- service_control('delete') if service_exists?
- FileUtils.rm_rf(svnserve_dir)
- end
- trap("INT") do
- service_control('stop') unless service_stopped?
- service_control('delete') if service_exists?
- FileUtils.rm_rf(svnserve_dir)
- end
-
- config = SetupEnvironment.gen_make_opts
- apr_version_include = Pathname.new(config["--with-apr"]) +
- 'include' + 'apr_version.h'
- %r'^\s*#define\s+APR_MAJOR_VERSION\s+(\d+)' =~ apr_version_include.read
- apr_major_version = $1 == '0' ? '' : "-#{$1}"
-
- cwd = Dir.getwd
- targets = %W(svnserve.exe libsvn_subr-1.dll libsvn_repos-1.dll
- libsvn_fs-1.dll libsvn_delta-1.dll
- libaprutil#{apr_major_version}.dll
- libapr#{apr_major_version}.dll
- libapriconv#{apr_major_version}.dll
- libdb??.dll libdb??d.dll)
- ENV["PATH"].split(";").each do |path|
-
- # Change the cwd to path, but ignore non-existent paths.
- begin
- Dir.chdir(path)
- rescue Errno::ENOENT
- next
- end
-
- found_targets = []
- targets.each do |target|
- matching_paths = Dir.glob(target)
- matching_paths.each do |target_path|
- target_path = File.join(path.tr('\\', '/'), target_path)
- if File.exists?(target_path)
- found_targets << target
- retried = 0
- begin
- FileUtils.cp(target_path, svnserve_dir)
- rescue Errno::EACCES
- # On Windows the tests frequently fail spuriously with a
- # 'Errno::EACCES: Permission denied - svnserve.exe' error.
- # Sleeping for a few seconds avoids this.
- if retried > 5
- # Give up!
- raise
- else
- # Wait a sec...
- sleep(1)
- retried += 1
- retry
- end
- end
- end
- end
- end
- targets -= found_targets
- break if targets.empty?
- end
- Dir.chdir(cwd)
- # Remove optional targets instead of raising below. If they are really
- # needed, svnserve won't start anyway.
- targets -= %W[libapriconv#{apr_major_version}.dll]
- # Ditto these four, since svnserve.exe might be a static build.
- targets -= %W[libsvn_subr-1.dll]
- targets -= %W[libsvn_repos-1.dll]
- targets -= %W[libsvn_fs-1.dll]
- targets -= %W[libsvn_delta-1.dll]
-
- unless targets.empty?
- raise "can't find libraries to work svnserve: #{targets.join(' ')}"
- end
-
- grant_everyone_full_access(svnserve_dir)
- svnserve_path = File.join(svnserve_dir, "svnserve.exe")
- svnserve_path = svnserve_path.tr(File::SEPARATOR,
- File::ALT_SEPARATOR)
+ top_directory = File.join(File.dirname(__FILE__), "..", "..", "..", "..", "..")
+ build_type = ENV["BUILD_TYPE"] || "Release"
+ svnserve_path = File.join(top_directory, build_type, 'subversion', 'svnserve', 'svnserve.exe')
svnserve_path = Svnserve.escape_value(svnserve_path)
root = @full_repos_path.tr(File::SEPARATOR, File::ALT_SEPARATOR)
+ FileUtils.mkdir_p(root)
- args = ["--service", "--root", Svnserve.escape_value(root),
- "--listen-host", @svnserve_host,
- "--listen-port", @svnserve_port]
+ IO.popen("#{svnserve_path} -d -r #{Svnserve.escape_value(root)} --listen-host #{@svnserve_host} --listen-port #{@svnserve_port} --pid-file #{@svnserve_pid_file}")
user = ENV["USERNAME"] || Etc.getlogin
- service_control('create',
- [["binPath", "#{svnserve_path} #{args.join(' ')}"],
- ["DisplayName", service_name],
- ["type", "own"]])
end
- service_control('start')
true
end
def teardown_svnserve
- service_control('stop') unless service_stopped?
+ # TODO:
+ # Load @svnserve_pid_file
+ # Kill process
end
def add_pre_revprop_change_hook
Modified: subversion/branches/fsfs-improvements/subversion/include/private/svn_editor.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/private/svn_editor.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/private/svn_editor.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/private/svn_editor.h Tue Oct 15 22:57:03 2013
@@ -270,7 +270,6 @@ svn_delta_shim_callbacks_default(apr_poo
* svn_editor_setcb_delete() \n
* svn_editor_setcb_copy() \n
* svn_editor_setcb_move() \n
- * svn_editor_setcb_rotate() \n
* svn_editor_setcb_complete() \n
* svn_editor_setcb_abort()
*
@@ -293,7 +292,6 @@ svn_delta_shim_callbacks_default(apr_poo
* svn_editor_delete() \n
* svn_editor_copy() \n
* svn_editor_move() \n
- * svn_editor_rotate()
* \n\n
* Just before each callback invocation is carried out, the @a cancel_func
* that was passed to svn_editor_create() is invoked to poll any
@@ -325,7 +323,7 @@ svn_delta_shim_callbacks_default(apr_poo
* In order to reduce complexity of callback receivers, the editor callbacks
* must be driven in adherence to these rules:
*
- * - If any path is added (with add_*) or deleted/moved/rotated, then
+ * - If any path is added (with add_*) or deleted/moved, then
* an svn_editor_alter_directory() call must be made for its parent
* directory with the target/eventual set of children.
*
@@ -344,15 +342,13 @@ svn_delta_shim_callbacks_default(apr_poo
* its children, if a directory) may be copied many times, and are
* otherwise subject to the Once Rule. The destination path of a copy
* or move may have alter_* operations applied, but not add_* or delete.
- * If the destination path of a copy, move, or rotate is a directory,
+ * If the destination path of a copy or move is a directory,
* then its children are subject to the Once Rule. The source path of
* a move (and its child paths) may be referenced in add_*, or as the
* destination of a copy (where these new or copied nodes are subject
- * to the Once Rule). Paths listed in a rotation are both sources and
- * destinations, so they may not be referenced again in an add_* or a
- * deletion; these paths may have alter_* operations applied.
+ * to the Once Rule).
*
- * - The ancestor of an added, copied-here, moved-here, rotated, or
+ * - The ancestor of an added, copied-here, moved-here, or
* modified node may not be deleted. The ancestor may not be moved
* (instead: perform the move, *then* the edits).
*
@@ -375,10 +371,6 @@ svn_delta_shim_callbacks_default(apr_poo
* by a delete... that is fine. It is simply that svn_editor_move()
* should be used to describe a semantic move.
*
- * - Paths mentioned in svn_editor_rotate() may have their properties
- * and contents edited (via alter_* calls) by a previous or later call,
- * but they may not be subject to a later move, rotate, or deletion.
- *
* - One of svn_editor_complete() or svn_editor_abort() must be called
* exactly once, which must be the final call the driver invokes.
* Invoking svn_editor_complete() must imply that the set of changes has
@@ -620,15 +612,6 @@ typedef svn_error_t *(*svn_editor_cb_mov
svn_revnum_t replaces_rev,
apr_pool_t *scratch_pool);
-/** @see svn_editor_rotate(), svn_editor_t.
- * @since New in 1.8.
- */
-typedef svn_error_t *(*svn_editor_cb_rotate_t)(
- void *baton,
- const apr_array_header_t *relpaths,
- const apr_array_header_t *revisions,
- apr_pool_t *scratch_pool);
-
/** @see svn_editor_complete(), svn_editor_t.
* @since New in 1.8.
*/
@@ -790,17 +773,6 @@ svn_editor_setcb_move(svn_editor_t *edit
svn_editor_cb_move_t callback,
apr_pool_t *scratch_pool);
-/** Sets the #svn_editor_cb_rotate_t callback in @a editor
- * to @a callback.
- * @a scratch_pool is used for temporary allocations (if any).
- * @see also svn_editor_setcb_many().
- * @since New in 1.8.
- */
-svn_error_t *
-svn_editor_setcb_rotate(svn_editor_t *editor,
- svn_editor_cb_rotate_t callback,
- apr_pool_t *scratch_pool);
-
/** Sets the #svn_editor_cb_complete_t callback in @a editor
* to @a callback.
* @a scratch_pool is used for temporary allocations (if any).
@@ -841,7 +813,6 @@ typedef struct svn_editor_cb_many_t
svn_editor_cb_delete_t cb_delete;
svn_editor_cb_copy_t cb_copy;
svn_editor_cb_move_t cb_move;
- svn_editor_cb_rotate_t cb_rotate;
svn_editor_cb_complete_t cb_complete;
svn_editor_cb_abort_t cb_abort;
@@ -1093,7 +1064,7 @@ svn_editor_copy(svn_editor_t *editor,
* expect to find this node. That is, @a src_relpath at the start of
* the whole edit and @a src_relpath at @a src_revision must lie within
* the same node-rev (aka history-segment). This is just like the
- * revisions specified to svn_editor_delete() and svn_editor_rotate().
+ * revisions specified to svn_editor_delete().
*
* For a description of @a replaces_rev, see svn_editor_add_file().
*
@@ -1110,36 +1081,6 @@ svn_editor_move(svn_editor_t *editor,
const char *dst_relpath,
svn_revnum_t replaces_rev);
-/** Drive @a editor's #svn_editor_cb_rotate_t callback.
- *
- * Perform a rotation among multiple nodes in the target tree.
- *
- * The @a relpaths and @a revisions arrays (pair-wise) specify nodes in the
- * tree which are located at a path and expected to be at a specific
- * revision. These nodes are simultaneously moved in a rotation pattern.
- * For example, the node at index 0 of @a relpaths and @a revisions will
- * be moved to the relpath specified at index 1 of @a relpaths. The node
- * at index 1 will be moved to the location at index 2. The node at index
- * N-1 will be moved to the relpath specified at index 0.
- *
- * The simplest form of this operation is to swap nodes A and B. One may
- * think to move A to a temporary location T, then move B to A, then move
- * T to B. However, this last move violations the Once Rule by moving T
- * (which had already by edited by the move from A). In order to keep the
- * restrictions against multiple moves of a single node, the rotation
- * operation is needed for certain types of tree edits.
- *
- * ### what happens if one of the paths of the rotation is not "within" the
- * ### receiver's set of paths?
- *
- * For all restrictions on driving the editor, see #svn_editor_t.
- * @since New in 1.8.
- */
-svn_error_t *
-svn_editor_rotate(svn_editor_t *editor,
- const apr_array_header_t *relpaths,
- const apr_array_header_t *revisions);
-
/** Drive @a editor's #svn_editor_cb_complete_t callback.
*
* Send word that the edit has been completed successfully.
Modified: subversion/branches/fsfs-improvements/subversion/include/private/svn_packed_data.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/private/svn_packed_data.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/private/svn_packed_data.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/private/svn_packed_data.h Tue Oct 15 22:57:03 2013
@@ -1,255 +1,255 @@
-/* packed_data.h : Interface to the packed binary stream data structure
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- */
-
-#ifndef SVN_PACKED_DATA_H
-#define SVN_PACKED_DATA_H
-
-#include "svn_string.h"
-#include "svn_io.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/* This API provides Yet Another Serialization Framework.
- *
- * It is geared towards efficiently encoding collections of structured
- * binary data (e.g. an array of noderev objects). The basic idea is to
- * transform them into hierarchies of streams with each stream usually
- * corresponding to a single attribute in the original data structures.
- * The user is free model the mapping structure <-> streams mapping as she
- * sees fit.
- *
- * With all data inside the same (sub-)stream carrying similar attribute
- * values, the whole stream lends itself to data compression. Strings /
- * plain byte sequences will be stored as is. Numbers use a 7b/8b encoding
- * scheme to eliminate leading zeros. Because values are often dependent
- * (increasing offsets, roughly similar revision number, etc.), streams
- * can be configured as storing (hopefully shorter) deltas instead of the
- * original value.
- *
- * Two stream types are provided: integer and byte streams. While the
- * first store 64 bit integers only and can be configured to assume
- * signed and / or deltifyable data, the second will store arbitrary
- * byte sequences including their length. At the root level, you may
- * create an arbitrary number of integer and byte streams. Any stream
- * may have an arbitrary number of sub-streams of the same kind. You
- * should create the full stream hierarchy before writing any data to it.
- *
- * As a convenience, when an integer stream has sub-streams, you may write
- * to the parent stream instead of all sub-streams individually and the
- * values will be passed down automatically in a round-robin fashion.
- * Reading from the parent stream is similarly supported.
- *
- * When all data has been added to the stream, it can be written to an
- * ordinary svn_stream_t. First, we write a description of the stream
- * structure (types, sub-streams, sizes and configurations) followed by
- * zlib compressed stream content. For each top-level stream, all sub-
- * stream data will be concatenated and then compressed as a single block.
- * To maximize the effect of this, make sure all data in that stream
- * hierarchy has a similar value distribution.
- *
- * Reading data starts with an svn_stream_t and automatically recreates
- * the stream hierarchies. You only need to extract data from it in the
- * same order as you wrote it.
- *
- * Although not enforced programmatically, you may either only write to a
- * stream hierarchy or only read from it but you cannot do both on the
- * same data structure.
- */
-
-
-
-/* We pack / unpack integers en block to minimize calling and setup overhead.
- * This is the number of integers we put into a buffer before writing them
- * them to / after reading them from the 7b/8b stream. Under 64 bits, this
- * value creates a 128 byte data structure (14 + 2 integers, 8 bytes each).
- */
-#define SVN__PACKED_DATA_BUFFER_SIZE 14
-
-
-/* Data types. */
-
-/* Opaque type for the root object.
- */
-typedef struct svn_packed__data_root_t svn_packed__data_root_t;
-
-/* Opaque type for byte streams.
- */
-typedef struct svn_packed__byte_stream_t svn_packed__byte_stream_t;
-
-/* Semi-opaque type for integer streams. We expose the unpacked buffer
- * to allow for replacing svn_packed__add_uint and friends by macros.
- */
-typedef struct svn_packed__int_stream_t
-{
- /* pointer to the remainder of the data structure */
- void *private_data;
-
- /* number of value entries in BUFFER */
- apr_size_t buffer_used;
-
- /* unpacked integers (either yet to be packed or pre-fetched from the
- * packed buffers). Only the first BUFFER_USED entries are valid. */
- apr_uint64_t buffer[SVN__PACKED_DATA_BUFFER_SIZE];
-} svn_packed__int_stream_t;
-
-
-/* Writing data. */
-
-/* Return a new serialization root object, allocated in POOL.
- */
-svn_packed__data_root_t *
-svn_packed__data_create_root(apr_pool_t *pool);
-
-/* Create and return a new top-level integer stream in ROOT. If signed,
- * negative numbers will be put into that stream, SIGNED_INTS should be
- * TRUE as a more efficient encoding will be used in that case. Set
- * DIFF to TRUE if you expect the difference between consecutive numbers
- * to be much smaller (~100 times) than the actual numbers.
- */
-svn_packed__int_stream_t *
-svn_packed__create_int_stream(svn_packed__data_root_t *root,
- svn_boolean_t diff,
- svn_boolean_t signed_ints);
-
-/* Create and return a sub-stream to the existing integer stream PARENT.
- * If signed, negative numbers will be put into that stream, SIGNED_INTS
- * should be TRUE as a more efficient encoding will be used in that case.
- * Set DIFF to TRUE if you expect the difference between consecutive numbers
- * to be much smaller (~100 times) than the actual numbers.
- */
-svn_packed__int_stream_t *
-svn_packed__create_int_substream(svn_packed__int_stream_t *parent,
- svn_boolean_t diff,
- svn_boolean_t signed_ints);
-
-/* Create and return a new top-level byte sequence stream in ROOT.
- */
-svn_packed__byte_stream_t *
-svn_packed__create_bytes_stream(svn_packed__data_root_t *root);
-
-/* Write the unsigned integer VALUE to STEAM.
- */
-void
-svn_packed__add_uint(svn_packed__int_stream_t *stream,
- apr_uint64_t value);
-
-/* Write the signed integer VALUE to STEAM.
- */
-void
-svn_packed__add_int(svn_packed__int_stream_t *stream,
- apr_int64_t value);
-
-/* Write the sequence stating at DATA containing LEN bytes to STEAM.
- */
-void
-svn_packed__add_bytes(svn_packed__byte_stream_t *stream,
- const char *data,
- apr_size_t len);
-
-/* Write all contents of ROOT (including all sub-streams) to STREAM.
- * Use SCRATCH_POOL for temporary allocations.
- */
-svn_error_t *
-svn_packed__data_write(svn_stream_t *stream,
- svn_packed__data_root_t *root,
- apr_pool_t *scratch_pool);
-
-
-/* Reading data. */
-
-/* Return the first integer stream in ROOT. Returns NULL in case there
- * aren't any.
- */
-svn_packed__int_stream_t *
-svn_packed__first_int_stream(svn_packed__data_root_t *root);
-
-/* Return the first byte sequence stream in ROOT. Returns NULL in case
- * there aren't any.
- */
-svn_packed__byte_stream_t *
-svn_packed__first_byte_stream(svn_packed__data_root_t *root);
-
-/* Return the next (sibling) integer stream to STREAM. Returns NULL in
- * case there isn't any.
- */
-svn_packed__int_stream_t *
-svn_packed__next_int_stream(svn_packed__int_stream_t *stream);
-
-/* Return the next (sibling) byte sequence stream to STREAM. Returns NULL
- * in case there isn't any.
- */
-svn_packed__byte_stream_t *
-svn_packed__next_byte_stream(svn_packed__byte_stream_t *stream);
-
-/* Return the first sub-stream of STREAM. Returns NULL in case there
- * isn't any.
- */
-svn_packed__int_stream_t *
-svn_packed__first_int_substream(svn_packed__int_stream_t *stream);
-
-/* Return the number of integers left to read from STREAM.
- */
-apr_size_t
-svn_packed__int_count(svn_packed__int_stream_t *stream);
-
-/* Return the number of bytes left to read from STREAM.
- */
-apr_size_t
-svn_packed__byte_count(svn_packed__byte_stream_t *stream);
-
-/* Return the next number from STREAM as unsigned integer. Returns 0 when
- * reading beyond the end of the stream.
- */
-apr_uint64_t
-svn_packed__get_uint(svn_packed__int_stream_t *stream);
-
-/* Return the next number from STREAM as signed integer. Returns 0 when
- * reading beyond the end of the stream.
- */
-apr_int64_t
-svn_packed__get_int(svn_packed__int_stream_t *stream);
-
-/* Return the next byte sequence from STREAM and set *LEN to the length
- * of that sequence. Sets *LEN to 0 when reading beyond the end of the
- * stream.
- */
-const char *
-svn_packed__get_bytes(svn_packed__byte_stream_t *stream,
- apr_size_t *len);
-
-/* Allocate a new packed data root in RESULT_POOL, read its structure and
- * stream contents from STREAM and return it in *ROOT_P. Use SCRATCH_POOL
- * for temporary allocations.
- */
-svn_error_t *
-svn_packed__data_read(svn_packed__data_root_t **root_p,
- svn_stream_t *stream,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* SVN_PACKED_DATA_H */
+/* packed_data.h : Interface to the packed binary stream data structure
+ *
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ */
+
+#ifndef SVN_PACKED_DATA_H
+#define SVN_PACKED_DATA_H
+
+#include "svn_string.h"
+#include "svn_io.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* This API provides Yet Another Serialization Framework.
+ *
+ * It is geared towards efficiently encoding collections of structured
+ * binary data (e.g. an array of noderev objects). The basic idea is to
+ * transform them into hierarchies of streams with each stream usually
+ * corresponding to a single attribute in the original data structures.
+ * The user is free model the mapping structure <-> streams mapping as she
+ * sees fit.
+ *
+ * With all data inside the same (sub-)stream carrying similar attribute
+ * values, the whole stream lends itself to data compression. Strings /
+ * plain byte sequences will be stored as is. Numbers use a 7b/8b encoding
+ * scheme to eliminate leading zeros. Because values are often dependent
+ * (increasing offsets, roughly similar revision number, etc.), streams
+ * can be configured as storing (hopefully shorter) deltas instead of the
+ * original value.
+ *
+ * Two stream types are provided: integer and byte streams. While the
+ * first store 64 bit integers only and can be configured to assume
+ * signed and / or deltifyable data, the second will store arbitrary
+ * byte sequences including their length. At the root level, you may
+ * create an arbitrary number of integer and byte streams. Any stream
+ * may have an arbitrary number of sub-streams of the same kind. You
+ * should create the full stream hierarchy before writing any data to it.
+ *
+ * As a convenience, when an integer stream has sub-streams, you may write
+ * to the parent stream instead of all sub-streams individually and the
+ * values will be passed down automatically in a round-robin fashion.
+ * Reading from the parent stream is similarly supported.
+ *
+ * When all data has been added to the stream, it can be written to an
+ * ordinary svn_stream_t. First, we write a description of the stream
+ * structure (types, sub-streams, sizes and configurations) followed by
+ * zlib compressed stream content. For each top-level stream, all sub-
+ * stream data will be concatenated and then compressed as a single block.
+ * To maximize the effect of this, make sure all data in that stream
+ * hierarchy has a similar value distribution.
+ *
+ * Reading data starts with an svn_stream_t and automatically recreates
+ * the stream hierarchies. You only need to extract data from it in the
+ * same order as you wrote it.
+ *
+ * Although not enforced programmatically, you may either only write to a
+ * stream hierarchy or only read from it but you cannot do both on the
+ * same data structure.
+ */
+
+
+
+/* We pack / unpack integers en block to minimize calling and setup overhead.
+ * This is the number of integers we put into a buffer before writing them
+ * them to / after reading them from the 7b/8b stream. Under 64 bits, this
+ * value creates a 128 byte data structure (14 + 2 integers, 8 bytes each).
+ */
+#define SVN__PACKED_DATA_BUFFER_SIZE 14
+
+
+/* Data types. */
+
+/* Opaque type for the root object.
+ */
+typedef struct svn_packed__data_root_t svn_packed__data_root_t;
+
+/* Opaque type for byte streams.
+ */
+typedef struct svn_packed__byte_stream_t svn_packed__byte_stream_t;
+
+/* Semi-opaque type for integer streams. We expose the unpacked buffer
+ * to allow for replacing svn_packed__add_uint and friends by macros.
+ */
+typedef struct svn_packed__int_stream_t
+{
+ /* pointer to the remainder of the data structure */
+ void *private_data;
+
+ /* number of value entries in BUFFER */
+ apr_size_t buffer_used;
+
+ /* unpacked integers (either yet to be packed or pre-fetched from the
+ * packed buffers). Only the first BUFFER_USED entries are valid. */
+ apr_uint64_t buffer[SVN__PACKED_DATA_BUFFER_SIZE];
+} svn_packed__int_stream_t;
+
+
+/* Writing data. */
+
+/* Return a new serialization root object, allocated in POOL.
+ */
+svn_packed__data_root_t *
+svn_packed__data_create_root(apr_pool_t *pool);
+
+/* Create and return a new top-level integer stream in ROOT. If signed,
+ * negative numbers will be put into that stream, SIGNED_INTS should be
+ * TRUE as a more efficient encoding will be used in that case. Set
+ * DIFF to TRUE if you expect the difference between consecutive numbers
+ * to be much smaller (~100 times) than the actual numbers.
+ */
+svn_packed__int_stream_t *
+svn_packed__create_int_stream(svn_packed__data_root_t *root,
+ svn_boolean_t diff,
+ svn_boolean_t signed_ints);
+
+/* Create and return a sub-stream to the existing integer stream PARENT.
+ * If signed, negative numbers will be put into that stream, SIGNED_INTS
+ * should be TRUE as a more efficient encoding will be used in that case.
+ * Set DIFF to TRUE if you expect the difference between consecutive numbers
+ * to be much smaller (~100 times) than the actual numbers.
+ */
+svn_packed__int_stream_t *
+svn_packed__create_int_substream(svn_packed__int_stream_t *parent,
+ svn_boolean_t diff,
+ svn_boolean_t signed_ints);
+
+/* Create and return a new top-level byte sequence stream in ROOT.
+ */
+svn_packed__byte_stream_t *
+svn_packed__create_bytes_stream(svn_packed__data_root_t *root);
+
+/* Write the unsigned integer VALUE to STEAM.
+ */
+void
+svn_packed__add_uint(svn_packed__int_stream_t *stream,
+ apr_uint64_t value);
+
+/* Write the signed integer VALUE to STEAM.
+ */
+void
+svn_packed__add_int(svn_packed__int_stream_t *stream,
+ apr_int64_t value);
+
+/* Write the sequence stating at DATA containing LEN bytes to STEAM.
+ */
+void
+svn_packed__add_bytes(svn_packed__byte_stream_t *stream,
+ const char *data,
+ apr_size_t len);
+
+/* Write all contents of ROOT (including all sub-streams) to STREAM.
+ * Use SCRATCH_POOL for temporary allocations.
+ */
+svn_error_t *
+svn_packed__data_write(svn_stream_t *stream,
+ svn_packed__data_root_t *root,
+ apr_pool_t *scratch_pool);
+
+
+/* Reading data. */
+
+/* Return the first integer stream in ROOT. Returns NULL in case there
+ * aren't any.
+ */
+svn_packed__int_stream_t *
+svn_packed__first_int_stream(svn_packed__data_root_t *root);
+
+/* Return the first byte sequence stream in ROOT. Returns NULL in case
+ * there aren't any.
+ */
+svn_packed__byte_stream_t *
+svn_packed__first_byte_stream(svn_packed__data_root_t *root);
+
+/* Return the next (sibling) integer stream to STREAM. Returns NULL in
+ * case there isn't any.
+ */
+svn_packed__int_stream_t *
+svn_packed__next_int_stream(svn_packed__int_stream_t *stream);
+
+/* Return the next (sibling) byte sequence stream to STREAM. Returns NULL
+ * in case there isn't any.
+ */
+svn_packed__byte_stream_t *
+svn_packed__next_byte_stream(svn_packed__byte_stream_t *stream);
+
+/* Return the first sub-stream of STREAM. Returns NULL in case there
+ * isn't any.
+ */
+svn_packed__int_stream_t *
+svn_packed__first_int_substream(svn_packed__int_stream_t *stream);
+
+/* Return the number of integers left to read from STREAM.
+ */
+apr_size_t
+svn_packed__int_count(svn_packed__int_stream_t *stream);
+
+/* Return the number of bytes left to read from STREAM.
+ */
+apr_size_t
+svn_packed__byte_count(svn_packed__byte_stream_t *stream);
+
+/* Return the next number from STREAM as unsigned integer. Returns 0 when
+ * reading beyond the end of the stream.
+ */
+apr_uint64_t
+svn_packed__get_uint(svn_packed__int_stream_t *stream);
+
+/* Return the next number from STREAM as signed integer. Returns 0 when
+ * reading beyond the end of the stream.
+ */
+apr_int64_t
+svn_packed__get_int(svn_packed__int_stream_t *stream);
+
+/* Return the next byte sequence from STREAM and set *LEN to the length
+ * of that sequence. Sets *LEN to 0 when reading beyond the end of the
+ * stream.
+ */
+const char *
+svn_packed__get_bytes(svn_packed__byte_stream_t *stream,
+ apr_size_t *len);
+
+/* Allocate a new packed data root in RESULT_POOL, read its structure and
+ * stream contents from STREAM and return it in *ROOT_P. Use SCRATCH_POOL
+ * for temporary allocations.
+ */
+svn_error_t *
+svn_packed__data_read(svn_packed__data_root_t **root_p,
+ svn_stream_t *stream,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SVN_PACKED_DATA_H */
Propchange: subversion/branches/fsfs-improvements/subversion/include/private/svn_packed_data.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: subversion/branches/fsfs-improvements/subversion/include/private/svn_repos_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/private/svn_repos_private.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/private/svn_repos_private.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/private/svn_repos_private.h Tue Oct 15 22:57:03 2013
@@ -32,6 +32,7 @@
#include "svn_types.h"
#include "svn_repos.h"
#include "svn_editor.h"
+#include "svn_config.h"
#ifdef __cplusplus
extern "C" {
@@ -124,6 +125,66 @@ svn_repos__replay_ev2(svn_fs_root_t *roo
void *authz_read_baton,
apr_pool_t *scratch_pool);
+/* Given a PATH which might be a relative repo URL (^/), an absolute
+ * local repo URL (file://), an absolute path outside of the repo
+ * or a location in the Windows registry.
+ *
+ * Retrieve the configuration data that PATH points at and parse it into
+ * CFG_P allocated in POOL.
+ *
+ * If PATH cannot be parsed as a config file then an error is returned. The
+ * contents of CFG_P is then undefined. If MUST_EXIST is TRUE, a missing
+ * authz file is also an error.
+ *
+ * REPOS_ROOT points at the root of the repos you are
+ * going to apply the authz against, can be NULL if you are sure that you
+ * don't have a repos relative URL in PATH. */
+svn_error_t *
+svn_repos__retrieve_config(svn_config_t **cfg_p,
+ const char *path,
+ svn_boolean_t must_exist,
+ apr_pool_t *pool);
+
+/**
+ * @defgroup svn_config_pool Configuration object pool API
+ * @{
+ */
+
+/* Opaque thread-safe factory and container for configuration objects.
+ *
+ * Instances handed out are read-only and may be given to multiple callers
+ * from multiple threads. Configuration objects no longer referenced by
+ * any user may linger for a while before being cleaned up.
+ */
+typedef struct svn_repos__config_pool_t svn_repos__config_pool_t;
+
+/* Create a new configuration pool object with a minim lifetime determined
+ * by POOL and return it in *CONFIG_POOL. References to any configuration
+ * in the *CONFIG_POOL will keep the latter alive beyond POOL cleanup.
+ */
+svn_error_t *
+svn_repos__config_pool_create(svn_repos__config_pool_t **config_pool,
+ apr_pool_t *pool);
+
+/* Set *CFG to a read-only reference to the current contents of the
+ * configuration specified by PATH. If the latter is a URL, we read the
+ * data from a local repository. REGISTRY: urls are not supported.
+ * CONFIG_POOL will store the configuration and make further callers use
+ * the same instance if the content matches.
+ *
+ * POOL determines the minimum lifetime of *CFG.
+ *
+ * Note: The read-only behavior is not enforced, yet.
+ */
+svn_error_t *
+svn_repos__config_pool_get(svn_config_t **cfg,
+ svn_repos__config_pool_t *config_pool,
+ const char *path,
+ apr_pool_t *pool);
+
+/** @} */
+
+
#ifdef __cplusplus
}
Modified: subversion/branches/fsfs-improvements/subversion/include/private/svn_subr_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/private/svn_subr_private.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/private/svn_subr_private.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/private/svn_subr_private.h Tue Oct 15 22:57:03 2013
@@ -26,6 +26,7 @@
#include "svn_types.h"
#include "svn_io.h"
+#include "svn_config.h"
#ifdef __cplusplus
@@ -429,6 +430,49 @@ svn__decompress(svn_stringbuf_t *in,
/** @} */
+/**
+ * @defgroup svn_root_pools Recycle-able root pools API
+ * @{
+ */
+
+/* Opaque thread-safe container for unused / recylcleable root pools.
+ *
+ * Recyling root pools (actually, their allocators) circumvents a
+ * scalability bottleneck in the OS memory management when multi-threaded
+ * applications frequently create and destroy allocators.
+ */
+typedef struct svn_root_pools__t svn_root_pools__t;
+
+/* Create a new root pools container and return it in *POOLS.
+ */
+svn_error_t *
+svn_root_pools__create(svn_root_pools__t **pools);
+
+/* Return a currently unused pool from POOLS. If POOLS is empty, create a
+ * new root pool and return that. The pool returned is not thread-safe.
+ */
+apr_pool_t *
+svn_root_pools__acquire_pool(svn_root_pools__t *pools);
+
+/* Clear and release the given root POOL and put it back into POOLS.
+ * If that fails, destroy POOL.
+ */
+void
+svn_root_pools__release_pool(apr_pool_t *pool,
+ svn_root_pools__t *pools);
+
+/** @} */
+
+/**
+ * @defgroup svn_config_private Private configuration handling API
+ * @{
+ */
+
+/* Future attempts to modify CFG will trigger an assertion. */
+void svn_config__set_read_only(svn_config_t *cfg,
+ apr_pool_t *scratch_pool);
+
+/** @} */
#ifdef __cplusplus
}
Modified: subversion/branches/fsfs-improvements/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_client.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_client.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_client.h Tue Oct 15 22:57:03 2013
@@ -1018,6 +1018,42 @@ typedef struct svn_client_ctx_t
*
* @Since New in 1.9. */
apr_off_t progress;
+
+ /** Check-tunnel callback
+ *
+ * If not @c NULL, and open_tunnel_func is also not @c NULL, this
+ * callback will be invoked to check if open_tunnel_func should be
+ * used to create a specific tunnel, or if the default tunnel
+ * implementation (either built-in or configured in the client
+ * configuration file) should be used instead.
+ * @since New in 1.9.
+ */
+ svn_ra_check_tunnel_func_t check_tunnel_func;
+
+ /** Open-tunnel callback
+ *
+ * If not @c NULL, this callback will be invoked to create a tunnel
+ * for a ra_svn connection that needs one, overriding any tunnel
+ * definitions in the client config file. This callback is used only
+ * for ra_svn and ignored by the other RA modules.
+ * @since New in 1.9.
+ */
+ svn_ra_open_tunnel_func_t open_tunnel_func;
+
+ /** Close-tunnel callback
+ *
+ * If not @c NULL, this callback will be invoked when the pool that
+ * owns the connection created by the open_tunnel callback is
+ * cleared or destroyed. This callback is used only for ra_svn and
+ * ignored by the other RA modules.
+ * @since New in 1.9.
+ */
+ svn_ra_close_tunnel_func_t close_tunnel_func;
+
+ /** A baton used with open_tunnel_func and close_tunnel_func.
+ * @since New in 1.9.
+ */
+ void *tunnel_baton;
} svn_client_ctx_t;
/** Initialize a client context.
@@ -2659,6 +2695,9 @@ svn_client_status(svn_revnum_t *result_r
*
* If @a include_merged_revisions is set, log information for revisions
* which have been merged to @a targets will also be returned.
+ *
+ * @a move_behavior will control which changes will be reported as moves
+ * instead of additions and vice versa.
*
* If @a revprops is NULL, retrieve all revision properties; else, retrieve
* only the revision properties named by the (const char *) array elements
@@ -2669,8 +2708,31 @@ svn_client_status(svn_revnum_t *result_r
* If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2/baton2
* with a 'skip' signal on any unversioned targets.
*
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_client_log6(const apr_array_header_t *targets,
+ const svn_opt_revision_t *peg_revision,
+ const apr_array_header_t *revision_ranges,
+ int limit,
+ svn_boolean_t discover_changed_paths,
+ svn_boolean_t strict_node_history,
+ svn_boolean_t include_merged_revisions,
+ svn_move_behavior_t move_behavior,
+ const apr_array_header_t *revprops,
+ svn_log_entry_receiver_t receiver,
+ void *receiver_baton,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool);
+
+/**
+ * Similar to svn_client_log6(), but with @a move_behavior set to
+ * #svn_move_behavior_no_moves.
+ *
+ * @deprecated Provided for compatibility with the 1.8 API.
* @since New in 1.6.
*/
+SVN_DEPRECATED
svn_error_t *
svn_client_log5(const apr_array_header_t *targets,
const svn_opt_revision_t *peg_revision,
Modified: subversion/branches/fsfs-improvements/subversion/include/svn_dirent_uri.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_dirent_uri.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_dirent_uri.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_dirent_uri.h Tue Oct 15 22:57:03 2013
@@ -646,8 +646,8 @@ svn_dirent_skip_ancestor(const char *par
/** Return the relative path part of @a child_relpath that is below
* @a parent_relpath, or just "" if @a parent_relpath is equal to
- * @a child_relpath. If @a child_relpath is not below or equal to
- * @a parent_relpath, return NULL.
+ * @a child_relpath. If @a child_relpath is not below @a parent_relpath,
+ * return NULL.
*
* @since New in 1.7.
*/
@@ -657,7 +657,7 @@ svn_relpath_skip_ancestor(const char *pa
/** Return the URI-decoded relative path of @a child_uri that is below
* @a parent_uri, or just "" if @a parent_uri is equal to @a child_uri. If
- * @a child_uri is not below or equal to @a parent_uri, return NULL.
+ * @a child_uri is not below @a parent_uri, return NULL.
*
* Allocate the result in @a result_pool.
*
Modified: subversion/branches/fsfs-improvements/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_error_codes.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_error_codes.h Tue Oct 15 22:57:03 2013
@@ -836,6 +836,16 @@ SVN_ERROR_START
SVN_ERR_FS_CATEGORY_START + 58,
"Index files are inconsistent.")
+ /** @since New in 1.9. */
+ SVN_ERRDEF(SVN_ERR_FS_AMBIGUOUS_MOVE,
+ SVN_ERR_FS_CATEGORY_START + 59,
+ "Ambiguous move")
+
+ /** @since New in 1.9. */
+ SVN_ERRDEF(SVN_ERR_FS_INCOMPLETE_MOVE,
+ SVN_ERR_FS_CATEGORY_START + 60,
+ "Move without a suitable deletion")
+
/* repos errors */
SVN_ERRDEF(SVN_ERR_REPOS_LOCKED,
Modified: subversion/branches/fsfs-improvements/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_fs.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_fs.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_fs.h Tue Oct 15 22:57:03 2013
@@ -1311,7 +1311,13 @@ typedef enum svn_fs_path_change_kind_t
svn_fs_path_change_replace,
/** ignore all previous change items for path (internal-use only) */
- svn_fs_path_change_reset
+ svn_fs_path_change_reset,
+
+ /** moved to this path in txn */
+ svn_fs_path_change_move,
+
+ /** path removed and replaced by moved path in txn */
+ svn_fs_path_change_movereplace
} svn_fs_path_change_kind_t;
@@ -1393,6 +1399,8 @@ svn_fs_path_change2_create(const svn_fs_
* Allocate and return a hash @a *changed_paths2_p containing descriptions
* of the paths changed under @a root. The hash is keyed with
* <tt>const char *</tt> paths, and has #svn_fs_path_change2_t * values.
+ * @a move_behavior determines how moves are being detected and reported;
+ * see #svn_fs_move_behavior_t for the various options.
*
* Callers can assume that this function takes time proportional to
* the amount of data output, and does not need to do tree crawls;
@@ -1402,8 +1410,22 @@ svn_fs_path_change2_create(const svn_fs_
*
* Use @a pool for all allocations, including the hash and its values.
*
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_fs_paths_changed3(apr_hash_t **changed_paths2_p,
+ svn_fs_root_t *root,
+ svn_move_behavior_t move_behavior,
+ apr_pool_t *pool);
+
+
+/** Same as svn_fs_paths_changed3 but with @a move_behavior set to
+ * #svn_fs_move_behavior_no_moves.
+ *
+ * @deprecated Provided for backward compatibility with the 1.8 API.
* @since New in 1.6.
*/
+SVN_DEPRECATED
svn_error_t *
svn_fs_paths_changed2(apr_hash_t **changed_paths2_p,
svn_fs_root_t *root,
@@ -1918,6 +1940,38 @@ svn_fs_revision_link(svn_fs_root_t *from
svn_fs_root_t *to_root,
const char *path,
apr_pool_t *pool);
+
+/** Create a copy of @a from_path in @a from_root named @a to_path in
+ * @a to_root and record it as a Move. If @a from_path in @a from_root is
+ * a directory, copy the tree it refers to recursively. @a from_root must
+ * be @a to_root's base revision.
+ *
+ * The move will remember its source; use svn_fs_copied_from() to
+ * access this information.
+ *
+ * @a to_root must be the root of a transaction based on that revision.
+ * Further, @a to_root and @a from_root must represent the same filesystem.
+ *
+ * Do any necessary temporary allocation in @a pool.
+ *
+ * @note This will not implicitly delete the @a from_path in @a to_root
+ * but the deletion must be reported just as if this was a
+ * #svn_fs_copy call.
+ *
+ * @warning This function is marked as @b experimental. That means this
+ * function will probably be supported in future releases but
+ * might change in signature or various aspects of its semantics.
+ *
+ * @since New in 1.9.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_fs_move(svn_fs_root_t *from_root,
+ const char *from_path,
+ svn_fs_root_t *to_root,
+ const char *to_path,
+ apr_pool_t *pool);
+
/* Files. */
Modified: subversion/branches/fsfs-improvements/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_io.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_io.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_io.h Tue Oct 15 22:57:03 2013
@@ -1070,6 +1070,20 @@ svn_error_t *
svn_stream_for_stdout(svn_stream_t **out,
apr_pool_t *pool);
+/** Set @a *str to a string buffer allocated in @a pool that contains all
+ * data from the current position in @a stream to its end. @a len_hint
+ * specifies the initial capacity of the string buffer and may be 0. The
+ * buffer gets automatically resized to fit the actual amount of data being
+ * read from @a stream.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_stringbuf_from_stream(svn_stringbuf_t **str,
+ svn_stream_t *stream,
+ apr_size_t len_hint,
+ apr_pool_t *pool);
+
/** Return a generic stream connected to stringbuf @a str. Allocate the
* stream in @a pool.
*/
Modified: subversion/branches/fsfs-improvements/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_ra.h?rev=1532583&r1=1532582&r2=1532583&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_ra.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_ra.h Tue Oct 15 22:57:03 2013
@@ -270,6 +270,61 @@ typedef svn_error_t *(*svn_ra_replay_rev
apr_hash_t *rev_props,
apr_pool_t *pool);
+
+/**
+ * Callback function that checks if an ra_svn tunnel called
+ * @a tunnel_name is handled by the callbakcs or the default
+ * implementation.
+ *
+ * @a tunnel_baton is the baton as originally passed to ra_open.
+ *
+ * @since New in 1.9.
+ */
+typedef svn_boolean_t (*svn_ra_check_tunnel_func_t)(
+ void *tunnel_baton, const char *tunnel_name);
+
+/**
+ * Callback function for opening a tunnel in ra_svn.
+ *
+ * Given the @a tunnel_name, tunnel @a user and server @a hostname and
+ * @a port, return a new ra_svn connection in @a conn. The returned
+ * connection must be allocated from @a pool.
+ *
+ * @a request and @a response are the standard input and output,
+ * respectively, of the process on the other end of the tunnel.
+ *
+ * @a tunnel_context will be passed on to the close-unnel callback.
+ *
+ * @a tunnel_baton is the baton as originally passed to ra_open.
+ *
+ * @since New in 1.9.
+ */
+typedef svn_error_t *(*svn_ra_open_tunnel_func_t)(
+ apr_file_t **request, apr_file_t **response,
+ void **tunnel_context, void *tunnel_baton,
+ const char *tunnel_name, const char *user,
+ const char *hostname, int port,
+ apr_pool_t *pool);
+
+/**
+ * Callback function for closing a tunnel in ra_svn.
+ *
+ * This function will be called when the pool that owns the tunnel
+ * connection is cleared or destroyed. It receives the @a baton that
+ * was created by the open-tunnel callback, and the same
+ * @a tunnel_name, @a user, @a hostname and @a port parameters.
+ *
+ * @a tunel_baton was returned by the open-tunnel callback.
+ *
+ * @a open_baton is the baton as originally passed to ra_open.
+ *
+ * @since New in 1.9.
+ */
+typedef svn_error_t *(*svn_ra_close_tunnel_func_t)(
+ void *tunnel_context, void *tunnel_baton,
+ const char *tunnel_name, const char *user,
+ const char *hostname, int port);
+
/**
* The update Reporter.
@@ -538,6 +593,41 @@ typedef struct svn_ra_callbacks2_t
*/
svn_ra_get_wc_contents_func_t get_wc_contents;
+ /** Check-tunnel callback
+ *
+ * If not @c NULL, and open_tunnel_func is also not @c NULL, this
+ * callback will be invoked to check if open_tunnel_func should be
+ * used to create a specific tunnel, or if the default tunnel
+ * implementation (either built-in or configured in the client
+ * configuration file) should be used instead.
+ * @since New in 1.9.
+ */
+ svn_ra_check_tunnel_func_t check_tunnel_func;
+
+ /** Open-tunnel callback
+ *
+ * If not @c NULL, this callback will be invoked to create a tunnel
+ * for a ra_svn connection that needs one, overriding any tunnel
+ * definitions in the client config file. This callback is used only
+ * for ra_svn and ignored by the other RA modules.
+ * @since New in 1.9.
+ */
+ svn_ra_open_tunnel_func_t open_tunnel_func;
+
+ /** Close-tunnel callback
+ *
+ * If not @c NULL, this callback will be invoked when the pool that
+ * owns the connection created by the open_tunnel callback is
+ * cleared or destroyed. This callback is used only for ra_svn and
+ * ignored by the other RA modules.
+ * @since New in 1.9.
+ */
+ svn_ra_close_tunnel_func_t close_tunnel_func;
+
+ /** A baton used with open_tunnel_func and close_tunnel_func.
+ * @since New in 1.9.
+ */
+ void *tunnel_baton;
} svn_ra_callbacks2_t;
/** Similar to svn_ra_callbacks2_t, except that the progress
@@ -1481,6 +1571,9 @@ svn_ra_do_diff(svn_ra_session_t *session
* If @a include_merged_revisions is set, log information for revisions
* which have been merged to @a targets will also be returned.
*
+ * @a move_behavior defines which changes are being reported as moves.
+ * See #svn_move_behavior_t for the various options.
+ *
* If @a revprops is NULL, retrieve all revision properties; else, retrieve
* only the revision properties named by the (const char *) array elements
* (i.e. retrieve none if the array is empty).
@@ -1508,10 +1601,33 @@ svn_ra_do_diff(svn_ra_session_t *session
* revprops is NULL or contains a revprop other than svn:author, svn:date,
* or svn:log, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is returned.
*
- * @since New in 1.5.
+ * @since New in 1.9.
*/
svn_error_t *
+svn_ra_get_log3(svn_ra_session_t *session,
+ const apr_array_header_t *paths,
+ svn_revnum_t start,
+ svn_revnum_t end,
+ int limit,
+ svn_boolean_t discover_changed_paths,
+ svn_boolean_t strict_node_history,
+ svn_boolean_t include_merged_revisions,
+ svn_move_behavior_t move_behavior,
+ const apr_array_header_t *revprops,
+ svn_log_entry_receiver_t receiver,
+ void *receiver_baton,
+ apr_pool_t *pool);
+
+/**
+ * Similar to svn_ra_get_log3(), but with @a move_behavior being set to
+ * #svn_fs_move_behavior_no_moves.
+ *
+ * @since New in 1.5.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
+ */
+SVN_DEPRECATED
+svn_error_t *
svn_ra_get_log2(svn_ra_session_t *session,
const apr_array_header_t *paths,
svn_revnum_t start,