svn commit: r993253 - /subversion/trunk/subversion/libsvn_subr/win32_xlate.c

2010-09-07 Thread rhuijben
Author: rhuijben
Date: Tue Sep  7 07:28:10 2010
New Revision: 993253

URL: http://svn.apache.org/viewvc?rev=993253view=rev
Log:
* subversion/libsvn_subr/win32_xlate.c
  (get_page_id_from_name): Revert r993183 for this function as it is
impossible to return a svn_error_t* message via a apr status code.
This fixes compilation of this file on Windows.

Modified:
subversion/trunk/subversion/libsvn_subr/win32_xlate.c

Modified: subversion/trunk/subversion/libsvn_subr/win32_xlate.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/win32_xlate.c?rev=993253r1=993252r2=993253view=diff
==
--- subversion/trunk/subversion/libsvn_subr/win32_xlate.c (original)
+++ subversion/trunk/subversion/libsvn_subr/win32_xlate.c Tue Sep  7 07:28:10 
2010
@@ -110,7 +110,7 @@ get_page_id_from_name(UINT *page_id_p, c
   if ((page_name[0] == 'c' || page_name[0] == 'C')
(page_name[1] == 'p' || page_name[1] == 'P'))
 {
-  SVN_ERR(svn_cstring_atoui(page_id_p, page_name + 2));
+  *page_id_p = atoi(page_name + 2);
   return APR_SUCCESS;
 }
 




svn commit: r993258 - /subversion/trunk/subversion/mod_dav_svn/reports/log.c

2010-09-07 Thread rhuijben
Author: rhuijben
Date: Tue Sep  7 07:32:34 2010
New Revision: 993258

URL: http://svn.apache.org/viewvc?rev=993258view=rev
Log:
* subversion/mod_dav_svn/reports/log.c
  (dav_svn__log_report): Partially revert r993246 to fix compilation.
The malformed_element_error() function is not defined nor a public
api.

Modified:
subversion/trunk/subversion/mod_dav_svn/reports/log.c

Modified: subversion/trunk/subversion/mod_dav_svn/reports/log.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/reports/log.c?rev=993258r1=993257r2=993258view=diff
==
--- subversion/trunk/subversion/mod_dav_svn/reports/log.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/reports/log.c Tue Sep  7 07:32:34 
2010
@@ -311,15 +311,7 @@ dav_svn__log_report(const dav_resource *
   else if (strcmp(child-name, end-revision) == 0)
 end = SVN_STR_TO_REV(dav_xml_get_cdata(child, resource-pool, 1));
   else if (strcmp(child-name, limit) == 0)
-{
-  serr = svn_cstring_atoi(limit,
-  dav_xml_get_cdata(child, resource-pool, 1));
-  if (serr)
-{
-  svn_error_clear(serr);
-  return malformed_element_error(limit, resource-pool);
-}
-}
+limit = atoi(dav_xml_get_cdata(child, resource-pool, 1));
   else if (strcmp(child-name, discover-changed-paths) == 0)
 discover_changed_paths = TRUE; /* presence indicates positivity */
   else if (strcmp(child-name, strict-node-history) == 0)




svn commit: r993272 - /subversion/trunk/subversion/libsvn_subr/io.c

2010-09-07 Thread rhuijben
Author: rhuijben
Date: Tue Sep  7 08:16:35 2010
New Revision: 993272

URL: http://svn.apache.org/viewvc?rev=993272view=rev
Log:
Resolve two highly-unlikely open file handle leaks.

* subversion/libsvn_subr/io.c
  (svn_io_file_create,
   svn_io_write_unique): Close file handle on writing errors.

Modified:
subversion/trunk/subversion/libsvn_subr/io.c

Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=993272r1=993271r2=993272view=diff
==
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Tue Sep  7 08:16:35 2010
@@ -1025,14 +1025,19 @@ svn_error_t *svn_io_file_create(const ch
 {
   apr_file_t *f;
   apr_size_t written;
+  svn_error_t *err;
 
   SVN_ERR(svn_io_file_open(f, file,
(APR_WRITE | APR_CREATE | APR_EXCL),
APR_OS_DEFAULT,
pool));
-  SVN_ERR(svn_io_file_write_full(f, contents, strlen(contents),
- written, pool));
-  return svn_io_file_close(f, pool);
+  err= svn_io_file_write_full(f, contents, strlen(contents),
+  written, pool);
+
+
+  return svn_error_return(
+svn_error_compose_create(err,
+ svn_io_file_close(f, pool)));
 }
 
 svn_error_t *svn_io_dir_file_copy(const char *src_path,
@@ -2868,12 +2873,19 @@ svn_io_write_unique(const char **tmp_pat
 apr_pool_t *pool)
 {
   apr_file_t *new_file;
+  svn_error_t *err;
 
   SVN_ERR(svn_io_open_unique_file3(new_file, tmp_path, dirpath,
delete_when, pool, pool));
-  SVN_ERR(svn_io_file_write_full(new_file, buf, nbytes, NULL, pool));
-  SVN_ERR(svn_io_file_flush_to_disk(new_file, pool));
-  return svn_io_file_close(new_file, pool);
+
+  err = svn_io_file_write_full(new_file, buf, nbytes, NULL, pool);
+
+  if (!err)
+err = svn_io_file_flush_to_disk(new_file, pool);
+
+  return svn_error_return(
+  svn_error_compose_create(err,
+   svn_io_file_close(new_file, pool)));
 }
 
 




svn commit: r993308 - /subversion/trunk/subversion/libsvn_subr/io.c

2010-09-07 Thread rhuijben
Author: rhuijben
Date: Tue Sep  7 10:00:40 2010
New Revision: 993308

URL: http://svn.apache.org/viewvc?rev=993308view=rev
Log:
Fix another open file handle leak in one function and properly close
files and return all errors in another function.

* subversion/libsvn_subr/io.c
  (svn_io_read_version_file): Close file if svn_io_file_read() fails.
  (contents_identical_p): Properly close both files on all error conditions.
Return all errors instead of just clearing a few.

Modified:
subversion/trunk/subversion/libsvn_subr/io.c

Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=993308r1=993307r2=993308view=diff
==
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Tue Sep  7 10:00:40 2010
@@ -3449,15 +3449,17 @@ svn_io_read_version_file(int *version,
   apr_file_t *format_file;
   char buf[80];
   apr_size_t len;
+  svn_error_t *err;
 
   /* Read a chunk of data from PATH */
   SVN_ERR(svn_io_file_open(format_file, path, APR_READ,
APR_OS_DEFAULT, pool));
   len = sizeof(buf);
-  SVN_ERR(svn_io_file_read(format_file, buf, len, pool));
+  err = svn_io_file_read(format_file, buf, len, pool);
 
   /* Close the file. */
-  SVN_ERR(svn_io_file_close(format_file, pool));
+  SVN_ERR(svn_error_compose_create(err,
+   svn_io_file_close(format_file, pool)));
 
   /* If there was no data in PATH, return an error. */
   if (len == 0)
@@ -3498,48 +3500,65 @@ contents_identical_p(svn_boolean_t *iden
  const char *file2,
  apr_pool_t *pool)
 {
-  svn_error_t *err1;
-  svn_error_t *err2;
+  svn_error_t *err;
   apr_size_t bytes_read1, bytes_read2;
   char *buf1 = apr_palloc(pool, SVN__STREAM_CHUNK_SIZE);
   char *buf2 = apr_palloc(pool, SVN__STREAM_CHUNK_SIZE);
   apr_file_t *file1_h = NULL;
   apr_file_t *file2_h = NULL;
+  svn_boolean_t done1 = FALSE;
+  svn_boolean_t done2 = FALSE;
 
   SVN_ERR(svn_io_file_open(file1_h, file1, APR_READ, APR_OS_DEFAULT,
pool));
-  SVN_ERR(svn_io_file_open(file2_h, file2, APR_READ, APR_OS_DEFAULT,
-   pool));
+
+  err = svn_io_file_open(file2_h, file2, APR_READ, APR_OS_DEFAULT,
+ pool);
+
+  if (err)
+return svn_error_return(
+   svn_error_compose_create(err,
+svn_io_file_close(file1_h, pool)));
 
   *identical_p = TRUE;  /* assume TRUE, until disproved below */
-  do
+  while (! (done1 || done2))
 {
-  err1 = svn_io_file_read_full(file1_h, buf1,
-   SVN__STREAM_CHUNK_SIZE, bytes_read1, pool);
-  if (err1  !APR_STATUS_IS_EOF(err1-apr_err))
-return err1;
-
-  err2 = svn_io_file_read_full(file2_h, buf2,
-   SVN__STREAM_CHUNK_SIZE, bytes_read2, pool);
-  if (err2  !APR_STATUS_IS_EOF(err2-apr_err))
+  err = svn_io_file_read_full(file1_h, buf1,
+  SVN__STREAM_CHUNK_SIZE, bytes_read1, pool);
+  if (err  APR_STATUS_IS_EOF(err-apr_err))
+{
+  svn_error_clear(err);
+  err = NULL;
+  done1 = TRUE;
+}
+  else if (err)
+break;
+
+  err = svn_io_file_read_full(file2_h, buf2,
+  SVN__STREAM_CHUNK_SIZE, bytes_read2, pool);
+  if (err  APR_STATUS_IS_EOF(err-apr_err))
 {
-  svn_error_clear(err1);
-  return err2;
+  svn_error_clear(err);
+  err = NULL;
+  done2 = TRUE;
 }
+  else if (err)
+break;
 
   if ((bytes_read1 != bytes_read2)
+  || (done1 != done2)
   || (memcmp(buf1, buf2, bytes_read1)))
 {
   *identical_p = FALSE;
   break;
 }
-} while (! err1  ! err2);
-
-  svn_error_clear(err1);
-  svn_error_clear(err2);
+}
 
-  SVN_ERR(svn_io_file_close(file1_h, pool));
-  return svn_io_file_close(file2_h, pool);
+  return svn_error_return(
+   svn_error_compose_create(
+err,
+svn_error_compose_create(svn_io_file_close(file1_h, pool),
+ svn_io_file_close(file2_h, pool;
 }
 
 




svn commit: r993310 - /subversion/trunk/subversion/mod_dav_svn/reports/log.c

2010-09-07 Thread stsp
Author: stsp
Date: Tue Sep  7 10:09:28 2010
New Revision: 993310

URL: http://svn.apache.org/viewvc?rev=993310view=rev
Log:
Follow-up to r993183:

* subversion/mod_dav_svn/reports/log.c
  (dav_svn__log_report): Use svn_cstring_atoi() instead of atoi(), and
   handle conversion errors properly this time.

Modified:
subversion/trunk/subversion/mod_dav_svn/reports/log.c

Modified: subversion/trunk/subversion/mod_dav_svn/reports/log.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/reports/log.c?rev=993310r1=993309r2=993310view=diff
==
--- subversion/trunk/subversion/mod_dav_svn/reports/log.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/reports/log.c Tue Sep  7 10:09:28 
2010
@@ -311,7 +311,17 @@ dav_svn__log_report(const dav_resource *
   else if (strcmp(child-name, end-revision) == 0)
 end = SVN_STR_TO_REV(dav_xml_get_cdata(child, resource-pool, 1));
   else if (strcmp(child-name, limit) == 0)
-limit = atoi(dav_xml_get_cdata(child, resource-pool, 1));
+{
+  serr = svn_cstring_atoi(limit,
+  dav_xml_get_cdata(child, resource-pool, 1));
+  if (serr)
+{
+  derr = dav_svn__convert_err(serr, HTTP_BAD_REQUEST,
+  Malformed CDATA in element 
+  \limit\, resource-pool);
+  goto cleanup;
+}
+}
   else if (strcmp(child-name, discover-changed-paths) == 0)
 discover_changed_paths = TRUE; /* presence indicates positivity */
   else if (strcmp(child-name, strict-node-history) == 0)




svn commit: r993314 - /subversion/trunk/subversion/libsvn_diff/parse-diff.c

2010-09-07 Thread rhuijben
Author: rhuijben
Date: Tue Sep  7 10:38:42 2010
New Revision: 993314

URL: http://svn.apache.org/viewvc?rev=993314view=rev
Log:
* subversion/libsvn_diff/parse-diff.c
  (parse_offset): Pass a apr_uint64_t * instead of a unsigned * to
svn_cstring_strtoui64(). This fixes several patch tests on 32 bit systems.

Modified:
subversion/trunk/subversion/libsvn_diff/parse-diff.c

Modified: subversion/trunk/subversion/libsvn_diff/parse-diff.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?rev=993314r1=993313r2=993314view=diff
==
--- subversion/trunk/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/trunk/subversion/libsvn_diff/parse-diff.c Tue Sep  7 10:38:42 
2010
@@ -121,14 +121,17 @@ static svn_boolean_t
 parse_offset(svn_linenum_t *offset, const char *number)
 {
   svn_error_t *err;
+  apr_uint64_t val;
 
-  err = svn_cstring_strtoui64(offset, number, 0, SVN_LINENUM_MAX_VALUE, 10);
+  err = svn_cstring_strtoui64(val, number, 0, SVN_LINENUM_MAX_VALUE, 10);
   if (err)
 {
   svn_error_clear(err);
   return FALSE;
 }
-  
+
+  *offset = (svn_linenum_t)val;
+
   return TRUE;
 }
 




svn commit: r993327 - /subversion/trunk/subversion/tests/cmdline/revert_tests.py

2010-09-07 Thread rhuijben
Author: rhuijben
Date: Tue Sep  7 12:25:46 2010
New Revision: 993327

URL: http://svn.apache.org/viewvc?rev=993327view=rev
Log:
* subversion/tests/cmdline/revert_tests.py
  (status_of_missing_dir_after_revert_replaced_with_history_dir):
Expect that G/pi, G/rho and G/tau are also reverted, as their
information is not lost in single-DB. Then restore the expected
result to be like it was in 1.6. (Revert leaves unversioned files,
not additions). Finally expect that nodes under a missing file
are still visible in single-db.

This resolves some older concerns and fixes the test.

  (test_list): Remove wimp marking from
status_of_missing_dir_after_revert_replaced_with_history_dir.

Modified:
subversion/trunk/subversion/tests/cmdline/revert_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/revert_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/revert_tests.py?rev=993327r1=993326r2=993327view=diff
==
--- subversion/trunk/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/revert_tests.py Tue Sep  7 
12:25:46 2010
@@ -851,29 +851,37 @@ def status_of_missing_dir_after_revert_r
   os.path.join(G_path, 'alpha'),
   os.path.join(G_path, 'beta')]
 
+  if svntest.main.wc_is_singledb(wc_dir):
+# These nodes are not lost in single-db
+revert_paths += [ os.path.join(G_path, 'pi'),
+  os.path.join(G_path, 'rho'),
+  os.path.join(G_path, 'tau')]
+
   expected_output = svntest.verify.UnorderedOutput([
 Reverted '%s'\n % path for path in revert_paths])
 
   svntest.actions.run_and_verify_svn(None, expected_output, [], revert, -R,
  G_path)
 
-  ### GS (Oct 11): this is stupid. after a revert, there should be
-  ###  *NO* status whatsoever. ugh. this status behavior
-  ###  has been twiddled over the 1.6/1.7 dev cycle, but
-  ###  it should just disappear.
 
-  ### Is it a bug that we'd need to run revert twice to finish the job?
+  # Revert leaves these added nodes as unversioned
   expected_output = svntest.verify.UnorderedOutput(
-[A+ os.path.join(G_path, pi) + \n,
- A+ os.path.join(G_path, rho) + \n,
- A+ os.path.join(G_path, tau) + \n])
+[?+ os.path.join(G_path, pi) + \n,
+ ?+ os.path.join(G_path, rho) + \n,
+ ?+ os.path.join(G_path, tau) + \n])
   svntest.actions.run_and_verify_svn(None, expected_output, [],
  status, wc_dir)
 
   svntest.main.safe_rmtree(G_path)
 
-  expected_output = svntest.verify.UnorderedOutput(
-[!+ G_path + \n])
+  if svntest.main.wc_is_singledb(wc_dir):
+expected_output = svntest.verify.UnorderedOutput(
+  [!+ G_path + \n,
+   !+ os.path.join(G_path, alpha) + \n,
+   !+ os.path.join(G_path, beta) + \n])
+  else:
+expected_output = svntest.verify.UnorderedOutput(
+  [!+ G_path + \n])
   svntest.actions.run_and_verify_svn(None, expected_output, [], status,
  wc_dir)
 
@@ -1054,8 +1062,7 @@ test_list = [ None,
   revert_propdel__file,
   revert_replaced_with_history_file_1,
   status_of_missing_dir_after_revert,
-  Wimp(revert behavior needs better definition,
-   
status_of_missing_dir_after_revert_replaced_with_history_dir),
+  status_of_missing_dir_after_revert_replaced_with_history_dir,
   revert_replaced_with_history_file_2,
   revert_tree_conflicts_in_updated_files,
   revert_add_over_not_present_dir,




svn propchange: r993314 - svn:log

2010-09-07 Thread rhuijben
Author: rhuijben
Revision: 993314
Modified property: svn:log

Modified: svn:log at Tue Sep  7 12:36:07 2010
--
--- svn:log (original)
+++ svn:log Tue Sep  7 12:36:07 2010
@@ -1,3 +1,3 @@
 * subversion/libsvn_diff/parse-diff.c
-  (parse_offset): Pass a apr_uint64_t * instead of a unsigned * to
+  (parse_offset): Pass an apr_uint64_t * instead of an unsigned int* to
 svn_cstring_strtoui64(). This fixes several patch tests on 32 bit systems.



svn commit: r993356 - in /subversion/trunk/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/ src/org/tigris/subversion/javahl/ tests/org/apache/subversion/javahl/

2010-09-07 Thread hwright
Author: hwright
Date: Tue Sep  7 13:42:33 2010
New Revision: 993356

URL: http://svn.apache.org/viewvc?rev=993356view=rev
Log:
Revert r992041, as a result of this discussion:
http://svn.haxx.se/dev/archive-2010-09/0044.shtml

Modified:
subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp

subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/CommitItem.java

subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictVersion.java

subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/CommitItem.java

subversion/trunk/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java

Modified: subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp?rev=993356r1=993355r2=993356view=diff
==
--- subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/CreateJ.cpp Tue Sep  7 
13:42:33 2010
@@ -871,21 +871,8 @@ CreateJ::CommitItem(svn_client_commit_it
   midConstructor = env-GetMethodID(clazz, init,
 (Ljava/lang/String;
 LJAVA_PACKAGE/NodeKind;
-ILjava/net/URI;
-Ljava/net/URI;J)V);
-  if (JNIUtil::isExceptionThrown())
-POP_AND_RETURN_NULL;
-}
-
-  jclass clazz2 = env-FindClass(java/net/URI);
-  if (JNIUtil::isJavaExceptionThrown())
-POP_AND_RETURN_NULL;
-
-  static jmethodID mid2 = 0;
-  if (mid2 == 0)
-{
-  mid2 = env-GetMethodID(clazz2, init,
-  (Ljava/lang/String;)V);
+ILjava/lang/String;
+Ljava/lang/String;J)V);
   if (JNIUtil::isExceptionThrown())
 POP_AND_RETURN_NULL;
 }
@@ -913,23 +900,13 @@ CreateJ::CommitItem(svn_client_commit_it
 jstateFlags |=
   org_apache_subversion_javahl_CommitItemStateFlags_IsCopy;
 
-  jobject jurl = NULL;
-  if (item-url != NULL)
-{
-  jurl = env-NewObject(clazz2, mid2,
-JNIUtil::makeJString(item-url));
-  if (JNIUtil::isJavaExceptionThrown())
-POP_AND_RETURN_NULL;
-}
+  jstring jurl = JNIUtil::makeJString(item-url);
+  if (JNIUtil::isJavaExceptionThrown())
+POP_AND_RETURN_NULL;
 
-  jobject jcopyUrl = NULL;
-  if (item-copyfrom_url != NULL)
-{
-  jcopyUrl = env-NewObject(clazz2, mid2,
-JNIUtil::makeJString(item-copyfrom_url));
-  if (JNIUtil::isJavaExceptionThrown())
-POP_AND_RETURN_NULL;
-}
+  jstring jcopyUrl = JNIUtil::makeJString(item-copyfrom_url);
+  if (JNIUtil::isJavaExceptionThrown())
+POP_AND_RETURN_NULL;
 
   jlong jcopyRevision = item-revision;
 

Modified: 
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/CommitItem.java
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/CommitItem.java?rev=993356r1=993355r2=993356view=diff
==
--- 
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/CommitItem.java
 (original)
+++ 
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/CommitItem.java
 Tue Sep  7 13:42:33 2010
@@ -23,8 +23,6 @@
 
 package org.apache.subversion.javahl;
 
-import java.net.URI;
-
 /**
  * This class describes a item which will be commited.
  */
@@ -57,12 +55,12 @@ public class CommitItem implements java.
 /**
  * the url of the item
  */
-URI url;
+String url;
 
 /**
  * the source of the copy
  */
-URI copyUrl;
+String copyUrl;
 
 /**
  * the revision
@@ -78,7 +76,7 @@ public class CommitItem implements java.
  * @param cucopy source url
  * @param r revision number
  */
-public CommitItem(String p, NodeKind nk, int sf, URI u, URI cu, long r)
+public CommitItem(String p, NodeKind nk, int sf, String u, String cu, long 
r)
 {
 path = p;
 nodeKind = nk;
@@ -127,7 +125,7 @@ public class CommitItem implements java.
  * Returns the url of the item
  * @return url
  */
-public URI getUrl()
+public String getUrl()
 {
 return url;
 }
@@ -136,7 +134,7 @@ public class CommitItem implements java.
  * Returns the source url if the item is copied
  * @return source url
  */
-public URI getCopyUrl()
+public String getCopyUrl()
 {
 return copyUrl;
 }

Modified: 
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictVersion.java
URL: 

svn propchange: r993356 - svn:log

2010-09-07 Thread hwright
Author: hwright
Revision: 993356
Modified property: svn:log

Modified: svn:log at Tue Sep  7 13:44:38 2010
--
--- svn:log (original)
+++ svn:log Tue Sep  7 13:44:38 2010
@@ -1,2 +1,5 @@
 Revert r992041, as a result of this discussion:
 http://svn.haxx.se/dev/archive-2010-09/0044.shtml
+
+Note: this revert itself accidentally included a change for ConflictVersion,
+which will shortly be reverted.



svn commit: r993358 - /subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictVersion.java

2010-09-07 Thread hwright
Author: hwright
Date: Tue Sep  7 13:47:01 2010
New Revision: 993358

URL: http://svn.apache.org/viewvc?rev=993358view=rev
Log:
Revert some changes to ConflictVersion.java accidentally committed in r993356
(which was itself a revertion of r992041.)

Modified:

subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictVersion.java

Modified: 
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictVersion.java
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictVersion.java?rev=993358r1=993357r2=993358view=diff
==
--- 
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictVersion.java
 (original)
+++ 
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictVersion.java
 Tue Sep  7 13:47:01 2010
@@ -23,8 +23,6 @@
 
 package org.apache.subversion.javahl;
 
-import java.net.URI;
-
 /**
  * The description of a merge conflict, encountered during
  * merge/update/switch operations.
@@ -33,14 +31,14 @@ import java.net.URI;
  */
 public class ConflictVersion
 {
-private URI reposURL;
+private String reposURL;
 private long pegRevision;
 private String pathInRepos;
 
 private NodeKind nodeKind;
 
 /** This constructor should only be called from JNI code. */
-public ConflictVersion(URI reposURL, long pegRevision, String pathInRepos,
+public ConflictVersion(String reposURL, long pegRevision, String 
pathInRepos,
 NodeKind nodeKind)
 {
 this.reposURL = reposURL;
@@ -49,7 +47,7 @@ public class ConflictVersion
 this.nodeKind = nodeKind;
 }
 
-public URI getReposURL()
+public String getReposURL()
 {
 return reposURL;
 }




svn commit: r993368 [2/4] - in /subversion/branches/javahl-ra: ./ notes/wc-ng/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/include/ subversion/include/private/ subversion

2010-09-07 Thread hwright
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c?rev=993368r1=993367r2=993368view=diff
==
--- subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c Tue Sep  7 
13:59:41 2010
@@ -272,7 +272,10 @@ get_base_info_for_deleted(svn_wc_entry_t
db, parent_abspath,
scratch_pool, scratch_pool));
   if (parent_status == svn_wc__db_status_added
-  || parent_status == svn_wc__db_status_obstructed_add)
+#ifndef SVN_WC__SINGLE_DB
+  || parent_status == svn_wc__db_status_obstructed_add
+#endif
+  )
 SVN_ERR(svn_wc__db_scan_addition(NULL, NULL,
  parent_repos_relpath,
  entry-repos,
@@ -405,7 +408,10 @@ get_base_info_for_deleted(svn_wc_entry_t
db, parent_abspath,
scratch_pool, scratch_pool));
   if (parent_status == svn_wc__db_status_added
-  || parent_status == svn_wc__db_status_obstructed_add)
+#ifndef SVN_WC__SINGLE_DB
+  || parent_status == svn_wc__db_status_obstructed_add
+#endif
+  )
 SVN_ERR(svn_wc__db_scan_addition(parent_status,
  NULL,
  NULL, NULL, NULL,
@@ -649,7 +655,10 @@ read_one_entry(const svn_wc_entry_t **ne
 }
 }
   else if (status == svn_wc__db_status_deleted
-   || status == svn_wc__db_status_obstructed_delete)
+#ifndef SVN_WC__SINGLE_DB
+   || status == svn_wc__db_status_obstructed_delete
+#endif
+   )
 {
 #ifdef SVN_WC__SINGLE_DB
   svn_node_kind_t path_kind;
@@ -690,7 +699,10 @@ read_one_entry(const svn_wc_entry_t **ne
 #endif
 }
   else if (status == svn_wc__db_status_added
-   || status == svn_wc__db_status_obstructed_add)
+#ifndef SVN_WC__SINGLE_DB
+   || status == svn_wc__db_status_obstructed_add
+#endif
+   )
 {
   svn_wc__db_status_t work_status;
   const char *op_root_abspath;
@@ -772,6 +784,7 @@ read_one_entry(const svn_wc_entry_t **ne
!SVN_IS_VALID_REVNUM(entry-cmt_rev))
 entry-revision = 0;
 
+#ifndef SVN_WC__SINGLE_DB
   if (status == svn_wc__db_status_obstructed_add)
 entry-revision = SVN_INVALID_REVNUM;
 
@@ -781,6 +794,7 @@ read_one_entry(const svn_wc_entry_t **ne
status == svn_wc__db_status_obstructed_add)
 entry-schedule = svn_wc_schedule_normal;
   else
+#endif
 entry-schedule = svn_wc_schedule_add;
 }
 }
@@ -789,6 +803,7 @@ read_one_entry(const svn_wc_entry_t **ne
  then we cannot begin a scan for data. The original node may
  have important data. Set up stuff to kill that idea off,
  and finish up this entry.  */
+#ifndef SVN_WC__SINGLE_DB
   if (status == svn_wc__db_status_obstructed_add)
 {
   entry-cmt_rev = SVN_INVALID_REVNUM;
@@ -796,6 +811,7 @@ read_one_entry(const svn_wc_entry_t **ne
   scanned_original_relpath = NULL;
 }
   else
+#endif
 {
   SVN_ERR(svn_wc__db_scan_addition(work_status,
op_root_abspath,
@@ -993,12 +1009,14 @@ read_one_entry(const svn_wc_entry_t **ne
   entry-schedule = svn_wc_schedule_normal;
   entry-deleted = TRUE;
 }
+#ifndef SVN_WC__SINGLE_DB
   else if (status == svn_wc__db_status_obstructed)
 {
   /* ### set some values that should (hopefully) let this directory
  ### be usable.  */
   entry-revision = SVN_INVALID_REVNUM;
 }
+#endif
   else if (status == svn_wc__db_status_absent)
 {
   entry-absent = TRUE;
@@ -1049,6 +1067,14 @@ read_one_entry(const svn_wc_entry_t **ne
 
  ### the last three should probably have an implied REPOS_RELPATH
   */
+#ifdef SVN_WC__SINGLE_DB
+  SVN_ERR_ASSERT(repos_relpath != NULL
+ || entry-schedule == svn_wc_schedule_delete
+ || status == svn_wc__db_status_not_present
+ || status == svn_wc__db_status_absent
+ || status == svn_wc__db_status_excluded
+ );
+#else
   SVN_ERR_ASSERT(repos_relpath != NULL
  || entry-schedule == svn_wc_schedule_delete
  || status == svn_wc__db_status_obstructed
@@ -1058,6 +1084,7 @@ read_one_entry(const svn_wc_entry_t **ne
  || status == svn_wc__db_status_absent
  || status == svn_wc__db_status_excluded
  );
+#endif
   if (repos_relpath)
 entry-url = 

svn commit: r993368 [4/4] - in /subversion/branches/javahl-ra: ./ notes/wc-ng/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/include/ subversion/include/private/ subversion

2010-09-07 Thread hwright
Modified: 
subversion/branches/javahl-ra/subversion/tests/cmdline/externals_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/externals_tests.py?rev=993368r1=993367r2=993368view=diff
==
--- subversion/branches/javahl-ra/subversion/tests/cmdline/externals_tests.py 
(original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/externals_tests.py 
Tue Sep  7 13:59:41 2010
@@ -1471,6 +1471,104 @@ def wc_repos_file_externals(sbox):
 None, None, None, None, None,
 True)
 
+#--
+def merge_target_with_externals(sbox):
+  merge target with externals
+
+  # Test for a problem the plagued Subversion in the pre-1.7-single-DB world:
+  # Externals in a merge target would get meaningless explicit mergeinfo set
+  # on them.  See http://svn.haxx.se/dev/archive-2010-08/0088.shtml
+  externals_test_setup(sbox)
+  wc_dir = sbox.wc_dir
+  repo_url = sbox.repo_url
+
+  # Some paths we'll care about
+  A_path  = os.path.join(wc_dir, A)
+  A_branch_path   = os.path.join(wc_dir, A-branch)
+  A_gamma_branch_path = os.path.join(wc_dir, A-branch, D, gamma)
+  
+  svntest.actions.run_and_verify_svn(None, None, [],
+ 'checkout',
+ repo_url, wc_dir)
+
+  # Branch a...@1 to A-branch and make a simple text change on the latter in 
r8.
+  svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_path + '@1',
+ A_branch_path)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
+ '-m', 'make a copy', wc_dir)
+  svntest.main.file_write(A_gamma_branch_path, The new gamma!\n)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
+ '-m', 'branch edit', wc_dir)
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+  # Merge r8 from A-branch back to A.  There should be explicit mergeinfo
+  # only at the root of A; the externals should not get any.
+  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c8',
+ repo_url + '/A-branch', A_path)
+  svntest.actions.run_and_verify_svn(
+Unexpected subtree mergeinfo created,
+[Properties on ' + A_path + ':\n,
+   svn:mergeinfo\n,
+ /A-branch:8\n],
+[], 'pg', svntest.main.SVN_PROP_MERGEINFO, '-vR', wc_dir)
+
+def update_modify_file_external(sbox):
+  update that modifies a file external
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Setup A/external as file external to A/mu
+  externals_prop = ^/A/mu external\n
+  change_external(sbox.ospath('A'), externals_prop)
+  expected_output = svntest.wc.State(wc_dir, {
+  'A/external'  : Item(status='E '),
+})
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.add({
+'A'  : Item(props={'svn:externals':externals_prop}),
+'A/external' : Item(This is the file 'mu'.\n),
+})
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+  expected_status.add({
+'A/external' : Item(status='  ', wc_rev='2', switched='X'),
+})
+  svntest.actions.run_and_verify_update(wc_dir,
+expected_output,
+expected_disk,
+expected_status,
+None, None, None, None, None,
+True)
+
+  # Modify A/mu
+  svntest.main.file_append(sbox.ospath('A/mu'), 'appended mu text')
+  expected_output = svntest.wc.State(wc_dir, {
+'A/mu' : Item(verb='Sending'),
+})
+  expected_status.tweak('A/mu', wc_rev=3)
+  svntest.actions.run_and_verify_commit(wc_dir,
+expected_output,
+expected_status,
+None,
+wc_dir)
+
+  # Update to modify the file external, this asserts in update_editor.c
+  expected_output = svntest.wc.State(wc_dir, {
+  'A/external'  : Item(status='E '),
+})
+  expected_disk.tweak('A/mu', 'A/external',
+  contents=expected_disk.desc['A/mu'].contents
+  + 'appended mu text')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
+  expected_status.add({
+'A/external' : Item(status='  ', wc_rev='3', switched='X'),
+})
+  svntest.actions.run_and_verify_update(wc_dir,
+expected_output,
+expected_disk,
+expected_status,
+None, None, None, None, None,
+   

svn commit: r993390 - /subversion/trunk/tools/dev/wc-ng/bump-to-19.py

2010-09-07 Thread stsp
Author: stsp
Date: Tue Sep  7 15:10:11 2010
New Revision: 993390

URL: http://svn.apache.org/viewvc?rev=993390view=rev
Log:
* tools/dev/wc-ng/bump-to-19.py
  (move_and_shard_pristine_files): If a shard already exists, don't
   attempt to rename it into itself. Saw this error on a working copy
   which had its subdirectories at various formats, so bump-to-19.py
   errored out early. On subsequent runs, however, it kept trying to rename
   .svn/pristine/00 to .svn/pristine/00/00 within already converted
   directories, not realising the pristine directory had already been sharded.

Modified:
subversion/trunk/tools/dev/wc-ng/bump-to-19.py

Modified: subversion/trunk/tools/dev/wc-ng/bump-to-19.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/dev/wc-ng/bump-to-19.py?rev=993390r1=993389r2=993390view=diff
==
--- subversion/trunk/tools/dev/wc-ng/bump-to-19.py (original)
+++ subversion/trunk/tools/dev/wc-ng/bump-to-19.py Tue Sep  7 15:10:11 2010
@@ -192,6 +192,8 @@ def move_and_shard_pristine_files(old_wc
 
   for basename in os.listdir(old_pristine_dir):
 shard = basename[:2]
+if shard == basename: # already converted
+  continue
 old = os.path.join(old_pristine_dir, basename)
 new = os.path.join(new_pristine_dir, shard, basename)
 os.renames(old, new)




svn commit: r993419 - /subversion/trunk/tools/dev/unix-build/Makefile.svn

2010-09-07 Thread stsp
Author: stsp
Date: Tue Sep  7 16:33:27 2010
New Revision: 993419

URL: http://svn.apache.org/viewvc?rev=993419view=rev
Log:
* tools/dev/unix-build/Makefile.svn: Don't build neon with libproxy for now.
   On my system it ends up pulling -L/usr/local/lib into LDFLAGS, causing
   run-time conflicts with libraries installed by 3rd party software managed
   by OpenBSD ports. Fixes local test failures with the BDB backend.

Modified:
subversion/trunk/tools/dev/unix-build/Makefile.svn

Modified: subversion/trunk/tools/dev/unix-build/Makefile.svn
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/dev/unix-build/Makefile.svn?rev=993419r1=993418r2=993419view=diff
==
--- subversion/trunk/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/trunk/tools/dev/unix-build/Makefile.svn Tue Sep  7 16:33:27 2010
@@ -554,7 +554,8 @@ $(NEON_OBJDIR)/.configured: $(NEON_OBJDI
PATH=$(NEON_OBJDIR):$$PATH \
--prefix=$(PREFIX)/neon \
--with-ssl \
-   --enable-shared
+   --enable-shared \
+   --without-libproxy
touch $@
 
 # compile neon




svn commit: r993425 - /subversion/trunk/subversion/libsvn_fs_base/util/fs_skels.c

2010-09-07 Thread stsp
Author: stsp
Date: Tue Sep  7 16:57:36 2010
New Revision: 993425

URL: http://svn.apache.org/viewvc?rev=993425view=rev
Log:
Convert use of atoi() and apr_atoi64() in the BDB skel parsing code over
to the new svn_cstring number parsing API.

* subversion/libsvn_fs_base/util/fs_skels.c
  (svn_fs_base__parse_representation_skel): Use svn_cstring_strtoui64()
   and svn_cstring_strtoi64() instead of atoi() and svn__atoui64().
  (svn_fs_base__parse_node_revision_skel): Use svn_cstring_atoi() instead
   of atoi() and apr_atoi64().

Modified:
subversion/trunk/subversion/libsvn_fs_base/util/fs_skels.c

Modified: subversion/trunk/subversion/libsvn_fs_base/util/fs_skels.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/util/fs_skels.c?rev=993425r1=993424r2=993425view=diff
==
--- subversion/trunk/subversion/libsvn_fs_base/util/fs_skels.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/util/fs_skels.c Tue Sep  7 
16:57:36 2010
@@ -31,6 +31,7 @@
 #include svn_time.h
 
 #include private/svn_skel.h
+#include private/svn_dep_compat.h
 
 #include svn_checksum.h
 #include fs_skels.h
@@ -550,32 +551,38 @@ svn_fs_base__parse_representation_skel(r
 {
   svn_skel_t *window_skel = chunk_skel-children-next;
   svn_skel_t *diff_skel = window_skel-children;
+  apr_int64_t val;
+  apr_uint64_t uval;
+  const char *str;
 
   /* Allocate a chunk and its window */
   chunk = apr_palloc(pool, sizeof(*chunk));
 
   /* Populate the window */
-  chunk-version
-= (apr_byte_t)atoi(apr_pstrmemdup
-   (pool,
-diff_skel-children-next-data,
-diff_skel-children-next-len));
+  str = apr_pstrmemdup(pool, diff_skel-children-next-data,
+   diff_skel-children-next-len);
+  SVN_ERR(svn_cstring_strtoui64(uval, str, 0, 255, 10));
+  chunk-version = (apr_byte_t)uval;
+
   chunk-string_key
 = apr_pstrmemdup(pool,
  diff_skel-children-next-next-data,
  diff_skel-children-next-next-len);
-  chunk-size
-= atoi(apr_pstrmemdup(pool,
-  window_skel-children-next-data,
-  window_skel-children-next-len));
+
+  str = apr_pstrmemdup(pool, window_skel-children-next-data,
+   window_skel-children-next-len);
+  SVN_ERR(svn_cstring_strtoui64(uval, str, 0, APR_SIZE_MAX, 10));
+  chunk-size = (apr_size_t)uval;
+
   chunk-rep_key
 = apr_pstrmemdup(pool,
  window_skel-children-next-next-data,
  window_skel-children-next-next-len);
-  chunk-offset =
-svn__atoui64(apr_pstrmemdup(pool,
-chunk_skel-children-data,
-chunk_skel-children-len));
+
+  str = apr_pstrmemdup(pool, chunk_skel-children-data,
+   chunk_skel-children-len);
+  SVN_ERR(svn_cstring_strtoi64(val, str, 0, APR_INT64_MAX, 10));
+  chunk-offset = (svn_filesize_t)val;
 
   /* Add this chunk to the array. */
   APR_ARRAY_PUSH(chunks, rep_delta_chunk_t *) = chunk;
@@ -633,24 +640,28 @@ svn_fs_base__parse_node_revision_skel(no
   noderev-predecessor_count = -1;
   if (cur_skel-next)
 {
+  const char *str;
+
   cur_skel = cur_skel-next;
   if (cur_skel-len)
-noderev-predecessor_count = atoi(apr_pstrmemdup(pool,
- cur_skel-data,
- cur_skel-len));
+{
+  str = apr_pstrmemdup(pool, cur_skel-data, cur_skel-len);
+  SVN_ERR(svn_cstring_atoi(noderev-predecessor_count, str));
+}
 
   /* HAS-MERGEINFO and MERGEINFO-COUNT */
   if (cur_skel-next)
 {
+  int val;
+
   cur_skel = cur_skel-next;
-  noderev-has_mergeinfo = atoi(apr_pstrmemdup(pool,
-   cur_skel-data,
-   cur_skel-len))
- != 0;
-  noderev-mergeinfo_count =
-apr_atoi64(apr_pstrmemdup(pool,
-  cur_skel-next-data,
-  cur_skel-next-len));
+  str = apr_pstrmemdup(pool, cur_skel-data, cur_skel-len);
+  SVN_ERR(svn_cstring_atoi(val, str));
+  noderev-has_mergeinfo = (val != 0);
+
+  str = 

svn commit: r993493 - in /subversion/branches/javahl-ra/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/ tests/org/apache/subversion/javahl/

2010-09-07 Thread hwright
Author: hwright
Date: Tue Sep  7 19:32:23 2010
New Revision: 993493

URL: http://svn.apache.org/viewvc?rev=993493view=rev
Log:
On the javahl-ra branch:
Implement the getLocks() ra API in JavaHL.

[ in subversion/bindings/javahl/ ]
* tests/org/apache/subversion/javahl/SVNRATests.java
  (setUp): Create a working copy, because it will be useful for out tests.
  (testGetLocks): New.

* native/CreateJ.cpp
  (LockMap): New.

* native/SVNReposAccess.h
  (getLocks): New.

* native/SVNReposAccess.cpp
  (getLocks): New.

* native/org_apache_subversion_javahl_SVNReposAccess.cpp
  (Java_org_apache_subversion_javahl_SVNReposAccess_getLocks): New.

* native/CreateJ.h
  (LockMap): New.

* src/org/apache/subversion/javahl/ISVNReposAccess.java
  (getLocks): New.

* src/org/apache/subversion/javahl/SVNReposAccess.java
  (getLocks): New.

Modified:
subversion/branches/javahl-ra/subversion/bindings/javahl/native/CreateJ.cpp
subversion/branches/javahl-ra/subversion/bindings/javahl/native/CreateJ.h

subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.cpp

subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.h

subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNReposAccess.cpp

subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNReposAccess.java

subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java

subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java

Modified: 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/CreateJ.cpp
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/CreateJ.cpp?rev=993493r1=993492r2=993493view=diff
==
--- subversion/branches/javahl-ra/subversion/bindings/javahl/native/CreateJ.cpp 
(original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/native/CreateJ.cpp 
Tue Sep  7 19:32:23 2010
@@ -350,6 +350,72 @@ CreateJ::Lock(const svn_lock_t *lock)
 }
 
 jobject
+CreateJ::LockMap(const apr_hash_t *locks, apr_pool_t *pool)
+{
+  JNIEnv *env = JNIUtil::getEnv();
+
+  if (locks == NULL)
+return NULL;
+
+  // Create a local frame for our references
+  env-PushLocalFrame(LOCAL_FRAME_SIZE);
+  if (JNIUtil::isJavaExceptionThrown())
+return NULL;
+
+  jclass clazz = env-FindClass(java/util/HashMap);
+  if (JNIUtil::isJavaExceptionThrown())
+POP_AND_RETURN_NULL;
+
+  static jmethodID init_mid = 0;
+  if (init_mid == 0)
+{
+  init_mid = env-GetMethodID(clazz, init, ()V);
+  if (JNIUtil::isJavaExceptionThrown())
+POP_AND_RETURN_NULL;
+}
+
+  static jmethodID put_mid = 0;
+  if (put_mid == 0)
+{
+  put_mid = env-GetMethodID(clazz, put,
+ (Ljava/lang/Object;Ljava/lang/Object;)
+ Ljava/lang/Object;);
+  if (JNIUtil::isJavaExceptionThrown())
+POP_AND_RETURN_NULL;
+}
+
+  jobject map = env-NewObject(clazz, init_mid);
+  if (JNIUtil::isJavaExceptionThrown())
+POP_AND_RETURN_NULL;
+
+  apr_hash_index_t *hi;
+  int i = 0;
+  for (hi = apr_hash_first(pool, (apr_hash_t *) locks); hi;
+hi = apr_hash_next(hi), ++i)
+{
+  const char *key = (const char *) svn__apr_hash_index_key(hi);
+  const svn_lock_t *lock = (const svn_lock_t *) 
svn__apr_hash_index_val(hi);
+
+  jstring jpath = JNIUtil::makeJString(key);
+  if (JNIUtil::isJavaExceptionThrown())
+POP_AND_RETURN_NULL;
+
+  jobject jlock = Lock(lock);
+  if (JNIUtil::isJavaExceptionThrown())
+POP_AND_RETURN_NULL;
+
+  env-CallObjectMethod(map, put_mid, jpath, jlock);
+  if (JNIUtil::isJavaExceptionThrown())
+POP_AND_RETURN_NULL;
+
+  env-DeleteLocalRef(jpath);
+  env-DeleteLocalRef(jlock);
+}
+
+  return env-PopLocalFrame(map);
+}
+
+jobject
 CreateJ::ChangedPath(const char *path, svn_log_changed_path2_t *log_item)
 {
   JNIEnv *env = JNIUtil::getEnv();

Modified: 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/CreateJ.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/CreateJ.h?rev=993493r1=993492r2=993493view=diff
==
--- subversion/branches/javahl-ra/subversion/bindings/javahl/native/CreateJ.h 
(original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/native/CreateJ.h 
Tue Sep  7 19:32:23 2010
@@ -52,6 +52,9 @@ class CreateJ
   Lock(const svn_lock_t *lock);
 
   static jobject
+  LockMap(const apr_hash_t *locks, apr_pool_t *pool);
+
+  static jobject
   ChangedPath(const char *path, svn_log_changed_path2_t *log_item);
 
   static jobject

Modified: 

svn commit: r993494 - in /subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl: ISVNReposAccess.java SVNReposAccess.java

2010-09-07 Thread hwright
Author: hwright
Date: Tue Sep  7 19:38:09 2010
New Revision: 993494

URL: http://svn.apache.org/viewvc?rev=993494view=rev
Log:
On the javahl-ra branch:
Ensure we inform callers that we may well throw SubversionExceptions.

[ in subversion/bindings/javahl/ ]
* src/org/apache/subversion/javahl/ISVNReposAccess.java,
  src/org/apache/subversion/javahl/SVNReposAccess.java
  (getDatedRevision, getLocks): Add throws SubversionException clause.

Modified:

subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNReposAccess.java

subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java

Modified: 
subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNReposAccess.java
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNReposAccess.java?rev=993494r1=993493r2=993494view=diff
==
--- 
subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNReposAccess.java
 (original)
+++ 
subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNReposAccess.java
 Tue Sep  7 19:38:09 2010
@@ -47,7 +47,9 @@ public interface ISVNReposAccess
  * @param date  The date
  * @return  The latest revision at date
  */
-public long getDatedRevision(Date date);
+public long getDatedRevision(Date date)
+throws SubversionException;
 
-public MapString, Lock getLocks(String path, Depth depth);
+public MapString, Lock getLocks(String path, Depth depth)
+throws SubversionException;
 }

Modified: 
subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java?rev=993494r1=993493r2=993494view=diff
==
--- 
subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java
 (original)
+++ 
subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java
 Tue Sep  7 19:38:09 2010
@@ -97,7 +97,9 @@ public class SVNReposAccess implements I
 return NativeResources.getVersion();
 }
 
-public native long getDatedRevision(Date date);
+public native long getDatedRevision(Date date)
+throws SubversionException;
 
-public native MapString, Lock getLocks(String path, Depth depth);
+public native MapString, Lock getLocks(String path, Depth depth)
+throws SubversionException;
 }




svn commit: r993495 - /subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java

2010-09-07 Thread hwright
Author: hwright
Date: Tue Sep  7 19:39:41 2010
New Revision: 993495

URL: http://svn.apache.org/viewvc?rev=993495view=rev
Log:
Make a function private which has no need of publicity.

* 
subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java
  (getCppAddr): Privatize.

Modified:

subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java

Modified: 
subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java?rev=993495r1=993494r2=993495view=diff
==
--- 
subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java
 (original)
+++ 
subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java
 Tue Sep  7 19:39:41 2010
@@ -60,9 +60,7 @@ public class SVNReposAccess implements I
 */
 }
 
-/** Don't call this function!  Public fucntion for backward compat reasons
-  */
-public long getCppAddr()
+private long getCppAddr()
 {
 return cppAddr;
 }




svn propchange: r993495 - svn:log

2010-09-07 Thread hwright
Author: hwright
Revision: 993495
Modified property: svn:log

Modified: svn:log at Tue Sep  7 19:40:04 2010
--
--- svn:log (original)
+++ svn:log Tue Sep  7 19:40:04 2010
@@ -1,3 +1,4 @@
+On the javahl-ra branch:
 Make a function private which has no need of publicity.
 
 * 
subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java



svn commit: r993504 - /subversion/trunk/subversion/tests/cmdline/patch_tests.py

2010-09-07 Thread dannas
Author: dannas
Date: Tue Sep  7 19:49:02 2010
New Revision: 993504

URL: http://svn.apache.org/viewvc?rev=993504view=rev
Log:
Add patch test for adding empty files.

Such files can only be applied if the diff uses the git extensions to
the unidiff format.

* subversion/tests/cmdline/patch_tests.py
  (patch_git_add_file): New.
  (test_list): Add patch_git_add_file.

Modified:
subversion/trunk/subversion/tests/cmdline/patch_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=993504r1=993503r2=993504view=diff
==
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Tue Sep  7 
19:49:02 2010
@@ -2976,6 +2976,43 @@ def patch_prop_with_fuzz(sbox):
1, # check-props
1) # dry-run
 
+def patch_git_add_file(sbox):
+  patch that contains empty files
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  patch_file_path = make_patch_path(sbox)
+
+  new_path = os.path.join(wc_dir, 'new')
+
+  unidiff_patch = [
+Index: new\n,
+===\n,
+diff --git a/new b/new\n,
+new file mode 10644\n,
+  ]
+
+  svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+  expected_output = [
+'A %s\n' % os.path.join(wc_dir, 'new'),
+  ]
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.add({'new' : Item(contents=)})
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({'new' : Item(status='A ', wc_rev=0)})
+
+  expected_skip = wc.State('', { })
+
+  svntest.actions.run_and_verify_patch(wc_dir, 
os.path.abspath(patch_file_path),
+   expected_output,
+   expected_disk,
+   expected_status,
+   expected_skip,
+   None, # expected err
+   1, # check-props
+   1) # dry-run
 
 #Run the tests
 
@@ -3005,6 +3042,7 @@ test_list = [ None,
   patch_add_path_with_props,
   patch_prop_offset,
   patch_prop_with_fuzz,
+  patch_git_add_file,
 ]
 
 if __name__ == '__main__':




svn commit: r993544 - in /subversion/branches/javahl-ra/subversion/bindings/javahl: native/ src/org/apache/subversion/javahl/ tests/org/apache/subversion/javahl/

2010-09-07 Thread hwright
Author: hwright
Date: Tue Sep  7 22:00:57 2010
New Revision: 993544

URL: http://svn.apache.org/viewvc?rev=993544view=rev
Log:
On the javahl-ra branch:
Implement the checkPath() RA method for JavaHL.

[ in subversion/bindings/javahl/ ]
* tests/org/apache/subversion/javahl/SVNRATests.java
  (testCheckPath): New.

* native/SVNReposAccess.h
  (checkPath): New.

* native/SVNReposAccess.cpp
  (checkPath): New.

* native/org_apache_subversion_javahl_SVNReposAccess.cpp
  (Java_org_apache_subversion_javahl_SVNReposAccess_checkPath): New.

* src/org/apache/subversion/javahl/ISVNReposAccess.java
  (checkPath): New.

* src/org/apache/subversion/javahl/SVNReposAccess.java
  (checkPath): New.

Modified:

subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.cpp

subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.h

subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNReposAccess.cpp

subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNReposAccess.java

subversion/branches/javahl-ra/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNReposAccess.java

subversion/branches/javahl-ra/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRATests.java

Modified: 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.cpp
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.cpp?rev=993544r1=993543r2=993544view=diff
==
--- 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.cpp
 (original)
+++ 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.cpp
 Tue Sep  7 22:00:57 2010
@@ -28,6 +28,8 @@
 #include JNIUtil.h
 #include JNICriticalSection.h
 #include CreateJ.h
+#include EnumMapper.h
+#include Revision.h
 
 #include svn_ra.h
 #include svn_private_config.h
@@ -90,3 +92,17 @@ SVNReposAccess::getLocks(const char *pat
 
   return CreateJ::LockMap(locks, requestPool.pool());
 }
+
+jobject
+SVNReposAccess::checkPath(const char *path, Revision revision)
+{
+  SVN::Pool requestPool;
+  svn_node_kind_t kind;
+
+  SVN_JNI_ERR(svn_ra_check_path(m_ra_session, path,
+revision.revision()-value.number,
+kind, requestPool.pool()),
+  NULL);
+
+  return EnumMapper::mapNodeKind(kind);
+}

Modified: 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.h?rev=993544r1=993543r2=993544view=diff
==
--- 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.h
 (original)
+++ 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/SVNReposAccess.h
 Tue Sep  7 22:00:57 2010
@@ -31,11 +31,14 @@
 #include svn_ra.h
 #include SVNBase.h
 
+class Revision;
+
 class SVNReposAccess : public SVNBase
 {
  public:
   svn_revnum_t getDatedRev(apr_time_t time);
   jobject getLocks(const char *path, svn_depth_t depth);
+  jobject checkPath(const char *path, Revision revision);
 
   SVNReposAccess(const char *repos_url);
   virtual ~SVNReposAccess();

Modified: 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNReposAccess.cpp
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNReposAccess.cpp?rev=993544r1=993543r2=993544view=diff
==
--- 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNReposAccess.cpp
 (original)
+++ 
subversion/branches/javahl-ra/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNReposAccess.cpp
 Tue Sep  7 22:00:57 2010
@@ -28,6 +28,7 @@
 #include JNIStackElement.h
 #include JNIStringHolder.h
 #include EnumMapper.h
+#include Revision.h
 
 #include svn_version.h
 #include svn_private_config.h
@@ -111,3 +112,26 @@ Java_org_apache_subversion_javahl_SVNRep
 
   return ra-getLocks(path, EnumMapper::toDepth(jdepth));
 }
+
+JNIEXPORT jobject JNICALL
+Java_org_apache_subversion_javahl_SVNReposAccess_checkPath
+(JNIEnv *env, jobject jthis, jstring jpath, jobject jrevision)
+{
+  JNIEntry(SVNReposAccess, checkPath);
+  SVNReposAccess *ra = SVNReposAccess::getCppObject(jthis);
+  if (ra == NULL)
+{
+  JNIUtil::throwError(bad C++ this);
+  return NULL;
+}
+
+  JNIStringHolder path(jpath);
+  if (JNIUtil::isExceptionThrown())
+return NULL;
+
+  Revision revision(jrevision);
+  if (JNIUtil::isExceptionThrown())
+return NULL;
+
+  return ra-checkPath(path,