svn commit: r982173 - /subversion/trunk/subversion/svn/log-cmd.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 09:21:13 2010
New Revision: 982173

URL: http://svn.apache.org/viewvc?rev=982173view=rev
Log:
* subversion/svn/log-cmd.c
  (svn_cl__log): Check for paths starting with a '/' instead of using
svn_dirent_is_absolute() as a '/a' style path is not absolute on
Windows and OS/2, and some valid relpaths theoretically might be.

Modified:
subversion/trunk/subversion/svn/log-cmd.c

Modified: subversion/trunk/subversion/svn/log-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/log-cmd.c?rev=982173r1=982172r2=982173view=diff
==
--- subversion/trunk/subversion/svn/log-cmd.c (original)
+++ subversion/trunk/subversion/svn/log-cmd.c Wed Aug  4 09:21:13 2010
@@ -648,7 +648,7 @@ svn_cl__log(apr_getopt_t *os,
 {
   target = APR_ARRAY_IDX(targets, i, const char *);
 
-  if (svn_path_is_url(target) || svn_dirent_is_absolute(target))
+  if (svn_path_is_url(target) || target[0] == '/')
 return svn_error_return(svn_error_createf(
   SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
   _(Only relative paths can be specified




svn commit: r982224 - /subversion/trunk/subversion/libsvn_wc/node.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 11:46:55 2010
New Revision: 982224

URL: http://svn.apache.org/viewvc?rev=982224view=rev
Log:
* subversion/libsvn_wc/node.c
  (walker_helper): Retrieve status and kind at once instead of in two
separate wc_db calls.
  (svn_wc__temp_get_keep_local): Resolve warning by moving variable
declaration inside #ifndef

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

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=982224r1=982223r2=982224view=diff
==
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Wed Aug  4 11:46:55 2010
@@ -673,6 +673,7 @@ walker_helper(svn_wc__db_t *db,
 {
   const char *child_abspath;
   svn_wc__db_kind_t child_kind;
+  svn_wc__db_status_t child_status;
 
   svn_pool_clear(iterpool);
 
@@ -685,27 +686,31 @@ walker_helper(svn_wc__db_t *db,
 const char *),
   iterpool);
 
-  if (!show_hidden)
-{
-  svn_boolean_t hidden;
-
-  SVN_ERR(svn_wc__db_node_hidden(hidden, db, child_abspath, 
iterpool));
-  if (hidden)
-continue;
-}
-
-  SVN_ERR(svn_wc__db_read_info(NULL, child_kind, NULL, NULL, NULL, NULL,
+  SVN_ERR(svn_wc__db_read_info(child_status, child_kind, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
-   NULL,
+   NULL, NULL, NULL,
db, child_abspath, iterpool, iterpool));
 
+  if (!show_hidden)
+switch (child_status)
+  {
+case svn_wc__db_status_not_present:
+case svn_wc__db_status_absent:
+case svn_wc__db_status_excluded:
+  continue;
+default:
+  break;
+  }
+
   /* Return the child, if appropriate.  (For a directory,
* this is the first visit: as a child.) */
   if (child_kind == svn_wc__db_kind_file
 || depth = svn_depth_immediates)
 {
+  /* ### Maybe we should pass kind to the callback?.
+ ### almost every callee starts by asking for this */
   SVN_ERR(walk_callback(child_abspath, walk_baton, iterpool));
 }
 
@@ -1246,9 +1251,9 @@ svn_wc__temp_get_keep_local(svn_boolean_
 const char *local_abspath,
 apr_pool_t *scratch_pool)
 {
+#ifndef SVN_WC__SINGLE_DB
   svn_boolean_t is_deleted;
 
-#ifndef SVN_WC__SINGLE_DB
   SVN_ERR(svn_wc__node_is_status_deleted(is_deleted, wc_ctx, local_abspath,
  scratch_pool));
   if (is_deleted)




svn commit: r982231 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 12:24:03 2010
New Revision: 982231

URL: http://svn.apache.org/viewvc?rev=982231view=rev
Log:
* subversion/libsvn_wc/update_editor.c
  (complete_directory): Update documentation of root case to document the
current state of the code and also handle excluded files properly.
(Most importantly excluded is no longer a flag but a status, so it is
already overridden). We don't have to verify if the target is not a wcdir,
as this is always the case for excluded directories.

In single-db mode we never have to delete missing subdirectories just
because they weren't added back by the update. (Missing directories can
always be restored locally, so they aren't reported as missing to the
repository)

  (tweak_entries): Disable special handling of missing nodes in single-db
mode. We must always recurse to keep the database valid.

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

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=982231r1=982230r2=982231view=diff
==
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Aug  4 12:24:03 
2010
@@ -708,15 +708,10 @@ complete_directory(struct edit_baton *eb
   int i;
   apr_pool_t *iterpool;
 
-  /* If this is the root directory and there is a target, we can't
+  /* If this is the root directory and there is a target, we don't have to
  mark this directory complete. */
   if (is_root_dir  *eb-target_basename != '\0')
 {
-  /* ### obsolete comment?
- Before we can finish, we may need to clear the exclude flag for
- target. Also give a chance to the target that is explicitly pulled
- in. */
-  svn_wc__db_kind_t kind;
   svn_wc__db_status_t status;
   svn_error_t *err;
 
@@ -731,38 +726,26 @@ complete_directory(struct edit_baton *eb
 
  If there is no BASE node for the target, then we certainly don't
  have to worry about removing it.  */
-  err = svn_wc__db_base_get_info(status, kind, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- eb-db, eb-target_abspath,
- pool, pool);
+  err = svn_wc__db_base_get_info(status, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ eb-db, eb-target_abspath, pool, pool);
   if (err)
 {
   if (err-apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
 return svn_error_return(err);
 
   svn_error_clear(err);
-  return SVN_NO_ERROR;
 }
 
-  if (status == svn_wc__db_status_excluded)
+  if (!err  status == svn_wc__db_status_excluded)
 {
-  /* ### obsolete comment?
- There is a small chance that the target is gone in the
- repository.  If so, we should get rid of the entry now. */
+  /* There is a small chance that the explicit target of an update/
+ switch is gone in the repository, in that specific case the node
+ hasn't been re-added to the BASE tree by this update. If so, we
+ should get rid of this excluded node now. */
 
-  if (kind == svn_wc__db_kind_dir 
-  svn_wc__adm_missing(eb-db, eb-target_abspath, pool))
-{
-  /* ### obsolete comment?
-   * Still passing NULL for THEIR_URL. A case where THEIR_URL
-   * is needed in this call is rare or even non-existant.
-   * ### TODO: Construct a proper THEIR_URL anyway. See also
-   * NULL handling code in do_entry_deletion(). */
-  SVN_ERR(do_entry_deletion(eb, eb-target_abspath,
-NULL, FALSE, pool));
-}
+  SVN_ERR(do_entry_deletion(eb, eb-target_abspath, NULL, FALSE, 
pool));
 }
 
   return SVN_NO_ERROR;
@@ -903,6 +886,9 @@ complete_directory(struct edit_baton *eb
 {
   SVN_ERR(svn_wc__db_base_remove(eb-db, node_abspath, iterpool));
 }
+#ifndef SVN_WC__SINGLE_DB
+  /* In Single-DB mode, administrative data is never reported as missing
+ by the adm crawler, and we should always remove nodes recursively */
   else if (kind == svn_wc__db_kind_dir
 svn_wc__adm_missing(eb-db, node_abspath, iterpool)
 status != svn_wc__db_status_absent)
@@ -916,6 +902,7 @@ complete_directory(struct edit_baton *eb
 : svn_node_file,
  

svn commit: r982245 - /subversion/branches/1.6.x/STATUS

2010-08-04 Thread stylesen
Author: stylesen
Date: Wed Aug  4 13:24:51 2010
New Revision: 982245

URL: http://svn.apache.org/viewvc?rev=982245view=rev
Log:
* STATUS: Move r980811 and r981921 groups to the proper block, they
  were in vetoed block.

Modified:
subversion/branches/1.6.x/STATUS

Modified: subversion/branches/1.6.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.6.x/STATUS?rev=982245r1=982244r2=982245view=diff
==
--- subversion/branches/1.6.x/STATUS (original)
+++ subversion/branches/1.6.x/STATUS Wed Aug  4 13:24:51 2010
@@ -208,6 +208,31 @@ Candidate changes:
 Votes:
   +1: rhuijben
 
+ * r980811, r981449
+   Improve handling of missing fsfs.conf during svnadmin hotcopy.
+   Justification:
+ People are complaining. There's Debian bug reports and whatnot.
+ See http://svn.haxx.se/dev/archive-2010-07/0471.shtml and follow-ups.
+   Notes:
+ r980811 is the actual fix
+ r981449 is a follow-up which fixes an error leak
+   Backport branch:
+ ^/subversion/branches/1.6.x-r980811
+   Votes:
+ +1: stsp
+
+ * r981921
+   fsfs: make rev files read-only.
+   Justification:
+ They should never be changed.  Revprop edits are one suspected cause of
+ rev file corruption; this *may* (total guess) prevent the corruption.
+   Thread:
+ http://svn.haxx.se/dev/archive-2010-08/0060.shtml
+   Backport branch:
+ ^/subversion/branches/1.6.x-r981921
+   Votes:
+ +1: danielsh
+
 Veto-blocked changes:
 =
 
@@ -281,7 +306,6 @@ Veto-blocked changes:
Votes:
  -1: cmpilato (pending results of aforemented discussion)
 
-
  * r950445, 950468
Fix for issue #2591 'svnadmin hotcopy' does not replicate symlinks.
Justification:
@@ -300,30 +324,5 @@ Veto-blocked changes:
Discussing on list.)
  -1: cmpilato (Changes semantics of svn_io_dir_walk()).
 
- * r980811, r981449
-   Improve handling of missing fsfs.conf during svnadmin hotcopy.
-   Justification:
- People are complaining. There's Debian bug reports and whatnot.
- See http://svn.haxx.se/dev/archive-2010-07/0471.shtml and follow-ups.
-   Notes:
- r980811 is the actual fix
- r981449 is a follow-up which fixes an error leak
-   Backport branch:
- ^/subversion/branches/1.6.x-r980811
-   Votes:
- +1: stsp
-
- * r981921
-   fsfs: make rev files read-only.
-   Justification:
- They should never be changed.  Revprop edits are one suspected cause of
- rev file corruption; this *may* (total guess) prevent the corruption.
-   Thread:
- http://svn.haxx.se/dev/archive-2010-08/0060.shtml
-   Backport branch:
- ^/subversion/branches/1.6.x-r981921
-   Votes:
- +1: danielsh
-
 Approved changes:
 =




svn commit: r982246 - /subversion/trunk/subversion/include/private/svn_wc_private.h

2010-08-04 Thread julianfoad
Author: julianfoad
Date: Wed Aug  4 13:32:32 2010
New Revision: 982246

URL: http://svn.apache.org/viewvc?rev=982246view=rev
Log:
* subversion/include/private/svn_wc_private.h
  (svn_wc__node_walk_children): Tweak the doc string.

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=982246r1=982245r2=982246view=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Wed Aug  4 
13:32:32 2010
@@ -375,8 +375,10 @@ svn_wc__node_get_copyfrom_info(const cha
apr_pool_t *scratch_pool);
 
 /**
- * Recursively call @a walk_callback for all nodes underneath
- * @a local_abspath, restricted by @a walk_depth.
+ * Call @a walk_callback with @a walk_baton for @a local_abspath and all
+ * nodes underneath it, restricted by @a walk_depth.
+ *
+ * If @a show_hidden is true, include hidden nodes, else ignore them.
  */
 svn_error_t *
 svn_wc__node_walk_children(svn_wc_context_t *wc_ctx,




svn commit: r982248 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

2010-08-04 Thread julianfoad
Author: julianfoad
Date: Wed Aug  4 13:40:34 2010
New Revision: 982248

URL: http://svn.apache.org/viewvc?rev=982248view=rev
Log:
Remove some redundant code.

* subversion/libsvn_fs_fs/fs_fs.c
  (recover_find_max_ids): Don't bother reading the noderev id or creating a
noderev structure, as we don't use them.

Modified:
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=982248r1=982247r2=982248view=diff
==
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Wed Aug  4 13:40:34 2010
@@ -6626,7 +6626,7 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
 {
   apr_hash_t *headers;
   char *value;
-  node_revision_t noderev;
+  representation_t *data_rep;
   struct rep_args *ra;
   struct recover_read_from_file_baton baton;
   svn_stream_t *stream;
@@ -6639,10 +6639,6 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
pool),
 pool));
 
-  /* We're going to populate a skeletal noderev - just the id and data_rep. */
-  value = apr_hash_get(headers, HEADER_ID, APR_HASH_KEY_STRING);
-  noderev.id = svn_fs_fs__id_parse(value, strlen(value), pool);
-
   /* Check that this is a directory.  It should be. */
   value = apr_hash_get(headers, HEADER_TYPE, APR_HASH_KEY_STRING);
   if (value == NULL || strcmp(value, KIND_DIR) != 0)
@@ -6653,18 +6649,18 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
   value = apr_hash_get(headers, HEADER_TEXT, APR_HASH_KEY_STRING);
   if (!value)
 return SVN_NO_ERROR;
-  SVN_ERR(read_rep_offsets(noderev.data_rep, value, NULL, FALSE, pool));
+  SVN_ERR(read_rep_offsets(data_rep, value, NULL, FALSE, pool));
 
   /* If the directory's data representation wasn't changed in this revision,
  we've already scanned the directory's contents for noderevs, so we don't
  need to again.  This will occur if a property is changed on a directory
  without changing the directory's contents. */
-  if (noderev.data_rep-revision != rev)
+  if (data_rep-revision != rev)
 return SVN_NO_ERROR;
 
   /* We could use get_dir_contents(), but this is much cheaper.  It does
  rely on directory entries being stored as PLAIN reps, though. */
-  offset = noderev.data_rep-offset;
+  offset = data_rep-offset;
   SVN_ERR(svn_io_file_seek(rev_file, APR_SET, offset, pool));
   SVN_ERR(read_rep_line(ra, rev_file, pool));
   if (ra-is_delta)
@@ -6676,7 +6672,7 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
  stored in the representation. */
   baton.file = rev_file;
   baton.pool = pool;
-  baton.remaining = noderev.data_rep-expanded_size;
+  baton.remaining = data_rep-expanded_size;
   stream = svn_stream_create(baton, pool);
   svn_stream_set_read(stream, read_handler_recover);
 




svn commit: r982259 - /subversion/trunk/subversion/tests/cmdline/diff_tests.py

2010-08-04 Thread dannas
Author: dannas
Date: Wed Aug  4 14:11:50 2010
New Revision: 982259

URL: http://svn.apache.org/viewvc?rev=982259view=rev
Log:
Add XFailing diff test for creating git diffs with added and deleted
empty files. The git diff format only displays '---' and '+++' lines
if we have text changes. Currently it works for added paths but not
deleted ones.

* subversion/tests/cmdline/diff_tests.py
  (make_git_diff_header): Add new parameter 'text_changes' defaulting to 
True.  Only print '---' and '+++' lines if we have text changes. 
  (diff_git_empty_files): New.
  (test_list): Add diff_git_empty_files().

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

Modified: subversion/trunk/subversion/tests/cmdline/diff_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/diff_tests.py?rev=982259r1=982258r2=982259view=diff
==
--- subversion/trunk/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/diff_tests.py Wed Aug  4 14:11:50 
2010
@@ -53,8 +53,8 @@ def make_diff_header(path, old_tag, new_
 ]
 
 def make_git_diff_header(path, old_tag, new_tag, add=False, src_label=None,
- dst_label=None, delete=False, cp=False, mv=False, 
- copyfrom=None):
+ dst_label=None, delete=False, text_changes=True,
+ cp=False, mv=False, copyfrom=None):
Generate the expected 'git diff' header for file PATH, with its old
   and new versions described in parentheses by OLD_TAG and NEW_TAG.
   SRC_LABEL and DST_LABEL are paths or urls that are added to the diff
@@ -78,31 +78,42 @@ def make_git_diff_header(path, old_tag, 
 dst_label = ''
 
   if add:
-return [
+output = [
   Index:  + path_as_shown + \n,
   ===\n,
   diff --git a/ + path_as_shown +  b/ + path_as_shown + \n,
   new file mode 10644\n,
-  --- /dev/null\t( + old_tag + )\n,
-  +++ b/ + path_as_shown + dst_label + \t( + new_tag + )\n,
 ]
+if text_changes:
+  output.extend([
+--- /dev/null\t( + old_tag + )\n,
++++ b/ + path_as_shown + dst_label + \t( + new_tag + )\n
+  ])
   elif delete:
-return [
+output = [
   Index:  + path_as_shown + \n,
   ===\n,
   diff --git a/ + path_as_shown +  b/ + path_as_shown + \n,
   deleted file mode 10644\n,
-  --- a/ + path_as_shown + src_label + \t( + old_tag + )\n,
-  +++ /dev/null\t( + new_tag + )\n,
 ]
+if text_changes:
+  output.extend([
+--- a/ + path_as_shown + src_label + \t( + old_tag + )\n,
++++ /dev/null\t( + new_tag + )\n
+  ])
   elif cp:
-return [
+output = [
   Index:  + path_as_shown + \n,
   ===\n,
   diff --git a/ + copyfrom_as_shown +  b/ + path_as_shown + \n,
   copy from  + copyfrom_as_shown + \n,
   copy to  + path_as_shown + \n,
 ]
+if text_changes:
+  output.extend([
+--- a/ + copyfrom_as_shown + src_label + \t( + old_tag + )\n,
++++ b/ + path_as_shown + \t( + new_tag + )\n
+  ])
   elif mv:
 return [
   Index:  + path_as_shown + \n,
@@ -111,14 +122,20 @@ def make_git_diff_header(path, old_tag, 
   rename from  + copyfrom_as_shown + \n,
   rename to  + path_as_shown + \n,
 ]
+if text_changes:
+  output.extend([
+--- a/ + copyfrom_as_shown + src_label + \t( + old_tag + )\n,
++++ b/ + path_as_shown + \t( + new_tag + )\n
+  ])
   else:
-return [
+output = [
   Index:  + path_as_shown + \n,
   ===\n,
   diff --git a/ + path_as_shown +  b/ + path_as_shown + \n,
   --- a/ + path_as_shown + src_label + \t( + old_tag + )\n,
   +++ b/ + path_as_shown + dst_label + \t( + new_tag + )\n,
 ]
+  return output
 
 
 ##
@@ -3499,6 +3516,40 @@ def diff_prop_multiple_hunks(sbox):
 
   svntest.actions.run_and_verify_svn(None, expected_output, [],
  'diff', iota_path)
+def diff_git_empty_files(sbox):
+  create a diff in git format for empty files
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  iota_path = os.path.join(wc_dir, 'iota')
+  new_path = os.path.join(wc_dir, 'new')
+  svntest.main.file_write(iota_path, )
+
+  # Now commit the local mod, creating rev 2.
+  expected_output = svntest.wc.State(wc_dir, {
+'iota' : Item(verb='Sending'),
+})
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+'iota' : Item(status='  ', wc_rev=2),
+})
+
+  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ 

svn commit: r982267 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 14:36:25 2010
New Revision: 982267

URL: http://svn.apache.org/viewvc?rev=982267view=rev
Log:
* subversion/libsvn_wc/update_editor.c
  (modcheck_found_node): Don't perform expensive checks if we already found
a non-delete somewhere else.

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

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=982267r1=982266r2=982267view=diff
==
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Aug  4 14:36:25 
2010
@@ -1485,7 +1485,9 @@ modcheck_found_node(const char *local_ab
 
   if (status != svn_wc__db_status_normal)
 modified = TRUE;
-  else
+  /* No need to check if we already have at least one non-delete
+ modification */
+  else if (!baton-found_mod || baton-all_edits_are_deletes)
 SVN_ERR(entry_has_local_mods(modified, baton-db, local_abspath,
  kind, scratch_pool));
 




svn commit: r982268 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 14:37:39 2010
New Revision: 982268

URL: http://svn.apache.org/viewvc?rev=982268view=rev
Log:
* subversion/libsvn_wc/update_editor.c
  (close_edit): Disable some code that checks for missing administrative data
for single-db, updating the comment to explain that is about the missing
of administrative data.

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

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=982268r1=982267r2=982268view=diff
==
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Aug  4 14:37:39 
2010
@@ -5871,7 +5871,8 @@ close_edit(void *edit_baton,
 {
   struct edit_baton *eb = edit_baton;
 
-  /* If there is a target and that target is missing, then it
+  #ifndef SVN_WC__SINGLE_DB
+  /* If the explicit target still misses its administrative data, then it
  apparently wasn't re-added by the update process, so we'll
  pretend that the editor deleted the entry.  The helper function
  do_entry_deletion() will take care of the necessary steps.  */
@@ -5884,6 +5885,7 @@ close_edit(void *edit_baton,
* NULL handling code in do_entry_deletion(). */
   SVN_ERR(do_entry_deletion(eb, eb-target_abspath, NULL, FALSE, pool));
 }
+#endif
 
   /* The editor didn't even open the root; we have to take care of
  some cleanup stuffs. */




svn commit: r982291 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 15:11:29 2010
New Revision: 982291

URL: http://svn.apache.org/viewvc?rev=982291view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (*): Replace tabs with whitespace. No functional changes.

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

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=982291r1=982290r2=982291view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Aug  4 15:11:29 2010
@@ -802,7 +802,7 @@ insert_incomplete_working_children(svn_s
 svn_relpath_join(local_relpath, name,
  scratch_pool),
 #ifndef SINGLE_DB
-   (apr_int64_t) 2, /* non-THIS_DIR working */
+(apr_int64_t) 2, /* non-THIS_DIR working */
 #endif
 local_relpath));
   SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
@@ -840,8 +840,8 @@ insert_working_node(void *baton,
   SVN_ERR(svn_sqlite__bindf(stmt, isstt,
 piwb-wc_id, piwb-local_relpath,
 parent_relpath,
-   presence_map, piwb-presence,
-   kind_map, piwb-kind));
+presence_map, piwb-presence,
+kind_map, piwb-kind));
 
   if (piwb-original_repos_relpath != NULL)
 {
@@ -899,11 +899,11 @@ insert_working_node(void *baton,
 #endif
   SVN_ERR(svn_sqlite__get_statement(stmt_node, sdb, STMT_INSERT_NODE_DATA));
   SVN_ERR(svn_sqlite__bindf(stmt_node, isistt,
-   piwb-wc_id, piwb-local_relpath,
-   op_depth,
-   parent_relpath,
-   presence_map, piwb-presence,
-   kind_map, piwb-kind));
+piwb-wc_id, piwb-local_relpath,
+op_depth,
+parent_relpath,
+presence_map, piwb-presence,
+kind_map, piwb-kind));
 
   if (SVN_IS_VALID_REVNUM(piwb-changed_rev))
 SVN_ERR(svn_sqlite__bind_int64(stmt_node, 7, piwb-changed_rev));
@@ -915,7 +915,7 @@ insert_working_node(void *baton,
   if (piwb-kind == svn_wc__db_kind_dir)
 {
   SVN_ERR(svn_sqlite__bind_text(stmt_node, 10,
-   svn_depth_to_word(piwb-depth)));
+svn_depth_to_word(piwb-depth)));
 }
   else if (piwb-kind == svn_wc__db_kind_file)
 {
@@ -933,7 +933,7 @@ insert_working_node(void *baton,
 {
   SVN_ERR(svn_sqlite__bind_int64(stmt_node, 13, piwb-original_repos_id));
   SVN_ERR(svn_sqlite__bind_text(stmt_node, 14,
-   piwb-original_repos_relpath));
+piwb-original_repos_relpath));
   SVN_ERR(svn_sqlite__bind_int64(stmt_node, 15, piwb-original_revnum));
 }
 
@@ -942,7 +942,7 @@ insert_working_node(void *baton,
 
 
   SVN_ERR(svn_sqlite__bind_properties(stmt_node, 16, piwb-props,
- scratch_pool));
+  scratch_pool));
 
   SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
 #endif
@@ -3815,8 +3815,8 @@ svn_wc__db_temp_base_set_props(svn_wc__d
 {
 #ifdef SVN_WC__NODE_DATA
   SVN_ERR(set_properties(db, local_abspath, props,
-STMT_UPDATE_NODE_DATA_BASE_PROPS, base node,
-scratch_pool));
+ STMT_UPDATE_NODE_DATA_BASE_PROPS,
+ base node, scratch_pool));
 #endif
   return svn_error_return(set_properties(db, local_abspath, props,
  STMT_UPDATE_BASE_PROPS,
@@ -3833,8 +3833,8 @@ svn_wc__db_temp_working_set_props(svn_wc
 {
 #ifdef SVN_WC__NODE_DATA
   SVN_ERR(set_properties(db, local_abspath, props,
-STMT_UPDATE_NODE_DATA_WORKING_PROPS, working node,
-scratch_pool));
+ STMT_UPDATE_NODE_DATA_WORKING_PROPS,
+ working node, scratch_pool));
 #endif
   return svn_error_return(set_properties(db, local_abspath, props,
  STMT_UPDATE_WORKING_PROPS,
@@ -4300,9 +4300,9 @@ svn_wc__db_temp_op_remove_entry(svn_wc__
 
 #ifdef SVN_WC__NODE_DATA
   SVN_ERR(svn_sqlite__get_statement(stmt, sdb,
-   STMT_DELETE_NODE_DATA_LAYERS));
+STMT_DELETE_NODE_DATA_LAYERS));
   SVN_ERR(svn_sqlite__bindf(stmt, isi,
-   wc_id, local_relpath, (apr_int64_t)0));
+wc_id, local_relpath, (apr_int64_t)0));
   

svn commit: r982295 - /subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c

2010-08-04 Thread dannas
Author: dannas
Date: Wed Aug  4 15:19:40 2010
New Revision: 982295

URL: http://svn.apache.org/viewvc?rev=982295view=rev
Log:
Add XFailing test for parsing git diffs with spaces in the paths.

Note that we only need to parse the '--git diff a/path b/path' line
for added and deleted empty files. In all other cases we have other
header lines to obtain the information from.

* subversion/tests/libsvn_diff/parse-diff-test.c
  (path_with_spaces_unidiff): New unidiff test data.
  (test_git_diffs_with_spaces_diff): New.
  (test_funcs): Add test_git_diffs_with_spaces_diff() as XFailing.

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

Modified: subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c?rev=982295r1=982294r2=982295view=diff
==
--- subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c Wed Aug  4 
15:19:40 2010
@@ -214,6 +214,17 @@ static const char *bad_git_diff_header =
   +## -1,2 +1,4 ##NL
   NL;
 
+  /* A unidiff containing paths with spaces. */
+  static const char *path_with_spaces_unidiff =
+  git --diff a/path 1 b/path 1NL
+  new file mode 100644NL
+  git --diff a/path one 1 b/path one 1NL
+  new file mode 100644NL
+  git --diff a/dir/b/path b/dir/b/pathNL
+  new file mode 100644NL
+  git --diff a/b/path 1 b/b/path 1NL
+  new file mode 100644NL;
+
 
 /* Create a PATCH_FILE with name FNAME containing the contents of DIFF. */
 static svn_error_t *
@@ -788,6 +799,58 @@ test_parse_diff_symbols_in_prop_unidiff(
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_git_diffs_with_spaces_diff(apr_pool_t *pool)
+{
+  apr_file_t *patch_file;
+  svn_patch_t *patch;
+  const char *fname = test_git_diffs_with_spaces_diff.patch;
+
+  SVN_ERR(create_patch_file(patch_file, fname, path_with_spaces_unidiff,
+pool));
+
+  SVN_ERR(svn_diff_parse_next_patch(patch, patch_file, 
+FALSE, /* reverse */
+FALSE, /* ignore_whitespace */ 
+pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch-old_filename, path 1));
+  SVN_TEST_ASSERT(! strcmp(patch-new_filename, path 1));
+  SVN_TEST_ASSERT(patch-operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch-hunks-nelts == 0);
+  
+  SVN_ERR(svn_diff_parse_next_patch(patch, patch_file, 
+FALSE, /* reverse */
+FALSE, /* ignore_whitespace */ 
+pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch-old_filename, path one 1));
+  SVN_TEST_ASSERT(! strcmp(patch-new_filename, path one 1));
+  SVN_TEST_ASSERT(patch-operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch-hunks-nelts == 0);
+
+  SVN_ERR(svn_diff_parse_next_patch(patch, patch_file, 
+FALSE, /* reverse */
+FALSE, /* ignore_whitespace */ 
+pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch-old_filename, dir/b/path));
+  SVN_TEST_ASSERT(! strcmp(patch-new_filename, dir/b/path));
+  SVN_TEST_ASSERT(patch-operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch-hunks-nelts == 0);
+
+  SVN_ERR(svn_diff_parse_next_patch(patch, patch_file, 
+FALSE, /* reverse */
+FALSE, /* ignore_whitespace */ 
+pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch-old_filename, b/path 1));
+  SVN_TEST_ASSERT(! strcmp(patch-new_filename, b/path 1));
+  SVN_TEST_ASSERT(patch-operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch-hunks-nelts == 0);
+
+  return SVN_NO_ERROR;
+}
 /* == 
*/
 
 struct svn_test_descriptor_t test_funcs[] =
@@ -807,5 +870,7 @@ struct svn_test_descriptor_t test_funcs[
test property and text unidiff parsing),
 SVN_TEST_PASS2(test_parse_diff_symbols_in_prop_unidiff,
test property diffs with odd symbols),
+SVN_TEST_XFAIL2(test_git_diffs_with_spaces_diff,
+   test git diffs with spaces in paths),
 

svn commit: r982307 - in /subversion/trunk/subversion/libsvn_wc: wc_db.c wc_db.h

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 15:37:45 2010
New Revision: 982307

URL: http://svn.apache.org/viewvc?rev=982307view=rev
Log:
Mark two wc__db apis as only being used for a very specific purpose.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_temp_base_set_props,
   svn_wc__db_temp_working_set_props): Undefine for !SVN__SUPPORT_BASE_MERGE
* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_temp_base_set_props,
   svn_wc__db_temp_working_set_props): Undefine for !SVN__SUPPORT_BASE_MERGE

Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=982307r1=982306r2=982307view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Aug  4 15:37:45 2010
@@ -3806,6 +3806,7 @@ set_properties(svn_wc__db_t *db,
   return SVN_NO_ERROR;
 }
 
+#ifdef SVN__SUPPORT_BASE_MERGE
 
 svn_error_t *
 svn_wc__db_temp_base_set_props(svn_wc__db_t *db,
@@ -3842,6 +3843,7 @@ svn_wc__db_temp_working_set_props(svn_wc
  scratch_pool));
 }
 
+#endif /* SVN__SUPPORT_BASE_MERGE  */
 
 svn_error_t *
 svn_wc__db_op_delete(svn_wc__db_t *db,

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=982307r1=982306r2=982307view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Wed Aug  4 15:37:45 2010
@@ -1211,6 +1211,8 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
 const svn_skel_t *work_items,
 apr_pool_t *scratch_pool);
 
+/* See props.h  */
+#ifdef SVN__SUPPORT_BASE_MERGE
 /* ### Set the properties of the node LOCAL_ABSPATH in the BASE tree to PROPS.
###
### This function should not exist because properties should be stored
@@ -1243,7 +1245,7 @@ svn_wc__db_temp_working_set_props(svn_wc
   const char *local_abspath,
   const apr_hash_t *props,
   apr_pool_t *scratch_pool);
-
+#endif
 
 /* ### KFF: This handles files, dirs, symlinks, anything else? */
 /* ### dlr: Does this support recursive dir deletes (e.g. _revert)? Document. 
*/




svn commit: r982360 - in /subversion/branches/performance/subversion/libsvn_fs_fs: caching.c fs.h

2010-08-04 Thread stefan2
Author: stefan2
Date: Wed Aug  4 18:56:24 2010
New Revision: 982360

URL: http://svn.apache.org/viewvc?rev=982360view=rev
Log:
Introduce a process-global open file handle cache and make it available to FSFS 
code.
A reference in fs_fs_data_t is used instead of a global svn_get_fh_cache 
function
to allow for more fine-grained configuration in future.

* subversion/libsvn_fs_fs/fs.h
  (fs_fs_data_t): add file_handle_cache member; fix indentation
* subversion/libsvn_fs_fs/caching.c
  (get_global_file_handle_cache): new function managing the cache singleton
  (svn_fs_fs__set_cache_config): auto-init the file handle cache as well
  (svn_fs_fs__initialize_caches): assign the file handle cache to the FSFS 
context

Modified:
subversion/branches/performance/subversion/libsvn_fs_fs/caching.c
subversion/branches/performance/subversion/libsvn_fs_fs/fs.h

Modified: subversion/branches/performance/subversion/libsvn_fs_fs/caching.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/caching.c?rev=982360r1=982359r2=982360view=diff
==
--- subversion/branches/performance/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/caching.c Wed Aug  
4 18:56:24 2010
@@ -249,11 +249,25 @@ get_global_membuffer_cache(void)
   return cache;
 }
 
-/* Set the current FSFS cache configuration. Apply it immediately to ensure
- * thread-safety: since this function should be called from the processes'
- * initialization code, no race with background / worker threads should occur.
+/* Access the process-global (singleton) open file handle cache. The first
+ * call will automatically allocate the cache using the current cache config.
+ * Even for file handle limit of 0, a cache object will be returned.
  */
-void
+static svn_file_handle_cache_t *
+get_global_file_handle_cache(void)
+{
+  static svn_file_handle_cache_t *cache = NULL;
+
+  if (!cache)
+svn_file_handle_cache__create_cache(cache,
+cache_settings.file_handle_count,
+!cache_settings.single_threaded,
+svn_pool_create(NULL));
+
+  return cache;
+}
+
+void 
 svn_fs_fs__set_cache_config(const svn_fs_fs__cache_config_t *settings)
 {
   cache_settings = *settings;
@@ -261,6 +275,9 @@ svn_fs_fs__set_cache_config(const svn_fs
   /* Allocate global membuffer cache as a side-effect.
* Only the first call will actually take affect. */
   get_global_membuffer_cache();
+
+  /* Same for the file handle cache. */
+  get_global_file_handle_cache();
 }
 
 svn_error_t *
@@ -363,6 +380,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
 SVN_ERR(svn_cache__set_error_handler(ffd-packed_offset_cache,
  warn_on_cache_errors, fs, pool));
 
+  /* initialize fulltext cache as configured */
   if (memcache)
 {
   SVN_ERR(svn_cache__create_memcache((ffd-fulltext_cache),
@@ -395,5 +413,8 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
 SVN_ERR(svn_cache__set_error_handler(ffd-fulltext_cache,
 warn_on_cache_errors, fs, pool));
 
+  /* initialize file handle cache as configured */
+  ffd-file_handle_cache = get_global_file_handle_cache();
+
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/performance/subversion/libsvn_fs_fs/fs.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/fs.h?rev=982360r1=982359r2=982360view=diff
==
--- subversion/branches/performance/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/fs.h Wed Aug  4 
18:56:24 2010
@@ -34,6 +34,7 @@
 #include private/svn_cache.h
 #include private/svn_fs_private.h
 #include private/svn_sqlite.h
+#include private/svn_file_handle_cache.h
 
 #ifdef __cplusplus
 extern C {
@@ -240,6 +241,9 @@ typedef struct
  pack files. */
   svn_cache__t *packed_offset_cache;
 
+  /* Reference to the process-global open file handle cache */
+  svn_file_handle_cache_t *file_handle_cache;
+
   /* Data shared between all svn_fs_t objects for a given filesystem. */
   fs_fs_shared_data_t *shared;
 
@@ -249,14 +253,14 @@ typedef struct
   /* Thread-safe boolean */
   svn_atomic_t rep_cache_db_opened;
 
-   /* The sqlite database used for revprops. */
-   svn_sqlite__db_t *revprop_db;
+  /* The sqlite database used for revprops. */
+  svn_sqlite__db_t *revprop_db;
 
   /* The oldest revision not in a pack file. */
   svn_revnum_t min_unpacked_rev;
 
-   /* The oldest revision property not in a pack db. */
-   svn_revnum_t min_unpacked_revprop;
+  /* The oldest revision property not in a pack db. */
+  svn_revnum_t min_unpacked_revprop;
 
   /* Whether rep-sharing is supported by the filesystem
* and allowed by the configuration. */




svn commit: r982365 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c update_editor.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 19:13:10 2010
New Revision: 982365

URL: http://svn.apache.org/viewvc?rev=982365view=rev
Log:
Apply some sanity checks similar to those in svn_wc_add4() to
svn_wc_add_repos_file4(). This handles some assertions in Single-DB mode,
with proper error messages.

* subversion/libsvn_wc/adm_ops.c
  (svn_wc_add4): Update error message to match that in update_editor.c

* subversion/libsvn_wc/update_editor.c
  (svn_wc_add_repos_file4): Check if we try to add in a present directory
and not over an existing node.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/update_editor.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=982365r1=982364r2=982365view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Wed Aug  4 19:13:10 2010
@@ -1021,7 +1021,7 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
   {
 return
   svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, err,
-_(Can't find parent directory's entry while
+_(Can't find parent directory's node while
trying to add '%s'),
 svn_dirent_local_style(local_abspath,
scratch_pool));

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=982365r1=982364r2=982365view=diff
==
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Aug  4 19:13:10 
2010
@@ -6501,10 +6501,12 @@ svn_wc_add_repos_file4(svn_wc_context_t 
void *cancel_baton,
svn_wc_notify_func2_t notify_func,
void *notify_baton,
-   apr_pool_t *pool)
+   apr_pool_t *scratch_pool)
 {
   svn_wc__db_t *db = wc_ctx-db;
-  const char *dir_abspath = svn_dirent_dirname(local_abspath, pool);
+  const char *dir_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
+  svn_wc__db_status_t status;
+  svn_wc__db_kind_t kind;
   const char *tmp_text_base_abspath;
   svn_checksum_t *new_text_base_md5_checksum;
   svn_checksum_t *new_text_base_sha1_checksum;
@@ -6518,6 +6520,8 @@ svn_wc_add_repos_file4(svn_wc_context_t 
   svn_revnum_t changed_rev;
   apr_time_t changed_date;
   const char *changed_author;
+  svn_error_t *err;
+  apr_pool_t *pool = scratch_pool;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
   SVN_ERR_ASSERT(new_base_contents != NULL);
@@ -6526,6 +6530,60 @@ svn_wc_add_repos_file4(svn_wc_context_t 
   /* We should have a write lock on this file's parent directory.  */
   SVN_ERR(svn_wc__write_check(db, dir_abspath, pool));
 
+  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  err-apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+return svn_error_return(err);
+  else if(err)
+svn_error_clear(err);
+  else
+switch (status)
+  {
+case svn_wc__db_status_not_present:
+case svn_wc__db_status_deleted:
+  break;
+default:
+  return svn_error_createf(SVN_ERR_ENTRY_EXISTS, NULL,
+   _(Node '%s' exists.),
+   svn_dirent_local_style(local_abspath,
+  scratch_pool));
+  }
+
+  SVN_ERR(svn_wc__db_read_info(status, kind, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL,
+   db, dir_abspath, scratch_pool, scratch_pool));
+
+  switch (status)
+{
+  case svn_wc__db_status_normal:
+  case svn_wc__db_status_added:
+break;
+  case svn_wc__db_status_deleted:
+return
+  svn_error_createf(SVN_ERR_WC_SCHEDULE_CONFLICT, NULL,
+_(Can't add '%s' to a parent directory
+   scheduled for deletion),
+svn_dirent_local_style(local_abspath,
+   scratch_pool));
+  default:
+return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, err,
+   

Re: svn commit: r982375 - in /subversion/branches/performance/subversion: include/svn_io.h libsvn_subr/stream.c

2010-08-04 Thread Hyrum K. Wright
On Wed, Aug 4, 2010 at 2:27 PM,  stef...@apache.org wrote:
 Author: stefan2
 Date: Wed Aug  4 19:27:41 2010
 New Revision: 982375

 URL: http://svn.apache.org/viewvc?rev=982375view=rev
 Log:
 Introduce a variant of svn_stream_from_aprfile2, that takes cached file 
 handles
 instead of APR file handles.

 * subversion/include/svn_io.h
  (svn_stream_from_aprfile3): declare new API function

Is this intended as a replacement for svn_stream_from_aprfile2()?  If
so, the the later should be deprecated.  If not, I would suggest a new
name, since we generally only have one non-deprecated version of
svn_fooN() APIs in any given release.  It's okay for the separate
functions to exist, but they shouldn't be related via the naming
ancestry.

-Hyrum

 * subversion/libsvn_subr/stream.c
  (baton_apr): add cached_handle member
  (close_handler_cached_handle): new close() function
  (stream_from_aprfile): extract generic part from svn_stream_from_aprfile2
  (svn_stream_from_aprfile2): call stream_from_aprfile for most of the init 
 code
  (svn_stream_from_aprfile3): implement new API function

 Modified:
    subversion/branches/performance/subversion/include/svn_io.h
    subversion/branches/performance/subversion/libsvn_subr/stream.c

 Modified: subversion/branches/performance/subversion/include/svn_io.h
 URL: 
 http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_io.h?rev=982375r1=982374r2=982375view=diff
 ==
 --- subversion/branches/performance/subversion/include/svn_io.h (original)
 +++ subversion/branches/performance/subversion/include/svn_io.h Wed Aug  4 
 19:27:41 2010
 @@ -923,6 +923,26 @@ svn_stream_from_aprfile2(apr_file_t *fil
                          svn_boolean_t disown,
                          apr_pool_t *pool);

 +/* forward-declare svn_file_handle_cache__handle_t */
 +struct svn_file_handle_cache__handle_t;
 +
 +/** Create a stream from a cached file handle.  For convenience, if @a file
 + * is @c NULL, an empty stream created by svn_stream_empty() is returned.
 + *
 + * This function should normally be called with @a disown set to FALSE,
 + * in which case closing the stream will also return the file handle to
 + * the respective cache object.
 + *
 + * If @a disown is TRUE, the stream will disown the file handle, meaning
 + * that svn_stream_close() will not close the cached file handle.
 + *
 + * @since New in 1.7.
 + */
 +svn_stream_t *
 +svn_stream_from_aprfile3(struct svn_file_handle_cache__handle_t *file,
 +                         svn_boolean_t disown,
 +                         apr_pool_t *pool);
 +
  /** Similar to svn_stream_from_aprfile2(), except that the file will
  * always be disowned.
  *

 Modified: subversion/branches/performance/subversion/libsvn_subr/stream.c
 URL: 
 http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_subr/stream.c?rev=982375r1=982374r2=982375view=diff
 ==
 --- subversion/branches/performance/subversion/libsvn_subr/stream.c (original)
 +++ subversion/branches/performance/subversion/libsvn_subr/stream.c Wed Aug  
 4 19:27:41 2010
 @@ -43,7 +43,7 @@
  #include svn_checksum.h
  #include svn_path.h
  #include private/svn_eol_private.h
 -
 +#include private/svn_file_handle_cache.h

  struct svn_stream_t {
   void *baton;
 @@ -579,6 +579,10 @@ struct baton_apr {
   apr_file_t *file;
   apr_pool_t *pool;

 +  /* If not NULL, file is actually wrapped into this cached file handle
 +   * and should be returned to the file handle cache asap. */
 +  svn_file_handle_cache__handle_t *cached_handle;
 +
   /* Offsets when reading from a range of the file.
    * When either of these is negative, no range has been specified. */
   apr_off_t start;
 @@ -622,6 +626,17 @@ close_handler_apr(void *baton)
   return svn_io_file_close(btn-file, btn-pool);
  }

 +/* Returns the cached file handle back to the respective cache object.
 + * This is call is allowed even for btn-cached_handle == NULL.
 + */
 +static svn_error_t *
 +close_handler_cached_handle(void *baton)
 +{
 +  struct baton_apr *btn = baton;
 +
 +  return svn_file_handle_cache__close(btn-cached_handle);
 +}
 +
  static svn_error_t *
  reset_handler_apr(void *baton)
  {
 @@ -713,36 +728,83 @@ svn_stream_open_unique(svn_stream_t **st
   return SVN_NO_ERROR;
  }

 +/* Common initialization code for svn_stream_from_aprfile2() and
 + * svn_stream_from_aprfile3().
 + */
 +static svn_stream_t *
 +stream_from_aprfile(struct baton_apr **baton,
 +                    apr_file_t *file,
 +                    apr_pool_t *pool)
 +{
 +  struct baton_apr *new_baton;
 +  svn_stream_t *stream;
 +
 +  /* create and fully initialize the baton */
 +  new_baton = apr_palloc(pool, sizeof(*new_baton));
 +  new_baton-file = file;
 +  new_baton-cached_handle = NULL; /* default */
 +  new_baton-pool = pool;
 +  new_baton-start = -1;
 +  new_baton-end 

svn propchange: r982365 - svn:log

2010-08-04 Thread rhuijben
Author: rhuijben
Revision: 982365
Modified property: svn:log

Modified: svn:log at Wed Aug  4 19:46:37 2010
--
--- svn:log (original)
+++ svn:log Wed Aug  4 19:46:37 2010
@@ -7,4 +7,5 @@ with proper error messages.
 
 * subversion/libsvn_wc/update_editor.c
   (svn_wc_add_repos_file4): Check if we try to add in a present directory
-and not over an existing node.
+and not over an existing node. Also remove an obsolete block that tried
+to detect replacements from when we still had a revert base.



svn commit: r982386 - /subversion/trunk/subversion/libsvn_client/merge.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 20:08:39 2010
New Revision: 982386

URL: http://svn.apache.org/viewvc?rev=982386view=rev
Log:
Remove the assumption that deleted directories must still exist from the
merge code in libsvn_client. This fixes several tests for Single-DB.

After we switch to single-db we should remove the assumption that directories
can still exist when deleted.

* subversion/libsvn_client/merge.c
  (obstructed_or_missing): Make this function return errors for easier
(future) debugging. When a node is a deleted directory and it's missing
check if it is obstructed and if not assume that no directory is ok.
  (merge_props_changed,
   merge_file_changed,
   merge_file_added,
   merge_file_deleted,
   merge_dir_added,
   merge_dir_deleted,
   merge_dir_opened): Update callers.

Modified:
subversion/trunk/subversion/libsvn_client/merge.c

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=982386r1=982385r2=982386view=diff
==
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Wed Aug  4 20:08:39 2010
@@ -378,8 +378,9 @@ is_path_conflicted_by_merge(merge_cmd_ba
  * different kind is expected, or if the disk node cannot be read.
  *   - Return 'missing' if there is no node on disk but one is expected.
  * Also return 'missing' for absent nodes (not here due to authz).*/
-static svn_wc_notify_state_t
-obstructed_or_missing(const char *local_abspath,
+static svn_error_t *
+obstructed_or_missing(svn_wc_notify_state_t *obstr_state,
+  const char *local_abspath,
   const char *local_dir_abspath,
   const merge_cmd_baton_t *merge_b,
   apr_pool_t *pool)
@@ -391,20 +392,14 @@ obstructed_or_missing(const char *local_
 
   /* In a dry run, make as if nodes deleted by the dry run appear so. */
   if (merge_b-dry_run  dry_run_deleted_p(merge_b, local_abspath))
-return svn_wc_notify_state_inapplicable;
-
-  /* Since this function returns no svn_error_t, we make all errors look like
-   * no node found in the wc. */
-
-  err = svn_wc_read_kind(kind_expected, merge_b-ctx-wc_ctx,
- local_abspath, FALSE, pool);
-
-  if (err)
 {
-  svn_error_clear(err);
-  kind_expected = svn_node_none;
+  *obstr_state = svn_wc_notify_state_inapplicable;
+  return SVN_NO_ERROR;
 }
 
+  SVN_ERR(svn_wc_read_kind(kind_expected, merge_b-ctx-wc_ctx,
+   local_abspath, FALSE, pool));
+
   /* Report absent nodes as 'missing'. First of all, they count as 'hidden',
* and since we pass show_hidden == FALSE above, they will show up as
* 'none' here. */
@@ -413,44 +408,66 @@ obstructed_or_missing(const char *local_
   svn_boolean_t is_absent;
   err = svn_wc__node_is_status_absent(is_absent, merge_b-ctx-wc_ctx,
   local_abspath, pool);
-  if (err)
-svn_error_clear(err);
-  else if (is_absent)
-return svn_wc_notify_state_missing;
+  if (err  err-apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+return svn_error_return(err);
+  else if (!err  is_absent)
+{
+  *obstr_state = svn_wc_notify_state_missing;
+  return SVN_NO_ERROR;
+}
+
+  svn_error_clear(err);
 }
 
-  /* If a node is deleted, we will still get its kind from the working copy.
+  SVN_ERR(svn_io_check_path(local_abspath, kind_on_disk, pool));
+
+  /* If a node is deleted, the node might be gone in the working copy (and
+   * it probably is gone after we switch to single-db
+   *
* But to compare with disk state, we want to consider deleted nodes as
-   * svn_node_none instead of their original kind.
-   * ### Not necessary with central DB:
-   * Because deleted directories are expected to remain on disk until commit
-   * to keep the metadata available, we only do this for files, not dirs. */
-  if (kind_expected == svn_node_file)
+   * svn_node_none instead of their original kind. */
+
+  if (kind_expected == svn_node_file
+  || kind_expected == svn_node_dir)
 {
   svn_boolean_t is_deleted;
-  err = svn_wc__node_is_status_deleted(is_deleted,
-   merge_b-ctx-wc_ctx,
-   local_abspath,
-   pool);
-  if (err)
-svn_error_clear(err);
-  else if (is_deleted)
-kind_expected = svn_node_none;
-}
 
-  err = svn_io_check_path(local_abspath, kind_on_disk, pool);
-  if (err)
-{
-  svn_error_clear(err);
-  kind_on_disk = svn_node_unknown;
+  SVN_ERR(svn_wc__node_is_status_deleted(is_deleted,
+ merge_b-ctx-wc_ctx,
+   

svn commit: r982391 - in /subversion/branches/performance/subversion: include/svn_io.h libsvn_subr/stream.c

2010-08-04 Thread stefan2
Author: stefan2
Date: Wed Aug  4 20:22:10 2010
New Revision: 982391

URL: http://svn.apache.org/viewvc?rev=982391view=rev
Log:
Upon second thought, svn_stream_from_aprfile3 should be renamed to 
svn_stream_from_cached_file_handle.

* subversion/include/svn_io.h
  (svn_stream_from_cached_file_handle): renamed from svn_stream_from_aprfile3
* subversion/libvn_subr/stream.c
  (svn_stream_from_cached_file_handle): renamed from svn_stream_from_aprfile3

Modified:
subversion/branches/performance/subversion/include/svn_io.h
subversion/branches/performance/subversion/libsvn_subr/stream.c

Modified: subversion/branches/performance/subversion/include/svn_io.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_io.h?rev=982391r1=982390r2=982391view=diff
==
--- subversion/branches/performance/subversion/include/svn_io.h (original)
+++ subversion/branches/performance/subversion/include/svn_io.h Wed Aug  4 
20:22:10 2010
@@ -926,23 +926,6 @@ svn_stream_from_aprfile2(apr_file_t *fil
 /* forward-declare svn_file_handle_cache__handle_t */
 struct svn_file_handle_cache__handle_t;
 
-/** Create a stream from a cached file handle.  For convenience, if @a file
- * is @c NULL, an empty stream created by svn_stream_empty() is returned.
- *
- * This function should normally be called with @a disown set to FALSE,
- * in which case closing the stream will also return the file handle to
- * the respective cache object.
- *
- * If @a disown is TRUE, the stream will disown the file handle, meaning 
- * that svn_stream_close() will not close the cached file handle.
- *
- * @since New in 1.7.
- */
-svn_stream_t *
-svn_stream_from_aprfile3(struct svn_file_handle_cache__handle_t *file,
- svn_boolean_t disown,
- apr_pool_t *pool);
-
 /** Similar to svn_stream_from_aprfile2(), except that the file will
  * always be disowned.
  *
@@ -957,6 +940,24 @@ svn_stream_t *
 svn_stream_from_aprfile(apr_file_t *file,
 apr_pool_t *pool);
 
+/** Create a stream from a cached file handle.  For convenience, if @a file
+ * is @c NULL, an empty stream created by svn_stream_empty() is returned.
+ *
+ * This function should normally be called with @a disown set to FALSE,
+ * in which case closing the stream will also return the file handle to
+ * the respective cache object.
+ *
+ * If @a disown is TRUE, the stream will disown the file handle, meaning 
+ * that svn_stream_close() will not close the cached file handle.
+ *
+ * @since New in 1.7.
+ */
+svn_stream_t *
+svn_stream_from_cached_file_handle
+(struct svn_file_handle_cache__handle_t *file,
+ svn_boolean_t disown,
+ apr_pool_t *pool);
+
 /** Create a stream for reading from a range of an APR file.
  * The stream cannot be written to.
  *

Modified: subversion/branches/performance/subversion/libsvn_subr/stream.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_subr/stream.c?rev=982391r1=982390r2=982391view=diff
==
--- subversion/branches/performance/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/performance/subversion/libsvn_subr/stream.c Wed Aug  4 
20:22:10 2010
@@ -782,9 +782,9 @@ svn_stream_from_aprfile2(apr_file_t *fil
 }
 
 svn_stream_t *
-svn_stream_from_aprfile3(svn_file_handle_cache__handle_t *file,
- svn_boolean_t disown,
- apr_pool_t *pool)
+svn_stream_from_cached_file_handle(svn_file_handle_cache__handle_t *file,
+   svn_boolean_t disown,
+   apr_pool_t *pool)
 {
   struct baton_apr *baton;
 




svn commit: r982397 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/deprecated.c libsvn_wc/props.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 20:45:46 2010
New Revision: 982397

URL: http://svn.apache.org/viewvc?rev=982397view=rev
Log:
Reintroduce svn_wc_props_modified_p2() to allow cheap access to the wc_db
knowledge about whether properties are modified. Clients like TortoiseSVN
and AnkhSVN will use this or a similar libsvn_client api which will wrap
this api to determine if properties are changed in their status caches.

* subversion/include/svn_wc.h
  (svn_wc_props_modified_p2): New function.
  (svn_wc_props_modified_p): Refer to svn_wc_props_modified_p2 instead
of a function that retrieves all modified property values.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_props_modified_p): Use svn_wc_props_modified_p2 instead of the
internal version.

* subversion/libsvn_wc/props.c
  (svn_wc__props_modified): Just fetch the props_modified boolean from
svn_wc__db_read_info. No need to read the real data as properties not NULL
in ACTUAL defines that there are property changes.
  (svn_wc_props_modified_p2): New function.

Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_wc/deprecated.c
subversion/trunk/subversion/libsvn_wc/props.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=982397r1=982396r2=982397view=diff
==
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Wed Aug  4 20:45:46 2010
@@ -2709,13 +2709,20 @@ svn_wc_text_modified_p(svn_boolean_t *mo
svn_wc_adm_access_t *adm_access,
apr_pool_t *pool);
 
-
 /** Set @a *modified_p to non-zero if @a path's properties are modified
  * with regard to the base revision, else set @a modified_p to zero.
  * @a adm_access must be an access baton for @a path.
  *
- * If you want to use this with a post-wc-ng working copy, just call
- * svn_wc_get_prop_diffs2() and examine the output.
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_wc_props_modified_p2(svn_boolean_t *modified_p,
+ svn_wc_context_t* wc_ctx,
+ const char *local_abspath,
+  apr_pool_t *scratch_pool);
+
+/** Similar to svn_wc_props_modified_p2(), but with a relative path and
+ * adm_access baton.
  *
  * @deprecated Provided for backward compatibility with the 1.6 API.
  */

Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=982397r1=982396r2=982397view=diff
==
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Wed Aug  4 20:45:46 2010
@@ -2330,12 +2330,26 @@ svn_wc_props_modified_p(svn_boolean_t *m
 svn_wc_adm_access_t *adm_access,
 apr_pool_t *pool)
 {
-  svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
+  svn_wc_context_t *wc_ctx;
   const char *local_abspath;
+  svn_error_t *err;
 
   SVN_ERR(svn_dirent_get_absolute(local_abspath, path, pool));
+  SVN_ERR(svn_wc__context_create_with_db(wc_ctx, NULL /* config */,
+ svn_wc__adm_get_db(adm_access), 
pool));
+
+  err = svn_wc_props_modified_p2(modified_p,
+ wc_ctx,
+ local_abspath,
+ pool);
 
-  return svn_wc__props_modified(modified_p, db, local_abspath, pool);
+  if (err  err-apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+{
+  svn_error_clear(err);
+  *modified_p = FALSE;
+}
+
+  return svn_error_return(svn_wc_context_destroy(wc_ctx));
 }
 
 

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=982397r1=982396r2=982397view=diff
==
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Wed Aug  4 20:45:46 2010
@@ -2458,77 +2458,28 @@ svn_wc__props_modified(svn_boolean_t *mo
const char *local_abspath,
apr_pool_t *scratch_pool)
 {
-  apr_array_header_t *local_propchanges;
-  apr_hash_t *localprops;
-  apr_hash_t *baseprops;
-  svn_wc__db_status_t status;
-  svn_error_t *err;
-
-  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 we 

svn commit: r982398 - in /subversion/trunk/subversion/libsvn_ra_serf: property.c ra_serf.h

2010-08-04 Thread danielsh
Author: danielsh
Date: Wed Aug  4 20:49:15 2010
New Revision: 982398

URL: http://svn.apache.org/viewvc?rev=982398view=rev
Log:
Plug an ra_serf error leak.

* subversion/libsvn_ra_serf/property.c
  (svn_ra_serf__walk_all_props):
Wrap SVN_ERR() around the 'svn_ra_serf__walker_visitor_t walker()' call.

* subversion/libsvn_ra_serf/ra_serf.h
  (svn_ra_serf__walk_all_props):
 Change the return type to 'svn_error_t *'.

Modified:
subversion/trunk/subversion/libsvn_ra_serf/property.c
subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h

Modified: subversion/trunk/subversion/libsvn_ra_serf/property.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/property.c?rev=982398r1=982397r2=982398view=diff
==
--- subversion/trunk/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/property.c Wed Aug  4 20:49:15 
2010
@@ -736,7 +736,7 @@ svn_ra_serf__retrieve_props(apr_hash_t *
   return SVN_NO_ERROR;
 }
 
-void
+svn_error_t *
 svn_ra_serf__walk_all_props(apr_hash_t *props,
 const char *name,
 svn_revnum_t rev,
@@ -751,14 +751,14 @@ svn_ra_serf__walk_all_props(apr_hash_t *
 
   if (!ver_props)
 {
-  return;
+  return SVN_NO_ERROR;
 }
 
   path_props = apr_hash_get(ver_props, name, strlen(name));
 
   if (!path_props)
 {
-  return;
+  return SVN_NO_ERROR;
 }
 
   for (ns_hi = apr_hash_first(pool, path_props); ns_hi;
@@ -778,9 +778,12 @@ svn_ra_serf__walk_all_props(apr_hash_t *
 
   apr_hash_this(name_hi, prop_name, prop_len, prop_val);
   /* use a subpool? */
-  walker(baton, ns_name, ns_len, prop_name, prop_len, prop_val, pool);
+  SVN_ERR(walker(baton, ns_name, ns_len, prop_name, prop_len,
+ prop_val, pool));
 }
 }
+
+  return SVN_NO_ERROR;
 }
 
 void

Modified: subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h?rev=982398r1=982397r2=982398view=diff
==
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Wed Aug  4 20:49:15 
2010
@@ -978,7 +978,7 @@ typedef svn_error_t *
  const svn_string_t *val,
  apr_pool_t *pool);
 
-void
+svn_error_t *
 svn_ra_serf__walk_all_props(apr_hash_t *props,
 const char *name,
 svn_revnum_t rev,




svn propchange: r982275 - svn:log

2010-08-04 Thread rhuijben
Author: rhuijben
Revision: 982275
Modified property: svn:log

Modified: svn:log at Wed Aug  4 21:21:10 2010
--
--- svn:log (original)
+++ svn:log Wed Aug  4 21:21:10 2010
@@ -2,4 +2,4 @@
   (set_new_dir_to_incomplete_baton_txn): Following up on recent discussion,
 just store infinite depth even though it is mostly equivalent to depth
 unknown. Currently all other places in wc_db.c store depth infinity
-literally
+literally. Also replace some tab characters with spaces.



svn commit: r982410 - /subversion/trunk/subversion/libsvn_wc/deprecated.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 21:27:58 2010
New Revision: 982410

URL: http://svn.apache.org/viewvc?rev=982410view=rev
Log:
* subversion/libsvn_wc/deprecated.c
  (svn_wc_props_modified_p): Fix error leak.

Found by: gstein

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

Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=982410r1=982409r2=982410view=diff
==
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Wed Aug  4 21:27:58 2010
@@ -2343,8 +2343,11 @@ svn_wc_props_modified_p(svn_boolean_t *m
  local_abspath,
  pool);
 
-  if (err  err-apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+  if (err)
 {
+  if (err-apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+return svn_error_return(err);
+
   svn_error_clear(err);
   *modified_p = FALSE;
 }




svn propchange: r982386 - svn:log

2010-08-04 Thread rhuijben
Author: rhuijben
Revision: 982386
Modified property: svn:log

Modified: svn:log at Wed Aug  4 21:57:10 2010
--
--- svn:log (original)
+++ svn:log Wed Aug  4 21:57:10 2010
@@ -11,7 +11,12 @@ can still exist when deleted.
   (merge_props_changed,
merge_file_changed,
merge_file_added,
-   merge_file_deleted,
-   merge_dir_added,
-   merge_dir_deleted,
+   merge_file_deleted): Update callers.
+
+  (merge_dir_added): Update caller. Use svn_io_dir_make() instead of
+svn_io_make_dir_recursively() to make sure missing parent directory
+errors caused by switching to single-db show an understandable
+error message.
+
+  (merge_dir_deleted,
merge_dir_opened): Update callers.



svn commit: r982415 - in /subversion/trunk/subversion/libsvn_ra_serf: commit.c replay.c serf.c update.c

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 22:20:30 2010
New Revision: 982415

URL: http://svn.apache.org/viewvc?rev=982415view=rev
Log:
Following up on r982398, fix a few more mostly theoretical error leaks.

* subversion/libsvn_ra_serf/commit.c
  (create_proppatch_body): Explicitly clear result from
svn_ra_serf__walk_all_props.

* subversion/libsvn_ra_serf/replay.c
  (start_replay): Handle errors.

* subversion/libsvn_ra_serf/serf.c
  (svn_ra_serf__rev_proplist,
   svn_ra_serf__stat
   svn_ra_serf__get_dir): Handle errors.

* subversion/libsvn_ra_serf/update.c
  (close_dir
   handle_fetch,
   handle_propchange_only): Handle errors.

Modified:
subversion/trunk/subversion/libsvn_ra_serf/commit.c
subversion/trunk/subversion/libsvn_ra_serf/replay.c
subversion/trunk/subversion/libsvn_ra_serf/serf.c
subversion/trunk/subversion/libsvn_ra_serf/update.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/commit.c?rev=982415r1=982414r2=982415view=diff
==
--- subversion/trunk/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/commit.c Wed Aug  4 22:20:30 2010
@@ -748,6 +748,7 @@ create_proppatch_body(void *baton,
 {
   proppatch_context_t *ctx = baton;
   serf_bucket_t *body_bkt;
+  svn_error_t *err;
 
   body_bkt = serf_bucket_aggregate_create(alloc);
 
@@ -764,9 +765,10 @@ create_proppatch_body(void *baton,
   svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, D:set, NULL);
   svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, D:prop, NULL);
 
-  svn_ra_serf__walk_all_props(ctx-changed_props, ctx-path,
-  SVN_INVALID_REVNUM,
-  proppatch_walker, body_bkt, pool);
+  err = svn_ra_serf__walk_all_props(ctx-changed_props, ctx-path,
+SVN_INVALID_REVNUM,
+ proppatch_walker, body_bkt, pool);
+  svn_error_clear(err); /* ### */
 
   svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, D:prop);
   svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, D:set);
@@ -777,9 +779,10 @@ create_proppatch_body(void *baton,
   svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, D:remove, NULL);
   svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, D:prop, NULL);
 
-  svn_ra_serf__walk_all_props(ctx-removed_props, ctx-path,
-  SVN_INVALID_REVNUM,
-  proppatch_walker, body_bkt, pool);
+  err = svn_ra_serf__walk_all_props(ctx-removed_props, ctx-path,
+SVN_INVALID_REVNUM,
+proppatch_walker, body_bkt, pool);
+  svn_error_clear(err); /* ### */
 
   svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, D:prop);
   svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, D:remove);

Modified: subversion/trunk/subversion/libsvn_ra_serf/replay.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/replay.c?rev=982415r1=982414r2=982415view=diff
==
--- subversion/trunk/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/replay.c Wed Aug  4 22:20:30 2010
@@ -183,9 +183,10 @@ start_replay(svn_ra_serf__xml_parser_t *
   /* Create a pool for the commit editor. */
   ctx-dst_rev_pool = svn_pool_create(ctx-src_rev_pool);
   ctx-props = apr_hash_make(ctx-dst_rev_pool);
-  svn_ra_serf__walk_all_props(ctx-revs_props, ctx-report_target,
-  ctx-revision, svn_ra_serf__set_bare_props,
-  ctx-props, ctx-dst_rev_pool);
+  SVN_ERR(svn_ra_serf__walk_all_props(ctx-revs_props, ctx-report_target,
+  ctx-revision,
+  svn_ra_serf__set_bare_props,
+  ctx-props, ctx-dst_rev_pool));
   if (ctx-revstart_func)
 {
   SVN_ERR(ctx-revstart_func(ctx-revision, ctx-replay_baton,

Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=982415r1=982414r2=982415view=diff
==
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Wed Aug  4 22:20:30 2010
@@ -541,8 +541,9 @@ svn_ra_serf__rev_proplist(svn_ra_session
   propfind_path, rev, 0, all_props,
   pool));
 
-  svn_ra_serf__walk_all_props(props, propfind_path, rev,
-  svn_ra_serf__set_bare_props, 

svn commit: r982417 - /subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c

2010-08-04 Thread stefan2
Author: stefan2
Date: Wed Aug  4 22:23:34 2010
New Revision: 982417

URL: http://svn.apache.org/viewvc?rev=982417view=rev
Log:
Instead of using plain APR files, use cached file handles for FSFS
read operations.

* subversion/libsvn_fs_fs/fs_fs.c
  (DEFAULT_FILE_COOKIE, REF_FILE_COOKIE): define file cookies
  (svn_fs_fs__path_rev_absolute): use cache lookup to increase performance
  (sync_file_handle_cache): new utility function
  (open_pack_or_rev_file, open_and_seek_revision, open_and_seek_transaction,
  open_and_seek_representation):
  use cached file handles instead of APR file handles; add / change parameters
  (get_node_revision_body, svn_fs_fs__rev_get_root, svn_fs_fs__paths_changed,
   recover_get_largest_revision, recover_body): implement using file handle 
cache
  (svn_fs_fs__put_node_revision, write_next_ids, svn_fs_fs__set_entry,
   svn_fs_fs__add_change, rep_write_contents_close, svn_fs_fs__set_proplist,
   commit_body, commit_obliteration_body): clear cache after DB modification
  (rep_state): add  cached file handle member
  (create_rep_state_body, read_window, get_contents, 
   svn_fs_fs__get_file_delta_stream): read reps from cached file handles

Modified:
subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c?rev=982417r1=982416r2=982417view=diff
==
--- subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c Wed Aug  4 
22:23:34 2010
@@ -113,6 +113,17 @@
 #define REP_PLAIN  PLAIN
 #define REP_DELTA  DELTA
 
+/* Cookies used to classify cached file handle usage */
+/* Used whenever no other specific region of the rev file is being read. */
+#define DEFAULT_FILE_COOKIE 0
+
+/* Used when reading representation data.
+ * Since this is often interleaved with other reads, use a separate 
+ * cookie (hence a separate file handle) for the reps.  That way, rep
+ * access can often be satisfied from the APR read buffer.  The same
+ * applies to the meta data because it is not rep data. */
+#define REP_FILE_COOKIE 1
+
 /* Notes:
 
 To avoid opening and closing the rev-files all the time, it would
@@ -252,11 +263,18 @@ svn_fs_fs__path_rev_absolute(const char 
 {
   if (! is_packed_rev(fs, rev))
 {
+  fs_fs_data_t *ffd = fs-fsap_data;
   svn_node_kind_t kind;
 
   /* Initialize the return variable. */
   *path = path_rev(fs, rev, pool);
 
+  /* quick check the path. For revs close to HEAD, this will often
+   * be effective (and, hence, efficient). */
+  if (svn_file_handle_cache__has_file(ffd-file_handle_cache, *path))
+return SVN_NO_ERROR;
+
+  /* the expensive standard lookup check */
   SVN_ERR(svn_io_check_path(*path, kind, pool));
   if (kind == svn_node_file)
 {
@@ -644,6 +662,17 @@ with_txn_current_lock(svn_fs_t *fs,
 pool);
 }
 
+/* A frequently used utility method: close all cached, idle file handles.
+ * Call this at the end of write transactions to ensure that successive
+ * reads will see the new file content.
+ */
+static svn_error_t *
+sync_file_handle_cache(svn_fs_t *fs)
+{
+  fs_fs_data_t *ffd = fs-fsap_data;
+  return svn_file_handle_cache__flush(ffd-file_handle_cache);
+}
+
 /* A structure used by unlock_proto_rev() and unlock_proto_rev_body(),
which see. */
 struct unlock_proto_rev_baton
@@ -1780,21 +1809,40 @@ ensure_revision_exists(svn_fs_t *fs,
 /* Open the correct revision file for REV.  If the filesystem FS has
been packed, *FILE will be set to the packed file; otherwise, set *FILE
to the revision file for REV.  Return SVN_ERR_FS_NO_SUCH_REVISION if the
-   file doesn't exist.  Use POOL for allocations. */
+   file doesn't exist.  Move the file pointer of OFFSET, if the latter is
+   not -1.  Prefer cached file handles that share the same COOKIE (again,
+   if not -1).  Use POOL for allocations. */
 static svn_error_t *
-open_pack_or_rev_file(apr_file_t **file,
+open_pack_or_rev_file(svn_file_handle_cache__handle_t **file,
   svn_fs_t *fs,
   svn_revnum_t rev,
+  apr_off_t offset,
+  int cookie,
   apr_pool_t *pool)
 {
   svn_error_t *err;
   const char *path;
 
+  /* make sure file has a defined state */
+  *file = NULL;
   err = svn_fs_fs__path_rev_absolute(path, fs, rev, pool);
 
   if (! err)
-err = svn_io_file_open(file, path,
-   APR_READ | APR_BUFFERED, APR_OS_DEFAULT, pool);
+{
+  /* open the revision file in buffered r/o mode */
+  fs_fs_data_t *ffd = fs-fsap_data;
+  err = svn_file_handle_cache__open(file,
+ffd-file_handle_cache,

svn commit: r982429 - /subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py

2010-08-04 Thread rhuijben
Author: rhuijben
Date: Wed Aug  4 22:51:01 2010
New Revision: 982429

URL: http://svn.apache.org/viewvc?rev=982429view=rev
Log:
* subversion/tests/cmdline/svnrdump_tests.py
  (test_list): Mark skeleton_load XFail for serf and dav. The loader
doesn't drive the commit editor properly yet. (Directories aren't
opened before touching its files. I'm actually surprised ra_local
does work for this test.)

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

Modified: subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py?rev=982429r1=982428r2=982429view=diff
==
--- subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py Wed Aug  4 
22:51:01 2010
@@ -175,8 +175,8 @@ test_list = [ None,
   basic_dump,
   revision_0_dump,
   revision_0_load,
-  Wimp(Need to interpret response 501, skeleton_load,
-   svntest.main.is_ra_type_dav),
+  XFail(XFail(skeleton_load, svntest.main.is_ra_type_dav),
+svntest.main.is_ra_type_svn),
   Wimp(Need to interpret response 501, copy_and_modify_load,
svntest.main.is_ra_type_dav),
   Wimp(Need to fix headers in RA layer, copy_and_modify_dump),