You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/10/25 19:50:28 UTC

svn commit: r1027203 [1/5] - in /subversion/branches/performance: ./ notes/http-and-webdav/ subversion/bindings/ctypes-python/csvn/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_fs/ subversion/libsvn_fs_...

Author: hwright
Date: Mon Oct 25 17:50:25 2010
New Revision: 1027203

URL: http://svn.apache.org/viewvc?rev=1027203&view=rev
Log:
On the performance branch:
Bring up-to-date with trunk.

Added:
    subversion/branches/performance/subversion/libsvn_repos/load-fs-vtable.c
      - copied unchanged from r1027193, subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c
    subversion/branches/performance/subversion/svn/relocate-cmd.c
      - copied unchanged from r1027193, subversion/trunk/subversion/svn/relocate-cmd.c
    subversion/branches/performance/subversion/tests/cmdline/upgrade_tests_data/dirs-only.tar.bz2
      - copied unchanged from r1027193, subversion/trunk/subversion/tests/cmdline/upgrade_tests_data/dirs-only.tar.bz2
    subversion/branches/performance/subversion/tests/libsvn_wc/op-depth-test.c
      - copied unchanged from r1027193, subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/branches/performance/subversion/tests/svn_test_utils.c
      - copied unchanged from r1027193, subversion/trunk/subversion/tests/svn_test_utils.c
    subversion/branches/performance/subversion/tests/svn_test_utils.h
      - copied unchanged from r1027193, subversion/trunk/subversion/tests/svn_test_utils.h
Modified:
    subversion/branches/performance/   (props changed)
    subversion/branches/performance/COMMITTERS
    subversion/branches/performance/build.conf
    subversion/branches/performance/notes/http-and-webdav/webdav-usage.html
    subversion/branches/performance/subversion/bindings/ctypes-python/csvn/repos.py
    subversion/branches/performance/subversion/bindings/ctypes-python/csvn/wc.py
    subversion/branches/performance/subversion/include/private/svn_file_handle_cache.h   (props changed)
    subversion/branches/performance/subversion/include/private/svn_temp_serializer.h   (props changed)
    subversion/branches/performance/subversion/include/svn_io.h
    subversion/branches/performance/subversion/include/svn_opt.h
    subversion/branches/performance/subversion/include/svn_ra.h
    subversion/branches/performance/subversion/include/svn_wc.h
    subversion/branches/performance/subversion/libsvn_client/copy.c
    subversion/branches/performance/subversion/libsvn_client/merge.c
    subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.h
    subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c   (props changed)
    subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.h   (props changed)
    subversion/branches/performance/subversion/libsvn_fs_util/caching.c   (props changed)
    subversion/branches/performance/subversion/libsvn_repos/load.c
    subversion/branches/performance/subversion/libsvn_subr/config_file.c
    subversion/branches/performance/subversion/libsvn_subr/config_impl.h
    subversion/branches/performance/subversion/libsvn_subr/io.c
    subversion/branches/performance/subversion/libsvn_subr/opt.c
    subversion/branches/performance/subversion/libsvn_subr/svn_file_handle_cache.c   (props changed)
    subversion/branches/performance/subversion/libsvn_subr/svn_temp_serializer.c   (props changed)
    subversion/branches/performance/subversion/libsvn_wc/adm_ops.c
    subversion/branches/performance/subversion/libsvn_wc/conflicts.c
    subversion/branches/performance/subversion/libsvn_wc/copy.c
    subversion/branches/performance/subversion/libsvn_wc/props.c
    subversion/branches/performance/subversion/libsvn_wc/relocate.c
    subversion/branches/performance/subversion/libsvn_wc/status.c
    subversion/branches/performance/subversion/libsvn_wc/translate.c
    subversion/branches/performance/subversion/libsvn_wc/update_editor.c
    subversion/branches/performance/subversion/libsvn_wc/upgrade.c
    subversion/branches/performance/subversion/libsvn_wc/wc-queries.sql
    subversion/branches/performance/subversion/libsvn_wc/wc_db.c
    subversion/branches/performance/subversion/libsvn_wc/wc_db.h
    subversion/branches/performance/subversion/libsvn_wc/workqueue.c
    subversion/branches/performance/subversion/libsvn_wc/workqueue.h
    subversion/branches/performance/subversion/svn/cl.h
    subversion/branches/performance/subversion/svn/main.c
    subversion/branches/performance/subversion/tests/cmdline/basic_tests.py
    subversion/branches/performance/subversion/tests/cmdline/copy_tests.py
    subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout
    subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
    subversion/branches/performance/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout
    subversion/branches/performance/subversion/tests/cmdline/lock_tests.py
    subversion/branches/performance/subversion/tests/cmdline/merge_tests.py
    subversion/branches/performance/subversion/tests/cmdline/patch_tests.py
    subversion/branches/performance/subversion/tests/cmdline/prop_tests.py
    subversion/branches/performance/subversion/tests/cmdline/revert_tests.py
    subversion/branches/performance/subversion/tests/cmdline/svntest/main.py
    subversion/branches/performance/subversion/tests/cmdline/switch_tests.py
    subversion/branches/performance/subversion/tests/cmdline/upgrade_tests.py
    subversion/branches/performance/subversion/tests/libsvn_diff/parse-diff-test.c
    subversion/branches/performance/subversion/tests/libsvn_wc/   (props changed)
    subversion/branches/performance/subversion/tests/libsvn_wc/db-test.c
    subversion/branches/performance/subversion/tests/libsvn_wc/entries-compat.c
    subversion/branches/performance/subversion/tests/libsvn_wc/pristine-store-test.c
    subversion/branches/performance/subversion/tests/svn_test_main.c
    subversion/branches/performance/tools/dev/wc-format.py
    subversion/branches/performance/tools/diff/diff.c
    subversion/branches/performance/tools/diff/diff3.c
    subversion/branches/performance/tools/diff/diff4.c

Propchange: subversion/branches/performance/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 25 17:50:25 2010
@@ -37,4 +37,4 @@
 /subversion/branches/tc_url_rev:874351-874483
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:962911-1022694
+/subversion/trunk:962911-1027198

Modified: subversion/branches/performance/COMMITTERS
URL: http://svn.apache.org/viewvc/subversion/branches/performance/COMMITTERS?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/COMMITTERS [UTF-8] (original)
+++ subversion/branches/performance/COMMITTERS [UTF-8] Mon Oct 25 17:50:25 2010
@@ -49,7 +49,7 @@ Blanket commit access:
       danielsh   Daniel Shahaf <d....@daniel.shahaf.name>
         peters   Peter Samuelson <pe...@p12n.org>
       rhuijben   Bert Huijben <rh...@collab.net>
-      stylesen   Senthil Kumaran S <se...@collab.net>
+      stylesen   Senthil Kumaran S <st...@gmail.com>
      steveking   Stefan Küng <to...@gmail.com>
          neels   Neels J. Hofmeyr <ne...@elego.de>
      jwhitlock   Jeremy Whitlock <jc...@gmail.com>

Modified: subversion/branches/performance/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/performance/build.conf?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/build.conf (original)
+++ subversion/branches/performance/build.conf Mon Oct 25 17:50:25 2010
@@ -615,7 +615,7 @@ link-cmd = $(LINK_JAVAHL_CXX)
 type = lib
 path = subversion/tests
 install = test
-libs = libsvn_repos libsvn_fs libsvn_delta libsvn_subr aprutil apriconv apr
+libs = libsvn_client libsvn_repos libsvn_fs libsvn_delta libsvn_subr aprutil apriconv apr
 msvc-static = yes
 undefined-lib-symbols = yes
 
@@ -958,6 +958,14 @@ sources = entries-compat.c
 install = test
 libs = libsvn_test libsvn_wc libsvn_subr apriconv apr
 
+[op-depth-test]
+description = Test the main WC API functions
+type = exe
+path = subversion/tests/libsvn_wc
+sources = op-depth-test.c
+install = test
+libs = libsvn_client libsvn_test libsvn_wc libsvn_subr apriconv apr
+
 # ----------------------------------------------------------------------------
 # These are not unit tests at all, they are small programs that exercise
 # parts of the libsvn_delta API from the command line.  They are stuck here
@@ -1103,7 +1111,7 @@ libs = __ALL__
        entries-dump atomic-ra-revprop-change
        diff-test diff3-test diff4-test
        client-test
-       tree-conflict-data-test db-test pristine-store-test entries-compat-test
+       tree-conflict-data-test db-test pristine-store-test entries-compat-test op-depth-test
        dirent_uri-test
        auth-test
        parse-diff-test

Modified: subversion/branches/performance/notes/http-and-webdav/webdav-usage.html
URL: http://svn.apache.org/viewvc/subversion/branches/performance/notes/http-and-webdav/webdav-usage.html?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/notes/http-and-webdav/webdav-usage.html (original)
+++ subversion/branches/performance/notes/http-and-webdav/webdav-usage.html Mon Oct 25 17:50:25 2010
@@ -19,7 +19,7 @@
 
     <p>
       This document details how WebDAV is used within the
-      <a href="http://subversion.tigris.org/">Subversion
+      <a href="http://subversion.apache.org/">Subversion
       product</a>. Specifically, how the client side interfaces with
       <a href="http://www.webdav.org/neon/">Neon</a> to generate
       WebDAV requests over the wire, and what the
@@ -31,7 +31,7 @@
     </p>
     <p>
       This document heavily refers to the
-      <a href="http://subversion.tigris.org/files/documents/15/17/svn-design.html">Subversion
+      <a href="http://svn.apache.org/repos/asf/subversion/trunk/notes/subversion-design.html">Subversion
 	design document</a> and the
       <a href="http://www.webdav.org/deltav/">latest Delta-V protocol
 	draft</a>. Details of those documents will <em>not</em> be

Modified: subversion/branches/performance/subversion/bindings/ctypes-python/csvn/repos.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/ctypes-python/csvn/repos.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/bindings/ctypes-python/csvn/repos.py (original)
+++ subversion/branches/performance/subversion/bindings/ctypes-python/csvn/repos.py Mon Oct 25 17:50:25 2010
@@ -324,7 +324,7 @@ class RemoteRepository(object):
     def set_log_func(self, log_func):
         """Register a callback to get a log message for commit and
         commit-like operations. LOG_FUNC should take an array as an argument,
-        which holds the files to be commited. It should return a list of the
+        which holds the files to be committed. It should return a list of the
         form [LOG, FILE] where LOG is a log message and FILE is the temporary
         file, if one was created instead of a log message. If LOG is None,
         the operation will be canceled and FILE will be treated as the
@@ -408,7 +408,7 @@ class LocalRepository(object):
           ... absent, then we return svn_node_none.
           ... a regular file, then we return svn_node_file.
           ... a directory, then we return svn_node_dir
-          ... unknown, then we return svn_node_unknowna
+          ... unknown, then we return svn_node_unknown
         """
         assert(not encoded)
         root = self.fs.root(rev=rev, pool=self.iterpool)

Modified: subversion/branches/performance/subversion/bindings/ctypes-python/csvn/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/bindings/ctypes-python/csvn/wc.py?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/bindings/ctypes-python/csvn/wc.py (original)
+++ subversion/branches/performance/subversion/bindings/ctypes-python/csvn/wc.py Mon Oct 25 17:50:25 2010
@@ -30,8 +30,8 @@ class WC(object):
 
         Keyword arguments:
         path -- path to the working copy (default current working directory)
-        user -- object implementingthe user interface representing the user
-            performing the operatio (defaults to an instance of the User class)
+        user -- object implementing the user interface representing the user
+            performing the operation (defaults to an instance of the User class)
         """
         if user is None:
             user = User()
@@ -238,7 +238,7 @@ class WC(object):
     def set_progress_func(self, progress_func):
         """Setup a callback for network progress information.
 
-        This callback should accept two intergers, being the number of bytes
+        This callback should accept two integers, being the number of bytes
         sent and the number of bytes to send.
 
         Keyword arguments:
@@ -428,7 +428,7 @@ class WC(object):
         return props
 
     def propget(self, propname, target="", recurse=True):
-        """Get the the value of propname for target.
+        """Get the value of propname for target.
 
         Returns a hash the keys of which are file paths and the values are the
         value of PROPNAME for the corresponding file. The values of the hash
@@ -477,7 +477,7 @@ class WC(object):
         """Get the status on path using callback to status.
 
         The status callback (which can be set when this method is called or
-        earlier) wil be called for each item.
+        earlier) will be called for each item.
 
         Keyword arguments:
         path -- items to get status for (defaults to WC root)
@@ -585,8 +585,8 @@ class WC(object):
         """Register a callback to get a log message for commit and commit-like
         operations.
 
-        LOG_FUNC should take an array as an argument,vwhich holds the files to
-        be commited. It should return a list of thevform [LOG, FILE] where LOG
+        LOG_FUNC should take an array as an argument, which holds the files to
+        be committed. It should return a list of the form [LOG, FILE] where LOG
         is a log message and FILE is the temporary file, if one was created
         instead of a log message. If LOG is None, the operation will be
         canceled and FILE will be treated as the temporary file holding the
@@ -615,9 +615,9 @@ class WC(object):
         """Commit changes in the working copy.
 
         Keyword arguments:
-        paths -- list of paths that should be commited (defaults to WC root)
+        paths -- list of paths that should be committed (defaults to WC root)
         recurse -- if True, the contents of directories to be committed will
-            also be commited (default True)
+            also be committed (default True)
         keep_locks -- if True, locks will not be released during commit
             (default False)"""
         commit_info = POINTER(svn_commit_info_t)()
@@ -702,9 +702,9 @@ class WC(object):
         self.iterpool.clear()
 
     def relocate(self, from_url, to_url, dir="", recurse=True):
-        """Modify a working copy directory, changing repository URLs. that begin with FROM_URL to begin with
-        TO_URL instead, recursing into subdirectories if RECURSE is True
-        (True by default).
+        """Modify a working copy directory, changing repository URLs that begin
+        with FROM_URL to begin with TO_URL instead, recursing into
+        subdirectories if RECURSE is True (True by default).
 
         Keyword arguments:
         from_url -- url to be replaced, if this url is matched at the beginning

Propchange: subversion/branches/performance/subversion/include/private/svn_file_handle_cache.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 25 17:50:25 2010
@@ -1 +1 @@
-/subversion/trunk/subversion/include/private/svn_file_handle_cache.h:962911-1022694
+/subversion/trunk/subversion/include/private/svn_file_handle_cache.h:962911-1027198

Propchange: subversion/branches/performance/subversion/include/private/svn_temp_serializer.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 25 17:50:25 2010
@@ -1 +1 @@
-/subversion/trunk/subversion/include/private/svn_temp_serializer.h:962911-1022694
+/subversion/trunk/subversion/include/private/svn_temp_serializer.h:962911-1027198

Modified: subversion/branches/performance/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_io.h?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/include/svn_io.h (original)
+++ subversion/branches/performance/subversion/include/svn_io.h Mon Oct 25 17:50:25 2010
@@ -1362,13 +1362,15 @@ svn_stringbuf_from_aprfile(svn_stringbuf
  * converting any error to a Subversion error. If @a ignore_enoent is TRUE, and
  * the file is not present (APR_STATUS_IS_ENOENT returns TRUE), then no
  * error will be returned.
+ *
+ * @since New in 1.7.
  */
 svn_error_t *
 svn_io_remove_file2(const char *path,
-                   svn_boolean_t ignore_enoent,
-                   apr_pool_t *scratch_pool);
+                    svn_boolean_t ignore_enoent,
+                    apr_pool_t *scratch_pool);
 
-/** Similar to svn_io_remove_file2(), except with @a missing_ok set to FALSE.
+/** Similar to svn_io_remove_file2(), except with @a ignore_enoent set to FALSE.
  *
  * @deprecated Provided for backwards compatibility with the 1.6 API.
  */

Modified: subversion/branches/performance/subversion/include/svn_opt.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_opt.h?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/include/svn_opt.h (original)
+++ subversion/branches/performance/subversion/include/svn_opt.h Mon Oct 25 17:50:25 2010
@@ -292,6 +292,11 @@ svn_opt_format_option(const char **strin
  * command name or an alias.  ### @todo Why does this only print to
  * @c stdout, whereas svn_opt_print_generic_help() gives us a choice?
  *
+ * When printing the description of an option, if the same option code
+ * appears a second time in @a options_table with a different name, then
+ * use that second name as an alias for the first name.  This additional
+ * behaviour is new in 1.7.
+ *
  * @since New in 1.5.
  */
 void

Modified: subversion/branches/performance/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_ra.h?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/include/svn_ra.h (original)
+++ subversion/branches/performance/subversion/include/svn_ra.h Mon Oct 25 17:50:25 2010
@@ -682,6 +682,8 @@ svn_ra_reparent(svn_ra_session_t *ra_ses
 
 /** Set @a *url to the repository URL to which @a ra_session was
  * opened or most recently reparented.
+ *
+ * @since New in 1.5.
  */
 svn_error_t *
 svn_ra_get_session_url(svn_ra_session_t *ra_session,

Modified: subversion/branches/performance/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_wc.h?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/include/svn_wc.h (original)
+++ subversion/branches/performance/subversion/include/svn_wc.h Mon Oct 25 17:50:25 2010
@@ -6633,9 +6633,10 @@ typedef svn_error_t *(*svn_wc_relocation
 
 /** Recursively change repository references at @a wcroot_abspath
  * (which is the root directory of a working copy).  The pre-change
- * URL should be @a from, and the post-change URL will be @a to.  @a
- * validator (and its baton, @a validator_baton), will be called for
- * the newly generated base URL and calculated repo root.
+ * URL should begin with @a from, and the post-change URL will begin
+ * with @a to.  @a validator (and its baton, @a validator_baton), will
+ * be called for the newly generated base URL and calculated repo
+ * root.
  *
  * @a wc_ctx is an working copy context.
  *

Modified: subversion/branches/performance/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/copy.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/copy.c Mon Oct 25 17:50:25 2010
@@ -300,7 +300,7 @@ do_wc_to_wc_copies(const apr_array_heade
   const char *dst_parent, *dst_parent_abspath;
   struct do_wc_to_wc_copies_with_write_lock_baton baton;
 
-  get_copy_pair_ancestors(copy_pairs, NULL, &dst_parent, NULL, pool);
+  SVN_ERR(get_copy_pair_ancestors(copy_pairs, NULL, &dst_parent, NULL, pool));
   if (copy_pairs->nelts == 1)
     dst_parent = svn_dirent_dirname(dst_parent, pool);
 
@@ -821,7 +821,8 @@ repos_to_repos_copy(const apr_array_head
      *and* destinations might be an optimization when the user is
      authorized to access all that stuff, but could cause the
      operation to fail altogether otherwise.  See issue #3242.  */
-  get_copy_pair_ancestors(copy_pairs, NULL, &top_url_dst, &top_url_all, pool);
+  SVN_ERR(get_copy_pair_ancestors(copy_pairs, NULL, &top_url_dst, &top_url_all, 
+                                  pool));
   top_url = is_move ? top_url_all : top_url_dst;
 
   /* Check each src/dst pair for resurrection, and verify that TOP_URL
@@ -1168,7 +1169,7 @@ wc_to_repos_copy(const apr_array_header_
   int i;
 
   /* Find the common root of all the source paths */
-  get_copy_pair_ancestors(copy_pairs, &top_src_path, NULL, NULL, pool);
+  SVN_ERR(get_copy_pair_ancestors(copy_pairs, &top_src_path, NULL, NULL, pool));
 
   /* Do we need to lock the working copy?  1.6 didn't take a write
      lock, but what happens if the working copy changes during the copy
@@ -1731,7 +1732,8 @@ repos_to_wc_copy(const apr_array_header_
       pair->src_abspath_or_url = apr_pstrdup(pool, src);
     }
 
-  get_copy_pair_ancestors(copy_pairs, &top_src_url, &top_dst_path, NULL, pool);
+  SVN_ERR(get_copy_pair_ancestors(copy_pairs, &top_src_url, &top_dst_path,
+                                  NULL, pool));
   lock_abspath = top_dst_path;
   if (copy_pairs->nelts == 1)
     {

Modified: subversion/branches/performance/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/merge.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/merge.c Mon Oct 25 17:50:25 2010
@@ -8190,6 +8190,33 @@ do_directory_merge(svn_mergeinfo_catalog
               svn_revnum_t next_end_rev;
               const char *real_url1 = url1, *real_url2 = url2;
               const char *old_sess1_url = NULL, *old_sess2_url = NULL;
+              svn_merge_range_t *first_target_range = APR_ARRAY_IDX(
+                target_merge_path->remaining_ranges, 0, svn_merge_range_t *);
+
+              /* Issue #3324: Stop editor abuse!  Don't call
+                 drive_merge_report_editor() in such a way that we request an
+                 editor with svn_client__get_diff_editor() for some rev X,
+                 then call svn_ra_do_diff3() for some revision Y, and then
+                 call reporter->set_path(PATH=="") to set the root revision
+                 for the editor drive to revision Z where
+                 (X != Z && X < Z < Y).  This is bogus because the server will
+                 send us the diff between X:Y but the client is expecting the
+                 diff between Y:Z.  See issue #3324 for full details on the
+                 problems this can cause. */
+              if (first_target_range
+                  && start_rev != first_target_range->start)
+                {
+                  if (is_rollback)
+                    {
+                      if (end_rev < first_target_range->start)
+                        end_rev = first_target_range->start;
+                    }
+                  else
+                    {
+                      if (end_rev > first_target_range->start)
+                        end_rev = first_target_range->start;
+                    }
+                }
 
               svn_pool_clear(iterpool);
 

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=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c Mon Oct 25 17:50:25 2010
@@ -1244,6 +1244,28 @@ update_min_unpacked_revprop(svn_fs_t *fs
                                pool);
 }
 
+/* Create a new SQLite database for storing the revprops in filesystem FS.
+ * Leave the DB open and set *SDB to its handle.  Also create the "min
+ * unpacked revprop" file. */
+static svn_error_t *
+create_packed_revprops_db(svn_sqlite__db_t **sdb,
+                          svn_fs_t *fs,
+                          apr_pool_t *result_pool,
+                          apr_pool_t *scratch_pool)
+{
+  SVN_ERR(svn_io_file_create(path_min_unpacked_revprop(fs, scratch_pool),
+                             "0\n", scratch_pool));
+  SVN_ERR(svn_sqlite__open(sdb,
+                           svn_dirent_join_many(scratch_pool, fs->path,
+                                                PATH_REVPROPS_DIR,
+                                                PATH_REVPROPS_DB,
+                                                NULL),
+                           svn_sqlite__mode_rwcreate, statements,
+                           0, NULL, result_pool, scratch_pool));
+  SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_SCHEMA));
+  return SVN_NO_ERROR;
+}
+
 static svn_error_t *
 get_youngest(svn_revnum_t *youngest_p, const char *fs_path, apr_pool_t *pool);
 
@@ -1381,19 +1403,7 @@ upgrade_body(void *baton, apr_pool_t *po
      and create the database. */
   if (format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
     {
-      SVN_ERR(svn_io_file_create(path_min_unpacked_revprop(fs, pool), "0\n",
-                                 pool));
-
-      SVN_ERR(svn_sqlite__open(&ffd->revprop_db, svn_dirent_join_many(
-                                                          pool, fs->path,
-                                                          PATH_REVPROPS_DIR,
-                                                          PATH_REVPROPS_DB,
-                                                          NULL),
-                               svn_sqlite__mode_rwcreate, statements,
-                               0, NULL,
-                               fs->pool, pool));
-      SVN_ERR(svn_sqlite__exec_statements(ffd->revprop_db,
-                                          STMT_CREATE_SCHEMA));
+      SVN_ERR(create_packed_revprops_db(&ffd->revprop_db, fs, fs->pool, pool));
     }
 
   /* Bump the format file. */
@@ -6835,6 +6845,7 @@ svn_fs_fs__create(svn_fs_t *fs,
                                                         pool),
                                         pool));
 
+  /* Create the revprops directory. */
   if (ffd->max_files_per_dir)
     SVN_ERR(svn_io_make_dir_recursively(path_revprops_shard(fs, 0, pool),
                                         pool));
@@ -6844,21 +6855,10 @@ svn_fs_fs__create(svn_fs_t *fs,
                                                         pool),
                                         pool));
 
-  /* Create the revprops directory. */
+  /* Write the min unpacked revprop file, and create the database. */
   if (format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
     {
-      SVN_ERR(svn_io_file_create(path_min_unpacked_revprop(fs, pool), "0\n",
-                                 pool));
-      SVN_ERR(svn_sqlite__open(&ffd->revprop_db, svn_dirent_join_many(
-                                                    pool, path,
-                                                    PATH_REVPROPS_DIR,
-                                                    PATH_REVPROPS_DB,
-                                                    NULL),
-                               svn_sqlite__mode_rwcreate, statements,
-                               0, NULL,
-                               fs->pool, pool));
-      SVN_ERR(svn_sqlite__exec_statements(ffd->revprop_db,
-                                          STMT_CREATE_SCHEMA));
+      SVN_ERR(create_packed_revprops_db(&ffd->revprop_db, fs, fs->pool, pool));
     }
 
   /* Create the transaction directory. */

Modified: subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.h?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.h Mon Oct 25 17:50:25 2010
@@ -26,7 +26,10 @@
 #include "fs.h"
 
 /* Open the fsfs filesystem pointed to by PATH and associate it with
-   filesystem object FS.  Use POOL for temporary allocations. */
+   filesystem object FS.  Use POOL for temporary allocations.
+
+   ### Some parts of *FS must have been initialized beforehand; some parts
+       (including FS->path) are initialized by this function. */
 svn_error_t *svn_fs_fs__open(svn_fs_t *fs,
                              const char *path,
                              apr_pool_t *pool);
@@ -334,7 +337,10 @@ svn_error_t *svn_fs_fs__reserve_copy_id(
                                         apr_pool_t *pool);
 
 /* Create a fs_fs fileysystem referenced by FS at path PATH.  Get any
-   temporary allocations from POOL. */
+   temporary allocations from POOL.
+
+   ### Some parts of *FS must have been initialized beforehand; some parts
+       (including FS->path) are initialized by this function. */
 svn_error_t *svn_fs_fs__create(svn_fs_t *fs,
                                const char *path,
                                apr_pool_t *pool);

Propchange: subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 25 17:50:25 2010
@@ -1 +1 @@
-/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c:962911-1022694
+/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c:962911-1027198

Propchange: subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 25 17:50:25 2010
@@ -34,4 +34,4 @@
 /subversion/branches/tc_url_rev/subversion/libsvn_fs_fs/fs_fs.h:874351-874483
 /subversion/branches/tree-conflicts/subversion/libsvn_fs_fs/fs_fs.h:868291-873154
 /subversion/branches/tree-conflicts-notify/subversion/libsvn_fs_fs/fs_fs.h:873926-874008
-/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h:962911-1022694
+/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h:962911-1027198

Propchange: subversion/branches/performance/subversion/libsvn_fs_util/caching.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 25 17:50:25 2010
@@ -34,4 +34,4 @@
 /subversion/branches/tc_url_rev/subversion/libsvn_fs/caching.c:874351-874483
 /subversion/branches/tree-conflicts/subversion/libsvn_fs/caching.c:868291-873154
 /subversion/branches/tree-conflicts-notify/subversion/libsvn_fs/caching.c:873926-874008
-/subversion/trunk/subversion/libsvn_fs_util/caching.c:962911-1022694
+/subversion/trunk/subversion/libsvn_fs_util/caching.c:962911-1027198

Modified: subversion/branches/performance/subversion/libsvn_repos/load.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_repos/load.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_repos/load.c (original)
+++ subversion/branches/performance/subversion/libsvn_repos/load.c Mon Oct 25 17:50:25 2010
@@ -43,73 +43,6 @@
 
 /*----------------------------------------------------------------------*/
 
-/** Batons used herein **/
-
-struct parse_baton
-{
-  svn_repos_t *repos;
-  svn_fs_t *fs;
-
-  svn_boolean_t use_history;
-  svn_boolean_t use_pre_commit_hook;
-  svn_boolean_t use_post_commit_hook;
-  enum svn_repos_load_uuid uuid_action;
-  const char *parent_dir;
-  svn_repos_notify_func_t notify_func;
-  void *notify_baton;
-  svn_repos_notify_t *notify;
-  apr_pool_t *pool;
-
-  /* A hash mapping copy-from revisions and mergeinfo range revisions
-     (svn_revnum_t *) in the dump stream to their corresponding revisions
-     (svn_revnum_t *) in the loaded repository.  The hash and its
-     contents are allocated in POOL. */
-  apr_hash_t *rev_map;
-
-  /* The most recent (youngest) revision from the dump stream mapped in
-     REV_MAP.  If no revisions have been mapped yet, this is set to
-     SVN_INVALID_REVNUM. */
-  svn_revnum_t last_rev_mapped;
-
-  /* The oldest old revision loaded from the dump stream.  If no revisions
-     have been loaded yet, this is set to SVN_INVALID_REVNUM. */
-  svn_revnum_t oldest_old_rev;
-};
-
-struct revision_baton
-{
-  svn_revnum_t rev;
-
-  svn_fs_txn_t *txn;
-  svn_fs_root_t *txn_root;
-
-  const svn_string_t *datestamp;
-
-  apr_int32_t rev_offset;
-
-  struct parse_baton *pb;
-  apr_pool_t *pool;
-};
-
-struct node_baton
-{
-  const char *path;
-  svn_node_kind_t kind;
-  enum svn_node_action action;
-  svn_checksum_t *base_checksum;        /* null, if not available */
-  svn_checksum_t *result_checksum;      /* null, if not available */
-  svn_checksum_t *copy_source_checksum; /* null, if not available */
-
-  svn_revnum_t copyfrom_rev;
-  const char *copyfrom_path;
-
-  struct revision_baton *rb;
-  apr_pool_t *pool;
-};
-
-
-/*----------------------------------------------------------------------*/
-
 /** The parser and related helper funcs **/
 
 
@@ -236,170 +169,6 @@ read_key_or_val(char **pbuf,
 }
 
 
-/* Prepend the mergeinfo source paths in MERGEINFO_ORIG with PARENT_DIR, and
-   return it in *MERGEINFO_VAL. */
-static svn_error_t *
-prefix_mergeinfo_paths(svn_string_t **mergeinfo_val,
-                       const svn_string_t *mergeinfo_orig,
-                       const char *parent_dir,
-                       apr_pool_t *pool)
-{
-  apr_hash_t *prefixed_mergeinfo, *mergeinfo;
-  apr_hash_index_t *hi;
-  void *rangelist;
-
-  SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mergeinfo_orig->data, pool));
-  prefixed_mergeinfo = apr_hash_make(pool);
-  for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
-    {
-      const void *key;
-      const char *path, *merge_source;
-
-      apr_hash_this(hi, &key, NULL, &rangelist);
-      merge_source = key;
-
-      /* The svn:mergeinfo property syntax demands absolute repository
-         paths, so prepend a leading slash if PARENT_DIR lacks one.  */
-      if (*parent_dir != '/')
-        path = svn_path_join_many(pool, "/", parent_dir,
-                                  merge_source + 1, NULL);
-      else
-        path = svn_path_join(parent_dir, merge_source + 1, pool);
-
-      apr_hash_set(prefixed_mergeinfo, path, APR_HASH_KEY_STRING, rangelist);
-    }
-  return svn_mergeinfo_to_string(mergeinfo_val, prefixed_mergeinfo, pool);
-}
-
-
-/* Examine the mergeinfo in INITIAL_VAL, renumber revisions in rangelists
-   as appropriate, and return the (possibly new) mergeinfo in *FINAL_VAL
-   (allocated from POOL). */
-static svn_error_t *
-renumber_mergeinfo_revs(svn_string_t **final_val,
-                        const svn_string_t *initial_val,
-                        struct revision_baton *rb,
-                        apr_pool_t *pool)
-{
-  apr_pool_t *subpool = svn_pool_create(pool);
-  svn_mergeinfo_t mergeinfo, predates_stream_mergeinfo;
-  svn_mergeinfo_t final_mergeinfo = apr_hash_make(subpool);
-  apr_hash_index_t *hi;
-
-  SVN_ERR(svn_mergeinfo_parse(&mergeinfo, initial_val->data, subpool));
-
-  /* Issue #3020
-     http://subversion.tigris.org/issues/show_bug.cgi?id=3020#desc16
-     Remove mergeinfo older than the oldest revision in the dump stream
-     and adjust its revisions by the difference between the head rev of
-     the target repository and the current dump stream rev. */
-  if (rb->pb->oldest_old_rev > 1)
-    {
-      SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
-        &predates_stream_mergeinfo, mergeinfo,
-        rb->pb->oldest_old_rev - 1, 0,
-        TRUE, subpool, subpool));
-      SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
-        &mergeinfo, mergeinfo,
-        rb->pb->oldest_old_rev - 1, 0,
-        FALSE, subpool, subpool));
-      SVN_ERR(svn_mergeinfo__adjust_mergeinfo_rangelists(
-        &predates_stream_mergeinfo, predates_stream_mergeinfo,
-        -rb->rev_offset, subpool, subpool));
-    }
-  else
-    {
-      predates_stream_mergeinfo = NULL;
-    }
-
-  for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))
-    {
-      const char *merge_source;
-      apr_array_header_t *rangelist;
-      struct parse_baton *pb = rb->pb;
-      int i;
-      const void *key;
-      void *val;
-
-      apr_hash_this(hi, &key, NULL, &val);
-      merge_source = key;
-      rangelist = val;
-
-      /* Possibly renumber revisions in merge source's rangelist. */
-      for (i = 0; i < rangelist->nelts; i++)
-        {
-          svn_revnum_t *rev_from_map;
-          svn_merge_range_t *range = APR_ARRAY_IDX(rangelist, i,
-                                                   svn_merge_range_t *);
-          rev_from_map = apr_hash_get(pb->rev_map, &range->start,
-                                      sizeof(svn_revnum_t));
-          if (rev_from_map && SVN_IS_VALID_REVNUM(*rev_from_map))
-            {
-              range->start = *rev_from_map;
-            }
-          else if (range->start == pb->oldest_old_rev - 1)
-            {
-              /* Since the start revision of svn_merge_range_t are not
-                 inclusive there is one possible valid start revision that
-                 won't be found in the PB->REV_MAP mapping of load stream
-                 revsions to loaded revisions: The revision immediately
-                 preceeding the oldest revision from the load stream.
-                 This is a valid revision for mergeinfo, but not a valid
-                 copy from revision (which PB->REV_MAP also maps for) so it
-                 will never be in the mapping.
-
-                 If that is what we have here, then find the mapping for the
-                 oldest rev from the load stream and subtract 1 to get the
-                 renumbered, non-inclusive, start revision. */
-              rev_from_map = apr_hash_get(pb->rev_map, &pb->oldest_old_rev,
-                                          sizeof(svn_revnum_t));
-              if (rev_from_map && SVN_IS_VALID_REVNUM(*rev_from_map))
-                range->start = *rev_from_map - 1;
-            }
-          else
-            {
-              /* If we can't remap the start revision then don't even bother
-                 trying to remap the end revision.  It's possible we might
-                 actually succeed at the latter, which can result in invalid
-                 mergeinfo with a start rev > end rev.  If that gets into the
-                 repository then a world of bustage breaks loose anytime that
-                 bogus mergeinfo is parsed.  See
-                 http://subversion.tigris.org/issues/show_bug.cgi?id=3020#desc16.
-                 */
-              continue;
-            }
-
-          rev_from_map = apr_hash_get(pb->rev_map, &range->end,
-                                      sizeof(svn_revnum_t));
-          if (rev_from_map && SVN_IS_VALID_REVNUM(*rev_from_map))
-            range->end = *rev_from_map;
-        }
-      apr_hash_set(final_mergeinfo, merge_source,
-                   APR_HASH_KEY_STRING, rangelist);
-    }
-
-  if (predates_stream_mergeinfo)
-      SVN_ERR(svn_mergeinfo_merge(final_mergeinfo, predates_stream_mergeinfo,
-                                  subpool));
-
-  SVN_ERR(svn_mergeinfo_sort(final_mergeinfo, subpool));
-
-  /* Mergeinfo revision sources for r0 and r1 are invalid; you can't merge r0
-     or r1.  However, svndumpfilter can be abused to produce r1 merge source
-     revs.  So if we encounter any, then strip them out, no need to put them
-     into the load target. */
-  SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(&final_mergeinfo,
-                                                    final_mergeinfo,
-                                                    1, 0, FALSE,
-                                                    subpool, subpool));
-
-  SVN_ERR(svn_mergeinfo_to_string(final_val, final_mergeinfo, pool));
-  svn_pool_destroy(subpool);
-
-  return SVN_NO_ERROR;
-}
-
-
 /* Read CONTENT_LENGTH bytes from STREAM, parsing the bytes as an
    encoded Subversion properties hash, and making multiple calls to
    PARSE_FNS->set_*_property on RECORD_BATON (depending on the value
@@ -480,38 +249,6 @@ parse_property_block(svn_stream_t *strea
               /* Now, send the property pair to the vtable! */
               if (is_node)
                 {
-                  /* svn_mergeinfo_parse() in parse_fns->set_node_property()
-                     will choke on mergeinfo with "\r\n" line endings, but we
-                     might legitimately encounter these in a dump stream.  If
-                     so normalize the line endings to '\n' and make a
-                     notification to PARSE_BATON->FEEDBACK_STREAM that we
-                     have made this correction. */
-                  if (strcmp(keybuf, SVN_PROP_MERGEINFO) == 0
-                      && strstr(propstring.data, "\r"))
-                    {
-                      const char *prop_eol_normalized;
-                      struct parse_baton *pb = parse_baton;
-
-                      SVN_ERR(svn_subst_translate_cstring2(
-                        propstring.data,
-                        &prop_eol_normalized,
-                        "\n",  /* translate to LF */
-                        FALSE, /* no repair */
-                        NULL,  /* no keywords */
-                        FALSE, /* no expansion */
-                        proppool));
-                      propstring.data = prop_eol_normalized;
-                      propstring.len = strlen(prop_eol_normalized);
-
-                      if (pb->notify_func)
-                        {
-                          pb->notify->action = 
-                            svn_repos_notify_load_normalized_mergeinfo;
-                          pb->notify_func(pb->notify_baton, pb->notify,
-                                          proppool);
-                        }
-                    }
-
                   SVN_ERR(parse_fns->set_node_property(record_baton,
                                                        keybuf,
                                                        &propstring));
@@ -663,7 +400,10 @@ parse_format_version(const char *version
 
 
 
-/* The Main Parser Logic */
+/*----------------------------------------------------------------------*/
+
+/** The public routines **/
+
 svn_error_t *
 svn_repos_parse_dumpstream2(svn_stream_t *stream,
                             const svn_repos_parse_fns2_t *parse_fns,
@@ -952,662 +692,3 @@ svn_repos_parse_dumpstream2(svn_stream_t
   svn_pool_destroy(nodepool);
   return SVN_NO_ERROR;
 }
-
-
-/*----------------------------------------------------------------------*/
-
-/** vtable for doing commits to a fs **/
-
-
-static struct node_baton *
-make_node_baton(apr_hash_t *headers,
-                struct revision_baton *rb,
-                apr_pool_t *pool)
-{
-  struct node_baton *nb = apr_pcalloc(pool, sizeof(*nb));
-  const char *val;
-
-  /* Start with sensible defaults. */
-  nb->rb = rb;
-  nb->pool = pool;
-  nb->kind = svn_node_unknown;
-
-  /* Then add info from the headers.  */
-  if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_NODE_PATH,
-                          APR_HASH_KEY_STRING)))
-  {
-    if (rb->pb->parent_dir)
-      nb->path = svn_path_join(rb->pb->parent_dir, val, pool);
-    else
-      nb->path = apr_pstrdup(pool, val);
-  }
-
-  if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_NODE_KIND,
-                          APR_HASH_KEY_STRING)))
-    {
-      if (! strcmp(val, "file"))
-        nb->kind = svn_node_file;
-      else if (! strcmp(val, "dir"))
-        nb->kind = svn_node_dir;
-    }
-
-  nb->action = (enum svn_node_action)(-1);  /* an invalid action code */
-  if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_NODE_ACTION,
-                          APR_HASH_KEY_STRING)))
-    {
-      if (! strcmp(val, "change"))
-        nb->action = svn_node_action_change;
-      else if (! strcmp(val, "add"))
-        nb->action = svn_node_action_add;
-      else if (! strcmp(val, "delete"))
-        nb->action = svn_node_action_delete;
-      else if (! strcmp(val, "replace"))
-        nb->action = svn_node_action_replace;
-    }
-
-  nb->copyfrom_rev = SVN_INVALID_REVNUM;
-  if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV,
-                          APR_HASH_KEY_STRING)))
-    {
-      nb->copyfrom_rev = SVN_STR_TO_REV(val);
-    }
-  if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH,
-                          APR_HASH_KEY_STRING)))
-    {
-      if (rb->pb->parent_dir)
-        nb->copyfrom_path = svn_path_join(rb->pb->parent_dir,
-                                          (*val == '/' ? val + 1 : val), pool);
-      else
-        nb->copyfrom_path = apr_pstrdup(pool, val);
-    }
-
-  if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_TEXT_CONTENT_CHECKSUM,
-                          APR_HASH_KEY_STRING)))
-    {
-      svn_checksum_parse_hex(&nb->result_checksum, svn_checksum_md5, val, pool);
-    }
-
-  if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_CHECKSUM,
-                          APR_HASH_KEY_STRING)))
-    {
-      svn_checksum_parse_hex(&nb->base_checksum, svn_checksum_md5, val, pool);
-    }
-
-  if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_CHECKSUM,
-                          APR_HASH_KEY_STRING)))
-    {
-      svn_checksum_parse_hex(&nb->copy_source_checksum, svn_checksum_md5, val,
-                             pool);
-    }
-
-  /* What's cool about this dump format is that the parser just
-     ignores any unrecognized headers.  :-)  */
-
-  return nb;
-}
-
-static struct revision_baton *
-make_revision_baton(apr_hash_t *headers,
-                    struct parse_baton *pb,
-                    apr_pool_t *pool)
-{
-  struct revision_baton *rb = apr_pcalloc(pool, sizeof(*rb));
-  const char *val;
-
-  rb->pb = pb;
-  rb->pool = pool;
-  rb->rev = SVN_INVALID_REVNUM;
-
-  if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_REVISION_NUMBER,
-                          APR_HASH_KEY_STRING)))
-    rb->rev = SVN_STR_TO_REV(val);
-
-  return rb;
-}
-
-
-static svn_error_t *
-new_revision_record(void **revision_baton,
-                    apr_hash_t *headers,
-                    void *parse_baton,
-                    apr_pool_t *pool)
-{
-  struct parse_baton *pb = parse_baton;
-  struct revision_baton *rb;
-  svn_revnum_t head_rev;
-
-  rb = make_revision_baton(headers, pb, pool);
-  SVN_ERR(svn_fs_youngest_rev(&head_rev, pb->fs, pool));
-
-  /* FIXME: This is a lame fallback loading multiple segments of dump in
-     several separate operations. It is highly susceptible to race conditions.
-     Calculate the revision 'offset' for finding copyfrom sources.
-     It might be positive or negative. */
-  rb->rev_offset = (apr_int32_t) (rb->rev) - (head_rev + 1);
-
-  if (rb->rev > 0)
-    {
-      /* Create a new fs txn. */
-      SVN_ERR(svn_fs_begin_txn2(&(rb->txn), pb->fs, head_rev, 0, pool));
-      SVN_ERR(svn_fs_txn_root(&(rb->txn_root), rb->txn, pool));
-
-      if (pb->notify_func)
-        {
-          pb->notify->action = svn_repos_notify_load_txn_start;
-          pb->notify->old_revision = rb->rev;
-          pb->notify_func(pb->notify_baton, pb->notify, rb->pool);
-        }
-
-      /* Stash the oldest "old" revision committed from the load stream. */
-      if (!SVN_IS_VALID_REVNUM(pb->oldest_old_rev))
-        pb->oldest_old_rev = rb->rev;
-    }
-
-  /* If we're parsing revision 0, only the revision are (possibly)
-     interesting to us: when loading the stream into an empty
-     filesystem, then we want new filesystem's revision 0 to have the
-     same props.  Otherwise, we just ignore revision 0 in the stream. */
-
-  *revision_baton = rb;
-  return SVN_NO_ERROR;
-}
-
-
-
-/* Factorized helper func for new_node_record() */
-static svn_error_t *
-maybe_add_with_history(struct node_baton *nb,
-                       struct revision_baton *rb,
-                       apr_pool_t *pool)
-{
-  struct parse_baton *pb = rb->pb;
-
-  if ((nb->copyfrom_path == NULL) || (! pb->use_history))
-    {
-      /* Add empty file or dir, without history. */
-      if (nb->kind == svn_node_file)
-        SVN_ERR(svn_fs_make_file(rb->txn_root, nb->path, pool));
-
-      else if (nb->kind == svn_node_dir)
-        SVN_ERR(svn_fs_make_dir(rb->txn_root, nb->path, pool));
-    }
-  else
-    {
-      /* Hunt down the source revision in this fs. */
-      svn_fs_root_t *copy_root;
-      svn_revnum_t src_rev = nb->copyfrom_rev - rb->rev_offset;
-      svn_revnum_t *src_rev_from_map;
-      if ((src_rev_from_map = apr_hash_get(pb->rev_map, &nb->copyfrom_rev,
-                                           sizeof(nb->copyfrom_rev))))
-        src_rev = *src_rev_from_map;
-
-      if (! SVN_IS_VALID_REVNUM(src_rev))
-        return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-                                 _("Relative source revision %ld is not"
-                                   " available in current repository"),
-                                 src_rev);
-
-      SVN_ERR(svn_fs_revision_root(&copy_root, pb->fs, src_rev, pool));
-
-      if (nb->copy_source_checksum)
-        {
-          svn_checksum_t *checksum;
-          SVN_ERR(svn_fs_file_checksum(&checksum, svn_checksum_md5, copy_root,
-                                       nb->copyfrom_path, TRUE, pool));
-          if (!svn_checksum_match(nb->copy_source_checksum, checksum))
-            return svn_error_createf
-              (SVN_ERR_CHECKSUM_MISMATCH,
-               NULL,
-               apr_psprintf(pool, "%s:\n%s\n%s\n",
-                            _("Copy source checksum mismatch on copy from '%s'@%ld\n"
-                              "to '%s' in rev based on r%ld"),
-                            _("   expected:  %s"),
-                            _("     actual:  %s")),
-               nb->copyfrom_path, src_rev,
-               nb->path, rb->rev,
-               svn_checksum_to_cstring_display(nb->copy_source_checksum, pool),
-               svn_checksum_to_cstring_display(checksum, pool));
-        }
-
-      SVN_ERR(svn_fs_copy(copy_root, nb->copyfrom_path,
-                          rb->txn_root, nb->path, pool));
-
-      if (pb->notify_func)
-        {
-          pb->notify->action = svn_repos_notify_load_copied_node;
-          pb->notify_func(pb->notify_baton, pb->notify, rb->pool);
-        }
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
-uuid_record(const char *uuid,
-            void *parse_baton,
-            apr_pool_t *pool)
-{
-  struct parse_baton *pb = parse_baton;
-  svn_revnum_t youngest_rev;
-
-  if (pb->uuid_action == svn_repos_load_uuid_ignore)
-    return SVN_NO_ERROR;
-
-  if (pb->uuid_action != svn_repos_load_uuid_force)
-    {
-      SVN_ERR(svn_fs_youngest_rev(&youngest_rev, pb->fs, pool));
-      if (youngest_rev != 0)
-        return SVN_NO_ERROR;
-    }
-
-  return svn_fs_set_uuid(pb->fs, uuid, pool);
-}
-
-static svn_error_t *
-new_node_record(void **node_baton,
-                apr_hash_t *headers,
-                void *revision_baton,
-                apr_pool_t *pool)
-{
-  struct revision_baton *rb = revision_baton;
-  struct parse_baton *pb = rb->pb;
-  struct node_baton *nb;
-
-  if (rb->rev == 0)
-    return svn_error_create(SVN_ERR_STREAM_MALFORMED_DATA, NULL,
-                            _("Malformed dumpstream: "
-                              "Revision 0 must not contain node records"));
-
-  nb = make_node_baton(headers, rb, pool);
-
-  /* Make sure we have an action we recognize. */
-  if (nb->action < svn_node_action_change
-        || nb->action > svn_node_action_replace)
-      return svn_error_createf(SVN_ERR_STREAM_UNRECOGNIZED_DATA, NULL,
-                               _("Unrecognized node-action on node '%s'"),
-                               nb->path);
-
-  if (pb->notify_func)
-    {
-      pb->notify->action = svn_repos_notify_load_node_start;
-      pb->notify->node_action = nb->action;
-      pb->notify->path = nb->path;
-      pb->notify_func(pb->notify_baton, pb->notify, rb->pool);
-    }
-
-  switch (nb->action)
-    {
-    case svn_node_action_change:
-      break;
-
-    case svn_node_action_delete:
-      SVN_ERR(svn_fs_delete(rb->txn_root, nb->path, pool));
-      break;
-
-    case svn_node_action_add:
-      SVN_ERR(maybe_add_with_history(nb, rb, pool));
-      break;
-
-    case svn_node_action_replace:
-      SVN_ERR(svn_fs_delete(rb->txn_root, nb->path, pool));
-      SVN_ERR(maybe_add_with_history(nb, rb, pool));
-      break;
-    }
-
-  *node_baton = nb;
-  return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
-set_revision_property(void *baton,
-                      const char *name,
-                      const svn_string_t *value)
-{
-  struct revision_baton *rb = baton;
-
-  if (rb->rev > 0)
-    {
-      SVN_ERR(svn_fs_change_txn_prop(rb->txn, name, value, rb->pool));
-
-      /* Remember any datestamp that passes through!  (See comment in
-         close_revision() below.) */
-      if (! strcmp(name, SVN_PROP_REVISION_DATE))
-        rb->datestamp = svn_string_dup(value, rb->pool);
-    }
-  else if (rb->rev == 0)
-    {
-      /* Special case: set revision 0 properties when loading into an
-         'empty' filesystem. */
-      struct parse_baton *pb = rb->pb;
-      svn_revnum_t youngest_rev;
-
-      SVN_ERR(svn_fs_youngest_rev(&youngest_rev, pb->fs, rb->pool));
-
-      if (youngest_rev == 0)
-        SVN_ERR(svn_fs_change_rev_prop2(pb->fs, 0, name, NULL, value,
-                                        rb->pool));
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
-set_node_property(void *baton,
-                  const char *name,
-                  const svn_string_t *value)
-{
-  struct node_baton *nb = baton;
-  struct revision_baton *rb = nb->rb;
-  const char *parent_dir = rb->pb->parent_dir;
-
-  if (strcmp(name, SVN_PROP_MERGEINFO) == 0)
-    {
-      /* Renumber mergeinfo as appropriate. */
-      svn_string_t *renumbered_mergeinfo;
-      SVN_ERR(renumber_mergeinfo_revs(&renumbered_mergeinfo, value, rb,
-                                      nb->pool));
-      value = renumbered_mergeinfo;
-      if (parent_dir)
-        {
-          /* Prefix the merge source paths with PARENT_DIR. */
-          /* ASSUMPTION: All source paths are included in the dump stream. */
-          svn_string_t *mergeinfo_val;
-          SVN_ERR(prefix_mergeinfo_paths(&mergeinfo_val, value, parent_dir,
-                                         nb->pool));
-          value = mergeinfo_val;
-        }
-    }
-
-  return svn_fs_change_node_prop(rb->txn_root, nb->path,
-                                 name, value, nb->pool);
-}
-
-
-static svn_error_t *
-delete_node_property(void *baton,
-                     const char *name)
-{
-  struct node_baton *nb = baton;
-  struct revision_baton *rb = nb->rb;
-
-  return svn_fs_change_node_prop(rb->txn_root, nb->path,
-                                 name, NULL, nb->pool);
-}
-
-
-static svn_error_t *
-remove_node_props(void *baton)
-{
-  struct node_baton *nb = baton;
-  struct revision_baton *rb = nb->rb;
-  apr_hash_t *proplist;
-  apr_hash_index_t *hi;
-
-  SVN_ERR(svn_fs_node_proplist(&proplist,
-                               rb->txn_root, nb->path, nb->pool));
-
-  for (hi = apr_hash_first(nb->pool, proplist); hi; hi = apr_hash_next(hi))
-    {
-      const void *key;
-
-      apr_hash_this(hi, &key, NULL, NULL);
-
-      SVN_ERR(svn_fs_change_node_prop(rb->txn_root, nb->path,
-                                      (const char *) key, NULL,
-                                      nb->pool));
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
-apply_textdelta(svn_txdelta_window_handler_t *handler,
-                void **handler_baton,
-                void *node_baton)
-{
-  struct node_baton *nb = node_baton;
-  struct revision_baton *rb = nb->rb;
-
-  return svn_fs_apply_textdelta(handler, handler_baton,
-                                rb->txn_root, nb->path,
-                                nb->base_checksum ?
-                                svn_checksum_to_cstring(nb->base_checksum,
-                                                        nb->pool) : NULL,
-                                nb->result_checksum ?
-                                svn_checksum_to_cstring(nb->result_checksum,
-                                                        nb->pool) : NULL,
-                                nb->pool);
-}
-
-
-static svn_error_t *
-set_fulltext(svn_stream_t **stream,
-             void *node_baton)
-{
-  struct node_baton *nb = node_baton;
-  struct revision_baton *rb = nb->rb;
-
-  return svn_fs_apply_text(stream,
-                           rb->txn_root, nb->path,
-                           nb->result_checksum ?
-                           svn_checksum_to_cstring(nb->result_checksum,
-                                                   nb->pool) : NULL,
-                           nb->pool);
-}
-
-
-static svn_error_t *
-close_node(void *baton)
-{
-  struct node_baton *nb = baton;
-  struct revision_baton *rb = nb->rb;
-  struct parse_baton *pb = rb->pb;
-
-  if (pb->notify_func)
-    {
-      pb->notify->action = svn_repos_notify_load_node_done;
-      pb->notify_func(pb->notify_baton, pb->notify, rb->pool);
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
-close_revision(void *baton)
-{
-  struct revision_baton *rb = baton;
-  struct parse_baton *pb = rb->pb;
-  const char *conflict_msg = NULL;
-  svn_revnum_t *old_rev, *new_rev;
-  svn_error_t *err;
-
-  if (rb->rev <= 0)
-    return SVN_NO_ERROR;
-
-  /* Prepare memory for saving dump-rev -> in-repos-rev mapping. */
-  old_rev = apr_palloc(pb->pool, sizeof(*old_rev) * 2);
-  new_rev = old_rev + 1;
-  *old_rev = rb->rev;
-
-  /* Run the pre-commit hook, if so commanded. */
-  if (pb->use_pre_commit_hook)
-    {
-      const char *txn_name;
-      err = svn_fs_txn_name(&txn_name, rb->txn, rb->pool);
-      if (! err)
-        err = svn_repos__hooks_pre_commit(pb->repos, txn_name, rb->pool);
-      if (err)
-        {
-          svn_error_clear(svn_fs_abort_txn(rb->txn, rb->pool));
-          return svn_error_return(err);
-        }
-    }
-
-  /* Commit. */
-  if ((err = svn_fs_commit_txn(&conflict_msg, new_rev, rb->txn, rb->pool)))
-    {
-      svn_error_clear(svn_fs_abort_txn(rb->txn, rb->pool));
-      if (conflict_msg)
-        return svn_error_quick_wrap(err, conflict_msg);
-      else
-        return svn_error_return(err);
-    }
-
-  /* Run post-commit hook, if so commanded.  */
-  if (pb->use_post_commit_hook)
-    {
-      if ((err = svn_repos__hooks_post_commit(pb->repos, *new_rev, rb->pool)))
-        return svn_error_create
-          (SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED, err,
-           _("Commit succeeded, but post-commit hook failed"));
-    }
-
-  /* After a successful commit, must record the dump-rev -> in-repos-rev
-     mapping, so that copyfrom instructions in the dump file can look up the
-     correct repository revision to copy from. */
-  apr_hash_set(pb->rev_map, old_rev, sizeof(svn_revnum_t), new_rev);
-
-  /* If the incoming dump stream has non-contiguous revisions (e.g. from
-     using svndumpfilter --drop-empty-revs without --renumber-revs) then
-     we must account for the missing gaps in PB->REV_MAP.  Otherwise we
-     might not be able to map all mergeinfo source revisions to the correct
-     revisions in the target repos. */
-  if (pb->last_rev_mapped != SVN_INVALID_REVNUM
-      && *old_rev != pb->last_rev_mapped + 1)
-    {
-      svn_revnum_t i;
-
-      /* Map all dropped revisions between PB->LAST_REV_MAPPED and OLD_REV. */
-      for (i = pb->last_rev_mapped + 1; i < *old_rev; i++)
-        {
-          svn_revnum_t *gap_rev_old = apr_palloc(pb->pool,
-                                                 sizeof(*gap_rev_old));
-          svn_revnum_t *gap_rev_new = apr_palloc(pb->pool,
-                                                 sizeof(*gap_rev_new));
-          *gap_rev_old = i;
-          *gap_rev_new = pb->last_rev_mapped;
-          apr_hash_set(pb->rev_map, gap_rev_old, sizeof(svn_revnum_t),
-                       gap_rev_new);
-        }
-    }
-  pb->last_rev_mapped = *old_rev;
-
-  /* Deltify the predecessors of paths changed in this revision. */
-  SVN_ERR(svn_fs_deltify_revision(pb->fs, *new_rev, rb->pool));
-
-  /* Grrr, svn_fs_commit_txn rewrites the datestamp property to the
-     current clock-time.  We don't want that, we want to preserve
-     history exactly.  Good thing revision props aren't versioned!
-     Note that if rb->datestamp is NULL, that's fine -- if the dump
-     data doesn't carry a datestamp, we want to preserve that fact in
-     the load. */
-  SVN_ERR(svn_fs_change_rev_prop(pb->fs, *new_rev,
-                                 SVN_PROP_REVISION_DATE, rb->datestamp,
-                                 rb->pool));
-
-  if (pb->notify_func)
-    {
-      pb->notify->action = svn_repos_notify_load_txn_committed;
-      pb->notify->new_revision = *new_rev;
-      pb->notify->old_revision = ((*new_rev == rb->rev)
-                                    ? SVN_INVALID_REVNUM
-                                    : rb->rev);
-      pb->notify_func(pb->notify_baton, pb->notify, rb->pool);
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
-/*----------------------------------------------------------------------*/
-
-/** The public routines **/
-
-
-svn_error_t *
-svn_repos_get_fs_build_parser3(const svn_repos_parse_fns2_t **callbacks,
-                               void **parse_baton,
-                               svn_repos_t *repos,
-                               svn_boolean_t use_history,
-                               enum svn_repos_load_uuid uuid_action,
-                               const char *parent_dir,
-                               svn_repos_notify_func_t notify_func,
-                               void *notify_baton,
-                               apr_pool_t *pool)
-{
-  svn_repos_parse_fns2_t *parser = apr_pcalloc(pool, sizeof(*parser));
-  struct parse_baton *pb = apr_pcalloc(pool, sizeof(*pb));
-
-  parser->new_revision_record = new_revision_record;
-  parser->new_node_record = new_node_record;
-  parser->uuid_record = uuid_record;
-  parser->set_revision_property = set_revision_property;
-  parser->set_node_property = set_node_property;
-  parser->remove_node_props = remove_node_props;
-  parser->set_fulltext = set_fulltext;
-  parser->close_node = close_node;
-  parser->close_revision = close_revision;
-  parser->delete_node_property = delete_node_property;
-  parser->apply_textdelta = apply_textdelta;
-
-  pb->repos = repos;
-  pb->fs = svn_repos_fs(repos);
-  pb->use_history = use_history;
-  pb->notify_func = notify_func;
-  pb->notify_baton = notify_baton;
-  pb->notify = svn_repos_notify_create(svn_repos_notify_load_txn_start, pool);
-  pb->uuid_action = uuid_action;
-  pb->parent_dir = parent_dir;
-  pb->pool = pool;
-  pb->rev_map = apr_hash_make(pool);
-  pb->oldest_old_rev = SVN_INVALID_REVNUM;
-  pb->last_rev_mapped = SVN_INVALID_REVNUM;
-
-  *callbacks = parser;
-  *parse_baton = pb;
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_repos_load_fs3(svn_repos_t *repos,
-                   svn_stream_t *dumpstream,
-                   enum svn_repos_load_uuid uuid_action,
-                   const char *parent_dir,
-                   svn_boolean_t use_pre_commit_hook,
-                   svn_boolean_t use_post_commit_hook,
-                   svn_repos_notify_func_t notify_func,
-                   void *notify_baton,
-                   svn_cancel_func_t cancel_func,
-                   void *cancel_baton,
-                   apr_pool_t *pool)
-{
-  const svn_repos_parse_fns2_t *parser;
-  void *parse_baton;
-  struct parse_baton *pb;
-
-  /* This is really simple. */
-
-  SVN_ERR(svn_repos_get_fs_build_parser3(&parser, &parse_baton,
-                                         repos,
-                                         TRUE, /* look for copyfrom revs */
-                                         uuid_action,
-                                         parent_dir,
-                                         notify_func,
-                                         notify_baton,
-                                         pool));
-
-  /* Heh.  We know this is a parse_baton.  This file made it.  So
-     cast away, and set our hook booleans.  */
-  pb = parse_baton;
-  pb->use_pre_commit_hook = use_pre_commit_hook;
-  pb->use_post_commit_hook = use_post_commit_hook;
-
-  return svn_repos_parse_dumpstream2(dumpstream, parser, parse_baton,
-                                     cancel_func, cancel_baton, pool);
-}

Modified: subversion/branches/performance/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_subr/config_file.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/performance/subversion/libsvn_subr/config_file.c Mon Oct 25 17:50:25 2010
@@ -38,6 +38,11 @@
 
 #include "svn_private_config.h"
 
+#ifdef __HAIKU__
+#  include <FindDirectory.h>
+#  include <StorageDefs.h>
+#endif
+
 /* Used to terminate lines in large multi-line string literals. */
 #define NL APR_EOL_STR
 
@@ -331,7 +336,19 @@ svn_config__sys_config_path(const char *
                                    SVN_CONFIG__SUBDIRECTORY, fname, NULL);
   }
 
-#else  /* ! WIN32 */
+#elif defined(__HAIKU__)
+  {
+    char folder[B_PATH_NAME_LENGTH];
+
+    status_t error = find_directory(B_COMMON_SETTINGS_DIRECTORY, -1, false,
+                                    folder, sizeof(folder));
+    if (error)
+      return SVN_NO_ERROR;
+
+    *path_p = svn_dirent_join_many(pool, folder,
+                                   SVN_CONFIG__SYS_DIRECTORY, fname, NULL);
+  }
+#else  /* ! WIN32 && !__HAIKU__ */
 
   *path_p = svn_dirent_join_many(pool, SVN_CONFIG__SYS_DIRECTORY, fname, NULL);
 
@@ -1117,7 +1134,20 @@ svn_config_get_user_config_path(const ch
                                  SVN_CONFIG__SUBDIRECTORY, fname, NULL);
   }
 
-#else  /* ! WIN32 */
+#elif defined(__HAIKU__)
+  {
+    char folder[B_PATH_NAME_LENGTH];
+
+    status_t error = find_directory(B_USER_SETTINGS_DIRECTORY, -1, false,
+                                    folder, sizeof(folder));
+    if (error)
+      return SVN_NO_ERROR;
+
+    *path = svn_dirent_join_many(pool, folder,
+                                 SVN_CONFIG__USR_DIRECTORY, fname, NULL);
+  }
+#else  /* ! WIN32 && !__HAIKU__ */
+
   {
     const char *homedir = svn_user_get_homedir(pool);
     if (! homedir)

Modified: subversion/branches/performance/subversion/libsvn_subr/config_impl.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_subr/config_impl.h?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_subr/config_impl.h (original)
+++ subversion/branches/performance/subversion/libsvn_subr/config_impl.h Mon Oct 25 17:50:25 2010
@@ -114,7 +114,10 @@ svn_error_t *svn_config__parse_registry(
    or svn_config_get_user_config_path() instead. */
 #ifdef WIN32
 #  define SVN_CONFIG__SUBDIRECTORY    "Subversion"
-#else  /* ! WIN32 */
+#elif defined __HAIKU__ /* HAIKU */
+#  define SVN_CONFIG__SYS_DIRECTORY   "subversion"
+#  define SVN_CONFIG__USR_DIRECTORY   "subversion"
+#else  /* ! WIN32 && ! __HAIKU__ */
 #  define SVN_CONFIG__SYS_DIRECTORY   "/etc/subversion"
 #  define SVN_CONFIG__USR_DIRECTORY   ".subversion"
 #endif /* WIN32 */

Modified: subversion/branches/performance/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_subr/io.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/performance/subversion/libsvn_subr/io.c Mon Oct 25 17:50:25 2010
@@ -400,7 +400,8 @@ svn_io_open_uniquely_named(apr_file_t **
          sensitive to i18n in a way it shouldn't be... Oh well. */
       if (needs_utf8_conversion)
         {
-          SVN_ERR(cstring_from_utf8(&unique_name_apr, unique_name, scratch_pool));
+          SVN_ERR(cstring_from_utf8(&unique_name_apr, unique_name,
+                                    scratch_pool));
           if (i == 1)
             {
               /* The variable parts of unique_name will not require UTF8

Modified: subversion/branches/performance/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_subr/opt.c?rev=1027203&r1=1027202&r2=1027203&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/performance/subversion/libsvn_subr/opt.c Mon Oct 25 17:50:25 2010
@@ -124,6 +124,84 @@ svn_opt_get_option_from_code(int code,
 }
 
 
+/* Like svn_opt_get_option_from_code2(), but also, if CODE appears a second
+ * time in OPTION_TABLE with a different name, then set *LONG_ALIAS to that
+ * second name, else set it to NULL. */
+static const apr_getopt_option_t *
+get_option_from_code(const char **long_alias,
+                     int code,
+                     const apr_getopt_option_t *option_table,
+                     const svn_opt_subcommand_desc2_t *command,
+                     apr_pool_t *pool)
+{
+  const apr_getopt_option_t *i;
+  const apr_getopt_option_t *opt
+    = svn_opt_get_option_from_code2(code, option_table, command, pool);
+
+  /* Find a long alias in the table, if there is one. */
+  *long_alias = NULL;
+  for (i = option_table; i->optch; i++)
+    {
+      if (i->optch == code && i->name != opt->name)
+        {
+          *long_alias = i->name;
+          break;
+        }
+    }
+
+  return opt;
+}
+
+
+/* Print an option OPT nicely into a STRING allocated in POOL.
+ * If OPT has a single-character short form, then print OPT->name (if not
+ * NULL) as an alias, else print LONG_ALIAS (if not NULL) as an alias.
+ * If DOC is set, include the generic documentation string of OPT,
+ * localized to the current locale if a translation is available.
+ */
+static void
+format_option(const char **string,
+              const apr_getopt_option_t *opt,
+              const char *long_alias,
+              svn_boolean_t doc,
+              apr_pool_t *pool)
+{
+  char *opts;
+
+  if (opt == NULL)
+    {
+      *string = "?";
+      return;
+    }
+
+  /* We have a valid option which may or may not have a "short
+     name" (a single-character alias for the long option). */
+  if (opt->optch <= 255)
+    opts = apr_psprintf(pool, "-%c [--%s]", opt->optch, opt->name);
+  else if (long_alias)
+    opts = apr_psprintf(pool, "--%s [--%s]", opt->name, long_alias);
+  else
+    opts = apr_psprintf(pool, "--%s", opt->name);
+
+  if (opt->has_arg)
+    opts = apr_pstrcat(pool, opts, _(" ARG"), (char *)NULL);
+
+  if (doc)
+    opts = apr_psprintf(pool, "%-24s : %s", opts, _(opt->description));
+
+  *string = opts;
+}
+
+void
+svn_opt_format_option(const char **string,
+                      const apr_getopt_option_t *opt,
+                      svn_boolean_t doc,
+                      apr_pool_t *pool)
+{
+  format_option(string, opt, NULL, doc, pool);
+}
+
+
 svn_boolean_t
 svn_opt_subcommand_takes_option3(const svn_opt_subcommand_desc2_t *command,
                                  int option_code,
@@ -207,6 +285,7 @@ print_command_info2(const svn_opt_subcom
   if (help)
     {
       const apr_getopt_option_t *option;
+      const char *long_alias;
       svn_boolean_t have_options = FALSE;
 
       SVN_ERR(svn_cmdline_fprintf(stream, pool, ": %s", _(cmd->help)));
@@ -224,16 +303,14 @@ print_command_info2(const svn_opt_subcom
                 }
 
               /* convert each option code into an option */
-              option =
-                svn_opt_get_option_from_code2(cmd->valid_options[i],
-                                              options_table,
-                                              cmd, pool);
+              option = get_option_from_code(&long_alias, cmd->valid_options[i],
+                                            options_table, cmd, pool);
 
               /* print the option's docstring */
               if (option && option->description)
                 {
                   const char *optstr;
-                  svn_opt_format_option(&optstr, option, TRUE, pool);
+                  format_option(&optstr, option, long_alias, TRUE, pool);
                   SVN_ERR(svn_cmdline_fprintf(stream, pool, "  %s\n",
                                               optstr));
                 }
@@ -250,16 +327,14 @@ print_command_info2(const svn_opt_subcom
             {
 
               /* convert each option code into an option */
-              option =
-                svn_opt_get_option_from_code2(global_options[i],
-                                              options_table,
-                                              cmd, pool);
+              option = get_option_from_code(&long_alias, global_options[i],
+                                            options_table, cmd, pool);
 
               /* print the option's docstring */
               if (option && option->description)
                 {
                   const char *optstr;
-                  svn_opt_format_option(&optstr, option, TRUE, pool);
+                  format_option(&optstr, option, long_alias, TRUE, pool);
                   SVN_ERR(svn_cmdline_fprintf(stream, pool, "  %s\n",
                                               optstr));
                 }
@@ -312,36 +387,6 @@ svn_opt_print_generic_help2(const char *
   svn_error_clear(err);
 }
 
-void
-svn_opt_format_option(const char **string,
-                      const apr_getopt_option_t *opt,
-                      svn_boolean_t doc,
-                      apr_pool_t *pool)
-{
-  char *opts;
-
-  if (opt == NULL)
-    {
-      *string = "?";
-      return;
-    }
-
-  /* We have a valid option which may or may not have a "short
-     name" (a single-character alias for the long option). */
-  if (opt->optch <= 255)
-    opts = apr_psprintf(pool, "-%c [--%s]", opt->optch, opt->name);
-  else
-    opts = apr_psprintf(pool, "--%s", opt->name);
-
-  if (opt->has_arg)
-    opts = apr_pstrcat(pool, opts, _(" ARG"), (char *)NULL);
-
-  if (doc)
-    opts = apr_psprintf(pool, "%-24s : %s", opts, _(opt->description));
-
-  *string = opts;
-}
-
 
 void
 svn_opt_subcommand_help3(const char *subcommand,

Propchange: subversion/branches/performance/subversion/libsvn_subr/svn_file_handle_cache.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 25 17:50:25 2010
@@ -1 +1 @@
-/subversion/trunk/subversion/libsvn_subr/svn_file_handle_cache.c:962911-1022694
+/subversion/trunk/subversion/libsvn_subr/svn_file_handle_cache.c:962911-1027198

Propchange: subversion/branches/performance/subversion/libsvn_subr/svn_temp_serializer.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 25 17:50:25 2010
@@ -1 +1 @@
-/subversion/trunk/subversion/libsvn_subr/svn_temp_serializer.c:962911-1022694
+/subversion/trunk/subversion/libsvn_subr/svn_temp_serializer.c:962911-1027198