You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/09/18 12:40:16 UTC
svn commit: r998439 [1/3] - in /subversion/branches/object-model: ./
subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/
subversion/bindings/javahl/src/org/tigris/subversion/javahl/
subversion/bindings/javahl...
Author: hwright
Date: Sat Sep 18 10:40:15 2010
New Revision: 998439
URL: http://svn.apache.org/viewvc?rev=998439&view=rev
Log:
On the object-model branch:
Bring up-to-date with trunk (to pull in the JavaHL changes).
Modified:
subversion/branches/object-model/ (props changed)
subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp
subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.h
subversion/branches/object-model/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
subversion/branches/object-model/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
subversion/branches/object-model/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
subversion/branches/object-model/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
subversion/branches/object-model/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
subversion/branches/object-model/subversion/include/private/svn_sqlite.h
subversion/branches/object-model/subversion/include/svn_client.h
subversion/branches/object-model/subversion/include/svn_wc.h
subversion/branches/object-model/subversion/libsvn_client/checkout.c
subversion/branches/object-model/subversion/libsvn_client/cleanup.c
subversion/branches/object-model/subversion/libsvn_client/client.h
subversion/branches/object-model/subversion/libsvn_client/externals.c
subversion/branches/object-model/subversion/libsvn_client/patch.c
subversion/branches/object-model/subversion/libsvn_client/switch.c
subversion/branches/object-model/subversion/libsvn_client/update.c
subversion/branches/object-model/subversion/libsvn_diff/parse-diff.c
subversion/branches/object-model/subversion/libsvn_wc/adm_ops.c
subversion/branches/object-model/subversion/libsvn_wc/deprecated.c
subversion/branches/object-model/subversion/libsvn_wc/entries.c
subversion/branches/object-model/subversion/libsvn_wc/update_editor.c
subversion/branches/object-model/subversion/libsvn_wc/wc-metadata.sql
subversion/branches/object-model/subversion/libsvn_wc/wc-queries.sql
subversion/branches/object-model/subversion/libsvn_wc/wc_db.c
subversion/branches/object-model/subversion/libsvn_wc/wc_db.h
subversion/branches/object-model/subversion/libsvn_wc/workqueue.c
subversion/branches/object-model/subversion/mod_dav_svn/dav_svn.h
subversion/branches/object-model/subversion/svn/upgrade-cmd.c
subversion/branches/object-model/subversion/tests/cmdline/copy_tests.py
subversion/branches/object-model/subversion/tests/cmdline/input_validation_tests.py
subversion/branches/object-model/subversion/tests/cmdline/patch_tests.py
subversion/branches/object-model/subversion/tests/cmdline/resolve_tests.py
subversion/branches/object-model/subversion/tests/cmdline/resolved_tests.py
subversion/branches/object-model/subversion/tests/cmdline/svntest/main.py
subversion/branches/object-model/subversion/tests/cmdline/update_tests.py
subversion/branches/object-model/subversion/tests/libsvn_wc/db-test.c
subversion/branches/object-model/subversion/tests/libsvn_wc/entries-compat.c
Propchange: subversion/branches/object-model/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Sep 18 10:40:15 2010
@@ -37,3 +37,4 @@
/subversion/branches/tc_url_rev:874351-874483
/subversion/branches/tree-conflicts:868291-873154
/subversion/branches/tree-conflicts-notify:873926-874008
+/subversion/trunk:997486-998437
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp Sat Sep 18 10:40:15 2010
@@ -33,6 +33,7 @@
#include "JNIPool.h"
#include "Targets.h"
#include "JNIRevision.h"
+#include "OutputStream.h"
#include "RevisionRange.h"
#include "BlameCallback.h"
#include "ProplistCallback.h"
@@ -1093,43 +1094,9 @@ SVNClient::diffSummarize(const char *tar
requestPool.pool()), );
}
-jbyteArray SVNClient::fileContent(const char *path, Revision &revision,
- Revision &pegRevision)
-{
- SVN::Pool requestPool;
- SVN_JNI_NULL_PTR_EX(path, "path", NULL);
- Path intPath(path);
- SVN_JNI_ERR(intPath.error_occured(), NULL);
-
- size_t size = 0;
- svn_stream_t *read_stream = createReadStream(requestPool.pool(),
- intPath.c_str(), revision,
- pegRevision, size);
- if (read_stream == NULL)
- return NULL;
-
- JNIEnv *env = JNIUtil::getEnv();
- // size will be set to the number of bytes available.
- jbyteArray jcontent = env->NewByteArray(size);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jbyte *jbytes = env->GetByteArrayElements(jcontent, NULL);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- svn_error_t *err = svn_stream_read(read_stream, (char *) jbytes, &size);
- env->ReleaseByteArrayElements(jcontent, jbytes, 0);
- SVN_JNI_ERR(err, NULL);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- return jcontent;
-}
-
void SVNClient::streamFileContent(const char *path, Revision &revision,
- Revision &pegRevision, jobject outputStream,
- size_t bufSize)
+ Revision &pegRevision,
+ OutputStream &outputStream)
{
SVN::Pool requestPool;
SVN_JNI_NULL_PTR_EX(path, "path", );
@@ -1137,101 +1104,14 @@ void SVNClient::streamFileContent(const
SVN_JNI_ERR(intPath.error_occured(), );
JNIEnv *env = JNIUtil::getEnv();
- jclass outputStreamClass = env->FindClass("java/io/OutputStream");
- if (outputStreamClass == NULL)
- return;
-
- jmethodID writeMethod = env->GetMethodID(outputStreamClass, "write",
- "([BII)V");
- if (writeMethod == NULL)
- return;
-
- // Create the buffer.
- jbyteArray buffer = env->NewByteArray(bufSize);
- if (JNIUtil::isJavaExceptionThrown())
- return;
-
- jbyte *bufData = env->GetByteArrayElements(buffer, NULL);
- if (JNIUtil::isJavaExceptionThrown())
- return;
-
- size_t contentSize = 0;
- svn_stream_t *read_stream = createReadStream(requestPool.pool(), path,
- revision, pegRevision,
- contentSize);
- if (read_stream == NULL)
+ svn_client_ctx_t *ctx = context.getContext(NULL);
+ if (ctx == NULL)
return;
- while (contentSize > 0)
- {
- size_t readSize = bufSize > contentSize ? contentSize : bufSize;
- svn_error_t *err;
-
- err = svn_stream_read(read_stream, (char *)bufData, &readSize);
- if (err != NULL)
- {
- env->ReleaseByteArrayElements(buffer, bufData, 0);
- svn_stream_close(read_stream);
- SVN_JNI_ERR(err, );
- }
-
- env->ReleaseByteArrayElements(buffer, bufData, JNI_COMMIT);
- env->CallVoidMethod(outputStream, writeMethod, buffer, 0, readSize);
- if (JNIUtil::isJavaExceptionThrown())
- {
- env->ReleaseByteArrayElements(buffer, bufData, 0);
- svn_stream_close(read_stream);
- return;
- }
- contentSize -= readSize;
- }
-
- env->ReleaseByteArrayElements(buffer, bufData, 0);
- return;
-}
-
-svn_stream_t *SVNClient::createReadStream(apr_pool_t *pool, const char *path,
- Revision &revision,
- Revision &pegRevision, size_t &size)
-{
- svn_stream_t *read_stream = NULL;
-
- if (revision.revision()->kind == svn_opt_revision_working)
- {
- // We want the working copy. Going back to the server returns
- // base instead (which is not what we want).
- apr_file_t *file = NULL;
- apr_finfo_t finfo;
- apr_status_t apr_err = apr_stat(&finfo, path, APR_FINFO_MIN, pool);
- if (apr_err)
- {
- JNIUtil::handleAPRError(apr_err, _("open file"));
- return NULL;
- }
- apr_err = apr_file_open(&file, path, APR_READ, 0, pool);
- if (apr_err)
- {
- JNIUtil::handleAPRError(apr_err, _("open file"));
- return NULL;
- }
- read_stream = svn_stream_from_aprfile2(file, TRUE, pool);
- size = finfo.size;
- }
- else
- {
- svn_client_ctx_t *ctx = context.getContext(NULL);
- if (ctx == NULL)
- return NULL;
-
- svn_stringbuf_t *buf = svn_stringbuf_create("", pool);
- read_stream = svn_stream_from_stringbuf(buf, pool);
- SVN_JNI_ERR(svn_client_cat2(read_stream, path, pegRevision.revision(),
- revision.revision(), ctx, pool),
- NULL);
- size = buf->len;
- }
-
- return read_stream;
+ SVN_JNI_ERR(svn_client_cat2(outputStream.getStream(requestPool),
+ path, pegRevision.revision(),
+ revision.revision(), ctx, requestPool.pool()),
+ );
}
jbyteArray SVNClient::revProperty(const char *path,
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.h?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.h Sat Sep 18 10:40:15 2010
@@ -47,6 +47,7 @@ class InfoCallback;
class CommitCallback;
class ListCallback;
class StatusCallback;
+class OutputStream;
class PatchCallback;
class ChangelistCallback;
class CommitMessage;
@@ -75,11 +76,8 @@ class SVNClient :public SVNBase
BlameCallback *callback);
void relocate(const char *from, const char *to, const char *path,
bool recurse);
- jbyteArray fileContent(const char *path, Revision &revision,
- Revision &pegRevision);
void streamFileContent(const char *path, Revision &revision,
- Revision &pegRevision, jobject outputStream,
- size_t bufSize);
+ Revision &pegRevision, OutputStream &outputStream);
void propertySet(const char *path, const char *name, const char *value,
svn_depth_t depth, StringArray &changelists, bool force,
RevpropTable &revprops, CommitCallback *callback);
@@ -199,9 +197,6 @@ class SVNClient :public SVNBase
SVNClient(jobject jthis_in);
virtual ~SVNClient();
private:
- svn_stream_t *createReadStream(apr_pool_t *pool, const char *path,
- Revision &revision, Revision &pegRevision,
- size_t &size);
/**
* Shared implementation for diff() APIs. When pegRevision is
* provided, revision1 and revision2 equate to startRevision and
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp Sat Sep 18 10:40:15 2010
@@ -32,6 +32,7 @@
#include "SVNClient.h"
#include "JNIRevision.h"
#include "RevisionRange.h"
+#include "OutputStream.h"
#include "EnumMapper.h"
#include "CommitMessage.h"
#include "Prompter.h"
@@ -1309,37 +1310,10 @@ Java_org_apache_subversion_javahl_SVNCli
jignoreAncestry ? true : false, receiver);
}
-JNIEXPORT jbyteArray JNICALL
-Java_org_apache_subversion_javahl_SVNClient_fileContent
-(JNIEnv *env, jobject jthis, jstring jpath, jobject jrevision,
- jobject jpegRevision)
-{
- JNIEntry(SVNClient, fileContent);
- SVNClient *cl = SVNClient::getCppObject(jthis);
- if (cl == NULL)
- {
- JNIUtil::throwError(_("bad C++ this"));
- return NULL;
- }
- JNIStringHolder path(jpath);
- if (JNIUtil::isExceptionThrown())
- return NULL;
-
- Revision revision(jrevision);
- if (JNIUtil::isExceptionThrown())
- return NULL;
-
- Revision pegRevision(jpegRevision);
- if (JNIUtil::isExceptionThrown())
- return NULL;
-
- return cl->fileContent(path, revision, pegRevision);
-}
-
JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNClient_streamFileContent
(JNIEnv *env, jobject jthis, jstring jpath, jobject jrevision,
- jobject jpegRevision, jint bufSize, jobject jstream)
+ jobject jpegRevision, jobject jstream)
{
JNIEntry(SVNClient, streamFileContent);
SVNClient *cl = SVNClient::getCppObject(jthis);
@@ -1360,7 +1334,11 @@ Java_org_apache_subversion_javahl_SVNCli
if (JNIUtil::isExceptionThrown())
return;
- cl->streamFileContent(path, revision, pegRevision, jstream, bufSize);
+ OutputStream dataOut(jstream);
+ if (JNIUtil::isExceptionThrown())
+ return;
+
+ cl->streamFileContent(path, revision, pegRevision, dataOut);
}
JNIEXPORT jstring JNICALL
Modified: subversion/branches/object-model/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java Sat Sep 18 10:40:15 2010
@@ -790,7 +790,7 @@ public interface ISVNClient
* @since 1.0
*/
void streamFileContent(String path, Revision revision, Revision pegRevision,
- int bufferSize, OutputStream stream)
+ OutputStream stream)
throws ClientException;
/**
Modified: subversion/branches/object-model/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java Sat Sep 18 10:40:15 2010
@@ -26,6 +26,7 @@ package org.apache.subversion.javahl;
import org.apache.subversion.javahl.callback.*;
import java.io.OutputStream;
+import java.io.ByteArrayOutputStream;
import java.util.Collection;
import java.util.Set;
@@ -473,15 +474,21 @@ public class SVNClient implements ISVNCl
/**
* @since 1.2
*/
- public native byte[] fileContent(String path, Revision revision,
- Revision pegRevision)
- throws ClientException;
+ public byte[] fileContent(String path, Revision revision,
+ Revision pegRevision)
+ throws ClientException
+ {
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+
+ streamFileContent(path, revision, pegRevision, stream);
+ return stream.toByteArray();
+ }
/**
* @since 1.0
*/
public native void streamFileContent(String path, Revision revision,
- Revision pegRevision, int bufferSize,
+ Revision pegRevision,
OutputStream stream)
throws ClientException;
Modified: subversion/branches/object-model/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java Sat Sep 18 10:40:15 2010
@@ -2105,7 +2105,7 @@ public class SVNClient implements SVNCli
aSVNClient.streamFileContent(path,
revision == null ? null : revision.toApache(),
pegRevision == null ? null : pegRevision.toApache(),
- bufferSize, stream);
+ stream);
}
catch (org.apache.subversion.javahl.ClientException ex)
{
Modified: subversion/branches/object-model/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Sat Sep 18 10:40:15 2010
@@ -1827,7 +1827,7 @@ public class BasicTests extends SVNTests
// get the content from the repository
ByteArrayOutputStream baos = new ByteArrayOutputStream();
client.streamFileContent(thisTest.getWCPath() + "/A/mu", null, null,
- 100, baos);
+ baos);
byte[] content = baos.toByteArray();
byte[] testContent = thisTest.getWc().getItemContent("A/mu").getBytes();
Modified: subversion/branches/object-model/subversion/include/private/svn_sqlite.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/include/private/svn_sqlite.h?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/include/private/svn_sqlite.h (original)
+++ subversion/branches/object-model/subversion/include/private/svn_sqlite.h Sat Sep 18 10:40:15 2010
@@ -165,7 +165,7 @@ svn_sqlite__prepare(svn_sqlite__stmt_t *
svn_error_t *
svn_sqlite__bindf(svn_sqlite__stmt_t *stmt, const char *fmt, ...);
-/* Error-handling wrapper around sqlite3_bind_int64. */
+/* Error-handling wrapper around sqlite3_bind_int. */
svn_error_t *
svn_sqlite__bind_int(svn_sqlite__stmt_t *stmt, int slot, int val);
Modified: subversion/branches/object-model/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/include/svn_client.h?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/include/svn_client.h (original)
+++ subversion/branches/object-model/subversion/include/svn_client.h Sat Sep 18 10:40:15 2010
@@ -316,6 +316,22 @@ svn_client_get_ssl_client_cert_pw_prompt
/** @} */
/**
+ * Revisions and Peg Revisions
+ *
+ * @defgroup clnt_revisions Revisions and Peg Revisions
+ *
+ * A brief word on operative and peg revisions.
+ *
+ * If the kind of the peg revision is #svn_opt_revision_unspecified, then it
+ * defaults to #svn_opt_revision_head for URLs and #svn_opt_revision_working
+ * for local paths.
+ *
+ * For deeper insight, please see the
+ * <a href="http://svnbook.red-bean.com/nightly/en/svn.advanced.pegrevs.html">
+ * Peg and Operative Revisions</a> section of the Subversion Book.
+ */
+
+/**
* Commit operations
*
* @defgroup clnt_commit Client commit subsystem
@@ -881,7 +897,7 @@ typedef struct svn_client_ctx_t
void *cancel_baton;
/** notification function, defaulting to a function that forwards
- * to notify_func().
+ * to notify_func(). If @a NULL, it will not be invoked.
* @since New in 1.2. */
svn_wc_notify_func2_t notify_func2;
@@ -1028,56 +1044,47 @@ svn_client_args_to_target_array(apr_arra
/**
- * Checkout a working copy of @a URL at @a revision, looked up at @a
- * peg_revision, using @a path as the root directory of the newly
- * checked out working copy, and authenticating with the
- * authentication baton cached in @a ctx. If @a result_rev is not @c
- * NULL, set @a *result_rev to the value of the revision actually
- * checked out from the repository.
- *
- * If @a peg_revision->kind is #svn_opt_revision_unspecified, then it
- * defaults to #svn_opt_revision_head.
- *
- * @a revision must be of kind #svn_opt_revision_number,
- * #svn_opt_revision_head, or #svn_opt_revision_date. If
- * @a revision does not meet these requirements, return the error
- * #SVN_ERR_CLIENT_BAD_REVISION.
- *
- * If @a depth is #svn_depth_infinity, check out fully recursively.
- * Else if it is #svn_depth_immediates, check out @a URL and its
- * immediate entries (subdirectories will be present, but will be at
- * depth #svn_depth_empty themselves); else #svn_depth_files,
- * check out @a URL and its file entries, but no subdirectories; else
- * if #svn_depth_empty, check out @a URL as an empty directory at
- * that depth, with no entries present.
- *
- * If @a depth is #svn_depth_unknown, then behave as if for
- * #svn_depth_infinity, except in the case of resuming a previous
- * checkout of @a path (i.e., updating), in which case use the depth
- * of the existing working copy.
- *
- * If @a ignore_externals is set, don't process externals definitions
- * as part of this operation.
- *
- * If @a ctx->notify_func2 is non-NULL, invoke @a ctx->notify_func2 with
- * @a ctx->notify_baton2 as the checkout progresses.
- *
- * If @a allow_unver_obstructions is TRUE then the checkout tolerates
- * existing unversioned items that obstruct added paths from @a URL. Only
- * obstructions of the same type (file or dir) as the added item are
- * tolerated. The text of obstructing files is left as-is, effectively
- * treating it as a user modification after the checkout. Working
- * properties of obstructing items are set equal to the base properties.
- * If @a allow_unver_obstructions is FALSE then the checkout will abort
- * if there are any unversioned obstructing items.
- *
- * If @a URL refers to a file rather than a directory, return the
- * error #SVN_ERR_UNSUPPORTED_FEATURE. If @a URL does not exist,
- * return the error #SVN_ERR_RA_ILLEGAL_URL.
+ * Checkout a working copy from a repository.
*
- * Use @a pool for any temporary allocation.
+ * @param[out] result_rev If non-NULL, the value of the revision checked
+ * out form the repository.
+ * @param[in] URL The repository URL of the checkout source.
+ * @param[in] path The root of the new working copy.
+ * @param[in] peg_revision The peg revision.
+ * @param[in] revision The operative revision.
+ * @param[in] depth The depth of the operation. If #svn_depth_unknown,
+ * then behave as if for #svn_depth_infinity, except in the case
+ * of resuming a previous checkout of @a path (i.e., updating),
+ * in which case use the depth of the existing working copy.
+ * @param[in] ignore_externals If @c TRUE, don't process externals
+ * definitions as part of this operation.
+ * @param[in] allow_unver_obstructions If @c TRUE, then tolerate existing
+ * unversioned items that obstruct incoming paths. Only
+ * obstructions of the same type (file or dir) as the added
+ * item are tolerated. The text of obstructing files is left
+ * as-is, effectively treating it as a user modification after
+ * the checkout. Working properties of obstructing items are
+ * set equal to the base properties. <br>
+ * If @c FALSE, then abort if there are any unversioned
+ * obstructing items.
+ * @param[in] ctx The standard client context, used for authentication and
+ * notification.
+ * @param[in] pool Used for any temporary allocation.
+ *
+ * @return A pointer to an #svn_error_t of the type (this list is not
+ * exhaustive): <br>
+ * #SVN_ERR_UNSUPPORTED_FEATURE if @a URL refers to a file rather
+ * than a directory; <br>
+ * #SVN_ERR_RA_ILLEGAL_URL if @a URL does not exist; <br>
+ * #SVN_ERR_CLIENT_BAD_REVISION if @a revision is not one of
+ * #svn_opt_revision_number, #svn_opt_revision_head, or
+ * #svn_opt_revision_date. <br>
+ * If no error occurred, return #SVN_NO_ERROR.
*
* @since New in 1.5.
+ *
+ * @see #svn_depth_t <br> #svn_client_ctx_t <br> @ref clnt_revisions for
+ * a discussion of operative and peg revisions.
*/
svn_error_t *
svn_client_checkout3(svn_revnum_t *result_rev,
@@ -4684,26 +4691,30 @@ svn_client_ls(apr_hash_t **dirents,
*/
/**
- * Output the content of file identified by @a path_or_url and @a
- * revision to the stream @a out. The actual node revision selected
- * is determined by the path as it exists in @a peg_revision. If @a
- * peg_revision->kind is #svn_opt_revision_unspecified, then it defaults
- * to #svn_opt_revision_head for URLs or #svn_opt_revision_working
- * for WC targets.
+ * Output the content of a file.
*
- * If @a path_or_url is not a local path, then if @a revision is of
- * kind #svn_opt_revision_previous (or some other kind that requires
- * a local path), an error will be returned, because the desired
- * revision cannot be determined.
- *
- * Use the authentication baton cached in @a ctx to authenticate against the
- * repository.
- *
- * Perform all allocations from @a pool.
- *
- * ### @todo Add an expansion/translation flag?
+ * @param[in] out The stream to which the content will be written.
+ * @param[in] path_or_url The path or URL of the file.
+ * @param[in] peg_revision The peg revision.
+ * @param[in] revision The operative revision.
+ * @param[in] ctx The standard client context, used for possible
+ * authentication.
+ * @param[in] pool Used for any temporary allocation.
+ *
+ * @todo Add an expansion/translation flag?
+ *
+ * @return A pointer to an #svn_error_t of the type (this list is not
+ * exhaustive): <br>
+ * An unspecified error if @a revision is of kind
+ * #svn_opt_revision_previous (or some other kind that requires
+ * a local path), because the desired revision cannot be
+ * determined. <br>
+ * If no error occurred, return #SVN_NO_ERROR.
*
* @since New in 1.2.
+ *
+ * @see #svn_client_ctx_t <br> @ref clnt_revisions for
+ * a discussion of operative and peg revisions.
*/
svn_error_t *
svn_client_cat2(svn_stream_t *out,
Modified: subversion/branches/object-model/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/include/svn_wc.h?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/include/svn_wc.h (original)
+++ subversion/branches/object-model/subversion/include/svn_wc.h Sat Sep 18 10:40:15 2010
@@ -1258,10 +1258,12 @@ typedef struct svn_wc_notify_t {
* hunk the notification is for. They are line-based
* offsets and lengths parsed from the unidiff hunk header.
* @since New in 1.7. */
+ /* @{ */
svn_linenum_t hunk_original_start;
svn_linenum_t hunk_original_length;
svn_linenum_t hunk_modified_start;
svn_linenum_t hunk_modified_length;
+ /* @} */
/** The line at which a hunk was matched (and applied).
* @since New in 1.7. */
@@ -5365,10 +5367,6 @@ svn_wc_get_actual_target(const char *pat
* whenever external changes are encountered, giving the callback a chance
* to store the external information for processing.
*
- * If @a fetch_func is non-NULL, then use it (with @a fetch_baton) as
- * a fallback for retrieving repository files whenever 'copyfrom' args
- * are sent into editor->add_file().
- *
* If @a diff3_cmd is non-NULL, then use it as the diff3 command for
* any merging; otherwise, use the built-in merge code.
*
@@ -5419,8 +5417,6 @@ svn_wc_get_update_editor4(const svn_delt
svn_boolean_t allow_unver_obstructions,
const char *diff3_cmd,
const apr_array_header_t *preserved_exts,
- svn_wc_get_file_t fetch_func,
- void *fetch_baton,
svn_wc_conflict_resolver_func_t conflict_func,
void *conflict_baton,
svn_wc_external_update_t external_func,
@@ -5434,7 +5430,8 @@ svn_wc_get_update_editor4(const svn_delt
/** Similar to svn_wc_get_update_editor4, but uses access batons and relative
* path instead of a working copy context-abspath pair and
- * svn_wc_traversal_info_t instead of an externals callback.
+ * svn_wc_traversal_info_t instead of an externals callback. Also,
+ * @a fetch_func and @a fetch_baton are ignored.
*
* If @a ti is non-NULL, record traversal info in @a ti, for use by
* post-traversal accessors such as svn_wc_edited_externals().
@@ -5546,8 +5543,6 @@ svn_wc_get_switch_editor4(const svn_delt
svn_boolean_t allow_unver_obstructions,
const char *diff3_cmd,
const apr_array_header_t *preserved_exts,
- svn_wc_get_file_t fetch_func,
- void *fetch_baton,
svn_wc_conflict_resolver_func_t conflict_func,
void *conflict_baton,
svn_wc_external_update_t external_func,
@@ -5561,8 +5556,7 @@ svn_wc_get_switch_editor4(const svn_delt
/** Similar to svn_wc_get_switch_editor4, but uses access batons and relative
* path instead of a working copy context and svn_wc_traversal_info_t instead
- * of an externals callback. This function doesn't support an external file
- * fetcher.
+ * of an externals callback.
*
* If @a ti is non-NULL, record traversal info in @a ti, for use by
* post-traversal accessors such as svn_wc_edited_externals().
Modified: subversion/branches/object-model/subversion/libsvn_client/checkout.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_client/checkout.c?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_client/checkout.c (original)
+++ subversion/branches/object-model/subversion/libsvn_client/checkout.c Sat Sep 18 10:40:15 2010
@@ -71,10 +71,11 @@ initialize_area(svn_revnum_t *result_rev
repos_root, uuid, revnum, depth, pool));
/* Have update fix the incompleteness. */
return svn_error_return(svn_client__update_internal(result_rev, local_abspath,
- revision, depth, TRUE, ignore_externals,
- allow_unver_obstructions,
- use_sleep, FALSE, innercheckout,
- ctx, pool));
+ revision, depth, TRUE,
+ ignore_externals,
+ allow_unver_obstructions,
+ use_sleep, innercheckout,
+ ctx, pool));
}
@@ -219,7 +220,7 @@ svn_client__checkout_internal(svn_revnum
revision, depth, TRUE,
ignore_externals,
allow_unver_obstructions,
- use_sleep, FALSE, innercheckout,
+ use_sleep, innercheckout,
ctx, pool);
}
else
Modified: subversion/branches/object-model/subversion/libsvn_client/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_client/cleanup.c?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_client/cleanup.c (original)
+++ subversion/branches/object-model/subversion/libsvn_client/cleanup.c Sat Sep 18 10:40:15 2010
@@ -129,6 +129,11 @@ svn_client_upgrade(const char *path,
info_baton.last_repos = NULL;
info_baton.last_uuid = NULL;
+ if (svn_path_is_url(path))
+ return svn_error_return(svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s' is not a local path"),
+ path));
+
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
SVN_ERR(svn_wc_upgrade(ctx->wc_ctx, local_abspath,
fetch_repos_info, &info_baton,
Modified: subversion/branches/object-model/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_client/client.h?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_client/client.h (original)
+++ subversion/branches/object-model/subversion/libsvn_client/client.h Sat Sep 18 10:40:15 2010
@@ -490,12 +490,6 @@ svn_client__make_local_parents(const cha
that obstruct items added from the repos are tolerated; if FALSE,
these obstructions cause the update to fail.
- If SEND_COPYFROM_ARGS is true, then request that the server not
- send file contents when adding files that have been created by
- explicit copying; instead, just send copyfrom-args to add_file(),
- and possibly follow up with an apply_textdelta() against the copied
- file.
-
If INNERUPDATE is true, no anchor check is performed on the update target.
*/
svn_error_t *
@@ -507,7 +501,6 @@ svn_client__update_internal(svn_revnum_t
svn_boolean_t ignore_externals,
svn_boolean_t allow_unver_obstructions,
svn_boolean_t *timestamp_sleep,
- svn_boolean_t send_copyfrom_args,
svn_boolean_t innerupdate,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
Modified: subversion/branches/object-model/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_client/externals.c?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/object-model/subversion/libsvn_client/externals.c Sat Sep 18 10:40:15 2010
@@ -205,7 +205,7 @@ switch_dir_external(const char *path,
revision, svn_depth_unknown,
FALSE, FALSE, FALSE,
timestamp_sleep, TRUE,
- TRUE, ctx, subpool));
+ ctx, subpool));
svn_pool_destroy(subpool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/object-model/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_client/patch.c?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/object-model/subversion/libsvn_client/patch.c Sat Sep 18 10:40:15 2010
@@ -862,59 +862,41 @@ match_hunk(svn_boolean_t *matched, targe
NULL, FALSE,
content_info->keywords, FALSE,
iterpool));
- lines_read++;
SVN_ERR(read_line(content_info, &target_line, iterpool, iterpool));
- if (! hunk_eof)
+
+ lines_read++;
+
+ /* If the last line doesn't have a newline, we get EOF but still
+ * have a non-empty line to compare. */
+ if ((hunk_eof && hunk_line->len == 0) ||
+ (content_info->eof && strlen(target_line) == 0))
+ break;
+
+ /* Leading/trailing fuzzy lines always match. */
+ if ((lines_read <= fuzz && leading_context > fuzz) ||
+ (lines_read > hunk_length - fuzz && trailing_context > fuzz))
+ lines_matched = TRUE;
+ else
{
- if (lines_read <= fuzz && leading_context > fuzz)
- lines_matched = TRUE;
- else if (lines_read > hunk_length - fuzz &&
- trailing_context > fuzz)
- lines_matched = TRUE;
- else
+ if (ignore_whitespace)
{
- if (ignore_whitespace)
- {
- char *stripped_hunk_line = apr_pstrdup(pool,
- hunk_line_translated);
- char *stripped_target_line = apr_pstrdup(pool, target_line);
-
- apr_collapse_spaces(stripped_hunk_line,
- hunk_line_translated);
- apr_collapse_spaces(stripped_target_line, target_line);
- lines_matched = ! strcmp(stripped_hunk_line,
- stripped_target_line);
- }
- else
- lines_matched = ! strcmp(hunk_line_translated, target_line);
+ char *hunk_line_trimmed;
+ char *target_line_trimmed;
+
+ hunk_line_trimmed = apr_pstrdup(iterpool, hunk_line_translated);
+ target_line_trimmed = apr_pstrdup(iterpool, target_line);
+ apr_collapse_spaces(hunk_line_trimmed, hunk_line_trimmed);
+ apr_collapse_spaces(target_line_trimmed, target_line_trimmed);
+ lines_matched = ! strcmp(hunk_line_trimmed, target_line_trimmed);
}
+ else
+ lines_matched = ! strcmp(hunk_line_translated, target_line);
}
}
- while (lines_matched && ! (hunk_eof || content_info->eof));
+ while (lines_matched);
+
+ *matched = lines_matched && hunk_eof && hunk_line->len == 0;
- if (hunk_eof)
- *matched = lines_matched;
- else if (content_info->eof)
- {
- /* If the target has no newline at end-of-file, we get an EOF
- * indication for the target earlier than we do get it for the hunk. */
- if (match_modified)
- SVN_ERR(svn_diff_hunk_readline_modified_text(hunk, &hunk_line,
- NULL, &hunk_eof,
- iterpool, iterpool));
- else
- SVN_ERR(svn_diff_hunk_readline_original_text(hunk, &hunk_line,
- NULL, &hunk_eof,
- iterpool, iterpool));
-
- /* When comparing modified text we require that all lines match, else
- * a hunk that adds a newline at the end will be treated as already
- * applied even if it isn't. */
- if (! match_modified && hunk_line->len == 0 && hunk_eof)
- *matched = lines_matched;
- else
- *matched = FALSE;
- }
SVN_ERR(seek_to_line(content_info, saved_line, iterpool));
svn_pool_destroy(iterpool);
@@ -1160,54 +1142,55 @@ get_hunk_info(hunk_info_t **hi, patch_ta
else if (original_start > 0 && content_info->stream)
{
svn_linenum_t saved_line = content_info->current_line;
- svn_linenum_t modified_start;
- /* Check if the hunk is already applied.
- * We only check for an exact match here, and don't bother checking
- * for already applied patches with offset/fuzz, because such a
- * check would be ambiguous. */
- if (fuzz == 0)
+ /* Scan for a match at the line where the hunk thinks it
+ * should be going. */
+ SVN_ERR(seek_to_line(content_info, original_start, scratch_pool));
+ if (content_info->current_line != original_start)
{
- modified_start = svn_diff_hunk_get_modified_start(hunk);
- if (modified_start == 0)
- {
- /* Patch wants to delete the file. */
- already_applied = target->locally_deleted;
- }
- else
- {
- SVN_ERR(seek_to_line(content_info, modified_start,
- scratch_pool));
- SVN_ERR(scan_for_match(&matched_line, content_info,
- hunk, TRUE,
- modified_start + 1,
- fuzz, ignore_whitespace, TRUE,
- cancel_func, cancel_baton,
- scratch_pool));
- already_applied = (matched_line == modified_start);
- }
+ /* Seek failed. */
+ matched_line = 0;
}
else
- already_applied = FALSE;
+ SVN_ERR(scan_for_match(&matched_line, content_info, hunk, TRUE,
+ original_start + 1, fuzz,
+ ignore_whitespace, FALSE,
+ cancel_func, cancel_baton,
+ scratch_pool));
- if (! already_applied)
+ if (matched_line != original_start)
{
- /* Scan for a match at the line where the hunk thinks it
- * should be going. */
- SVN_ERR(seek_to_line(content_info, original_start, scratch_pool));
- if (content_info->current_line != original_start)
+ /* Check if the hunk is already applied.
+ * We only check for an exact match here, and don't bother checking
+ * for already applied patches with offset/fuzz, because such a
+ * check would be ambiguous. */
+ if (fuzz == 0)
{
- /* Seek failed. */
- matched_line = 0;
+ svn_linenum_t modified_start;
+
+ modified_start = svn_diff_hunk_get_modified_start(hunk);
+ if (modified_start == 0)
+ {
+ /* Patch wants to delete the file. */
+ already_applied = target->locally_deleted;
+ }
+ else
+ {
+ SVN_ERR(seek_to_line(content_info, modified_start,
+ scratch_pool));
+ SVN_ERR(scan_for_match(&matched_line, content_info,
+ hunk, TRUE,
+ modified_start + 1,
+ fuzz, ignore_whitespace, TRUE,
+ cancel_func, cancel_baton,
+ scratch_pool));
+ already_applied = (matched_line == modified_start);
+ }
}
else
- SVN_ERR(scan_for_match(&matched_line, content_info, hunk, TRUE,
- original_start + 1, fuzz,
- ignore_whitespace, FALSE,
- cancel_func, cancel_baton,
- scratch_pool));
+ already_applied = FALSE;
- if (matched_line != original_start)
+ if (! already_applied)
{
/* Scan the whole file again from the start. */
SVN_ERR(seek_to_line(content_info, 1, scratch_pool));
Modified: subversion/branches/object-model/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_client/switch.c?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/object-model/subversion/libsvn_client/switch.c Sat Sep 18 10:40:15 2010
@@ -190,7 +190,6 @@ switch_internal(svn_revnum_t *result_rev
depth,
depth_is_sticky, allow_unver_obstructions,
diff3_cmd, preserved_exts,
- NULL, NULL,
ctx->conflict_func, ctx->conflict_baton,
svn_client__external_info_gatherer, &efb,
ctx->cancel_func, ctx->cancel_baton,
Modified: subversion/branches/object-model/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_client/update.c?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_client/update.c (original)
+++ subversion/branches/object-model/subversion/libsvn_client/update.c Sat Sep 18 10:40:15 2010
@@ -45,49 +45,6 @@
/*** Code. ***/
-/* Context baton for file_fetcher below. */
-struct ff_baton
-{
- svn_client_ctx_t *ctx; /* client context used to open ra session */
- const char *repos_root; /* repository root URL */
- svn_ra_session_t *session; /* the secondary ra session itself */
- apr_pool_t *pool; /* the pool where the ra session is allocated */
-};
-
-
-/* Implementation of svn_wc_get_file_t. A feeble callback wrapper
- around svn_ra_get_file(), so that the update_editor can use it to
- fetch any file, any time. */
-static svn_error_t *
-file_fetcher(void *baton,
- const char *path,
- svn_revnum_t revision,
- svn_stream_t *stream,
- svn_revnum_t *fetched_rev,
- apr_hash_t **props,
- apr_pool_t *pool)
-{
- struct ff_baton *ffb = (struct ff_baton *)baton;
- const char *dirpath, *base_name, *session_url, *old_session_url;
-
- svn_relpath_split(&dirpath, &base_name, path, pool);
- session_url = svn_path_url_add_component2(ffb->repos_root,
- dirpath, pool);
-
- if (ffb->session)
- SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url, ffb->session,
- session_url, ffb->pool));
- else
- SVN_ERR(svn_client__open_ra_session_internal(&(ffb->session), NULL,
- session_url, NULL, NULL,
- FALSE, TRUE,
- ffb->ctx, ffb->pool));
-
- return svn_ra_get_file(ffb->session, base_name, revision, stream,
- fetched_rev, props, pool);
-}
-
-
static svn_error_t *
update_internal(svn_revnum_t *result_rev,
const char *local_abspath,
@@ -98,7 +55,6 @@ update_internal(svn_revnum_t *result_rev
svn_boolean_t ignore_externals,
svn_boolean_t allow_unver_obstructions,
svn_boolean_t *timestamp_sleep,
- svn_boolean_t send_copyfrom_args,
svn_boolean_t innerupdate,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
@@ -120,7 +76,6 @@ update_internal(svn_revnum_t *result_rev
svn_ra_session_t *ra_session;
const char *preserved_exts_str;
apr_array_header_t *preserved_exts;
- struct ff_baton *ffb;
svn_client__external_func_baton_t efb;
svn_boolean_t server_supports_depth;
svn_config_t *cfg = ctx->config ? apr_hash_get(ctx->config,
@@ -216,12 +171,6 @@ update_internal(svn_revnum_t *result_rev
a strict sense, however.) */
SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root, pool));
- /* Build a baton for the file-fetching callback. */
- ffb = apr_pcalloc(pool, sizeof(*ffb));
- ffb->ctx = ctx;
- ffb->repos_root = repos_root;
- ffb->pool = pool;
-
/* Build a baton for the externals-info-gatherer callback. */
efb.externals_new = apr_hash_make(pool);
efb.externals_old = apr_hash_make(pool);
@@ -235,7 +184,6 @@ update_internal(svn_revnum_t *result_rev
target, use_commit_times, depth,
depth_is_sticky, allow_unver_obstructions,
diff3_cmd, preserved_exts,
- file_fetcher, ffb,
ctx->conflict_func, ctx->conflict_baton,
svn_client__external_info_gatherer, &efb,
ctx->cancel_func, ctx->cancel_baton,
@@ -244,12 +192,8 @@ update_internal(svn_revnum_t *result_rev
/* Tell RA to do an update of URL+TARGET to REVISION; if we pass an
invalid revnum, that means RA will use the latest revision. */
- SVN_ERR(svn_ra_do_update2(ra_session,
- &reporter, &report_baton,
- revnum,
- target,
- depth,
- send_copyfrom_args,
+ SVN_ERR(svn_ra_do_update2(ra_session, &reporter, &report_baton,
+ revnum, target, depth, FALSE,
update_editor, update_edit_baton, pool));
SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
@@ -321,7 +265,6 @@ svn_client__update_internal(svn_revnum_t
svn_boolean_t ignore_externals,
svn_boolean_t allow_unver_obstructions,
svn_boolean_t *timestamp_sleep,
- svn_boolean_t send_copyfrom_args,
svn_boolean_t innerupdate,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
@@ -343,8 +286,7 @@ svn_client__update_internal(svn_revnum_t
err = update_internal(result_rev, local_abspath, anchor_abspath,
revision, depth, depth_is_sticky,
ignore_externals, allow_unver_obstructions,
- timestamp_sleep, send_copyfrom_args,
- innerupdate, ctx, pool);
+ timestamp_sleep, innerupdate, ctx, pool);
err = svn_error_compose_create(
err,
@@ -398,7 +340,7 @@ svn_client_update3(apr_array_header_t **
revision, depth, depth_is_sticky,
ignore_externals,
allow_unver_obstructions,
- &sleep, TRUE, FALSE, ctx, subpool);
+ &sleep, FALSE, ctx, subpool);
if (err && err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
{
Modified: subversion/branches/object-model/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_diff/parse-diff.c?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/object-model/subversion/libsvn_diff/parse-diff.c Sat Sep 18 10:40:15 2010
@@ -183,7 +183,6 @@ parse_range(svn_linenum_t *start, svn_li
/* Try to parse a hunk header in string HEADER, putting parsed information
* into HUNK. Return TRUE if the header parsed correctly. ATAT is the
* character string used to delimit the hunk header.
- * If REVERSE is TRUE, invert the hunk header while parsing it.
* Do all allocations in POOL. */
static svn_boolean_t
parse_hunk_header(const char *header, svn_diff_hunk_t *hunk,
Modified: subversion/branches/object-model/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_wc/adm_ops.c?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/object-model/subversion/libsvn_wc/adm_ops.c Sat Sep 18 10:40:15 2010
@@ -1288,12 +1288,11 @@ revert_entry(svn_depth_t *depth,
sure we leave a not-present node behind */
if (was_not_present)
{
- SVN_ERR(svn_wc__db_base_add_absent_node(
+ SVN_ERR(svn_wc__db_base_add_not_present_node(
db, local_abspath,
repos_relpath, repos_root_url, repos_uuid,
base_revision,
base_kind,
- svn_wc__db_status_not_present,
NULL, NULL,
pool));
}
Modified: subversion/branches/object-model/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_wc/deprecated.c?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/object-model/subversion/libsvn_wc/deprecated.c Sat Sep 18 10:40:15 2010
@@ -2945,7 +2945,6 @@ svn_wc_get_update_editor3(svn_revnum_t *
allow_unver_obstructions,
diff3_cmd,
preserved_exts,
- fetch_func, fetch_baton,
conflict_func, conflict_baton,
external_func, eb,
cancel_func, cancel_baton,
@@ -3062,7 +3061,6 @@ svn_wc_get_switch_editor3(svn_revnum_t *
allow_unver_obstructions,
diff3_cmd,
preserved_exts,
- NULL, NULL,
conflict_func, conflict_baton,
external_func, eb,
cancel_func, cancel_baton,
Modified: subversion/branches/object-model/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_wc/entries.c?rev=998439&r1=998438&r2=998439&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/object-model/subversion/libsvn_wc/entries.c Sat Sep 18 10:40:15 2010
@@ -1677,6 +1677,7 @@ insert_working_node(svn_sqlite__db_t *sd
{
svn_sqlite__stmt_t *stmt;
+#ifndef SVN_WC__NODES_ONLY
/* ### NODE_DATA when switching to NODE_DATA, replace the
query below with STMT_INSERT_WORKING_NODE_DATA_2
and adjust the parameters bound. Can't do that yet. */
@@ -1748,68 +1749,59 @@ insert_working_node(svn_sqlite__db_t *sd
/* Execute and reset the insert clause. */
SVN_ERR(svn_sqlite__insert(NULL, stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_INSERT_WORKING_NODE_DATA_1));
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_NODE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isisnnnnsnrisnnni",
+ working_node->wc_id, working_node->local_relpath,
+ (working_node->parent_relpath == NULL ? 1 : 2),
+ working_node->parent_relpath,
+ /* Setting depth for files? */
+ svn_depth_to_word(working_node->depth),
+ working_node->changed_rev,
+ working_node->changed_date,
+ working_node->changed_author,
+ working_node->last_mod_time));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 1, working_node->wc_id));
- SVN_ERR(svn_sqlite__bind_text(stmt, 2, working_node->local_relpath));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 3,
- (*working_node->local_relpath == '\0') ? 1 : 2));
- SVN_ERR(svn_sqlite__bind_text(stmt, 4, working_node->parent_relpath));
+ if (working_node->copyfrom_repos_path)
+ {
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 5,
+ working_node->copyfrom_repos_id));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 6,
+ working_node->copyfrom_repos_path));
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 7, working_node->copyfrom_revnum));
+ }
- /* ### need rest of values */
if (working_node->presence == svn_wc__db_status_normal)
- SVN_ERR(svn_sqlite__bind_text(stmt, 5, "normal"));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "normal"));
else if (working_node->presence == svn_wc__db_status_not_present)
- SVN_ERR(svn_sqlite__bind_text(stmt, 5, "not-present"));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "not-present"));
else if (working_node->presence == svn_wc__db_status_base_deleted)
- SVN_ERR(svn_sqlite__bind_text(stmt, 5, "base-deleted"));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "base-deleted"));
else if (working_node->presence == svn_wc__db_status_incomplete)
- SVN_ERR(svn_sqlite__bind_text(stmt, 5, "incomplete"));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "incomplete"));
else if (working_node->presence == svn_wc__db_status_excluded)
- SVN_ERR(svn_sqlite__bind_text(stmt, 5, "excluded"));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "excluded"));
if (working_node->kind == svn_node_none)
- SVN_ERR(svn_sqlite__bind_text(stmt, 6, "unknown"));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 10, "unknown"));
else
- SVN_ERR(svn_sqlite__bind_text(stmt, 6,
+ SVN_ERR(svn_sqlite__bind_text(stmt, 10,
svn_node_kind_to_word(working_node->kind)));
- if (working_node->copyfrom_repos_path)
- {
- SVN_ERR(svn_sqlite__bind_int64(stmt, 7,
- working_node->copyfrom_repos_id));
- SVN_ERR(svn_sqlite__bind_text(stmt, 8,
- working_node->copyfrom_repos_path));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 9, working_node->copyfrom_revnum));
- }
-
- if (working_node->checksum)
- SVN_ERR(svn_sqlite__bind_checksum(stmt, 10, working_node->checksum,
+ if (working_node->kind == svn_wc__db_kind_file)
+ SVN_ERR(svn_sqlite__bind_checksum(stmt, 14, working_node->checksum,
scratch_pool));
- if (SVN_IS_VALID_REVNUM(working_node->changed_rev))
- SVN_ERR(svn_sqlite__bind_int64(stmt, 11, working_node->changed_rev));
- if (working_node->changed_date)
- SVN_ERR(svn_sqlite__bind_int64(stmt, 12, working_node->changed_date));
- if (working_node->changed_author)
- SVN_ERR(svn_sqlite__bind_text(stmt, 13, working_node->changed_author));
-
- SVN_ERR(svn_sqlite__bind_text(stmt, 14,
- svn_depth_to_word(working_node->depth)));
-
if (working_node->properties)
SVN_ERR(svn_sqlite__bind_properties(stmt, 15, working_node->properties,
scratch_pool));
- /* ### we should bind 'symlink_target' (16) as appropriate. */
+ if (working_node->translated_size != SVN_INVALID_FILESIZE)
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 16, working_node->translated_size));
- /* Execute and reset the insert clause. */
SVN_ERR(svn_sqlite__insert(NULL, stmt));
-
#endif
return SVN_NO_ERROR;