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 11:09:12 UTC
svn commit: r998426 -
/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
Author: hwright
Date: Sat Sep 18 09:09:12 2010
New Revision: 998426
URL: http://svn.apache.org/viewvc?rev=998426&view=rev
Log:
JavaHL:
Remove some functionality that is duplicated by the proper client library.
* subversion/bindings/javahl/native/SVNClient.cpp
(createReadStream): Don't special case for the working revision.
Modified:
subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp?rev=998426&r1=998425&r2=998426&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Sat Sep 18 09:09:12 2010
@@ -1195,41 +1195,16 @@ svn_stream_t *SVNClient::createReadStrea
Revision &pegRevision, size_t &size)
{
svn_stream_t *read_stream = NULL;
+ svn_client_ctx_t *ctx = context.getContext(NULL);
+ if (ctx == NULL)
+ return 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;
- }
+ 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;
}