You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2012/09/12 18:11:51 UTC

svn commit: r1384011 [1/2] - in /subversion/branches/inheritable-props: ./ subversion/include/ subversion/libsvn_fs_fs/ subversion/libsvn_ra_serf/ subversion/libsvn_subr/ subversion/svn/ subversion/svnversion/ subversion/tests/cmdline/ subversion/tests...

Author: pburba
Date: Wed Sep 12 16:11:49 2012
New Revision: 1384011

URL: http://svn.apache.org/viewvc?rev=1384011&view=rev
Log:
On the inheritable-props branch: Sync with ^/subversion/trunk through
r1383997.

Added:
    subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stderr
      - copied unchanged from r1383997, subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stderr
    subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
      - copied unchanged from r1383997, subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
    subversion/branches/inheritable-props/tools/fsfs/
      - copied from r1383997, subversion/trunk/tools/fsfs/
Modified:
    subversion/branches/inheritable-props/   (props changed)
    subversion/branches/inheritable-props/CHANGES
    subversion/branches/inheritable-props/build.conf
    subversion/branches/inheritable-props/subversion/include/svn_string.h
    subversion/branches/inheritable-props/subversion/include/svn_version.h
    subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.h
    subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c
    subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c
    subversion/branches/inheritable-props/subversion/libsvn_ra_serf/util.c
    subversion/branches/inheritable-props/subversion/libsvn_subr/cache-membuffer.c
    subversion/branches/inheritable-props/subversion/libsvn_subr/deprecated.c
    subversion/branches/inheritable-props/subversion/libsvn_subr/opt.c
    subversion/branches/inheritable-props/subversion/libsvn_subr/opt.h
    subversion/branches/inheritable-props/subversion/libsvn_subr/string.c
    subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c
    subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.h
    subversion/branches/inheritable-props/subversion/libsvn_subr/utf_validate.c
    subversion/branches/inheritable-props/subversion/libsvn_subr/version.c
    subversion/branches/inheritable-props/subversion/svn/cl.h
    subversion/branches/inheritable-props/subversion/svn/file-merge.c
    subversion/branches/inheritable-props/subversion/svn/log-cmd.c
    subversion/branches/inheritable-props/subversion/svn/main.c
    subversion/branches/inheritable-props/subversion/svnversion/main.c
    subversion/branches/inheritable-props/subversion/svnversion/svnversion.1
    subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests.py
    subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout
    subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
    subversion/branches/inheritable-props/subversion/tests/cmdline/log_tests.py
    subversion/branches/inheritable-props/subversion/tests/libsvn_subr/string-test.c
    subversion/branches/inheritable-props/tools/dev/unix-build/Makefile.svn
    subversion/branches/inheritable-props/tools/dist/make-deps-tarball.sh   (contents, props changed)
    subversion/branches/inheritable-props/tools/server-side/svnpubsub/README.txt
    subversion/branches/inheritable-props/tools/server-side/svnpubsub/svnwcsub.py

Propchange: subversion/branches/inheritable-props/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1382202-1383997

Modified: subversion/branches/inheritable-props/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/CHANGES?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/CHANGES (original)
+++ subversion/branches/inheritable-props/CHANGES Wed Sep 12 16:11:49 2012
@@ -26,6 +26,7 @@ http://svn.apache.org/repos/asf/subversi
     * ra_serf avoids re-downloading content present in pristine store (r1333936)
     * 'svn mergeinfo' now honors the --revision (-r) option (issue #4199)
     * new --search and --isearch options for 'svn log' (r1354666, -830)
+    * new --search-and and --isearch-and options for 'svn log' (r1383518)
     * new built-in interactive text conflict merge tool (r1357864, et al)
     * new 'svn --version --verbose' option shows runtime environment info
 
@@ -487,6 +488,20 @@ the 1.6 release:  http://subversion.apac
     * fixed setting binary properties in JavaHL (issue #3770)
     * fix type mapping of svn_txdelta_window_t in python bindings (issue #3688)
 
+Version 1.6.19
+(10 Sep 2012, from /branches/1.6.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.6.19
+
+  - Client-side bugfixes:
+    * handle missing svn:date reported by svnserve gracefully (r1306111)
+
+  - Server-side bugfixes:
+    * fix possible server hang if a hook script fails to start (r1330410)
+    * fix write-through proxy commit regression introduced in 1.6.17 (r1088602)
+    * partial sync drops properties when converting to adds (issue #4184)
+
+  - Developer-visible changes:
+    * fix the testsuite to avoid FAILs on APR hash order (r1230714, et al)
 
 Version 1.6.18
 (29 Mar 2012, from /branches/1.6.x)

Modified: subversion/branches/inheritable-props/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/build.conf?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/build.conf (original)
+++ subversion/branches/inheritable-props/build.conf Wed Sep 12 16:11:49 2012
@@ -1180,7 +1180,7 @@ libs = __ALL__
        ra-local-test
        svndiff-test vdelta-test
        entries-dump atomic-ra-revprop-change wc-lock-tester wc-incomplete-tester
-       diff diff3 diff4
+       diff diff3 diff4 reorg-fsfs
        client-test
        conflict-data-test db-test pristine-store-test entries-compat-test
        op-depth-test dirent_uri-test wc-queries-test
@@ -1229,6 +1229,13 @@ libs = __JAVAHL__ javahl-tests javahl-co
 # ----------------------------------------------------------------------------
 # Contrib and tools
 
+[reorg-fsfs]
+type = exe
+path = tools/fsfs
+sources = reorg.c
+install = tools
+libs = libsvn_delta libsvn_subr apr
+
 [diff]
 type = exe
 path = tools/diff

Modified: subversion/branches/inheritable-props/subversion/include/svn_string.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/include/svn_string.h?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/include/svn_string.h (original)
+++ subversion/branches/inheritable-props/subversion/include/svn_string.h Wed Sep 12 16:11:49 2012
@@ -307,6 +307,45 @@ void
 svn_stringbuf_appendcstr(svn_stringbuf_t *targetstr,
                          const char *cstr);
 
+/** Read @a count bytes from @a bytes and insert them into @a str at
+ * position @a pos and following.  The resulting string will be
+ * @c count+str->len bytes long.  If @c pos is larger or equal to the
+ * number of bytes currently used in @a str,  simply append @a bytes.
+ *
+ * Reallocs if necessary. @a str is affected, nothing else is.
+ *
+ * @note The inserted string may be a sub-range if @a str.
+ */
+void
+svn_stringbuf_insert(svn_stringbuf_t *str,
+                     apr_size_t pos,
+                     const char *bytes,
+                     apr_size_t count);
+
+/** Removes @a count bytes from @a str, starting at position @a pos.
+ * If that range exceeds the current string data,  @a str gets truncated
+ * at @a pos.  If the latter is larger or equal to @c str->pos, this will
+ * be a no-op.  Otherwise, the resulting string will be @c str->len-count
+ * bytes long.
+ */
+void
+svn_stringbuf_remove(svn_stringbuf_t *str,
+                     apr_size_t pos,
+                     apr_size_t count);
+
+/** Faster but functionally equivalent to the following sequence:
+ * @code
+ *   svn_stringbuf_remove(str, pos, old_count);
+ *   svn_stringbuf_insert(str, pos, bytes, new_count);
+ * @endcode
+ */
+void
+svn_stringbuf_replace(svn_stringbuf_t *str,
+                      apr_size_t pos,
+                      apr_size_t old_count,
+                      const char *bytes,
+                      apr_size_t new_count);
+
 /** Return a duplicate of @a original_string. */
 svn_stringbuf_t *
 svn_stringbuf_dup(const svn_stringbuf_t *original_string, apr_pool_t *pool);

Modified: subversion/branches/inheritable-props/subversion/include/svn_version.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/include/svn_version.h?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/include/svn_version.h (original)
+++ subversion/branches/inheritable-props/subversion/include/svn_version.h Wed Sep 12 16:11:49 2012
@@ -34,6 +34,7 @@
 #ifndef APR_STRINGIFY
 #include <apr_general.h>
 #endif
+#include <apr_tables.h>
 
 #include "svn_types.h"
 
@@ -256,6 +257,153 @@ const svn_version_t *
 svn_subr_version(void);
 
 
+/**
+ * Extended version infomation, including info about the running system.
+ *
+ * @since New in 1.8.
+ */
+typedef struct svn_version_extended_t svn_version_extended_t;
+
+/**
+ * Return version information for the running program.  If @a verbose
+ * is true, collect extra information that may be expensive to
+ * retrieve (for example, the OS release name, list of shared
+ * libraries, etc.).  Use @a pool for all allocations.
+ *
+ * @since New in 1.8.
+ */
+const svn_version_extended_t *
+svn_version_extended(svn_boolean_t verbose,
+                     apr_pool_t *pool);
+
+
+/**
+ * Accessor for svn_version_extended_t.
+ *
+ * @return The date when the libsvn_subr library was compiled, in the
+ * format defined by the C standard macro @c __DATE__.
+ *
+ * @since New in 1.8.
+ */
+const char *
+svn_version_ext_build_date(const svn_version_extended_t *ext_info);
+
+/**
+ * Accessor for svn_version_extended_t.
+ *
+ * @return The time when the libsvn_subr library was compiled, in the
+ * format defined by the C standard macro @c __TIME__.
+ *
+ * @since New in 1.8.
+ */
+const char *
+svn_version_ext_build_time(const svn_version_extended_t *ext_info);
+
+/**
+ * Accessor for svn_version_extended_t.
+ *
+ * @return The canonical host triplet (arch-vendor-osname) of the
+ * system where libsvn_subr was compiled.
+ *
+ * @note On Unix-like systems (includng Mac OS X), this string is the
+ * same as the output of the config.guess script.
+ *
+ * @since New in 1.8.
+ */
+const char *
+svn_version_ext_build_host(const svn_version_extended_t *ext_info);
+
+/**
+ * Accessor for svn_version_extended_t.
+ *
+ * @return The localized copyright notice.
+ *
+ * @since New in 1.8.
+ */
+const char *
+svn_version_ext_copyright(const svn_version_extended_t *ext_info);
+
+/**
+ * Accessor for svn_version_extended_t.
+ *
+ * @return The canonical host triplet (arch-vendor-osname) of the
+ * system where the current process is running.
+ *
+ * @note This string may not be the same as the output of config.guess
+ * on the same system.
+ *
+ * @since New in 1.8.
+ */
+const char *
+svn_version_ext_runtime_host(const svn_version_extended_t *ext_info);
+
+/**
+ * Accessor for svn_version_extended_t.
+ *
+ * @return The "commercial" release name of the running operating
+ * system, if available.  Not to be confused with, e.g., the output of
+ * "uname -v" or "uname -r".  The returned value may be @c NULL.
+ *
+ * @since New in 1.8.
+ */
+const char *
+svn_version_ext_runtime_osname(const svn_version_extended_t *ext_info);
+
+/**
+ * Dependent library information.
+ * Describes the name and versions of known dependencies
+ * used by libsvn_subr.
+ *
+ * @since New in 1.8.
+ */
+typedef struct svn_version_ext_linked_lib_t
+{
+  const char *name;             /**< Library name */
+  const char *compiled_version; /**< Compile-time version string */
+  const char *runtime_version;  /**< Run-time version string (optional) */
+} svn_version_ext_linked_lib_t;
+
+/**
+ * Accessor for svn_version_extended_t.
+ *
+ * @return Array of svn_version_ext_linked_lib_t describing dependent
+ * libraries.  The returned value may be @c NULL.
+ *
+ * @since New in 1.8.
+ */
+const apr_array_header_t *
+svn_version_ext_linked_libs(const svn_version_extended_t *ext_info);
+
+
+/**
+ * Loaded shared library information.
+ * Describes the name and, where available, version of the shared libraries
+ * loaded by the running program.
+ *
+ * @since New in 1.8.
+ */
+typedef struct svn_version_ext_loaded_lib_t
+{
+  const char *name;             /**< Library name */
+  const char *version;          /**< Library version (optional) */
+} svn_version_ext_loaded_lib_t;
+
+
+/**
+ * Accessor for svn_version_extended_t.
+ *
+ * @return Array of svn_version_ext_loaded_lib_t describing loaded
+ * shared libraries.  The returned value may be @c NULL.
+ *
+ * @note On Mac OS X, the loaded frameworks, private frameworks and
+ * system libraries will not be listed.
+ *
+ * @since New in 1.8.
+ */
+const apr_array_header_t *
+svn_version_ext_loaded_libs(const svn_version_extended_t *ext_info);
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.c Wed Sep 12 16:11:49 2012
@@ -2284,8 +2284,11 @@ get_node_revision_body(node_revision_t *
   SVN_ERR(svn_fs_fs__read_noderev(noderev_p,
                                   svn_stream_from_aprfile2(revision_file, FALSE,
                                                            pool),
-                                  svn_fs_fs__id_txn_id(id) != NULL,
                                   pool));
+  /* Workaround issue #4031: is-fresh-txn-root in revision files. */
+  if (svn_fs_fs__id_txn_id(id) == NULL)
+    (*noderev_p)->is_fresh_txn_root = FALSE;
+
 
   /* The noderev is not in cache, yet. Add it, if caching has been enabled. */
   return set_cached_node_revision_body(*noderev_p, fs, id, pool);
@@ -2294,7 +2297,6 @@ get_node_revision_body(node_revision_t *
 svn_error_t *
 svn_fs_fs__read_noderev(node_revision_t **noderev_p,
                         svn_stream_t *stream,
-                        svn_boolean_t allow_for_txn_roots,
                         apr_pool_t *pool)
 {
   apr_hash_t *headers;
@@ -2425,9 +2427,7 @@ svn_fs_fs__read_noderev(node_revision_t 
     }
 
   /* Get whether this is a fresh txn root. */
-  value = allow_for_txn_roots
-        ? apr_hash_get(headers, HEADER_FRESHTXNRT, APR_HASH_KEY_STRING)
-        : NULL;
+  value = apr_hash_get(headers, HEADER_FRESHTXNRT, APR_HASH_KEY_STRING);
   noderev->is_fresh_txn_root = (value != NULL);
 
   /* Get the mergeinfo count. */
@@ -4285,7 +4285,8 @@ create_rep_state_body(struct rep_state *
    and the rep args in *REP_ARGS, both allocated in POOL.
 
    When reading multiple reps, i.e. a skip delta chain, you may provide
-   non-NULL FILE_HINT and REV_HINT.  The function will use these variables
+   non-NULL FILE_HINT and REV_HINT.  (If FILE_HINT is not NULL, in the first
+   call it should be a pointer to NULL.)  The function will use these variables
    to store the previous call results and tries to re-use them.  This may
    result in significant savings in I/O for packed files.
  */
@@ -6782,11 +6783,14 @@ rep_write_contents(void *baton,
 
 /* Given a node-revision NODEREV in filesystem FS, return the
    representation in *REP to use as the base for a text representation
-   delta.  Perform temporary allocations in *POOL. */
+   delta if PROPS is FALSE.  If PROPS has been set, a suitable props
+   base representation will be returned.  Perform temporary allocations
+   in *POOL. */
 static svn_error_t *
 choose_delta_base(representation_t **rep,
                   svn_fs_t *fs,
                   node_revision_t *noderev,
+                  svn_boolean_t props,
                   apr_pool_t *pool)
 {
   int count;
@@ -6835,7 +6839,8 @@ choose_delta_base(representation_t **rep
     SVN_ERR(svn_fs_fs__get_node_revision(&base, fs,
                                          base->predecessor_id, pool));
 
-  *rep = base->data_rep;
+  /* return a suitable base representation */
+  *rep = props ? base->prop_rep : base->data_rep;
 
   return SVN_NO_ERROR;
 }
@@ -6882,7 +6887,7 @@ rep_write_get_baton(struct rep_write_bat
   SVN_ERR(get_file_offset(&b->rep_offset, file, b->pool));
 
   /* Get the base for this delta. */
-  SVN_ERR(choose_delta_base(&base_rep, fs, noderev, b->pool));
+  SVN_ERR(choose_delta_base(&base_rep, fs, noderev, FALSE, b->pool));
   SVN_ERR(read_representation(&source, fs, base_rep, b->pool));
 
   /* Write out the rep header. */
@@ -7301,7 +7306,8 @@ write_hash_rep(representation_t *rep,
    is not NULL, it will be used in addition to the on-disk cache to find
    earlier reps with the same content.  When such existing reps can be found,
    we will truncate the one just written from the file and return the existing
-   rep.  Perform temporary allocations in POOL. */
+   rep.  If PROPS is set, assume that we want to a props representation as
+   the base for our delta.  Perform temporary allocations in POOL. */
 static svn_error_t *
 write_hash_delta_rep(representation_t *rep,
                      apr_file_t *file,
@@ -7309,6 +7315,7 @@ write_hash_delta_rep(representation_t *r
                      svn_fs_t *fs,
                      node_revision_t *noderev,
                      apr_hash_t *reps_hash,
+                     svn_boolean_t props,
                      apr_pool_t *pool)
 {
   svn_txdelta_window_handler_t diff_wh;
@@ -7329,7 +7336,7 @@ write_hash_delta_rep(representation_t *r
   int diff_version = ffd->format >= SVN_FS_FS__MIN_SVNDIFF1_FORMAT ? 1 : 0;
 
   /* Get the base for this delta. */
-  SVN_ERR(choose_delta_base(&base_rep, fs, noderev, pool));
+  SVN_ERR(choose_delta_base(&base_rep, fs, noderev, props, pool));
   SVN_ERR(read_representation(&source, fs, base_rep, pool));
 
   SVN_ERR(get_file_offset(&rep->offset, file, pool));
@@ -7564,7 +7571,7 @@ write_final_rev(const svn_fs_id_t **new_
           if (ffd->deltify_directories)
             SVN_ERR(write_hash_delta_rep(noderev->data_rep, file,
                                          str_entries, fs, noderev, NULL,
-                                         pool));
+                                         FALSE, pool));
           else
             SVN_ERR(write_hash_rep(noderev->data_rep, file, str_entries,
                                    fs, NULL, pool));
@@ -7603,7 +7610,7 @@ write_final_rev(const svn_fs_id_t **new_
       if (ffd->deltify_properties)
         SVN_ERR(write_hash_delta_rep(noderev->prop_rep, file,
                                      proplist, fs, noderev, reps_hash,
-                                     pool));
+                                     TRUE, pool));
       else
         SVN_ERR(write_hash_rep(noderev->prop_rep, file, proplist,
                                fs, reps_hash, pool));

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.h?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.h Wed Sep 12 16:11:49 2012
@@ -94,13 +94,11 @@ svn_fs_fs__write_noderev(svn_stream_t *o
                          apr_pool_t *pool);
 
 /* Read a node-revision from STREAM. Set *NODEREV to the new structure,
-   allocated in POOL. If ALLOW_FOR_TXN_ROOTS is FALSE, the is-fresh-txn-root
-   flag will be ignored. */
+   allocated in POOL. */
 /* ### Currently used only by fs_fs.c */
 svn_error_t *
 svn_fs_fs__read_noderev(node_revision_t **noderev,
                         svn_stream_t *stream,
-                        svn_boolean_t allow_for_txn_roots,
                         apr_pool_t *pool);
 
 

Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c Wed Sep 12 16:11:49 2012
@@ -223,7 +223,8 @@ capabilities_headers_iterator_callback(v
       if (svn_cstring_casecmp(key, SVN_DAV_ROOT_URI_HEADER) == 0)
         {
           session->repos_root = session->session_url;
-          session->repos_root.path = apr_pstrdup(session->pool, val);
+          session->repos_root.path =
+            (char *)svn_fspath__canonicalize(val, session->pool);
           session->repos_root_str =
             svn_urlpath__canonicalize(
                 apr_uri_unparse(session->pool, &session->repos_root, 0),

Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c Wed Sep 12 16:11:49 2012
@@ -381,10 +381,12 @@ svn_ra_serf__open(svn_ra_session_t *sess
                                _("Illegal URL '%s'"),
                                session_URL);
     }
-  /* Contrary to what the comment for apr_uri_t.path says in apr-util 1.2.12 and
-     older, for root paths url.path will be "", where serf requires "/". */
+  /* Depending the version of apr-util in use, for root paths url.path
+     will be NULL or "", where serf requires "/". */
   if (url.path == NULL || url.path[0] == '\0')
-    url.path = apr_pstrdup(serf_sess->pool, "/");
+    {
+      url.path = apr_pstrdup(serf_sess->pool, "/");
+    }
   if (!url.port)
     {
       url.port = apr_uri_port_of_scheme(url.scheme);
@@ -478,9 +480,18 @@ svn_ra_serf__reparent(svn_ra_session_t *
                                _("Illegal repository URL '%s'"), url);
     }
 
-  /* Maybe we should use a string buffer for these strings so we don't
-     allocate memory in the session on every reparent? */
-  session->session_url.path = apr_pstrdup(session->pool, new_url.path);
+  /* Depending the version of apr-util in use, for root paths url.path
+     will be NULL or "", where serf requires "/". */
+  /* ### Maybe we should use a string buffer for these strings so we
+     ### don't allocate memory in the session on every reparent? */
+  if (new_url.path == NULL || new_url.path[0] == '\0')
+    {
+      session->session_url.path = apr_pstrdup(session->pool, "/");
+    }
+  else
+    {
+      session->session_url.path = apr_pstrdup(session->pool, new_url.path);
+    }
   session->session_url_str = apr_pstrdup(session->pool, url);
 
   return SVN_NO_ERROR;

Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/util.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/util.c Wed Sep 12 16:11:49 2012
@@ -2232,7 +2232,8 @@ svn_ra_serf__discover_vcc(const char **v
 
       /* Now recreate the root_url. */
       session->repos_root = session->session_url;
-      session->repos_root.path = apr_pstrdup(session->pool, url_buf->data);
+      session->repos_root.path =
+        (char *)svn_fspath__canonicalize(url_buf->data, session->pool);
       session->repos_root_str =
         svn_urlpath__canonicalize(apr_uri_unparse(session->pool,
                                                   &session->repos_root, 0),

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/cache-membuffer.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/cache-membuffer.c Wed Sep 12 16:11:49 2012
@@ -576,7 +576,7 @@ drop_entry(svn_membuffer_t *cache, entry
             /* remove the first entry -> insertion may start at pos 0, now */
             cache->current_data = 0;
           }
-          else
+        else
           {
             /* insertion may start right behind the previous entry */
             entry_t *previous = get_entry(cache, entry->previous);
@@ -658,6 +658,11 @@ insert_entry(svn_membuffer_t *cache, ent
       else
         cache->first = idx;
     }
+
+  /* The current insertion position must never point outside our
+   * data buffer.
+   */
+  assert(cache->current_data <= cache->data_size);
 }
 
 /* Map a KEY of 16 bytes to the CACHE and group that shall contain the
@@ -857,6 +862,11 @@ move_entry(svn_membuffer_t *cache, entry
    */
   cache->current_data = entry->offset + size;
   cache->next = entry->next;
+
+  /* The current insertion position must never point outside our
+   * data buffer.
+   */
+  assert(cache->current_data <= cache->data_size);
 }
 
 /* If necessary, enlarge the insertion window until it is at least
@@ -898,7 +908,7 @@ ensure_data_insertable(svn_membuffer_t *
 
       /* leave function as soon as the insertion window is large enough
        */
-      if (end - cache->current_data >= size)
+      if (end >= size + cache->current_data)
         return TRUE;
 
       /* Don't be too eager to cache data. Smaller items will fit into
@@ -1055,8 +1065,10 @@ svn_cache__membuffer_cache_create(svn_me
 
   /* limit the data size to what we can address.
    * Note that this cannot overflow since all values are of size_t.
+   * Also, make it a multiple of the item placement granularity to
+   * prevent subtle overflows.
    */
-  data_size = total_size - directory_size;
+  data_size = ALIGN_VALUE(total_size - directory_size + 1) - ITEM_ALIGNMENT;
 
   /* For cache sizes > 4TB, individual cache segments will be larger
    * than 16GB allowing for >4GB entries.  But caching chunks larger
@@ -1190,7 +1202,7 @@ membuffer_cache_set_internal(svn_membuff
         {
           /* Remove old data for this key, if that exists.
            * Get an unused entry for the key and and initialize it with
-           * the serialized item's (future) posion within data buffer.
+           * the serialized item's (future) position within data buffer.
            */
           entry = find_entry(cache, group_index, to_find, TRUE);
           entry->size = size;

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/deprecated.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/deprecated.c Wed Sep 12 16:11:49 2012
@@ -36,6 +36,7 @@
 #include "svn_path.h"
 #include "svn_opt.h"
 #include "svn_cmdline.h"
+#include "svn_version.h"
 #include "svn_pools.h"
 #include "svn_dso.h"
 #include "svn_mergeinfo.h"
@@ -606,7 +607,7 @@ svn_opt_print_help(apr_getopt_t *os,
   else if (print_version)   /* just --version */
     {
       SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer,
-                                          svn_opt__get_version_info(pool),
+                                          svn_version_extended(FALSE, pool),
                                           quiet, FALSE, pool));
     }
   else if (os && !targets->nelts)            /* `-h', `--help', or `help' */

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/opt.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/opt.c Wed Sep 12 16:11:49 2012
@@ -49,7 +49,6 @@
 #include "private/svn_opt_private.h"
 
 #include "opt.h"
-#include "sysinfo.h"
 #include "svn_private_config.h"
 
 
@@ -1103,49 +1102,24 @@ svn_opt__arg_canonicalize_path(const cha
 }
 
 
-const svn_opt__version_info_t *
-svn_opt__get_version_info(apr_pool_t *pool)
-{
-  svn_opt__version_info_t *info = apr_pcalloc(pool, sizeof(*info));
-
-  info->version_number = SVN_VER_NUMBER;
-  info->version_string =  SVN_VERSION;
-  info->build_date = __DATE__;
-  info->build_time = __TIME__;
-  info->build_host = SVN_BUILD_HOST;
-  info->copyright = apr_pstrdup
-    (pool, _("Copyright (C) 2012 The Apache Software Foundation.\n"
-             "This software consists of contributions made by many "
-             "people; see the NOTICE\n"
-             "file for more information.\n"
-             "Subversion is open source software, see "
-             "http://subversion.apache.org/\n"));
-  info->runtime_host = svn_sysinfo__canonical_host(pool);
-  info->runtime_osname = svn_sysinfo__release_name(pool);
-  info->linked_libs = svn_sysinfo__linked_libs(pool);
-  info->loaded_libs = svn_sysinfo__loaded_libs(pool);
-
-  return info;
-}
-
-
 svn_error_t *
 svn_opt__print_version_info(const char *pgm_name,
                             const char *footer,
-                            const svn_opt__version_info_t *info,
+                            const svn_version_extended_t *info,
                             svn_boolean_t quiet,
                             svn_boolean_t verbose,
                             apr_pool_t *pool)
 {
   if (quiet)
-    return svn_cmdline_printf(pool, "%s\n", info->version_number);
+    return svn_cmdline_printf(pool, "%s\n", SVN_VER_NUMBER);
 
   SVN_ERR(svn_cmdline_printf(pool, _("%s, version %s\n"
                                      "   compiled %s, %s on %s\n\n"),
-                             pgm_name, info->version_string,
-                             info->build_date, info->build_time,
-                             info->build_host));
-  SVN_ERR(svn_cmdline_printf(pool, "%s\n", info->copyright));
+                             pgm_name, SVN_VERSION,
+                             svn_version_ext_build_date(info),
+                             svn_version_ext_build_time(info),
+                             svn_version_ext_build_host(info)));
+  SVN_ERR(svn_cmdline_printf(pool, "%s\n", svn_version_ext_copyright(info)));
 
   if (footer)
     {
@@ -1154,26 +1128,28 @@ svn_opt__print_version_info(const char *
 
   if (verbose)
     {
+      const apr_array_header_t *libs;
+
       SVN_ERR(svn_cmdline_fputs(_("System information:\n\n"), stdout, pool));
       SVN_ERR(svn_cmdline_printf(pool, _("* running on %s\n"),
-                                 info->runtime_host));
-      if (info->runtime_osname)
+                                 svn_version_ext_runtime_host(info)));
+      if (svn_version_ext_runtime_osname(info))
         {
           SVN_ERR(svn_cmdline_printf(pool, _("  - %s\n"),
-                                     info->runtime_osname));
+                                     svn_version_ext_runtime_osname(info)));
         }
 
-      if (info->linked_libs && info->linked_libs->nelts)
+      libs = svn_version_ext_linked_libs(info);
+      if (libs && libs->nelts)
         {
-          const svn_sysinfo__linked_lib_t *lib;
+          const svn_version_ext_linked_lib_t *lib;
           int i;
 
           SVN_ERR(svn_cmdline_fputs(_("* linked dependencies:\n"),
                                     stdout, pool));
-          for (i = 0; i < info->linked_libs->nelts; ++i)
+          for (i = 0; i < libs->nelts; ++i)
             {
-              lib = &APR_ARRAY_IDX(info->linked_libs, i,
-                                   svn_sysinfo__linked_lib_t);
+              lib = &APR_ARRAY_IDX(libs, i, svn_version_ext_linked_lib_t);
               if (lib->runtime_version)
                 SVN_ERR(svn_cmdline_printf(pool,
                                            "  - %s %s (compiled with %s)\n",
@@ -1188,17 +1164,17 @@ svn_opt__print_version_info(const char *
             }
         }
 
-      if (info->loaded_libs && info->loaded_libs->nelts)
+      libs = svn_version_ext_loaded_libs(info);
+      if (libs && libs->nelts)
         {
-          const svn_sysinfo__loaded_lib_t *lib;
+          const svn_version_ext_loaded_lib_t *lib;
           int i;
 
           SVN_ERR(svn_cmdline_fputs(_("* loaded shared libraries:\n"),
                                     stdout, pool));
-          for (i = 0; i < info->loaded_libs->nelts; ++i)
+          for (i = 0; i < libs->nelts; ++i)
             {
-              lib = &APR_ARRAY_IDX(info->loaded_libs, i,
-                                   svn_sysinfo__loaded_lib_t);
+              lib = &APR_ARRAY_IDX(libs, i, svn_version_ext_loaded_lib_t);
               if (lib->version)
                 SVN_ERR(svn_cmdline_printf(pool,
                                            "  - %s   (%s)\n",
@@ -1245,7 +1221,7 @@ svn_opt_print_help4(apr_getopt_t *os,
   else if (print_version)   /* just --version */
     {
       SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer,
-                                          svn_opt__get_version_info(pool),
+                                          svn_version_extended(verbose, pool),
                                           quiet, verbose, pool));
     }
   else if (os && !targets->nelts)            /* `-h', `--help', or `help' */

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/opt.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/opt.h?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/opt.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/opt.h Wed Sep 12 16:11:49 2012
@@ -24,7 +24,7 @@
 #ifndef SVN_LIBSVN_SUBR_OPT_H
 #define SVN_LIBSVN_SUBR_OPT_H
 
-#include <apr_tables.h>
+#include "svn_version.h"
 #include "svn_opt.h"
 
 #ifdef __cplusplus
@@ -32,36 +32,6 @@ extern "C" {
 #endif /* __cplusplus */
 
 
-/* This structure stores the available information about the version,
- * build and runtime environment of the Subversion client libraries.
- */
-typedef struct svn_opt__version_info_t svn_opt__version_info_t;
-struct svn_opt__version_info_t
-{
-  const char *version_number;   /* version number */
-  const char *version_string;   /* version string */
-  const char *build_date;       /* compilation date */
-  const char *build_time;       /* compilation time */
-  const char *build_host;       /* nuild canonical host name */
-  const char *copyright;        /* vopyright notice */
-  const char *runtime_host;     /* runtime canonical host name */
-  const char *runtime_osname;   /* running OS release name */
-
-  /* Array svn_sysinfo__linked_lib_t describing dependent libraries */
-  const apr_array_header_t *linked_libs;
-
-  /* Array of svn_sysinfo__loaded_lib_t describing loaded shared libraries */
-  const apr_array_header_t *loaded_libs;
-};
-
-
-/* Return version information for the running program, allocated from POOL.
- *
- * Use POOL for temporary allocations.
- */
-const svn_opt__version_info_t *
-svn_opt__get_version_info(apr_pool_t *pool);
-
 /* Print version version info for PGM_NAME to the console.  If QUIET is
  * true, print in brief.  Else if QUIET is not true, print the version
  * more verbosely, and if FOOTER is non-null, print it following the
@@ -72,7 +42,7 @@ svn_opt__get_version_info(apr_pool_t *po
 svn_error_t *
 svn_opt__print_version_info(const char *pgm_name,
                             const char *footer,
-                            const svn_opt__version_info_t *info,
+                            const svn_version_extended_t *info,
                             svn_boolean_t quiet,
                             svn_boolean_t verbose,
                             apr_pool_t *pool);

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/string.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/string.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/string.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/string.c Wed Sep 12 16:11:49 2012
@@ -578,6 +578,80 @@ svn_stringbuf_appendcstr(svn_stringbuf_t
   svn_stringbuf_appendbytes(targetstr, cstr, strlen(cstr));
 }
 
+void
+svn_stringbuf_insert(svn_stringbuf_t *str,
+                     apr_size_t pos,
+                     const char *bytes,
+                     apr_size_t count)
+{
+  if (bytes + count > str->data && bytes < str->data + str->blocksize)
+    {
+      /* special case: BYTES overlaps with this string -> copy the source */
+      const char *temp = apr_pstrndup(str->pool, bytes, count);
+      svn_stringbuf_insert(str, pos, temp, count);
+    }
+  else
+    {
+      if (pos > str->len)
+        pos = str->len;
+
+      svn_stringbuf_ensure(str, str->len + count);
+      memmove(str->data + pos + count, str->data + pos, str->len - pos + 1);
+      memcpy(str->data + pos, bytes, count);
+
+      str->len += count;
+    }
+}
+
+void
+svn_stringbuf_remove(svn_stringbuf_t *str,
+                     apr_size_t pos,
+                     apr_size_t count)
+{
+  if (pos > str->len)
+    pos = str->len;
+  if (pos + count > str->len)
+    count = str->len - pos;
+
+  memmove(str->data + pos, str->data + pos + count, str->len - pos - count + 1);
+  str->len -= count;
+}
+
+void
+svn_stringbuf_replace(svn_stringbuf_t *str,
+                      apr_size_t pos,
+                      apr_size_t old_count,
+                      const char *bytes,
+                      apr_size_t new_count)
+{
+  if (bytes + new_count > str->data && bytes < str->data + str->blocksize)
+    {
+      /* special case: BYTES overlaps with this string -> copy the source */
+      const char *temp = apr_pstrndup(str->pool, bytes, new_count);
+      svn_stringbuf_replace(str, pos, old_count, temp, new_count);
+    }
+  else
+    {
+      if (pos > str->len)
+        pos = str->len;
+      if (pos + old_count > str->len)
+        old_count = str->len - pos;
+
+      if (old_count < new_count)
+        {
+          apr_size_t delta = new_count - old_count;
+          svn_stringbuf_ensure(str, str->len + delta);
+        }
+
+      if (old_count != new_count)
+        memmove(str->data + pos + new_count, str->data + pos + old_count,
+                str->len - pos - old_count + 1);
+
+      memcpy(str->data + pos, bytes, new_count);
+      str->len += new_count - old_count;
+    }
+}
+
 
 svn_stringbuf_t *
 svn_stringbuf_dup(const svn_stringbuf_t *original_string, apr_pool_t *pool)
@@ -989,7 +1063,7 @@ svn__ui64toa(char * dest, apr_uint64_t n
       target -= 8;
     }
 
-  /* Now, the number fits into 32 bits, but is larger than 1 */
+  /* Now, the number fits into 32 bits, but may still be larger than 99 */
   reduced = (apr_uint32_t)(number);
   while (reduced >= 100)
     {

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c Wed Sep 12 16:11:49 2012
@@ -47,6 +47,7 @@
 #include "svn_io.h"
 #include "svn_string.h"
 #include "svn_utf.h"
+#include "svn_version.h"
 
 #include "private/svn_sqlite.h"
 
@@ -88,7 +89,7 @@ static const apr_array_header_t *macos_s
 #endif
 
 
-#if LINUX
+#if __linux__
 static const char *linux_release_name(apr_pool_t *pool);
 #endif
 
@@ -112,7 +113,7 @@ svn_sysinfo__release_name(apr_pool_t *po
   return win32_release_name(pool);
 #elif defined(SVN_HAVE_MACOS_PLIST)
   return macos_release_name(pool);
-#elif LINUX
+#elif __linux__
   return linux_release_name(pool);
 #elif HAVE_UNAME
   return release_name_from_uname(pool);
@@ -124,20 +125,20 @@ svn_sysinfo__release_name(apr_pool_t *po
 const apr_array_header_t *
 svn_sysinfo__linked_libs(apr_pool_t *pool)
 {
-  svn_sysinfo__linked_lib_t *lib;
+  svn_version_ext_linked_lib_t *lib;
   apr_array_header_t *array = apr_array_make(pool, 3, sizeof(*lib));
 
-  lib = &APR_ARRAY_PUSH(array, svn_sysinfo__linked_lib_t);
+  lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
   lib->name = "APR";
   lib->compiled_version = APR_VERSION_STRING;
   lib->runtime_version = apr_pstrdup(pool, apr_version_string());
 
-  lib = &APR_ARRAY_PUSH(array, svn_sysinfo__linked_lib_t);
+  lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
   lib->name = "APR-Util";
   lib->compiled_version = APU_VERSION_STRING;
   lib->runtime_version = apr_pstrdup(pool, apu_version_string());
 
-  lib = &APR_ARRAY_PUSH(array, svn_sysinfo__linked_lib_t);
+  lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
   lib->name = "SQLite";
   lib->compiled_version = apr_pstrdup(pool, svn_sqlite__compiled_version());
 #ifdef SVN_SQLITE_INLINE
@@ -268,7 +269,7 @@ release_name_from_uname(apr_pool_t *pool
 #endif  /* HAVE_UNAME */
 
 
-#if LINUX
+#if __linux__
 /* Split a stringbuf into a key/value pair.
    Return the key, leaving the striped value in the stringbuf. */
 static const char *
@@ -532,7 +533,7 @@ linux_release_name(apr_pool_t *pool)
 
   return apr_psprintf(pool, "%s [%s]", release_name, uname_release);
 }
-#endif /* LINUX */
+#endif /* __linux__ */
 
 
 #ifdef WIN32
@@ -829,7 +830,7 @@ win32_shared_libs(apr_pool_t *pool)
           filename = wcs_to_utf8(buffer, pool);
           if (filename)
             {
-              svn_sysinfo__loaded_lib_t *lib;
+              svn_version_ext_loaded_lib_t *lib;
               char *truename;
 
               if (0 == apr_filepath_merge(&truename, "", filename,
@@ -842,7 +843,7 @@ win32_shared_libs(apr_pool_t *pool)
                 {
                   array = apr_array_make(pool, 32, sizeof(*lib));
                 }
-              lib = &APR_ARRAY_PUSH(array, svn_sysinfo__loaded_lib_t);
+              lib = &APR_ARRAY_PUSH(array, svn_version_ext_loaded_lib_t);
               lib->name = filename;
               lib->version = version;
             }
@@ -1062,7 +1063,7 @@ macos_shared_libs(apr_pool_t *pool)
       const char *filename = _dyld_get_image_name(i);
       const char *version;
       char *truename;
-      svn_sysinfo__loaded_lib_t *lib;
+      svn_version_ext_loaded_lib_t *lib;
 
       if (!(header && filename))
         break;
@@ -1100,7 +1101,7 @@ macos_shared_libs(apr_pool_t *pool)
             {
               result = apr_array_make(pool, 32, sizeof(*lib));
             }
-          lib = &APR_ARRAY_PUSH(result, svn_sysinfo__loaded_lib_t);
+          lib = &APR_ARRAY_PUSH(result, svn_version_ext_loaded_lib_t);
         }
       else
         {
@@ -1108,7 +1109,7 @@ macos_shared_libs(apr_pool_t *pool)
             {
               dylibs = apr_array_make(pool, 32, sizeof(*lib));
             }
-          lib = &APR_ARRAY_PUSH(dylibs, svn_sysinfo__loaded_lib_t);
+          lib = &APR_ARRAY_PUSH(dylibs, svn_version_ext_loaded_lib_t);
         }
 
       lib->name = filename;

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.h?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.h Wed Sep 12 16:11:49 2012
@@ -31,7 +31,6 @@
 extern "C" {
 #endif /* __cplusplus */
 
-
 /* Return a canonical name similar to the output of config.guess,
  * identifying the running system.
  *
@@ -46,16 +45,7 @@ const char *svn_sysinfo__canonical_host(
  */
 const char *svn_sysinfo__release_name(apr_pool_t *pool);
 
-/* Describes a linked dependency library */
-typedef struct svn_sysinfo__linked_lib_t svn_sysinfo__linked_lib_t;
-struct svn_sysinfo__linked_lib_t
-{
-  const char *name;             /* library name */
-  const char *compiled_version; /* compile-time version string */
-  const char *runtime_version;  /* run-time version string (optional) */
-};
-
-/* Return an array of svn_sysinfo__linked_lib_t of descriptions of the
+/* Return an array of svn_version_linked_lib_t of descriptions of the
  * link-time and run-time versions of dependent libraries, or NULL of
  * the info is not available.
  *
@@ -63,15 +53,7 @@ struct svn_sysinfo__linked_lib_t
  */
 const apr_array_header_t *svn_sysinfo__linked_libs(apr_pool_t *pool);
 
-/* Describes a loaded shared library */
-typedef struct svn_sysinfo__loaded_lib_t svn_sysinfo__loaded_lib_t;
-struct svn_sysinfo__loaded_lib_t
-{
-  const char *name;             /* library name */
-  const char *version;          /* library version (optional) */
-};
-
-/* Return an array of svn_sysinfo__loaded_lib_t of descriptions of
+/* Return an array of svn_version_loaded_lib_t of descriptions of
  * shared libraries loaded by the running process, including their
  * versions where applicable, or NULL if the information is not
  * available.

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/utf_validate.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/utf_validate.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/utf_validate.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/utf_validate.c Wed Sep 12 16:11:49 2012
@@ -58,6 +58,7 @@
 
 #include "private/svn_utf_private.h"
 #include "private/svn_eol_private.h"
+#include "private/svn_dep_compat.h"
 
 /* Lookup table to categorise each octet in the string. */
 static const char octet_category[256] = {
@@ -250,11 +251,12 @@ static const char machine [9][14] = {
    FSM_ERROR},        /* 0xf5-0xff */
 };
 
-/* Scan MAX_LEN bytes in *DATA for non-ASCII chars. Return the position
- * of the first non-ASCII char or DATA + MAX_LEN if all were ASCII.
+/* Scan MAX_LEN bytes in *DATA for chars that are not in the octet
+ * category 0 (FSM_START).  Return the position of the first such char
+ * or DATA + MAX_LEN if all were cat 0.
  */
 static const char *
-first_non_ascii_char(const char *data, apr_size_t max_len)
+first_non_fsm_start_char(const char *data, apr_size_t max_len)
 {
 #if !SVN_UNALIGNED_ACCESS_IS_OK
 
@@ -269,8 +271,8 @@ first_non_ascii_char(const char *data, a
       max_len -= len;
 
       for (; len > 0; ++data, --len)
-          if (*data < 0)
-            return data;
+        if (*data < 0 || *data >= 0x80)
+          return data;
     }
     
 #endif
@@ -283,17 +285,18 @@ first_non_ascii_char(const char *data, a
 
   /* The remaining odd bytes will be examined the naive way: */
   for (; max_len > 0; ++data, --max_len)
-    if (*data < 0)
-      return data;
+    if (*data < 0 || *data >= 0x80)
+      break;
 
   return data;
 }
 
-/* Scan the C string in *DATA for non-ASCII chars. Return the position
- * of either the first non-ASCII char or the terminating NUL.
+/* Scan the C string in *DATA for chars that are not in the octet
+ * category 0 (FSM_START).  Return the position of either the such
+ * char or of the terminating NUL.
  */
 static const char *
-first_non_ascii_char_cstring(const char *data)
+first_non_fsm_start_char_cstring(const char *data)
 {
   /* We need to make sure that BUF is properly aligned for chunky data
    * access because we don't know the string's length. Unaligned chunk
@@ -301,7 +304,7 @@ first_non_ascii_char_cstring(const char 
    * segfault.
    */
   for (; (apr_uintptr_t)data & (sizeof(apr_uintptr_t)-1); ++data)
-    if (*data <= 0)
+    if (*data <= 0 || *data >= 0x80)
       return data;
 
   /* Scan the input one machine word at a time. */
@@ -320,8 +323,8 @@ first_non_ascii_char_cstring(const char 
 
   /* The remaining odd bytes will be examined the naive way: */
   for (; ; ++data)
-    if (*data <= 0)
-      return data;
+    if (*data <= 0 || *data >= 0x80)
+      break;
 
   return data;
 }
@@ -329,7 +332,7 @@ first_non_ascii_char_cstring(const char 
 const char *
 svn_utf__last_valid(const char *data, apr_size_t len)
 {
-  const char *start = first_non_ascii_char(data, len);
+  const char *start = first_non_fsm_start_char(data, len);
   const char *end = data + len;
   int state = FSM_START;
 
@@ -349,7 +352,7 @@ svn_boolean_t
 svn_utf__cstring_is_valid(const char *data)
 {
   int state = FSM_START;
-  data = first_non_ascii_char_cstring(data);
+  data = first_non_fsm_start_char_cstring(data);
 
   while (*data)
     {
@@ -365,7 +368,7 @@ svn_utf__is_valid(const char *data, apr_
 {
   const char *end = data + len;
   int state = FSM_START;
-  data = first_non_ascii_char(data, len);
+  data = first_non_fsm_start_char(data, len);
 
   while (data < end)
     {
@@ -379,7 +382,7 @@ svn_utf__is_valid(const char *data, apr_
 const char *
 svn_utf__last_valid2(const char *data, apr_size_t len)
 {
-  const char *start = first_non_ascii_char(data, len);
+  const char *start = first_non_fsm_start_char(data, len);
   const char *end = data + len;
   int state = FSM_START;
 

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/version.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/version.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/version.c Wed Sep 12 16:11:49 2012
@@ -26,6 +26,7 @@
 #include "svn_error.h"
 #include "svn_version.h"
 
+#include "sysinfo.h"
 #include "svn_private_config.h"
 
 const svn_version_t *
@@ -96,3 +97,99 @@ svn_ver_check_list(const svn_version_t *
 
   return err;
 }
+
+
+struct svn_version_extended_t
+{
+  const char *build_date;       /* Compilation date */
+  const char *build_time;       /* Compilation time */
+  const char *build_host;       /* Build canonical host name */
+  const char *copyright;        /* Copyright notice (localized) */
+  const char *runtime_host;     /* Runtime canonical host name */
+  const char *runtime_osname;   /* Running OS release name */
+
+  /* Array of svn_version_ext_linked_lib_t describing dependent
+     libraries. */
+  const apr_array_header_t *linked_libs;
+
+  /* Array of svn_version_ext_loaded_lib_t describing loaded shared
+     libraries. */
+  const apr_array_header_t *loaded_libs;
+};
+
+
+const svn_version_extended_t *
+svn_version_extended(svn_boolean_t verbose,
+                     apr_pool_t *pool)
+{
+  svn_version_extended_t *info = apr_pcalloc(pool, sizeof(*info));
+
+  info->build_date = __DATE__;
+  info->build_time = __TIME__;
+  info->build_host = SVN_BUILD_HOST;
+  info->copyright = apr_pstrdup
+    (pool, _("Copyright (C) 2012 The Apache Software Foundation.\n"
+             "This software consists of contributions made by many people;\n"
+             "see the NOTICE file for more information.\n"
+             "Subversion is open source software, see "
+             "http://subversion.apache.org/\n"));
+
+  if (verbose)
+    {
+      info->runtime_host = svn_sysinfo__canonical_host(pool);
+      info->runtime_osname = svn_sysinfo__release_name(pool);
+      info->linked_libs = svn_sysinfo__linked_libs(pool);
+      info->loaded_libs = svn_sysinfo__loaded_libs(pool);
+    }
+
+  return info;
+}
+
+
+const char *
+svn_version_ext_build_date(const svn_version_extended_t *ext_info)
+{
+  return ext_info->build_date;
+}
+
+const char *
+svn_version_ext_build_time(const svn_version_extended_t *ext_info)
+{
+  return ext_info->build_time;
+}
+
+const char *
+svn_version_ext_build_host(const svn_version_extended_t *ext_info)
+{
+  return ext_info->build_host;
+}
+
+const char *
+svn_version_ext_copyright(const svn_version_extended_t *ext_info)
+{
+  return ext_info->copyright;
+}
+
+const char *
+svn_version_ext_runtime_host(const svn_version_extended_t *ext_info)
+{
+  return ext_info->runtime_host;
+}
+
+const char *
+svn_version_ext_runtime_osname(const svn_version_extended_t *ext_info)
+{
+  return ext_info->runtime_osname;
+}
+
+const apr_array_header_t *
+svn_version_ext_linked_libs(const svn_version_extended_t *ext_info)
+{
+  return ext_info->linked_libs;
+}
+
+const apr_array_header_t *
+svn_version_ext_loaded_libs(const svn_version_extended_t *ext_info)
+{
+  return ext_info->loaded_libs;
+}

Modified: subversion/branches/inheritable-props/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn/cl.h?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn/cl.h (original)
+++ subversion/branches/inheritable-props/subversion/svn/cl.h Wed Sep 12 16:11:49 2012
@@ -108,6 +108,12 @@ typedef enum svn_cl__accept_t
 svn_cl__accept_t
 svn_cl__accept_from_word(const char *word);
 
+/* --search and --isearch option values */
+typedef struct svn_cl__search_pattern_t {
+  const char *pattern; /* glob syntax */
+  svn_boolean_t case_insensitive;
+} svn_cl__search_pattern_t;
+
 
 /*** Mergeinfo flavors. ***/
 
@@ -237,8 +243,7 @@ typedef struct svn_cl__opt_state_t
   svn_boolean_t allow_mixed_rev; /* Allow operation on mixed-revision WC */
   svn_boolean_t include_externals; /* Recurses (in)to file & dir externals */
   svn_boolean_t show_inherited_props; /* get inherited properties */
-  const char *search_pattern;     /* pattern argument for --search */
-  svn_boolean_t case_insensitive_search; /* perform case-insensitive search */
+  apr_array_header_t* search_patterns; /* pattern arguments for --search */
 
   svn_wc_conflict_resolver_func2_t conflict_func;
   void *conflict_baton;

Modified: subversion/branches/inheritable-props/subversion/svn/file-merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn/file-merge.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn/file-merge.c (original)
+++ subversion/branches/inheritable-props/subversion/svn/file-merge.c Wed Sep 12 16:11:49 2012
@@ -851,6 +851,7 @@ svn_cl__merge_file(const char *base_path
   apr_file_t *merged_file;
   const char *merged_file_name;
   struct file_merge_baton fmb;
+  svn_boolean_t executable;
 
 
   SVN_ERR(svn_cmdline_printf(
@@ -912,7 +913,9 @@ svn_cl__merge_file(const char *base_path
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR_W(svn_io_file_move(merged_file_name, merged_path, scratch_pool),
+  SVN_ERR(svn_io_is_file_executable(&executable, merged_path, scratch_pool));
+  SVN_ERR_W(svn_io_copy_file(merged_file_name, merged_path, FALSE,
+                             scratch_pool),
             apr_psprintf(scratch_pool,
                          _("Could not write merged result to '%s', saved "
                            "instead at '%s'.\n'%s' remains in conflict.\n"),
@@ -924,6 +927,9 @@ svn_cl__merge_file(const char *base_path
                          svn_dirent_local_style(
                            svn_dirent_skip_ancestor(path_prefix, wc_path),
                            scratch_pool)));
+  SVN_ERR(svn_io_set_file_executable(merged_path, executable, FALSE,
+                                     scratch_pool));
+  SVN_ERR(svn_io_remove_file2(merged_file_name, TRUE, scratch_pool));
 
   /* The merge was not aborted and we could install the merged result. The
    * file remains in conflict unless all conflicting sections were resolved. */

Modified: subversion/branches/inheritable-props/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn/log-cmd.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn/log-cmd.c (original)
+++ subversion/branches/inheritable-props/subversion/svn/log-cmd.c Wed Sep 12 16:11:49 2012
@@ -71,10 +71,9 @@ struct log_receiver_baton
   /* Stack which keeps track of merge revision nesting, using svn_revnum_t's */
   apr_array_header_t *merge_stack;
 
-  /* Log message search pattern. Log entries will only be shown if the author,
-   * the log message, or a changed path matches this pattern. */
-  const char *search_pattern;
-  svn_boolean_t case_insensitive_search;
+  /* Log message search patterns. Log entries will only be shown if the author,
+   * the log message, or a changed path matches one of these patterns. */
+  apr_array_header_t *search_patterns;
 
   /* Pool for persistent allocations. */
   apr_pool_t *pool;
@@ -203,6 +202,51 @@ match_search_pattern(const char *search_
   return FALSE;
 }
 
+/* Match all search patterns in SEARCH_PATTERNS against AUTHOR, DATE, MESSAGE,
+ * and CHANGED_PATHS. Return TRUE if any pattern matches, else FALSE.
+ * SCRACH_POOL is used for temporary allocations. */
+static svn_boolean_t
+match_search_patterns(apr_array_header_t *search_patterns,
+                      const char *author,
+                      const char *date,
+                      const char *message,
+                      apr_hash_t *changed_paths,
+                      apr_pool_t *scratch_pool)
+{
+  int i;
+  svn_boolean_t match = FALSE;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+
+  for (i = 0; i < search_patterns->nelts; i++)
+    {
+      apr_array_header_t *pattern_group;
+      int j;
+
+      pattern_group = APR_ARRAY_IDX(search_patterns, i, apr_array_header_t *);
+
+      /* All patterns within the group must match. */
+      for (j = 0; j < pattern_group->nelts; j++)
+        {
+          svn_cl__search_pattern_t p;
+
+          svn_pool_clear(iterpool);
+          
+          p = APR_ARRAY_IDX(pattern_group, j, svn_cl__search_pattern_t);
+          match = match_search_pattern(p.pattern, author, date,
+                                       message, changed_paths,
+                                       p.case_insensitive, iterpool);
+          if (!match)
+            break;
+        }
+
+      match = (match && j == pattern_group->nelts);
+      if (match)
+        break;
+    }
+  svn_pool_destroy(iterpool);
+
+  return match;
+}
 
 /* Implement `svn_log_entry_receiver_t', printing the logs in
  * a human-readable and machine-parseable format.
@@ -320,10 +364,9 @@ log_entry_receiver(void *baton,
   if (! lb->omit_log_message && message == NULL)
     message = "";
 
-  if (lb->search_pattern &&
-      ! match_search_pattern(lb->search_pattern, author, date, message,
-                             log_entry->changed_paths2,
-                             lb->case_insensitive_search, pool))
+  if (lb->search_patterns &&
+      ! match_search_patterns(lb->search_patterns, author, date, message,
+                              log_entry->changed_paths2, pool))
     {
       if (log_entry->has_children)
         APR_ARRAY_PUSH(lb->merge_stack, svn_revnum_t) = log_entry->revision;
@@ -505,10 +548,9 @@ log_entry_receiver_xml(void *baton,
     }
 
   /* Match search pattern before XML-escaping. */
-  if (lb->search_pattern &&
-      ! match_search_pattern(lb->search_pattern, author, date, message,
-                             log_entry->changed_paths2,
-                             lb->case_insensitive_search, pool))
+  if (lb->search_patterns &&
+      ! match_search_patterns(lb->search_patterns, author, date, message,
+                              log_entry->changed_paths2, pool))
     {
       if (log_entry->has_children)
         APR_ARRAY_PUSH(lb->merge_stack, svn_revnum_t) = log_entry->revision;
@@ -740,8 +782,7 @@ svn_cl__log(apr_getopt_t *os,
                                                    : opt_state->depth;
   lb.diff_extensions = opt_state->extensions;
   lb.merge_stack = apr_array_make(pool, 0, sizeof(svn_revnum_t));
-  lb.search_pattern = opt_state->search_pattern;
-  lb.case_insensitive_search = opt_state->case_insensitive_search;
+  lb.search_patterns = opt_state->search_patterns;
   lb.pool = pool;
 
   if (opt_state->xml)

Modified: subversion/branches/inheritable-props/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svn/main.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svn/main.c (original)
+++ subversion/branches/inheritable-props/subversion/svn/main.c Wed Sep 12 16:11:49 2012
@@ -132,6 +132,8 @@ typedef enum svn_cl__longopt_t {
   opt_show_inherited_props,
   opt_search,
   opt_isearch,
+  opt_search_and,
+  opt_isearch_and,
 } svn_cl__longopt_t;
 
 
@@ -381,6 +383,11 @@ const apr_getopt_option_t svn_cl__option
                        N_("use ARG as search pattern (glob syntax)")},
   {"isearch", opt_isearch, 1,
                        N_("like --search, but case-insensitive")}, 
+  {"search-and", opt_search_and, 1,
+                       N_("combine ARG with the previous search pattern")},
+
+  {"isearch-and", opt_isearch_and, 1,
+                       N_("like --search-and, but case-insensitive")}, 
 
   /* Long-opt Aliases
    *
@@ -686,12 +693,18 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "  and limits the scope of the displayed diff to the specified depth.\n"
      "\n"
      "  If the --search option is used, log messages are displayed only if the\n"
-     "  provided search pattern matches the author, date, log message text,\n"
-     "  or, if the --verbose option is also provided, a changed path.\n"
-     "  The search pattern may include glob syntax wildcards:\n"
+     "  provided search pattern matches any of the author, date, log message\n"
+     "  text (unless --quiet is used), or, if the --verbose option is also\n"
+     "  provided, a changed path.\n"
+     "  The search pattern may include \"glob syntax\" wildcards:\n"
      "      ?      matches any single character\n"
      "      *      matches a sequence of arbitrary characters\n"
-     "      [...]  matches any of the characters listed inside the brackets\n"
+     "      [abc]  matches any of the characters listed inside the brackets\n"
+     "  If multiple --search options are provided, a log message is shown if\n"
+     "  it matches any of the provided search patterns. If the --search-and\n"
+     "  option is used, that option's argument is combined with the pattern\n"
+     "  from the previous --search or --search-and option, and a log message\n"
+     "  is shown only if it matches the combined search pattern.\n"
      "  If --limit is used in combination with --search, --limit restricts the\n"
      "  number of log messages searched, rather than restricting the output\n"
      "  to a particular number of matching log messages.\n"
@@ -724,7 +737,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
     {'r', 'q', 'v', 'g', 'c', opt_targets, opt_stop_on_copy, opt_incremental,
      opt_xml, 'l', opt_with_all_revprops, opt_with_no_revprops, opt_with_revprop,
      opt_depth, opt_diff, opt_diff_cmd, opt_internal_diff, 'x', opt_search,
-     opt_isearch},
+     opt_search_and, opt_isearch, opt_isearch_and},
     {{opt_with_revprop, N_("retrieve revision property ARG")},
      {'c', N_("the change made in revision ARG")}} },
 
@@ -734,19 +747,22 @@ const svn_opt_subcommand_desc2_t svn_cl_
        * (with quotes and newlines removed). */
 "Merge changes into a working copy.\n"
 "usage: 1. merge SOURCE[@REV] [TARGET_WCPATH]\n"
-"          (the 'sync' merge)\n"
+"          (the 'automatic' merge)\n"
 "       2. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
 "          (the 'cherry-pick' merge)\n"
 "       3. merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
 "          (the '2-URL' merge)\n"
 "\n"
-"  1. This form, with one source path and no revision range:\n"
+"  1. This form, with with one source path and no revision range, is called\n"
+"     an 'automatic' merge:\n"
 "\n"
 "       svn merge SOURCE[@REV] [TARGET_WCPATH]\n"
 "\n"
-"     finds all the changes on the source branch that have not already been\n"
-"     merged to the target branch, and merges them. Merge tracking is used\n"
-"     to know which changes have already been merged.\n"
+"     The automatic merge is used for the 'sync' and 'reintegrate' merges\n"
+"     in the 'feature branch' pattern described below. It finds all the\n"
+"     changes on the source branch that have not already been merged to the\n"
+"     target branch, and merges them into the working copy. Merge tracking\n"
+"     is used to know which changes have already been merged.\n"
 "\n"
 "     SOURCE specifies the branch from where the changes will be pulled, and\n"
 "     TARGET_WCPATH specifies a working copy of the target branch to which\n"
@@ -768,28 +784,23 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "\n"
 "       - The 'Feature Branch' Merging Pattern -\n"
 "\n"
-"     In this commonly used pattern of merging, a developer is working on\n"
-"     a feature development branch, committing a series of changes that\n"
-"     implement the feature. The developer periodically merges all the\n"
-"     latest changes from the 'parent' branch (from which the feature branch\n"
-"     is branched off). When the feature development is complete, the\n"
-"     developer integrates the feature back into the parent branch by\n"
-"     merging the other way, into a trunk working copy.\n"
+"     In this commonly used work flow, known also as the 'development\n"
+"     branch' pattern, a developer creates a branch and commits a series of\n"
+"     changes that implement a new feature. The developer periodically\n"
+"     merges all the latest changes from the parent branch so as to keep the\n"
+"     development branch up to date with those changes. When the feature is\n"
+"     complete, the developer performs a merge from the feature branch to\n"
+"     the parent branch to re-integrate the changes.\n"
 "\n"
-"         trunk  --+----------o------o-o-------------o--\n"
+"         parent --+----------o------o-o-------------o--\n"
 "                   \\            \\           \\      /\n"
 "                    \\          merge      merge  merge\n"
 "                     \\            \\           \\  /\n"
 "         feature      +--o-o-------o----o-o----o-------\n"
 "\n"
-"     In this pattern, a merge from the parent branch to the feature branch\n"
-"     is known as a 'sync' merge (or 'catch-up' merge), and a merge from the\n"
-"     feature branch to the parent branch may be called a 'reintegrate'\n"
-"     merge. The 'sync' merges are normally low-risk because the parent\n"
-"     branch is considered to be more 'stable' than the feature branch, in\n"
-"     the sense of being less likely to contain incomplete or broken work.\n"
-"     By syncing often, these merges can be kept small, avoiding the need\n"
-"     for a difficult 'big bang' merge at reintegration time.\n"
+"     A merge from the parent branch to the feature branch is called a\n"
+"     'sync' or 'catch-up' merge, and a merge from the feature branch to the\n"
+"     parent branch is called a 'reintegrate' merge.\n"
 "\n"
 "       - Sync Merge Example -\n"
 "                                 ............\n"
@@ -803,8 +814,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "\n"
 "     Subversion will locate all the changes on 'trunk' that have not yet\n"
 "     been merged into the 'feature' branch. In this case that is a single\n"
-"     range, r100:200. In the diagram above, L marks the left side\n"
-"     (trunk@100) and R marks the right side (trunk@200) of the merge. The\n"
+"     range, r100:200. In the diagram above, L marks the left side (trunk@100)\n"
+"     and R marks the right side (trunk@200) of the merge source. The\n"
 "     difference between L and R will be applied to the target working copy\n"
 "     path. In this case, the working copy is a clean checkout of the entire\n"
 "     'feature' branch.\n"
@@ -819,7 +830,6 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "     others. You can review the changes and you may have to resolve\n"
 "     conflicts before you commit the merge.\n"
 "\n"
-"\n"
 "       - Reintegrate Merge Example -\n"
 "\n"
 "     The feature branch was last synced with trunk up to revision X. So the\n"
@@ -1582,6 +1592,53 @@ svn_cl__check_cancel(void *baton)
     return SVN_NO_ERROR;
 }
 
+/* Add a --search or --isearch argument to OPT_STATE.
+ * These options start a new search pattern group. */
+static void
+add_search_pattern_group(svn_cl__opt_state_t *opt_state,
+                         const char *pattern,
+                         svn_boolean_t case_insensitive,
+                         apr_pool_t *result_pool)
+{
+  svn_cl__search_pattern_t p;
+  apr_array_header_t *group = NULL;
+
+  if (opt_state->search_patterns == NULL)
+    opt_state->search_patterns = apr_array_make(result_pool, 1,
+                                                sizeof(apr_array_header_t *));
+
+  group = apr_array_make(result_pool, 1, sizeof(svn_cl__search_pattern_t));
+  p.pattern = pattern;
+  p.case_insensitive = case_insensitive;
+  APR_ARRAY_PUSH(group, svn_cl__search_pattern_t) = p;
+  APR_ARRAY_PUSH(opt_state->search_patterns, apr_array_header_t *) = group;
+}
+
+/* Add a --search-and or --isearch-and argument to OPT_STATE.
+ * These patterns are added to an existing pattern group, if any. */
+static void
+add_search_pattern_to_latest_group(svn_cl__opt_state_t *opt_state,
+                                   const char *pattern,
+                                   svn_boolean_t case_insensitive,
+                                   apr_pool_t *result_pool)
+{
+  svn_cl__search_pattern_t p;
+  apr_array_header_t *group;
+
+  if (opt_state->search_patterns == NULL)
+    {
+      add_search_pattern_group(opt_state, pattern, case_insensitive,
+                               result_pool);
+      return;
+    }
+
+  group = APR_ARRAY_IDX(opt_state->search_patterns,
+                        opt_state->search_patterns->nelts - 1,
+                        apr_array_header_t *);
+  p.pattern = pattern;
+  p.case_insensitive = case_insensitive;
+  APR_ARRAY_PUSH(group, svn_cl__search_pattern_t) = p;
+}
 
 
 /*** Main. ***/
@@ -2136,11 +2193,15 @@ sub_main(int argc, const char *argv[], a
         opt_state.diff.properties_only = TRUE;
         break;
       case opt_search:
-        opt_state.search_pattern = opt_arg;
+        add_search_pattern_group(&opt_state, opt_arg, FALSE, pool);
         break;
       case opt_isearch:
-        opt_state.search_pattern = opt_arg;
-        opt_state.case_insensitive_search = TRUE;
+        add_search_pattern_group(&opt_state, opt_arg, TRUE, pool);
+        break;
+      case opt_search_and:
+        add_search_pattern_to_latest_group(&opt_state, opt_arg, FALSE, pool);
+      case opt_isearch_and:
+        add_search_pattern_to_latest_group(&opt_state, opt_arg, TRUE, pool);
         break;
       default:
         /* Hmmm. Perhaps this would be a good place to squirrel away

Modified: subversion/branches/inheritable-props/subversion/svnversion/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svnversion/main.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svnversion/main.c (original)
+++ subversion/branches/inheritable-props/subversion/svnversion/main.c Wed Sep 12 16:11:49 2012
@@ -57,19 +57,19 @@ help(const apr_getopt_option_t *options,
     (svn_cmdline_fprintf
      (stdout, pool,
       _("usage: svnversion [OPTIONS] [WC_PATH [TRAIL_URL]]\n\n"
-        "  Produce a compact 'version number' for the working copy path\n"
+        "  Produce a compact version identifier for the working copy path\n"
         "  WC_PATH.  TRAIL_URL is the trailing portion of the URL used to\n"
         "  determine if WC_PATH itself is switched (detection of switches\n"
-        "  within WC_PATH does not rely on TRAIL_URL).  The version number\n"
+        "  within WC_PATH does not rely on TRAIL_URL).  The version identifier\n"
         "  is written to standard output.  For example:\n"
         "\n"
         "    $ svnversion . /repos/svn/trunk\n"
         "    4168\n"
         "\n"
-        "  The version number will be a single number if the working\n"
+        "  The version identifier will be a single number if the working\n"
         "  copy is single revision, unmodified, not switched and with\n"
         "  a URL that matches the TRAIL_URL argument.  If the working\n"
-        "  copy is unusual the version number will be more complex:\n"
+        "  copy is unusual the version identifier will be more complex:\n"
         "\n"
         "   4123:4168     mixed revision working copy\n"
         "   4168M         modified working copy\n"

Modified: subversion/branches/inheritable-props/subversion/svnversion/svnversion.1
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svnversion/svnversion.1?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svnversion/svnversion.1 (original)
+++ subversion/branches/inheritable-props/subversion/svnversion/svnversion.1 Wed Sep 12 16:11:49 2012
@@ -23,7 +23,7 @@
 .\"
 .TH svnversion 1
 .SH NAME
-svnversion \- Produce a compact version number for a working copy.
+svnversion \- Produce a compact version identifier for a working copy.
 .SH SYNOPSIS
 .TP
 \fBsvnversion\fP [\fIoptions\fP] [\fIwc_path\fP [\fItrail_url\fP]]

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests.py?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests.py Wed Sep 12 16:11:49 2012
@@ -95,13 +95,41 @@ rep_lines_res = [
                   'Subversion command-line client, version X.Y.Z.'),
                 ]
 
+# This is a trigger pattern that selects the secondary set of
+# delete/replace patterns
+switch_res_line = 'System information:'
+
+# This is a list of lines to delete after having seen switch_res_line.
+switched_del_lines_res = [
+                          # In svn --version --verbose, dependent libs loaded
+                          # shared libs are optional.
+                          re.compile(r'^\* (loaded|linked)'),
+                          # In svn --version --verbose, remove everything from
+                          # the extended lists
+                          re.compile(r'^  - '),
+                         ]
+
+# This is a list of lines to search and replace text on after having
+# seen switch_res_line.
+switched_rep_lines_res = [
+                          # We don't care about the actual canonical host
+                          (re.compile('^\* running on.*$'), '* running on'),
+                         ]
+
 def process_lines(lines):
   "delete lines that should not be compared and search and replace the rest"
   output = [ ]
+  del_res = del_lines_res
+  rep_res = rep_lines_res
+
   for line in lines:
+    if line.startswith(switch_res_line):
+      del_res = switched_del_lines_res
+      rep_res = switched_rep_lines_res
+
     # Skip these lines from the output list.
     delete_line = 0
-    for delete_re in del_lines_res:
+    for delete_re in del_res:
       if delete_re.match(line):
         delete_line = 1
         break
@@ -109,7 +137,7 @@ def process_lines(lines):
       continue
 
     # Search and replace text on the rest.
-    for replace_re, replace_str in rep_lines_res:
+    for replace_re, replace_str in rep_res:
       line = replace_re.sub(replace_str, line)
 
     output.append(line)
@@ -179,6 +207,10 @@ def getopt__version__quiet(sbox):
   "run svn --version --quiet"
   run_one_test(sbox, 'svn--version--quiet', '--version', '--quiet')
 
+def getopt__version__verbose(sbox):
+  "run svn --version --verbose"
+  run_one_test(sbox, 'svn--version--verbose', '--version', '--verbose')
+
 def getopt__help(sbox):
   "run svn --help"
   run_one_test(sbox, 'svn--help', '--help')
@@ -204,6 +236,7 @@ test_list = [ None,
               getopt_no_args,
               getopt__version,
               getopt__version__quiet,
+              getopt__version__verbose,
               getopt__help,
               getopt_help,
               getopt_help_bogus_cmd,

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout Wed Sep 12 16:11:49 2012
@@ -2,8 +2,8 @@ svn, version 0.16.0 (r3987)
    compiled Dec  5 2002, 00:02:51
 
 Copyright (C) 2010 The Apache Software Foundation.
-This software consists of contributions made by many people; see the NOTICE
-file for more information.
+This software consists of contributions made by many people;
+see the NOTICE file for more information.
 Subversion is open source software, see http://subversion.apache.org/
 
 The following repository access (RA) modules are available:

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Wed Sep 12 16:11:49 2012
@@ -31,12 +31,18 @@ usage: 1. log [PATH][@REV]
   and limits the scope of the displayed diff to the specified depth.
 
   If the --search option is used, log messages are displayed only if the
-  provided search pattern matches the author, date, log message text,
-  or, if the --verbose option is also provided, a changed path.
-  The search pattern may include glob syntax wildcards:
+  provided search pattern matches any of the author, date, log message
+  text (unless --quiet is used), or, if the --verbose option is also
+  provided, a changed path.
+  The search pattern may include "glob syntax" wildcards:
       ?      matches any single character
       *      matches a sequence of arbitrary characters
-      [...]  matches any of the characters listed inside the brackets
+      [abc]  matches any of the characters listed inside the brackets
+  If multiple --search options are provided, a log message is shown if
+  it matches any of the provided search patterns. If the --search-and
+  option is used, that option's argument is combined with the pattern
+  from the previous --search or --search-and option, and a log message
+  is shown only if it matches the combined search pattern.
   If --limit is used in combination with --search, --limit restricts the
   number of log messages searched, rather than restricting the output
   to a particular number of matching log messages.
@@ -111,7 +117,9 @@ Valid options:
                                 -p (--show-c-function):
                                    Show C function name in diff output.
   --search ARG             : use ARG as search pattern (glob syntax)
+  --search-and ARG         : combine ARG with the previous search pattern
   --isearch ARG            : like --search, but case-insensitive
+  --isearch-and ARG        : like --search-and, but case-insensitive
 
 Global options:
   --username ARG           : specify a username ARG

Modified: subversion/branches/inheritable-props/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/cmdline/log_tests.py?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/inheritable-props/subversion/tests/cmdline/log_tests.py Wed Sep 12 16:11:49 2012
@@ -2304,6 +2304,43 @@ def log_search(sbox):
   log_chain = parse_log_output(output)
   check_log_chain(log_chain, [7, 6, 3])
 
+  # multi-pattern search
+  exit_code, output, err = svntest.actions.run_and_verify_svn(
+                             None, None, [], 'log',
+                             '--search', 'for revision 3',
+                             '--search', 'for revision 6',
+                             '--search', 'for revision 7')
+
+  log_chain = parse_log_output(output)
+  check_log_chain(log_chain, [7, 6, 3])
+
+  # combined pattern search
+  exit_code, output, err = svntest.actions.run_and_verify_svn(
+                             None, None, [], 'log', '--verbose',
+                             '--search', 'for revision 8',
+                             '--search-and', 'test the code',
+                             '--search', 'for revision 7',
+                             '--search-and', 'this won\'t match ',
+                             '--search', 'psi',
+                             '--search-and', 'multiple lines',
+                             '--search-and', 'revision 6') # don't match r4
+
+  log_chain = parse_log_output(output)
+  check_log_chain(log_chain, [8, 6])
+
+  exit_code, output, err = svntest.actions.run_and_verify_svn(
+                             None, None, [], 'log', '--verbose',
+                             '--search', 'for revision 8',
+                             '--search-and', 'this won\'t match ',
+                             '--search', 'for revision 7',
+                             '--search', 'psi',
+                             '--search-and', 'multiple lines',
+                             '--search-and', 'revision 4') # don't match r6
+
+  log_chain = parse_log_output(output)
+  check_log_chain(log_chain, [7, 4])
+
+
 @SkipUnless(server_has_mergeinfo)
 def merge_sensitive_log_with_search(sbox):
   "test 'svn log -g --search'"

Modified: subversion/branches/inheritable-props/subversion/tests/libsvn_subr/string-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/libsvn_subr/string-test.c?rev=1384011&r1=1384010&r2=1384011&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/libsvn_subr/string-test.c (original)
+++ subversion/branches/inheritable-props/subversion/tests/libsvn_subr/string-test.c Wed Sep 12 16:11:49 2012
@@ -540,6 +540,78 @@ test24(apr_pool_t *pool)
   return test_stringbuf_unequal("abc", "abb", pool);
 }
 
+static svn_error_t *
+expect_stringbuf_equal(const svn_stringbuf_t* str1,
+                       const char* str2,
+                       apr_pool_t *pool)
+{
+  if (svn_stringbuf_compare(str1, svn_stringbuf_create(str2, pool)))
+    return SVN_NO_ERROR;
+  else
+    return fail(pool, "test failed");
+}
+
+static svn_error_t *
+test_stringbuf_insert(apr_pool_t *pool)
+{
+  a = svn_stringbuf_create("st , ", pool);
+
+  svn_stringbuf_insert(a, 0, "teflon", 2);
+  SVN_TEST_STRING_ASSERT(a->data, "test , ");
+
+  svn_stringbuf_insert(a, 5, "hllo", 4);
+  SVN_TEST_STRING_ASSERT(a->data, "test hllo, ");
+
+  svn_stringbuf_insert(a, 6, a->data + 1, 1);
+  SVN_TEST_STRING_ASSERT(a->data, "test hello, ");
+  
+  svn_stringbuf_insert(a, 12, "world class", 5);
+  SVN_TEST_STRING_ASSERT(a->data, "test hello, world");
+
+  svn_stringbuf_insert(a, 1200, "!", 1);
+  return expect_stringbuf_equal(a, "test hello, world!", pool);
+}
+
+static svn_error_t *
+test_stringbuf_remove(apr_pool_t *pool)
+{
+  a = svn_stringbuf_create("test hello, world!", pool);
+
+  svn_stringbuf_remove(a, 0, 2);
+  SVN_TEST_STRING_ASSERT(a->data, "st hello, world!");
+
+  svn_stringbuf_remove(a, 2, 2);
+  SVN_TEST_STRING_ASSERT(a->data, "stello, world!");
+
+  svn_stringbuf_remove(a, 5, 200);
+  SVN_TEST_STRING_ASSERT(a->data, "stell");
+
+  svn_stringbuf_remove(a, 1200, 393);
+  return expect_stringbuf_equal(a, "stell", pool);
+}
+
+static svn_error_t *
+test_stringbuf_replace(apr_pool_t *pool)
+{
+  a = svn_stringbuf_create("odd with some world?", pool);
+
+  svn_stringbuf_replace(a, 0, 3, "tester", 4);
+  SVN_TEST_STRING_ASSERT(a->data, "test with some world?");
+
+  svn_stringbuf_replace(a, 5, 10, "hllo, coder", 6);
+  SVN_TEST_STRING_ASSERT(a->data, "test hllo, world?");
+
+  svn_stringbuf_replace(a, 6, 0, a->data + 1, 1);
+  SVN_TEST_STRING_ASSERT(a->data, "test hello, world?");
+
+  svn_stringbuf_replace(a, 17, 10, "!", 1);
+  SVN_TEST_STRING_ASSERT(a->data, "test hello, world!");
+
+  svn_stringbuf_replace(a, 1200, 199, "!!", 2);
+
+  return expect_stringbuf_equal(a, "test hello, world!!!", pool);
+}
+
 /*
    ====================================================================
    If you add a new test to this file, update this array.
@@ -599,5 +671,11 @@ struct svn_test_descriptor_t test_funcs[
                    "compare stringbufs; same length, different content"),
     SVN_TEST_PASS2(test24,
                    "verify i64toa"),
+    SVN_TEST_PASS2(test_stringbuf_insert,
+                   "check inserting into svn_stringbuf_t"),
+    SVN_TEST_PASS2(test_stringbuf_remove,
+                   "check deletion from svn_stringbuf_t"),
+    SVN_TEST_PASS2(test_stringbuf_replace,
+                   "check replacement in svn_stringbuf_t"),
     SVN_TEST_NULL
   };