svn commit: r1021282 - /subversion/trunk/subversion/libsvn_diff/diff_file.c

2010-10-11 Thread julianfoad
Author: julianfoad
Date: Mon Oct 11 08:44:33 2010
New Revision: 1021282

URL: http://svn.apache.org/viewvc?rev=1021282view=rev
Log:
Re-factor a group of array variables into an array of structures, and
thereby simplify their usage.

* subversion/libsvn_diff/diff_file.c
  (svn_diff__file_baton_t): Move a set of related array variables into a new
sub-structure array.
  (datasource_open, datasource_get_next_token, token_compare): By taking a
pointer to the appropriate element of the sub-structure, simplify all
references to these variables.
  (svn_diff_file_diff_2, svn_diff_file_diff3_2, svn_diff_file_diff4_2):
Adjust references.

Modified:
subversion/trunk/subversion/libsvn_diff/diff_file.c

Modified: subversion/trunk/subversion/libsvn_diff/diff_file.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/diff_file.c?rev=1021282r1=1021281r2=1021282view=diff
==
--- subversion/trunk/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/trunk/subversion/libsvn_diff/diff_file.c Mon Oct 11 08:44:33 2010
@@ -67,21 +67,24 @@ typedef struct svn_diff__file_token_t
 typedef struct svn_diff__file_baton_t
 {
   const svn_diff_file_options_t *options;
-  const char *path[4];
 
-  apr_file_t *file[4];
-  apr_off_t size[4];
+  struct file_info {
+const char *path;
 
-  int chunk[4];
-  char *buffer[4];
-  char *curp[4];
-  char *endp[4];
+apr_file_t *file;
+apr_off_t size;
+
+int chunk;
+char *buffer;
+char *curp;
+char *endp;
+
+svn_diff__normalize_state_t normalize_state;
+  } files[4];
 
   /* List of free tokens that may be reused. */
   svn_diff__file_token_t *tokens;
 
-  svn_diff__normalize_state_t normalize_state[4];
-
   apr_pool_t *pool;
 } svn_diff__file_baton_t;
 
@@ -203,21 +206,19 @@ static svn_error_t *
 datasource_open(void *baton, svn_diff_datasource_e datasource)
 {
   svn_diff__file_baton_t *file_baton = baton;
-  int idx;
+  struct file_info *file = file_baton-files[datasource_to_index(datasource)];
   apr_finfo_t finfo;
   apr_off_t length;
   char *curp;
   char *endp;
 
-  idx = datasource_to_index(datasource);
-
-  SVN_ERR(svn_io_file_open(file_baton-file[idx], file_baton-path[idx],
+  SVN_ERR(svn_io_file_open(file-file, file-path,
APR_READ, APR_OS_DEFAULT, file_baton-pool));
 
   SVN_ERR(svn_io_file_info_get(finfo, APR_FINFO_SIZE,
-   file_baton-file[idx], file_baton-pool));
+   file-file, file_baton-pool));
 
-  file_baton-size[idx] = finfo.size;
+  file-size = finfo.size;
   length = finfo.size  CHUNK_SIZE ? CHUNK_SIZE : finfo.size;
 
   if (length == 0)
@@ -226,10 +227,10 @@ datasource_open(void *baton, svn_diff_da
   endp = curp = apr_palloc(file_baton-pool, (apr_size_t) length);
   endp += length;
 
-  file_baton-buffer[idx] = file_baton-curp[idx] = curp;
-  file_baton-endp[idx] = endp;
+  file-buffer = file-curp = curp;
+  file-endp = endp;
 
-  return read_chunk(file_baton-file[idx], file_baton-path[idx],
+  return read_chunk(file-file, file-path,
 curp, length, 0, file_baton-pool);
 }
 
@@ -252,7 +253,7 @@ datasource_get_next_token(apr_uint32_t *
 {
   svn_diff__file_baton_t *file_baton = baton;
   svn_diff__file_token_t *file_token;
-  int idx;
+  struct file_info *file = file_baton-files[datasource_to_index(datasource)];
   char *endp;
   char *curp;
   char *eol;
@@ -264,15 +265,13 @@ datasource_get_next_token(apr_uint32_t *
 
   *token = NULL;
 
-  idx = datasource_to_index(datasource);
+  curp = file-curp;
+  endp = file-endp;
 
-  curp = file_baton-curp[idx];
-  endp = file_baton-endp[idx];
-
-  last_chunk = offset_to_chunk(file_baton-size[idx]);
+  last_chunk = offset_to_chunk(file-size);
 
   if (curp == endp
-   last_chunk == file_baton-chunk[idx])
+   last_chunk == file-chunk)
 {
   return SVN_NO_ERROR;
 }
@@ -289,8 +288,8 @@ datasource_get_next_token(apr_uint32_t *
 }
 
   file_token-datasource = datasource;
-  file_token-offset = chunk_to_offset(file_baton-chunk[idx])
-   + (curp - file_baton-buffer[idx]);
+  file_token-offset = chunk_to_offset(file-chunk)
+   + (curp - file-buffer);
   file_token-raw_length = 0;
   file_token-length = 0;
 
@@ -311,7 +310,7 @@ datasource_get_next_token(apr_uint32_t *
 }
 }
 
-  if (file_baton-chunk[idx] == last_chunk)
+  if (file-chunk == last_chunk)
 {
   eol = endp;
   break;
@@ -320,21 +319,21 @@ datasource_get_next_token(apr_uint32_t *
   length = endp - curp;
   file_token-raw_length += length;
   svn_diff__normalize_buffer(curp, length,
- file_baton-normalize_state[idx],
+ file-normalize_state,
  curp, file_baton-options);
   file_token-length += length;
  

svn commit: r1021313 - /subversion/trunk/subversion/include/svn_wc.h

2010-10-11 Thread julianfoad
Author: julianfoad
Date: Mon Oct 11 11:55:03 2010
New Revision: 1021313

URL: http://svn.apache.org/viewvc?rev=1021313view=rev
Log:
* subversion/include/svn_wc.h
  (svn_wc_add4): Tweak doc string for clarity.

Modified:
subversion/trunk/subversion/include/svn_wc.h

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1021313r1=1021312r2=1021313view=diff
==
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Mon Oct 11 11:55:03 2010
@@ -4213,8 +4213,8 @@ svn_wc_delete(const char *path,
  * or copy in the database containing its parent. The new node is scheduled
  * for addition to the repository below its parent node.
  *
- * 1) If the node already exists, it MUST BE the root of a separate working
- * copy from the same repository as the parent working copy. The new node
+ * 1) If the node is already versioned, it MUST BE the root of a separate
+ * working copy from the same repository as the parent WC. The new node
  * and anything below it will be scheduled for addition inside the parent
  * working copy as a copy of the original location. The separate working
  * copy will be integrated by this step. In this case, which is only used




svn commit: r1021402 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

2010-10-11 Thread julianfoad
Author: julianfoad
Date: Mon Oct 11 16:09:43 2010
New Revision: 1021402

URL: http://svn.apache.org/viewvc?rev=1021402view=rev
Log:
* subversion/libsvn_wc/adm_ops.c
  (svn_wc_add4): Move variables to tighter scope.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1021402r1=1021401r2=1021402view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Oct 11 16:09:43 2010
@@ -754,9 +754,6 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
   svn_boolean_t is_wc_root = FALSE;
   svn_node_kind_t kind;
   svn_wc__db_t *db = wc_ctx-db;
-  svn_error_t *err;
-  svn_wc__db_status_t status;
-  svn_wc__db_kind_t db_kind;
   svn_boolean_t exists;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -788,62 +785,66 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
 
   /* Get the node information for this path if one exists (perhaps
  this is actually a replacement of a previously deleted thing). */
-  err = svn_wc__db_read_info(status, db_kind, NULL, NULL, NULL, NULL, NULL,
+  {
+svn_wc__db_status_t status;
+svn_error_t *err
+  = svn_wc__db_read_info(status, NULL, NULL, NULL, NULL, NULL, NULL,
  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  NULL, NULL, NULL,
  db, local_abspath,
  scratch_pool, scratch_pool);
 
-  if (err)
-{
-  if (err-apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
-return svn_error_return(err);
+if (err)
+  {
+if (err-apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+  return svn_error_return(err);
 
-  svn_error_clear(err);
-  exists = FALSE;
-  is_wc_root = FALSE;
-}
-  else
-{
-  is_wc_root = FALSE;
-  exists = TRUE;
-  switch (status)
-{
-  case svn_wc__db_status_not_present:
-break;
-  case svn_wc__db_status_deleted:
-/* A working copy root should never have a WORKING_NODE */
-SVN_ERR_ASSERT(!is_wc_root);
-break;
-  case svn_wc__db_status_normal:
-if (copyfrom_url)
-  {
-SVN_ERR(svn_wc__check_wc_root(is_wc_root, NULL, NULL,
-  db, local_abspath,
-  scratch_pool));
+svn_error_clear(err);
+exists = FALSE;
+is_wc_root = FALSE;
+  }
+else
+  {
+is_wc_root = FALSE;
+exists = TRUE;
+switch (status)
+  {
+case svn_wc__db_status_not_present:
+  break;
+case svn_wc__db_status_deleted:
+  /* A working copy root should never have a WORKING_NODE */
+  SVN_ERR_ASSERT(!is_wc_root);
+  break;
+case svn_wc__db_status_normal:
+  if (copyfrom_url)
+{
+  SVN_ERR(svn_wc__check_wc_root(is_wc_root, NULL, NULL,
+db, local_abspath,
+scratch_pool));
 
-if (is_wc_root)
-  break;
-  }
-/* else: Fall through in default error */
+  if (is_wc_root)
+break;
+}
+  /* else: Fall through in default error */
 
-  default:
-return svn_error_createf(
- SVN_ERR_ENTRY_EXISTS, NULL,
- _('%s' is already under version control),
- svn_dirent_local_style(local_abspath,
-scratch_pool));
-}
-} /* err */
+default:
+  return svn_error_createf(
+   SVN_ERR_ENTRY_EXISTS, NULL,
+   _('%s' is already under version control),
+   svn_dirent_local_style(local_abspath,
+  scratch_pool));
+  }
+  } /* err */
+  }
 
   SVN_ERR(svn_wc__write_check(db, parent_abspath, scratch_pool));
 
   {
 svn_wc__db_status_t parent_status;
 svn_wc__db_kind_t parent_kind;
-
-err = svn_wc__db_read_info(parent_status, parent_kind, NULL,
+svn_error_t *err
+= svn_wc__db_read_info(parent_status, parent_kind, NULL,
parent_repos_relpath, repos_root_url,
repos_uuid, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,




svn commit: r1021405 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

2010-10-11 Thread julianfoad
Author: julianfoad
Date: Mon Oct 11 16:16:50 2010
New Revision: 1021405

URL: http://svn.apache.org/viewvc?rev=1021405view=rev
Log:
* subversion/libsvn_wc/adm_ops.c
  (svn_wc_add4): Improve comments.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1021405r1=1021404r2=1021405view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Oct 11 16:16:50 2010
@@ -783,8 +783,9 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
  svn_dirent_local_style(local_abspath,
 scratch_pool));
 
-  /* Get the node information for this path if one exists (perhaps
- this is actually a replacement of a previously deleted thing). */
+  /* Determine whether a DB row for this node EXISTS, and whether it
+ IS_WC_ROOT.  If it exists, check that it is in an acceptable state for
+ adding the new node; if not, return an error. */
   {
 svn_wc__db_status_t status;
 svn_error_t *err
@@ -881,6 +882,7 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
svn_dirent_local_style(local_abspath,
scratch_pool));
 
+/* If we haven't found the repository info yet, find it now. */
 if (!repos_root_url)
   {
 if (parent_status == svn_wc__db_status_added)




svn commit: r1021412 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

2010-10-11 Thread julianfoad
Author: julianfoad
Date: Mon Oct 11 16:29:53 2010
New Revision: 1021412

URL: http://svn.apache.org/viewvc?rev=1021412view=rev
Log:
* subversion/libsvn_wc/adm_ops.c
  (svn_wc_add4): Rearrange some code for clarity.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1021412r1=1021411r2=1021412view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Oct 11 16:29:53 2010
@@ -946,12 +946,34 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
  copyfrom_url, inner_url);
 }
 
-  if (kind == svn_node_file)
+  if (!copyfrom_url)  /* Case 2a: It's a simple add */
 {
-  if (!copyfrom_url)
+  if (kind == svn_node_file)
 SVN_ERR(svn_wc__db_op_add_file(db, local_abspath, NULL, scratch_pool));
   else
 {
+  SVN_ERR(svn_wc__db_op_add_directory(db, local_abspath, NULL,
+  scratch_pool));
+  if (!exists)
+{
+  /* If using the legacy 1.6 interface the parent lock may not
+ be recursive and add is expected to lock the new dir.
+
+ ### Perhaps the lock should be created in the same
+ transaction that adds the node? */
+  svn_boolean_t owns_lock;
+  SVN_ERR(svn_wc__db_wclock_owns_lock(owns_lock, db, 
local_abspath,
+  FALSE, scratch_pool));
+  if (!owns_lock)
+SVN_ERR(svn_wc__db_wclock_obtain(db, local_abspath, 0, FALSE,
+ scratch_pool));
+}
+}
+}
+  else if (!is_wc_root)  /* Case 2b: It's a copy from the repository */
+{
+  if (kind == svn_node_file)
+{
   /* This code should never be used, as it doesn't install proper
  pristine and/or properties. But it was not an error in the old
  version of this function. 
@@ -967,46 +989,27 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
  NULL, NULL,
  scratch_pool));
 }
+  else
+SVN_ERR(svn_wc__db_op_copy_dir(db,
+   local_abspath,
+   apr_hash_make(scratch_pool),
+   copyfrom_rev,
+   0,
+   NULL,
+   svn_path_uri_decode(
+
svn_uri_skip_ancestor(repos_root_url,
+  
copyfrom_url),
+scratch_pool),
+   repos_root_url,
+   repos_uuid,
+   copyfrom_rev,
+   NULL,
+   depth,
+   NULL,
+   NULL,
+   scratch_pool));
 }
-  else if (!copyfrom_url)
-{
-  SVN_ERR(svn_wc__db_op_add_directory(db, local_abspath, NULL,
-  scratch_pool));
-  if (!exists)
-{
-  /* If using the legacy 1.6 interface the parent lock may not
- be recursive and add is expected to lock the new dir.
-
- ### Perhaps the lock should be created in the same
- transaction that adds the node? */
-  svn_boolean_t owns_lock;
-  SVN_ERR(svn_wc__db_wclock_owns_lock(owns_lock, db, local_abspath,
-  FALSE, scratch_pool));
-  if (!owns_lock)
-SVN_ERR(svn_wc__db_wclock_obtain(db, local_abspath, 0, FALSE,
- scratch_pool));
-}
-}
-  else if (!is_wc_root)
-SVN_ERR(svn_wc__db_op_copy_dir(db,
-   local_abspath,
-   apr_hash_make(scratch_pool),
-   copyfrom_rev,
-   0,
-   NULL,
-   svn_path_uri_decode(
-svn_uri_skip_ancestor(repos_root_url,
-  copyfrom_url),
-scratch_pool),
-   repos_root_url,
-   repos_uuid,
-   copyfrom_rev,
-  

svn commit: r1021416 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

2010-10-11 Thread julianfoad
Author: julianfoad
Date: Mon Oct 11 16:39:16 2010
New Revision: 1021416

URL: http://svn.apache.org/viewvc?rev=1021416view=rev
Log:
* subversion/libsvn_wc/adm_ops.c
  (svn_wc_add4): Add another comment.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1021416r1=1021415r2=1021416view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Oct 11 16:39:16 2010
@@ -841,6 +841,10 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
 
   SVN_ERR(svn_wc__write_check(db, parent_abspath, scratch_pool));
 
+  /* Get PARENT_REPOS_RELPATH, REPOS_ROOT_URL, REPOS_UUID.  Check that the
+ parent is a versioned directory in an acceptable state.  If we're
+ performing a repos-to-WC copy, check that the copyfrom repository is
+ the same as the parent dir's repository. */
   {
 svn_wc__db_status_t parent_status;
 svn_wc__db_kind_t parent_kind;




svn commit: r1021430 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

2010-10-11 Thread julianfoad
Author: julianfoad
Date: Mon Oct 11 17:08:54 2010
New Revision: 1021430

URL: http://svn.apache.org/viewvc?rev=1021430view=rev
Log:
* subversion/libsvn_wc/adm_ops.c
  (svn_wc_add4): Remove an unused variable.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1021430r1=1021429r2=1021430view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Oct 11 17:08:54 2010
@@ -749,7 +749,6 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
 {
   const char *parent_abspath;
   const char *base_name;
-  const char *parent_repos_relpath;
   const char *repos_root_url, *repos_uuid;
   svn_boolean_t is_wc_root = FALSE;
   svn_node_kind_t kind;
@@ -850,7 +849,7 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
 svn_wc__db_kind_t parent_kind;
 svn_error_t *err
 = svn_wc__db_read_info(parent_status, parent_kind, NULL,
-   parent_repos_relpath, repos_root_url,
+   NULL, repos_root_url,
repos_uuid, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
@@ -890,13 +889,13 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
 if (!repos_root_url)
   {
 if (parent_status == svn_wc__db_status_added)
-  SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, parent_repos_relpath,
+  SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
repos_root_url, repos_uuid, NULL,
NULL, NULL, NULL,
db, parent_abspath,
scratch_pool, scratch_pool));
 else
-  SVN_ERR(svn_wc__db_scan_base_repos(parent_repos_relpath,
+  SVN_ERR(svn_wc__db_scan_base_repos(NULL,
  repos_root_url, repos_uuid,
  db, parent_abspath,
  scratch_pool, scratch_pool));




svn commit: r1021431 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

2010-10-11 Thread julianfoad
Author: julianfoad
Date: Mon Oct 11 17:10:35 2010
New Revision: 1021431

URL: http://svn.apache.org/viewvc?rev=1021431view=rev
Log:
* subversion/libsvn_wc/adm_ops.c
  (svn_wc_add4): Update a comment after r1021430.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1021431r1=1021430r2=1021431view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Oct 11 17:10:35 2010
@@ -840,7 +840,7 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
 
   SVN_ERR(svn_wc__write_check(db, parent_abspath, scratch_pool));
 
-  /* Get PARENT_REPOS_RELPATH, REPOS_ROOT_URL, REPOS_UUID.  Check that the
+  /* Get REPOS_ROOT_URL and REPOS_UUID.  Check that the
  parent is a versioned directory in an acceptable state.  If we're
  performing a repos-to-WC copy, check that the copyfrom repository is
  the same as the parent dir's repository. */




Re: svn commit: r1021431 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

2010-10-11 Thread Julian Foad
On Mon, 2010-10-11, julianf...@apache.org wrote:
 Author: julianfoad
 Date: Mon Oct 11 17:10:35 2010
 New Revision: 1021431
 
 URL: http://svn.apache.org/viewvc?rev=1021431view=rev
 Log:
 * subversion/libsvn_wc/adm_ops.c
   (svn_wc_add4): Update a comment after r1021430.

Please excuse this spate of tiny patches.  I built up a load of changes
to this function last week and now need to commit the obvious parts so I
can concentrate on the non-trivial parts.

- Julian




svn commit: r1021434 - /subversion/branches/object-model/subversion/bindings/c++/include/Types.h

2010-10-11 Thread hwright
Author: hwright
Date: Mon Oct 11 17:15:50 2010
New Revision: 1021434

URL: http://svn.apache.org/viewvc?rev=1021434view=rev
Log:
On the object-model branch:
More fun with templates.  Instead of obtaining the object duplication function
from a class (and having to define a wrapper in that class), instead just
use a non-class template argument to provide the dup'ing function.

In the event that we don't have a Subversion-defined duping function, we'll
have to define our own (which hasn't changed), but we can now do this
outside of a given class or namespace.

* subversion/bindings/c++/include/Types.h
  (RefCounter): Change the order and type of the template parameters.
  (CStructWrapper): Same, and update references to RefCounter.
  (CommitInfo, Lock, ClientNotifyInfo): Remove the duplicator methods, and
pass the predefined duplicators to the template.
  (Version): Same, but use the (now privately-defined) duplicator, since a
public one is not provided by the libraries.

Modified:
subversion/branches/object-model/subversion/bindings/c++/include/Types.h

Modified: 
subversion/branches/object-model/subversion/bindings/c++/include/Types.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Types.h?rev=1021434r1=1021433r2=1021434view=diff
==
--- subversion/branches/object-model/subversion/bindings/c++/include/Types.h 
(original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Types.h 
Mon Oct 11 17:15:50 2010
@@ -48,16 +48,16 @@ namespace Private
 {
 
 // Magic
-templatetypename C, typename T
+templatetypename T, T *DUP(const T *, apr_pool_t *pool)
 class RefCounter
 {
   public:
 inline
-RefCounterC, T(T *in)
+RefCounter(const T *in)
   : m_pool(),
 count(1)
 {
-  p = C::dup(in, m_pool);
+  p = DUP(in, m_pool.pool());
 }
 
 inline void inc_ref() { ++count; }
@@ -73,25 +73,25 @@ class RefCounter
 T *p;
 };
 
-templatetypename C, typename T
+templatetypename T, T *DUP(const T *, apr_pool_t *pool)
 class CStructWrapper
 {
   public:
 inline
-CStructWrapper(T *data)
+CStructWrapper(const T *data)
 {
-  m_data = new RefCounterC, T(data);
+  m_data = new RefCounterT, DUP(data);
 }
 
 inline
-CStructWrapper(const CStructWrapperC, T that)
+CStructWrapper(const CStructWrapperT, DUP that)
 {
   m_data = that.m_data;
   m_data-inc_ref();
 }
 
-inline CStructWrapperC, T
-operator= (const CStructWrapperC, T that)
+inline CStructWrapperT, DUP
+operator= (const CStructWrapperT, DUP that)
 {
   // Self assignment
   if (that == this)
@@ -117,7 +117,7 @@ class CStructWrapper
 inline const T* operator- () const { return m_data-ptr(); }
 
   private:
-RefCounterC, T *m_data;
+RefCounterT, DUP *m_data;
 };
 
 } // namespace Private
@@ -126,12 +126,6 @@ class CStructWrapper
 class CommitInfo
 {
   public:
-inline static svn_commit_info_t *
-dup(const svn_commit_info_t *info, Pool pool)
-{
-  return svn_commit_info_dup(info, pool.pool());
-}
-
 explicit inline
 CommitInfo(const svn_commit_info_t *info)
   : m_info(info)
@@ -169,18 +163,13 @@ class CommitInfo
 }
 
   private:
-Private::CStructWrapperCommitInfo, const svn_commit_info_t m_info;
+Private::CStructWrappersvn_commit_info_t,
+svn_commit_info_dup m_info;
 };
 
 class Lock
 {
   public:
-inline static svn_lock_t *
-dup(const svn_lock_t *lock, Pool pool)
-{
-  return svn_lock_dup(lock, pool.pool());
-}
-
 explicit inline
 Lock(const svn_lock_t *lock)
   : m_lock(lock)
@@ -230,18 +219,12 @@ class Lock
 }
 
   private:
-Private::CStructWrapperLock, const svn_lock_t m_lock;
+Private::CStructWrappersvn_lock_t, svn_lock_dup m_lock;
 };
 
 class ClientNotifyInfo
 {
   public:
-inline static svn_wc_notify_t *
-dup(const svn_wc_notify_t *notify, Pool pool)
-{
-  return svn_wc_dup_notify(notify, pool.pool());
-}
-
 inline
 ClientNotifyInfo(const svn_wc_notify_t *notify)
   : m_notify(notify)
@@ -256,25 +239,12 @@ class ClientNotifyInfo
 }
 
   private:
-Private::CStructWrapperClientNotifyInfo, const svn_wc_notify_t m_notify;
+Private::CStructWrappersvn_wc_notify_t, svn_wc_dup_notify m_notify;
 };
 
 class Version
 {
   public:
-inline static svn_version_t *
-dup(const svn_version_t *version, Pool pool)
-{
-  svn_version_t *v = pool.allocsvn_version_t();
-
-  v-major = version-major;
-  v-minor = version-minor;
-  v-patch = version-patch;
-  v-tag = pool.strdup(version-tag);
-
-  return v;
-}
-
 inline
 Version(const svn_version_t *version)
   : m_version(version)
@@ -288,7 +258,21 @@ class Version
 }
 
   private:
-Private::CStructWrapperVersion, const svn_version_t 

svn commit: r1021436 - in /subversion/branches/object-model/subversion/bindings/c++: Types.cpp include/Types.h

2010-10-11 Thread hwright
Author: hwright
Date: Mon Oct 11 17:20:05 2010
New Revision: 1021436

URL: http://svn.apache.org/viewvc?rev=1021436view=rev
Log:
On the object-model branch:
Move a privately-defined method implementation out of a header.

* subversion/bindings/c++/include/Types.h
  (Version::dup): Move definition from here...
 
* subversion/bindings/c++/Types.cpp
  (Version::dup): ...to here.

Modified:
subversion/branches/object-model/subversion/bindings/c++/Types.cpp
subversion/branches/object-model/subversion/bindings/c++/include/Types.h

Modified: subversion/branches/object-model/subversion/bindings/c++/Types.cpp
URL: 
http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/Types.cpp?rev=1021436r1=1021435r2=1021436view=diff
==
--- subversion/branches/object-model/subversion/bindings/c++/Types.cpp 
(original)
+++ subversion/branches/object-model/subversion/bindings/c++/Types.cpp Mon Oct 
11 17:20:05 2010
@@ -30,6 +30,18 @@
 namespace SVN
 {
 
+svn_version_t *
+Version::dup(const svn_version_t *version, apr_pool_t *pool)
+{
+  svn_version_t *v = reinterpret_castsvn_version_t *(
+apr_palloc(pool, sizeof(*v)));
+
+  v-major = version-major;
+  v-minor = version-minor;
+  v-patch = version-patch;
+  v-tag = apr_pstrdup(pool, version-tag);
 
+  return v;
+}
 
 }

Modified: 
subversion/branches/object-model/subversion/bindings/c++/include/Types.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Types.h?rev=1021436r1=1021435r2=1021436view=diff
==
--- subversion/branches/object-model/subversion/bindings/c++/include/Types.h 
(original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Types.h 
Mon Oct 11 17:20:05 2010
@@ -259,18 +259,7 @@ class Version
 
   private:
 static svn_version_t *
-dup(const svn_version_t *version, apr_pool_t *pool)
-{
-  svn_version_t *v = reinterpret_castsvn_version_t *(
-apr_palloc(pool, sizeof(*v)));
-
-  v-major = version-major;
-  v-minor = version-minor;
-  v-patch = version-patch;
-  v-tag = apr_pstrdup(pool, version-tag);
-
-  return v;
-}
+dup(const svn_version_t *version, apr_pool_t *pool);
 
 Private::CStructWrappersvn_version_t, dup m_version;
 };




svn commit: r1021477 - in /subversion/trunk/subversion: include/svn_config.h libsvn_repos/repos.c svnserve/cyrus_auth.c svnserve/main.c svnserve/serve.c svnserve/server.h

2010-10-11 Thread cmpilato
Author: cmpilato
Date: Mon Oct 11 19:26:36 2010
New Revision: 1021477

URL: http://svn.apache.org/viewvc?rev=1021477view=rev
Log:
Finish issue #3726 (svnserve lacks the equivalent of AuthzForceUsernameCase)
by introducing a new 'force-username-case' svnserve.conf option.

* subversion/libsvn_repos/repos.c
  (create_conf): Add configuration defaults for a new 'force-username-case' 
option.

* subversion/svnserve/server.h
  (enum username_case_type): New enum.
  (server_baton_t): Add 'username_case' and 'authz_user' members.
  (serve_params_t): Add 'username_case' member.
  (load_configs): Add 'username_case' out parameter, and rewrite the
docstring for readability.

* subversion/svnserve/main.c
  (main): Initialize 'username_case' baton member, and update call to
load_configs().

* subversion/svnserve/cyrus_auth.c
  (cyrus_auth_request): Balance braces.

* subversion/svnserve/serve.c
  (load_configs): Add 'username_case' out parameter, populated from
the configuration.
  (convert_case): New helper.
  (authz_check_access): Calculate the authz_user, converting case as
necessary, and use that value for authz checks.
  (find_repos): Update call to load_configs().
  (serve): Initialize 'username_case' and 'authz_user' baton members.

* subversion/include/svn_config.h
  (SVN_CONFIG_OPTION_FORCE_USERNAME_CASE): New.

Modified:
subversion/trunk/subversion/include/svn_config.h
subversion/trunk/subversion/libsvn_repos/repos.c
subversion/trunk/subversion/svnserve/cyrus_auth.c
subversion/trunk/subversion/svnserve/main.c
subversion/trunk/subversion/svnserve/serve.c
subversion/trunk/subversion/svnserve/server.h

Modified: subversion/trunk/subversion/include/svn_config.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_config.h?rev=1021477r1=1021476r2=1021477view=diff
==
--- subversion/trunk/subversion/include/svn_config.h (original)
+++ subversion/trunk/subversion/include/svn_config.h Mon Oct 11 19:26:36 2010
@@ -127,6 +127,7 @@ typedef struct svn_config_t svn_config_t
 #define SVN_CONFIG_OPTION_PASSWORD_DB   password-db
 #define SVN_CONFIG_OPTION_REALM realm
 #define SVN_CONFIG_OPTION_AUTHZ_DB  authz-db
+#define SVN_CONFIG_OPTION_FORCE_USERNAME_CASE   force-username-case
 #define SVN_CONFIG_SECTION_SASL sasl
 #define SVN_CONFIG_OPTION_USE_SASL  use-sasl
 #define SVN_CONFIG_OPTION_MIN_SSF   min-encryption

Modified: subversion/trunk/subversion/libsvn_repos/repos.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/repos.c?rev=1021477r1=1021476r2=1021477view=diff
==
--- subversion/trunk/subversion/libsvn_repos/repos.c (original)
+++ subversion/trunk/subversion/libsvn_repos/repos.c Mon Oct 11 19:26:36 2010
@@ -1141,6 +1141,13 @@ create_conf(svn_repos_t *repos, apr_pool
 ### have the same password database, and vice versa.  The default realmNL
 ### is repository's uuid.  NL
 # realm = My First Repository  NL
+### The force-username-case option causes svnserve to case-normalize   NL
+### usernames before comparing them against the authorization rules in the NL
+### authz-db file configured above.  Valid values are \upper\ (to upper- NL
+### case the usernames), \lower\ (to lowercase the usernames), and   NL
+### \none\ (to compare usernames as-is without case conversion, whichNL
+### is the default behavior).  NL
+# force-username-case = none   NL
NL
 [sasl] NL
 ### This option specifies whether you want to use the Cyrus SASL   NL

Modified: subversion/trunk/subversion/svnserve/cyrus_auth.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/cyrus_auth.c?rev=1021477r1=1021476r2=1021477view=diff
==
--- subversion/trunk/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/trunk/subversion/svnserve/cyrus_auth.c Mon Oct 11 19:26:36 2010
@@ -360,8 +360,10 @@ svn_error_t *cyrus_auth_request(svn_ra_s
 return fail_cmd(conn, pool, sasl_ctx);
 
   if ((p = strchr(user, '@')) != NULL)
-/* Drop the realm part. */
-b-user = apr_pstrndup(b-pool, user, p - (const char *)user);
+{
+  /* Drop the realm part. */
+  b-user = apr_pstrndup(b-pool, user, p - (const char *)user);
+}
   else
 {
   svn_error_t *err;

Modified: subversion/trunk/subversion/svnserve/main.c
URL: 

svn commit: r1021493 - in /subversion/trunk/subversion/tests/cmdline: svnsync_tests.py svnsync_tests_data/delete-revprops.dump svnsync_tests_data/delete-revprops.expected.dump

2010-10-11 Thread cmpilato
Author: cmpilato
Date: Mon Oct 11 20:15:54 2010
New Revision: 1021493

URL: http://svn.apache.org/viewvc?rev=1021493view=rev
Log:
Write a regression test for issue #3728 ('svnsync copy-revprops'
doesn't sync revprop deletions.).

* subversion/tests/cmdline/svnsync_tests.py
  (setup_and_sync, verify_mirror): New helpers, cored out of ...
  (run_test): ... this, which is now just a wrapper around the
aforementioned pair of helpers.
  (delete_revprops): New test.
  (test_list): Add XFail'ing reference to new test.

* svnsync_tests_data/delete-revprops.expected.dump,
* svnsync_tests_data/delete-revprops.dump
  New test data files.

Added:

subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.dump

subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/delete-revprops.expected.dump
Modified:
subversion/trunk/subversion/tests/cmdline/svnsync_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/svnsync_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnsync_tests.py?rev=1021493r1=1021492r2=1021493view=diff
==
--- subversion/trunk/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnsync_tests.py Mon Oct 11 
20:15:54 2010
@@ -136,21 +136,14 @@ def run_info(url, expected_error=None):
 raise SVNUnexpectedStdout(Missing stdout)
 
 
-def run_test(sbox, dump_file_name, subdir = None, exp_dump_file_name = None):
-  Load a dump file, sync repositories, and compare contents with the 
original
-or another dump file.
+def setup_and_sync(sbox, dump_file_contents, subdir=None):
+  Create a repository for SBOX, load it with DUMP_FILE_CONTENTS, then 
create a mirror repository and sync it with SBOX.  Return the mirror sandbox.
 
   # Create the empty master repository.
   build_repos(sbox)
 
-  # This directory contains all the dump files
-  svnsync_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
-   'svnsync_tests_data')
-  # Load the specified dump file into the master repository.
-  master_dumpfile_contents = open(os.path.join(svnsync_tests_dir,
-   dump_file_name),
-  'rb').readlines()
-  svntest.actions.run_and_verify_load(sbox.repo_dir, master_dumpfile_contents)
+  # Load the repository from DUMP_FILE_PATH.
+  svntest.actions.run_and_verify_load(sbox.repo_dir, dump_file_contents)
 
   # Create the empty destination repository.
   dest_sbox = sbox.clone_dependent()
@@ -173,6 +166,11 @@ or another dump file.
   run_sync(dest_sbox.repo_url, repo_url)
   run_copy_revprops(dest_sbox.repo_url, repo_url)
 
+  return dest_sbox
+
+def verify_mirror(dest_sbox, exp_dump_file_contents):
+  Compare the contents of the DEST_SBOX repository with 
EXP_DUMP_FILE_CONTENTS.
+
   # Remove some SVNSync-specific housekeeping properties from the
   # mirror repository in preparation for the comparison dump.
   for prop_name in (svn:sync-from-url, svn:sync-from-uuid,
@@ -184,6 +182,24 @@ or another dump file.
   # Create a dump file from the mirror repository.
   dest_dump = svntest.actions.run_and_verify_dump(dest_sbox.repo_dir)
 
+  svntest.verify.compare_and_display_lines(
+Dump files, DUMP, exp_dump_file_contents, dest_dump)
+  
+def run_test(sbox, dump_file_name, subdir=None, exp_dump_file_name=None):
+  Load a dump file, sync repositories, and compare contents with the 
original
+or another dump file.
+
+  # This directory contains all the dump files
+  svnsync_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
+   'svnsync_tests_data')
+
+  # Load the specified dump file into the master repository.
+  master_dumpfile_contents = open(os.path.join(svnsync_tests_dir,
+   dump_file_name),
+  'rb').readlines()
+
+  dest_sbox = setup_and_sync(sbox, master_dumpfile_contents, subdir)
+
   # Compare the dump produced by the mirror repository with either the original
   # dump file (used to create the master repository) or another specified dump
   # file.
@@ -193,8 +209,8 @@ or another dump file.
   else:
 exp_master_dumpfile_contents = master_dumpfile_contents
 
-  svntest.verify.compare_and_display_lines(
-Dump files, DUMP, exp_master_dumpfile_contents, dest_dump)
+  verify_mirror(dest_sbox, exp_master_dumpfile_contents)
+  
 
 
 ##
@@ -781,6 +797,37 @@ def descend_into_replace(sbox):
   run_test(sbox, descend_into_replace.dump, subdir='/trunk/H',
exp_dump_file_name = descend_into_replace.expected.dump)
 
+# issue #3728
+def delete_revprops(sbox):
+  copy-revprops with removals
+  svnsync_tests_dir = os.path.join(os.path.dirname(sys.argv[0]),
+   'svnsync_tests_data')
+  

svn commit: r1021511 - /subversion/site/publish/source-code.html

2010-10-11 Thread hwright
Author: hwright
Date: Mon Oct 11 21:18:24 2010
New Revision: 1021511

URL: http://svn.apache.org/viewvc?rev=1021511view=rev
Log:
One more bit of post-release house-keeping.  (How many places do we need this
information?!?)

Found by: Mark Poole mark.po...@wandisco.com

* publish/source-code.html:
  Update the best available version to 1.6.13.

Modified:
subversion/site/publish/source-code.html

Modified: subversion/site/publish/source-code.html
URL: 
http://svn.apache.org/viewvc/subversion/site/publish/source-code.html?rev=1021511r1=1021510r2=1021511view=diff
==
--- subversion/site/publish/source-code.html (original)
+++ subversion/site/publish/source-code.html Mon Oct 11 21:18:24 2010
@@ -19,7 +19,7 @@
 
 div class=bigpoint
 pThe best available version of Subversion
-   is:nbsp;a href=docs/release-notes/1.6.html1.6.12/a/p
+   is:nbsp;a href=docs/release-notes/1.6.html1.6.13/a/p
 /div !-- .bigpoint --
 
 pYou can install Subversion by compiling