subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1211703 [3/4] - in /subversion/branches/showing-merge-info: ./ contrib/server-side/mod_dontdothat/ notes/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/bindings/javahl/tests/org/tigris/subversion/javahl/ subvers...
Date Wed, 07 Dec 2011 23:23:04 GMT
Modified: subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/fs_fs.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/fs_fs.c Wed Dec  7 23:23:02 2011
@@ -3999,7 +3999,8 @@ svn_fs_fs__rep_contents_dir_entry(svn_fs
                                   svn_fs_t *fs,
                                   node_revision_t *noderev,
                                   const char *name,
-                                  apr_pool_t *pool)
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool)
 {
   svn_boolean_t found = FALSE;
 
@@ -4008,7 +4009,7 @@ svn_fs_fs__rep_contents_dir_entry(svn_fs
   if (cache)
     {
       const char *unparsed_id =
-        svn_fs_fs__id_unparse(noderev->id, pool)->data;
+        svn_fs_fs__id_unparse(noderev->id, scratch_pool)->data;
 
       /* Cache lookup. */
       SVN_ERR(svn_cache__get_partial((void **)dirent,
@@ -4017,7 +4018,7 @@ svn_fs_fs__rep_contents_dir_entry(svn_fs
                                      unparsed_id,
                                      svn_fs_fs__extract_dir_entry,
                                      (void*)name,
-                                     pool));
+                                     result_pool));
     }
 
   /* fetch data from disk if we did not find it in the cache */
@@ -4027,29 +4028,22 @@ svn_fs_fs__rep_contents_dir_entry(svn_fs
       svn_fs_dirent_t *entry;
       svn_fs_dirent_t *entry_copy = NULL;
 
-      /* since we don't need the directory content later on, put it into
-         some sub-pool that will be reclaimed immedeately after exiting
-         this function successfully. Opon failure, it will live as long
-         as pool.
-       */
-      apr_pool_t *sub_pool = svn_pool_create(pool);
-
       /* read the dir from the file system. It will probably be put it
          into the cache for faster lookup in future calls. */
-      SVN_ERR(svn_fs_fs__rep_contents_dir(&entries, fs, noderev, sub_pool));
+      SVN_ERR(svn_fs_fs__rep_contents_dir(&entries, fs, noderev,
+                                          scratch_pool));
 
       /* find desired entry and return a copy in POOL, if found */
       entry = apr_hash_get(entries, name, APR_HASH_KEY_STRING);
       if (entry != NULL)
         {
-          entry_copy = apr_palloc(pool, sizeof(*entry_copy));
-          entry_copy->name = apr_pstrdup(pool, entry->name);
-          entry_copy->id = svn_fs_fs__id_copy(entry->id, pool);
+          entry_copy = apr_palloc(result_pool, sizeof(*entry_copy));
+          entry_copy->name = apr_pstrdup(result_pool, entry->name);
+          entry_copy->id = svn_fs_fs__id_copy(entry->id, result_pool);
           entry_copy->kind = entry->kind;
         }
 
       *dirent = entry_copy;
-      apr_pool_destroy(sub_pool);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/fs_fs.h?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_fs_fs/fs_fs.h Wed Dec  7 23:23:02 2011
@@ -117,14 +117,15 @@ svn_error_t *svn_fs_fs__rep_contents_dir
                                          apr_pool_t *pool);
 
 /* Set *DIRENT to the entry identified by NAME in the directory given
-   by NODEREV in filesystem FS.  The returned object is allocated in POOL,
-   which is also used for temporary allocations. */
+   by NODEREV in filesystem FS.  The returned object is allocated in
+   RESULT_POOL; SCRATCH_POOL used for temporary allocations. */
 svn_error_t *
 svn_fs_fs__rep_contents_dir_entry(svn_fs_dirent_t **dirent,
                                   svn_fs_t *fs,
                                   node_revision_t *noderev,
                                   const char *name,
-                                  apr_pool_t *pool);
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool);
 
 /* Set *CONTENTS to be a readable svn_stream_t that receives the text
    representation of node-revision NODEREV as seen in filesystem FS.

Modified: subversion/branches/showing-merge-info/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_repos/commit.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_repos/commit.c Wed Dec  7 23:23:02 2011
@@ -791,11 +791,20 @@ prop_fetch_func(apr_hash_t **props,
 {
   struct edit_baton *eb = baton;
   svn_fs_root_t *fs_root;
+  svn_error_t *err;
 
   SVN_ERR(svn_fs_revision_root(&fs_root, eb->fs,
                                svn_fs_txn_base_revision(eb->txn),
                                scratch_pool));
-  SVN_ERR(svn_fs_node_proplist(props, fs_root, path, result_pool));
+  err = svn_fs_node_proplist(props, fs_root, path, result_pool);
+  if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
+    {
+      svn_error_clear(err);
+      *props = apr_hash_make(result_pool);
+      return SVN_NO_ERROR;
+    }
+  else if (err)
+    return svn_error_trace(err);
 
   return SVN_NO_ERROR;
 }
@@ -815,6 +824,43 @@ kind_fetch_func(svn_kind_t *kind,
   return SVN_NO_ERROR;
 } 
 
+static svn_error_t *
+fetch_base_func(const char **filename,
+                void *baton,
+                const char *path,
+                apr_pool_t *result_pool,
+                apr_pool_t *scratch_pool)
+{
+  struct edit_baton *eb = baton;
+  svn_stream_t *contents;
+  svn_stream_t *file_stream;
+  const char *tmp_filename;
+  svn_fs_root_t *fs_root;
+  svn_error_t *err;
+
+  SVN_ERR(svn_fs_revision_root(&fs_root, eb->fs,
+                               svn_fs_txn_base_revision(eb->txn),
+                               scratch_pool));
+
+  err = svn_fs_file_contents(&contents, fs_root, path, scratch_pool);
+  if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
+    {
+      svn_error_clear(err);
+      *filename = NULL;
+      return SVN_NO_ERROR;
+    }
+  else if (err)
+    return svn_error_trace(err);
+  SVN_ERR(svn_stream_open_unique(&file_stream, &tmp_filename, NULL,
+                                 svn_io_file_del_on_pool_cleanup,
+                                 scratch_pool, scratch_pool));
+  SVN_ERR(svn_stream_copy3(contents, file_stream, NULL, NULL, scratch_pool));
+
+  *filename = apr_pstrdup(result_pool, tmp_filename);
+
+  return SVN_NO_ERROR;
+}
+
 
 
 /*** Public interfaces. ***/
@@ -893,6 +939,8 @@ svn_repos_get_commit_editor5(const svn_d
   shim_callbacks->fetch_props_baton = eb;
   shim_callbacks->fetch_kind_func = kind_fetch_func;
   shim_callbacks->fetch_kind_baton = eb;
+  shim_callbacks->fetch_base_func = fetch_base_func;
+  shim_callbacks->fetch_base_baton = eb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks, pool, pool));

Modified: subversion/branches/showing-merge-info/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_repos/dump.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_repos/dump.c Wed Dec  7 23:23:02 2011
@@ -849,6 +849,37 @@ change_dir_prop(void *parent_baton,
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+fetch_base_func(const char **filename,
+                void *baton,
+                const char *path,
+                apr_pool_t *result_pool,
+                apr_pool_t *scratch_pool)
+{
+  struct edit_baton *eb = baton;
+  svn_stream_t *contents;
+  svn_stream_t *file_stream;
+  const char *tmp_filename;
+  svn_error_t *err;
+
+  err = svn_fs_file_contents(&contents, eb->fs_root, path, scratch_pool);
+  if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
+    {
+      svn_error_clear(err);
+      *filename = NULL;
+      return SVN_NO_ERROR;
+    }
+  else if (err)
+    return svn_error_trace(err);
+  SVN_ERR(svn_stream_open_unique(&file_stream, &tmp_filename, NULL,
+                                 svn_io_file_del_on_pool_cleanup,
+                                 scratch_pool, scratch_pool));
+  SVN_ERR(svn_stream_copy3(contents, file_stream, NULL, NULL, scratch_pool));
+
+  *filename = apr_pstrdup(result_pool, tmp_filename);
+
+  return SVN_NO_ERROR;
+}
 
 
 static svn_error_t *
@@ -898,6 +929,9 @@ get_dump_editor(const svn_delta_editor_t
   *edit_baton = eb;
   *editor = dump_editor;
 
+  shim_callbacks->fetch_base_func = fetch_base_func;
+  shim_callbacks->fetch_base_baton = eb;
+
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks, pool, pool));
 
@@ -1129,6 +1163,10 @@ svn_repos_dump_fs3(svn_repos_t *repos,
                                     NULL, NULL, subpool));
         }
 
+      /* While our editor close_edit implementation is a no-op, we still
+         do this for completeness. */
+      SVN_ERR(dump_editor->close_edit(dump_edit_baton, subpool));
+
     loop_end:
       if (notify_func)
         {

Modified: subversion/branches/showing-merge-info/subversion/libsvn_subr/debug.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_subr/debug.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_subr/debug.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_subr/debug.c Wed Dec  7 23:23:02 2011
@@ -27,10 +27,16 @@
 #include <stdarg.h>
 
 #include "svn_types.h"
+#include "svn_string.h"
+
+/* We only build this code if SVN_DEBUG is defined. */
+#ifdef SVN_DEBUG
 
 #include "private/svn_debug.h"
 
 
+#define DBG_FLAG "DBG: "
+
 /* This will be tweaked by the preamble code.  */
 static FILE * volatile debug_output = NULL;
 
@@ -59,21 +65,54 @@ svn_dbg__preamble(const char *file, long
       else
         ++slash;
 
-      fprintf(output, "DBG: %s:%4ld: ", slash, line);
+      fprintf(output, DBG_FLAG "%s:%4ld: ", slash, line);
     }
 }
 
 
-void
-svn_dbg__printf(const char *fmt, ...)
+static void
+print_line(const char *fmt, va_list ap)
 {
   FILE *output = debug_output;
-  va_list ap;
 
   if (output == NULL || quiet_mode())
     return;
 
-  va_start(ap, fmt);
   (void) vfprintf(output, fmt, ap);
+}
+
+
+void
+svn_dbg__printf(const char *fmt, ...)
+{
+  va_list ap;
+
+  va_start(ap, fmt);
+  print_line(fmt, ap);
+  va_end(ap);
+}
+
+
+void
+svn_dbg__print_props(apr_hash_t *props,
+                     const char *header_fmt,
+                     ...)
+{
+  apr_hash_index_t *hi;
+  va_list ap;
+
+  va_start(ap, header_fmt);
+  print_line(header_fmt, ap);
   va_end(ap);
+
+  for (hi = apr_hash_first(apr_hash_pool_get(props), props); hi;
+        hi = apr_hash_next(hi))
+    {
+      const char *name = svn__apr_hash_index_key(hi);
+      svn_string_t *val = svn__apr_hash_index_val(hi);
+
+      SVN_DBG(("    '%s' -> '%s'\n", name, val->data));
+    }
 }
+
+#endif

Modified: subversion/branches/showing-merge-info/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_subr/dirent_uri.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_subr/dirent_uri.c Wed Dec  7 23:23:02 2011
@@ -1295,25 +1295,17 @@ svn_uri_basename(const char *uri, apr_po
 {
   apr_size_t len = strlen(uri);
   apr_size_t start;
-  const char *base_name;
 
   assert(svn_uri_is_canonical(uri, NULL));
 
   if (svn_uri_is_root(uri, len))
     return "";
-  else
-    {
-      start = len;
-      while (start > 0 && uri[start - 1] != '/')
-        --start;
-    }
 
-  if (pool)
-    base_name = apr_pstrmemdup(pool, uri + start, len - start);
-  else
-    base_name = uri + start;
+  start = len;
+  while (start > 0 && uri[start - 1] != '/')
+    --start;
 
-  return svn_path_uri_decode(base_name, pool);
+  return svn_path_uri_decode(uri + start, pool);
 }
 
 void

Modified: subversion/branches/showing-merge-info/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_wc/externals.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_wc/externals.c Wed Dec  7 23:23:02 2011
@@ -300,8 +300,13 @@ svn_wc_parse_externals_description3(apr_
 
       item->target_dir = svn_dirent_internal_style(item->target_dir, pool);
 
-      if (item->target_dir[0] == '\0' || item->target_dir[0] == '/'
-          || svn_path_is_backpath_present(item->target_dir))
+      if (item->target_dir[0] == '\0'
+          || svn_dirent_is_absolute(item->target_dir)
+          || svn_path_is_backpath_present(item->target_dir)
+          || !svn_dirent_skip_ancestor("dummy",
+                                       svn_dirent_join("dummy",
+                                                       item->target_dir,
+                                                       pool)))
         return svn_error_createf
           (SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION, NULL,
            _("Invalid %s property on '%s': "

Modified: subversion/branches/showing-merge-info/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_wc/questions.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_wc/questions.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_wc/questions.c Wed Dec  7 23:23:02 2011
@@ -531,19 +531,6 @@ svn_wc__min_max_revisions(svn_revnum_t *
 
 
 svn_error_t *
-svn_wc__is_sparse_checkout(svn_boolean_t *is_sparse_checkout,
-                           svn_wc_context_t *wc_ctx,
-                           const char *local_abspath,
-                           apr_pool_t *scratch_pool)
-{
-  return svn_error_trace(svn_wc__db_is_sparse_checkout(is_sparse_checkout,
-                                                       wc_ctx->db,
-                                                       local_abspath,
-                                                       scratch_pool));
-}
-
-
-svn_error_t *
 svn_wc__has_switched_subtrees(svn_boolean_t *is_switched,
                               svn_wc_context_t *wc_ctx,
                               const char *local_abspath,

Modified: subversion/branches/showing-merge-info/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_wc/status.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_wc/status.c Wed Dec  7 23:23:02 2011
@@ -2549,11 +2549,14 @@ svn_wc_get_status_editor5(const svn_delt
   sfb = apr_palloc(result_pool, sizeof(*sfb));
   sfb->db = wc_ctx->db;
   sfb->base_abspath = eb->target_abspath;
+  sfb->fetch_base = FALSE;
 
   shim_callbacks->fetch_kind_func = svn_wc__fetch_kind_func;
   shim_callbacks->fetch_kind_baton = sfb;
   shim_callbacks->fetch_props_func = svn_wc__fetch_props_func;
   shim_callbacks->fetch_props_baton = sfb;
+  shim_callbacks->fetch_base_func = svn_wc__fetch_base_func;
+  shim_callbacks->fetch_base_baton = sfb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks,

Modified: subversion/branches/showing-merge-info/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_wc/update_editor.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_wc/update_editor.c Wed Dec  7 23:23:02 2011
@@ -4989,11 +4989,14 @@ make_editor(svn_revnum_t *target_revisio
   sfb = apr_palloc(result_pool, sizeof(*sfb));
   sfb->db = db;
   sfb->base_abspath = eb->target_abspath;
+  sfb->fetch_base = TRUE;
 
   shim_callbacks->fetch_kind_func = svn_wc__fetch_kind_func;
   shim_callbacks->fetch_kind_baton = sfb;
   shim_callbacks->fetch_props_func = svn_wc__fetch_props_func;
   shim_callbacks->fetch_props_baton = sfb;
+  shim_callbacks->fetch_base_func = svn_wc__fetch_base_func;
+  shim_callbacks->fetch_base_baton = sfb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks, result_pool, scratch_pool));

Modified: subversion/branches/showing-merge-info/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_wc/util.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_wc/util.c Wed Dec  7 23:23:02 2011
@@ -564,8 +564,12 @@ svn_wc__fetch_props_func(apr_hash_t **pr
                                               scratch_pool);
   svn_error_t *err;
 
-  err = svn_wc__db_read_props(props, sfb->db, local_abspath,
-                              result_pool, scratch_pool);
+  if (sfb->fetch_base)
+    err = svn_wc__db_base_get_props(props, sfb->db, local_abspath, result_pool,
+                                    scratch_pool);
+  else
+    err = svn_wc__db_read_props(props, sfb->db, local_abspath,
+                                result_pool, scratch_pool);
 
   /* If the path doesn't exist, just return an empty set of props. */
   if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
@@ -578,3 +582,45 @@ svn_wc__fetch_props_func(apr_hash_t **pr
 
   return SVN_NO_ERROR;
 }
+
+
+svn_error_t *
+svn_wc__fetch_base_func(const char **filename,
+                        void *baton,
+                        const char *path,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
+{
+  struct svn_wc__shim_fetch_baton_t *sfb = baton;
+  svn_stream_t *contents;
+  svn_stream_t *file_stream;
+  const char *tmp_filename;
+  const svn_checksum_t *checksum;
+  svn_error_t *err;
+  const char *local_abspath = svn_dirent_join(sfb->base_abspath, path,
+                                              scratch_pool);
+
+  err = svn_wc__db_base_get_info(NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, &checksum,
+                                 NULL, NULL, NULL, NULL, sfb->db,
+                                 local_abspath, scratch_pool, scratch_pool);
+  if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+    {
+      svn_error_clear(err);
+      *filename = NULL;
+      return SVN_NO_ERROR;
+    }
+  else if (err)
+    return svn_error_trace(err);
+  SVN_ERR(svn_wc__db_pristine_read(&contents, NULL, sfb->db, local_abspath,
+                                   checksum, scratch_pool, scratch_pool));
+
+  SVN_ERR(svn_stream_open_unique(&file_stream, &tmp_filename, NULL,
+                                 svn_io_file_del_on_pool_cleanup,
+                                 scratch_pool, scratch_pool));
+  SVN_ERR(svn_stream_copy3(contents, file_stream, NULL, NULL, scratch_pool));
+
+  *filename = apr_pstrdup(result_pool, tmp_filename);
+
+  return SVN_NO_ERROR;
+}

Modified: subversion/branches/showing-merge-info/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_wc/wc.h?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_wc/wc.h Wed Dec  7 23:23:02 2011
@@ -730,6 +730,7 @@ struct svn_wc__shim_fetch_baton_t
 {
   svn_wc__db_t *db;
   const char *base_abspath;
+  svn_boolean_t fetch_base;
 };
 
 /* Using a BATON of struct shim_fetch_baton, return KIND for PATH. */
@@ -747,6 +748,13 @@ svn_wc__fetch_props_func(apr_hash_t **pr
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);
 
+/* Using a BATON of struct shim_fetch_baton, return a delta base for PATH. */
+svn_error_t *
+svn_wc__fetch_base_func(const char **filename,
+                        void *baton,
+                        const char *path,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool);
 
 #ifdef __cplusplus
 }

Modified: subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db.c Wed Dec  7 23:23:02 2011
@@ -10163,9 +10163,6 @@ scan_deletion_txn(void *baton,
           else
             {
               const char *moved_child_relpath;
-              svn_wc__db_status_t moved_child_status;
-              svn_boolean_t found_child;
-              svn_error_t *err;
 
               /* The CURRENT_RELPATH is the op_root of the delete-half of
                * the move. LOCAL_RELPATH is a child that was moved along.
@@ -10178,67 +10175,19 @@ scan_deletion_txn(void *baton,
                                                   moved_child_relpath,
                                                   scratch_pool);
               
-              /* Figure out what happened to the child after it was moved
-               * along. Maybe the child was moved-away further, either by
-               * itself, or along with some intermediate parent node.
-               *
-               * If the child was deleted instead of moved-away,
-               * the resulting MOVED_TO_RELPATH is NULL. */
-              err = read_info(&moved_child_status, NULL, NULL, NULL, NULL,
-                              NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                              NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                              NULL, NULL, NULL, NULL, NULL, NULL, wcroot,
-                              moved_to_relpath, scratch_pool, scratch_pool);
-              if (err)
-                {
-                  if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
-                    {
-                      /* Tolerate missing children. A likely cause is that
-                       * the moved-to information in BASE is incorrect.
-                       * Just treat this as a normal deletion. */
-                      svn_error_clear(err); 
-                      moved_to_relpath = NULL;
-                      moved_to_op_root_relpath = NULL;
-                      if (sd_baton->moved_to_relpath)
-                        *sd_baton->moved_to_relpath = NULL;
-                      found_child = FALSE;
-                    }
-                  else
-                    return svn_error_compose_create(err,
-                                                    svn_sqlite__reset(stmt));
-                }
-              else
-                found_child = TRUE;
-
-              if (found_child &&
-                  moved_child_status == svn_wc__db_status_deleted)
-                {
-                  err = scan_deletion(NULL, &moved_to_relpath, NULL,
-                                      NULL, wcroot, moved_to_relpath,
-                                      scratch_pool, scratch_pool);
-                  if (err)
-                   return svn_error_compose_create(err,
-                                                   svn_sqlite__reset(stmt));
-                }
               if (sd_baton->moved_to_relpath)
                 *sd_baton->moved_to_relpath = moved_to_relpath ? 
                   apr_pstrdup(sd_baton->result_pool, moved_to_relpath) : NULL;
             }
 
-          /* CURRENT_RELPATH is the op_root of the delete-half of the move,
-           * so it's the BASE_DEL_RELPATH. */
-          if (sd_baton->base_del_relpath)
-            *sd_baton->base_del_relpath =
-              apr_pstrdup(sd_baton->result_pool, current_relpath);
-
           if (sd_baton->moved_to_op_root_relpath)
             *sd_baton->moved_to_op_root_relpath = moved_to_op_root_relpath ?
               apr_pstrdup(sd_baton->result_pool, moved_to_op_root_relpath)
               : NULL;
 
-          /* If all other out parameters are irrelevant, stop scanning.
-           * Happens to be only WORK_DEL_RELPATH. */
-          if (sd_baton->work_del_relpath == NULL)
+          /* If all other out parameters are irrelevant, stop scanning. */
+          if (sd_baton->work_del_relpath == NULL
+              && sd_baton->base_del_relpath == NULL)
             break;
 
           found_moved_to = TRUE;
@@ -12436,8 +12385,8 @@ svn_wc__db_min_max_revisions(svn_revnum_
 }
 
 
-/* Like svn_wc__db_is_sparse_checkout,
- * but accepts a WCROOT/LOCAL_RELPATH pair. */
+/* Set *IS_SPARSE_CHECKOUT TRUE if LOCAL_RELPATH or any of the nodes
+ * within LOCAL_RELPATH is sparse, FALSE otherwise. */
 static svn_error_t *
 is_sparse_checkout_internal(svn_boolean_t *is_sparse_checkout,
                             svn_wc__db_wcroot_t *wcroot,
@@ -12461,28 +12410,6 @@ is_sparse_checkout_internal(svn_boolean_
 }
 
 
-svn_error_t *
-svn_wc__db_is_sparse_checkout(svn_boolean_t *is_sparse_checkout,
-                              svn_wc__db_t *db,
-                              const char *local_abspath,
-                              apr_pool_t *scratch_pool)
-{
-  svn_wc__db_wcroot_t *wcroot;
-  const char *local_relpath;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                                                db, local_abspath,
-                                                scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(wcroot);
-
-  return svn_error_trace(is_sparse_checkout_internal(is_sparse_checkout,
-                                                     wcroot, local_relpath,
-                                                     scratch_pool));
-}
-
-
 /* Like svn_wc__db_has_switched_subtrees(),
  * but accepts a WCROOT/LOCAL_RELPATH pair. */
 static svn_error_t *

Modified: subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db.h?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db.h Wed Dec  7 23:23:02 2011
@@ -2564,7 +2564,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat
 
    If the user moves-away B/W/D from the WORKING tree, then behavior is
    again dependent upon the origination of B/W. For a plain add, the nodes
-   simply move to the destination. For a copy, a deletion is made at B/W/D,
+   simply move to the destination; this means that B/W/D ceases to be a
+   node and so cannot be scanned. For a copy, a deletion is made at B/W/D,
    and a new copy (of a subtree of the original source) is made at the
    destination. For a move-here, a deletion is made, and a copy is made at
    the destination (we do not track multiple moves; the source is moved to
@@ -2574,13 +2575,6 @@ svn_wc__db_scan_addition(svn_wc__db_stat
 
    There are three further considerations when resolving a deleted node:
 
-     If the BASE B/W/D was moved-away, then BASE_DEL_ABSPATH will specify
-     B/W/D as the root of the BASE deletion (not necessarily B/W as an
-     implicit delete caused by a replacement; only the closest ancestor is
-     reported). The other parameters will operate as normal, based on what
-     is happening in the WORKING tree. Also note that ancestors of B/W/D
-     may report additional, explicit moved-away status.
-
      If the BASE B/W/D was deleted explicitly *and* B/W is a replacement,
      then the explicit deletion is subsumed by the implicit deletion that
      occurred with the B/W replacement. Thus, BASE_DEL_ABSPATH will point
@@ -3045,19 +3039,6 @@ svn_wc__db_min_max_revisions(svn_revnum_
                              svn_boolean_t committed,
                              apr_pool_t *scratch_pool);
 
-/* Indicate in *IS_SPARSE_CHECKOUT whether any of the nodes within
- * LOCAL_ABSPATH is sparse, using DB.
- * Use SCRATCH_POOL for temporary allocations.
- *
- * This function provides a subset of the functionality of
- * svn_wc__db_revision_status() and is more efficient if the caller
- * doesn't need all information returned by svn_wc__db_revision_status(). */
-svn_error_t *
-svn_wc__db_is_sparse_checkout(svn_boolean_t *is_sparse_checkout,
-                              svn_wc__db_t *db,
-                              const char *local_abspath,
-                              apr_pool_t *scratch_pool);
-
 /* Indicate in *IS_SWITCHED whether any node beneath LOCAL_ABSPATH
  * is switched, using DB. Use SCRATCH_POOL for temporary allocations.
  *

Modified: subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db_pristine.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_wc/wc_db_pristine.c Wed Dec  7 23:23:02 2011
@@ -225,7 +225,15 @@ svn_wc__db_pristine_read(svn_stream_t **
 
   SVN_ERR_ASSERT(contents != NULL);
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
+
+  /* Some 1.6-to-1.7 wc upgrades created rows without checksums and
+     updating such a row passes NULL here. */
+  if (!sha1_checksum)
+    return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
+                             _("Can't read '%s' from pristine store "
+                               "because no checksum supplied"),
+                             svn_dirent_local_style(wri_abspath, scratch_pool));
+
   SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,

Modified: subversion/branches/showing-merge-info/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/libsvn_wc/workqueue.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/showing-merge-info/subversion/libsvn_wc/workqueue.c Wed Dec  7 23:23:02 2011
@@ -668,9 +668,24 @@ run_file_install(svn_wc__db_t *db,
                                       local_relpath,
                                       scratch_pool, scratch_pool));
     }
+  else if (! checksum)
+    {
+      /* This error replaces a previous assertion. Reporting an error from here
+         leaves the workingqueue operation in place, so the working copy is
+         still broken!
+
+         But when we report this error the user at least knows what node has
+         this specific problem, so maybe we can find out why users see this
+         error */
+      return svn_error_createf(SVN_ERR_WC_CORRUPT_TEXT_BASE, NULL,
+                               _("Can't install '%s' from pristine store, "
+                                 "because no checksum is recorded for this "
+                                 "file"),
+                               svn_dirent_local_style(local_abspath,
+                                                      scratch_pool));
+    }
   else
     {
-      SVN_ERR_ASSERT(checksum != NULL);
       SVN_ERR(svn_wc__db_pristine_get_future_path(&source_abspath,
                                                   wcroot_abspath,
                                                   checksum,

Modified: subversion/branches/showing-merge-info/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/svn/log-cmd.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/svn/log-cmd.c (original)
+++ subversion/branches/showing-merge-info/subversion/svn/log-cmd.c Wed Dec  7 23:23:02 2011
@@ -51,8 +51,9 @@ struct log_receiver_baton
   /* Client context. */
   svn_client_ctx_t *ctx;
 
-  /* The URL target of the log operation. */
-  const char *target_url;
+  /* The target of the log operation. */
+  const char *target_path_or_url;
+  svn_opt_revision_t target_peg_revision;
 
   /* Don't print log message body nor its line count. */
   svn_boolean_t omit_log_message;
@@ -298,23 +299,22 @@ log_entry_receiver(void *baton,
       end_revision.value.number = log_entry->revision;
 
       SVN_ERR(svn_cmdline_printf(pool, _("\n")));
-      SVN_ERR(svn_client_diff6(diff_options,
-                               lb->target_url,
-                               &start_revision,
-                               lb->target_url,
-                               &end_revision,
-                               NULL,
-                               lb->depth,
-                               FALSE, /* ignore ancestry */
-                               TRUE, /* no diff deleted */
-                               FALSE, /* show copies as adds */
-                               FALSE, /* ignore content type */
-                               FALSE, /* use git diff format */
-                               svn_cmdline_output_encoding(pool),
-                               outstream,
-                               errstream,
-                               NULL,
-                               lb->ctx, pool));
+      SVN_ERR(svn_client_diff_peg6(diff_options,
+                                   lb->target_path_or_url,
+                                   &lb->target_peg_revision,
+                                   &start_revision, &end_revision,
+                                   NULL,
+                                   lb->depth,
+                                   FALSE, /* ignore ancestry */
+                                   TRUE, /* no diff deleted */
+                                   FALSE, /* show copies as adds */
+                                   FALSE, /* ignore content type */
+                                   FALSE, /* use git diff format */
+                                   svn_cmdline_output_encoding(pool),
+                                   outstream,
+                                   errstream,
+                                   NULL,
+                                   lb->ctx, pool));
       SVN_ERR(svn_cmdline_printf(pool, _("\n")));
     }
 
@@ -507,8 +507,6 @@ svn_cl__log(apr_getopt_t *os,
   struct log_receiver_baton lb;
   const char *target;
   int i;
-  svn_opt_revision_t peg_revision;
-  const char *true_path;
   apr_array_header_t *revprops;
 
   if (!opt_state->xml)
@@ -562,8 +560,6 @@ svn_cl__log(apr_getopt_t *os,
   /* Add "." if user passed 0 arguments */
   svn_opt_push_implicit_dot_target(targets, pool);
 
-  target = APR_ARRAY_IDX(targets, 0, const char *);
-
   /* Determine if they really want a two-revision range. */
   if (opt_state->used_change_arg)
     {
@@ -585,9 +581,15 @@ svn_cl__log(apr_getopt_t *os,
         }
     }
 
-  /* Strip peg revision. */
-  SVN_ERR(svn_opt_parse_path(&peg_revision, &true_path, target, pool));
-  APR_ARRAY_IDX(targets, 0, const char *) = true_path;
+  /* Parse the first target into path-or-url and peg revision. */
+  target = APR_ARRAY_IDX(targets, 0, const char *);
+  SVN_ERR(svn_opt_parse_path(&lb.target_peg_revision, &lb.target_path_or_url,
+                             target, pool));
+  if (lb.target_peg_revision.kind == svn_opt_revision_unspecified)
+    lb.target_peg_revision.kind = (svn_path_is_url(target)
+                                     ? svn_opt_revision_head
+                                     : svn_opt_revision_working);
+  APR_ARRAY_IDX(targets, 0, const char *) = lb.target_path_or_url;
 
   if (svn_path_is_url(target))
     {
@@ -606,8 +608,6 @@ svn_cl__log(apr_getopt_t *os,
 
   lb.ctx = ctx;
   lb.omit_log_message = opt_state->quiet;
-  SVN_ERR(svn_client_url_from_path2(&lb.target_url, true_path, ctx,
-                                    pool, pool));
   lb.show_diff = opt_state->show_diff;
   lb.depth = opt_state->depth == svn_depth_unknown ? svn_depth_infinity
                                                    : opt_state->depth;
@@ -658,7 +658,7 @@ svn_cl__log(apr_getopt_t *os,
             APR_ARRAY_PUSH(revprops, const char *) = SVN_PROP_REVISION_LOG;
         }
       SVN_ERR(svn_client_log5(targets,
-                              &peg_revision,
+                              &lb.target_peg_revision,
                               opt_state->revision_ranges,
                               opt_state->limit,
                               opt_state->verbose,
@@ -681,7 +681,7 @@ svn_cl__log(apr_getopt_t *os,
       if (!opt_state->quiet)
         APR_ARRAY_PUSH(revprops, const char *) = SVN_PROP_REVISION_LOG;
       SVN_ERR(svn_client_log5(targets,
-                              &peg_revision,
+                              &lb.target_peg_revision,
                               opt_state->revision_ranges,
                               opt_state->limit,
                               opt_state->verbose,

Modified: subversion/branches/showing-merge-info/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/svn/main.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/svn/main.c (original)
+++ subversion/branches/showing-merge-info/subversion/svn/main.c Wed Dec  7 23:23:02 2011
@@ -301,11 +301,14 @@ const apr_getopt_option_t svn_cl__option
   {"accept",        opt_accept, 1,
                     N_("specify automatic conflict resolution action\n"
                        "                             "
-                       "('postpone', 'base', 'mine-conflict',\n"
+                       "('postpone', 'working', 'base', 'mine-conflict',\n"
                        "                             "
                        "'theirs-conflict', 'mine-full', 'theirs-full',\n"
                        "                             "
-                       "'edit', 'launch')")},
+                       "'edit', 'launch')\n"
+                       "                             "
+                       "(shorthand: 'p', 'mc', 'tc', 'mf', 'tf', 'e', 'l')"
+                       )},
   {"show-revs",     opt_show_revs, 1,
                     N_("specify which collection of revisions to display\n"
                        "                             "
@@ -671,294 +674,326 @@ const svn_opt_subcommand_desc2_t svn_cl_
      {'c', N_("the change made in revision ARG")}} },
 
   { "merge", svn_cl__merge, {0}, N_
-    ("Merge changes into a working copy.\n"
-     "usage: 0. merge SOURCE[@REV] [TARGET_WCPATH]\n"
-     "          (the 'sync' merge)\n"
-     "       1. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
-     "          (the 'cherry-pick' merge)\n"
-     "       2. merge --reintegrate SOURCE[@REV] [TARGET_WCPATH]\n"
-     "          (the 'reintegrate' merge)\n"
-     "       3. merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
-     "          (the '2-URL' merge)\n"
-     "\n"
-     "  0. This form is called a 'sync' (aka 'catch-up') merge:\n"
-     "\n"
-     "       svn merge SOURCE[@REV] [TARGET_WCPATH]\n"
-     "\n"
-     "     A sync merge is used to merge into a branch any unmerged changes\n"
-     "     made on its immediate ancestor branch. This uses merge tracking\n"
-     "     to find which changes need to be merged.\n"
-     "\n"
-     "     SOURCE specifies the branch from where the changes will be pulled,\n"
-     "     and TARGET_WCPATH specifies the working copy of the target branch,\n"
-     "     into which the changes will be applied. Normally SOURCE and\n"
-     "     TARGET_WCPATH should each point to the root of a branch. If changes\n"
-     "     need to be merged from and to only a subtree of the branch, then\n"
-     "     the path to that subtree must be included in both SOURCE and\n"
-     "     TARGET_WCPATH.\n"
-     "\n"
-     "     SOURCE is usually a URL. The optional '@REV' specifies both the peg\n"
-     "     revision of the URL and the latest revision that will be considered\n"
-     "     for merging; the default value is the HEAD revision. If SOURCE is a\n"
-     "     working copy path, the corresponding URL of the path is used, and\n"
-     "     the default value of 'REV' is the base revision.\n"
-     "\n"
-     "     TARGET_WCPATH is a working copy path; the default is '.'.\n"
-     "\n"
-     "       - Sync Merge Example -\n"
-     "\n"
-     "     A feature is being developed on a branch called 'feature'. The\n"
-     "     feature branch is regularly synced with trunk to keep up with the\n"
-     "     changes made there. The previous sync merges are not shown on this\n"
-     "     diagram, and the last of them was done when HEAD was r100, and now\n"
-     "     HEAD is r200.\n"
-     "\n"
-     "                 feature  +------------------------o-----\n"
-     "                         /                         ^\n"
-     "                        /                         /\n"
-     "                       /          .............../\n"
-     "         trunk ------+------------L--------------R------\n"
-     "                                r100           r200\n"
-     "\n"
-     "     Subversion will locate all the changes on 'trunk' that have not yet\n"
-     "     been merged into the target. In this case that is a single range,\n"
-     "     r100:200. In the diagram above, L marks the 'left' side of the\n"
-     "     range (trunk@100) and R marks the 'right' side of the range\n"
-     "     (trunk@200). The difference between L and R will be merged into\n"
-     "     the target.\n"
-     "\n"
-     "     To perform this sync merge, check out a working copy of the feature\n"
-     "     branch and run the following command in the top-level directory\n"
-     "     of the working copy:\n"
-     "\n"
-     "         svn merge ^/trunk\n"
-     "\n"
-     "\n"
-     "  1. This form is called a 'cherry-pick' merge:\n"
-     "\n"
-     "       svn merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
-     "\n"
-     "     A cherry-picking merge is used to merge specific revisions (or\n"
-     "     revision ranges) from one branch to another. By default, this form\n"
-     "     of merge uses merge tracking to avoid re-merging any of the specified\n"
-     "     revisions that have already been merged. If the --ignore-ancestry\n"
-     "     option is given then that does not happen.\n"
-     "\n"
-     "     The SOURCE and TARGET_WCPATH arguments are the same as for a 'sync'\n"
-     "     merge, except that REV acts only as a peg and does not specify the\n"
-     "     latest revision that will be considered for merging.\n"
-     "\n"
-     "     The revision ranges to be merged are specified by the '-r' and/or\n"
-     "     '-c' options. '-r N:M' refers to the difference in the history of\n"
-     "     the source branch between revision N and revision M. '-c M' is\n"
-     "     equivalent to '-r <M-1>:M'. Each such difference is merged into\n"
-     "     TARGET_WCPATH.\n"
-     "\n"
-     "     If mergeinfo within TARGET_WCPATH indicates that revisions within\n"
-     "     the range were already merged, changes made in those revisions\n"
-     "     are not merged again. If needed, the range is broken into multiple\n"
-     "     sub-ranges, and each sub-range is merged separately.\n"
-     "\n"
-     "     If N is greater than M in '-r N:M', or with '-c -M' which is\n"
-     "     equivalent to '-r M:<M-1>', the range is a 'reverse range'.\n"
-     "     A reverse range can be used to undo changes made to SOURCE\n"
-     "     between revisions N and M.\n"
-     "\n"
-     "     Multiple '-c' and/or '-r' options may be specified and mixing of\n"
-     "     forward and reverse ranges is allowed.\n"
-     "\n"
-     "       - Cherry-picking Merge Example -\n"
-     "\n"
-     "     A bug has been fixed on trunk on revision 50. This fix needs to\n"
-     "     be merged from the trunk into the release branch.\n"
-     "\n"
-     "            1.x-release  +-----------------------o-----\n"
-     "                        /                        ^\n"
-     "                       /                         |\n"
-     "                      /                          |\n"
-     "         trunk ------+--------------------------LR-----\n"
-     "                                                r50\n"
-     "\n"
-     "     In the above diagram, L marks the left side of the merge (trunk@49)\n"
-     "     and R marks the right side of the merge (trunk@50). The difference\n"
-     "     between the left and right side is merged into the target.\n"
-     "\n"
-     "     To perform the merge, check out a working copy of the release\n"
-     "     branch and run the following command in the top-level directory\n"
-     "     of the working copy:\n"
-     "\n"
-     "         svn merge -c50 ^/trunk\n"
-     "\n"
-     "     If several commits to trunk were related to the fix, multiple\n"
-     "     revisions can be merged:\n"
-     "\n"
-     "         svn merge -c50,54,60 ^/trunk\n"
-     "\n"
-     "\n"
-     "  2. This form is called a 'reintegrate merge':\n"
-     "\n"
-     "       svn merge --reintegrate SOURCE[@REV] [TARGET_WCPATH]\n"
-     "\n"
-     "     SOURCE is the URL of a branch to be merged back into (usually) its\n"
-     "     immediate ancestor branch.  If REV is specified, it is used a\n"
-     "     the peg revision for SOURCE, i.e. SOURCE is looked up in the\n"
-     "     repository at revision REV.  If REV is not specified, the HEAD\n"
-     "     revision is assumed.\n"
-     "\n"
-     "     TARGET_WCPATH is a working copy of the branch the changes will\n"
-     "     be applied to.\n"
-     "\n"
-     "       - Reintegrate Merge Example -\n"
-     "\n"
-     "     A feature has been developed on a branch called 'feature'.\n"
-     "     The feature branch started as a copy of trunk@W. Work on the\n"
-     "     feature has completed and it should be merged back into the trunk.\n"
-     "\n"
-     "     The feature branch was last synced with its immediate ancestor,\n"
-     "     the trunk, in revision X. So the difference between trunk@X and\n"
-     "     feature@HEAD contains the complete set of changes that implement\n"
-     "     the feature, and no other changes. These changes are applied to\n"
-     "     the trunk.\n"
-     "\n"
-     "                 feature  +-------------------------------R\n"
-     "                         /                               . \\\n"
-     "                        /                  ..............   \\\n"
-     "                       /                  .                  v\n"
-     "         trunk ------+--------------------L------------------o\n"
-     "                    rW                   rX\n"
-     "\n"
-     "     In the diagram above, L marks the left side of the merge (trunk@X),\n"
-     "     and R marks the right side of the merge (feature@HEAD). The difference\n"
-     "     between the left and right side is merged into the target.\n"
-     "\n"
-     "     To perform the merge, check out a working copy of the trunk, and run\n"
-     "     the following command in the top-level directory of the working copy:\n"
-     "\n"
-     "         svn merge --reintegrate ^/feature\n"
-     "\n"
-     "     To prevent unnecessary merge conflicts, reintegrate merges require\n"
-     "     that TARGET_WCPATH is not a mixed-revision working copy, has no\n"
-     "     local modifications, and has no switched subtrees.\n"
-     "\n"
-     "     Reintegrate merges also require that the reintegrate source be fully\n"
-     "     synced with the target since their common branch point.\n"
-     "     In the above example this means that all of the changes made\n"
-     "     on trunk between revision W and revision X are fully merged to\n"
-     "     the feature branch before it can be reintegrated back to trunk.\n"
-     "\n"
-     "     After the reintegrate merge, the feature branch cannot be synced\n"
-     "     to the trunk again without merge conflicts. If further work must\n"
-     "     be done on the feature branch, it should be deleted and then re-created.\n"
-     "\n"
-     "\n"
-     "  3. This form is called a '2-URL merge':\n"
-     "\n"
-     "       svn merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
-     "\n"
-     "     Two source URLs are specified, together with two revisions N and M.\n"
-     "     The two sources to be compared at the specified revisions, and the\n"
-     "     difference is applied to TARGET_WCPATH, which is a path to a working\n"
-     "     copy of another branch.\n"
-     "\n"
-     "     The revisions default to HEAD if omitted.\n"
-     "\n"
-     "     If TARGET_WCPATH is omitted, a default value of '.' is assumed,\n"
-     "     unless the sources have identical basenames that match a file\n"
-     "     within '.'; In which case, the differences will be applied to\n"
-     "     that file.\n"
-     "\n"
-     "     The sources can also be specified as working copy paths, in which\n"
-     "     case the URLs of the merge sources are derived from the working copies.\n"
-     "\n"
-     "     This is the most flexible type of merge, but also the most difficult\n"
-     "     to use. It can be used to merge the differences between two (possibly\n"
-     "     ancestrally unrelated) branches into a working copy of another branch.\n"
-     "     This type of merge should be used very carefully because the probability\n"
-     "     of merge conflicts is quite high. In most use cases, a sync, cherry-pick,\n"
-     "     or reintegrate merge is sufficient and reduces the chances of mistakes.\n"
-     "\n"
-     "       - 2-URL Merge Example -\n"
-     "\n"
-     "     A feature has been developed on a branch called 'feature'.\n"
-     "     Development for the upcoming 3.0 release has happened in parallel on\n"
-     "     the '3.x-release' branch. The work on the feature branch must be\n"
-     "     merged to the 3.x-release branch. However, the feature branch and\n"
-     "     the 3.x-release branch are not directly related, so a 2-URL merge\n"
-     "     is needed.\n"
-     "     The feature branch was last synced with its immediate ancestor,\n"
-     "     the trunk, up to revision 500. So the difference between trunk@500\n"
-     "     and feature@HEAD contains the complete set of changes related to\n"
-     "     the feature, and no other changes. These changes are applied to\n"
-     "     the 3.x-release branch.\n"
-     "\n"
-     "                   3.x-release  +-----------------------------------o\n"
-     "                               /                                    ^\n"
-     "                              /                                    /\n"
-     "                             /              r500                  /\n"
-     "         trunk ------+------+-----------------L--------->        /\n"
-     "                      \\                         .               /\n"
-     "                       \\                         ...........   /\n"
-     "                        \\                                   . /\n"
-     "                feature  +-----------------------------------R\n"
-     "\n"
-     "     In the diagram above, L marks the left side of the merge (trunk@500),\n"
-     "     and R marks the right side of the merge is (feature@HEAD).\n"
-     "     The difference between the left and right side is merged into the target.\n"
-     "\n"
-     "     To perform the merge, check out a working copy of the 3.x-release\n"
-     "     branch and run the following command in the top-level directory\n"
-     "     of the working copy:\n"
-     "\n"
-     "         svn merge ^/trunk@500 ^/feature\n"
-     "\n"
-     "     Before performing a 2-URL merge, it is a good idea to preview the\n"
-     "     changes which will be merged, because there is no guarantee that\n"
-     "     the merge will be free of conflicts. The preview can be done with\n"
-     "     the svn diff command:\n"
-     "\n"
-     "         svn diff ^/trunk@500 ^/feature@HEAD\n"
-     "\n"
-     "     Note that a 2-URL merge can also merge from foreign repositories.\n"
-     "     While SOURCE1 and SOURCE2 must both come from the same repository,\n"
-     "     TARGET_WCPATH may come from a different repository than the sources.\n"
-     "     However, there are some caveats. Most notably, copies made in the\n"
-     "     merge source will be transformed into plain additions in the merge\n"
-     "     target. Also, merge-tracking is not supported.\n"
-     "\n"
-     "\n"
-     "  The following applies to all types of merges:\n"
-     "\n"
-     "  To prevent unnecessary merge conflicts, svn merge requires that\n"
-     "  TARGET_WCPATH is not a mixed-revision working copy.\n"
-     "  Running 'svn update' before starting a merge ensures that all\n"
-     "  items in the working copy are based on the same revision.\n"
-     "\n"
-     "  For each merged item a line will be printed with characters reporting\n"
-     "  the action taken. These characters have the following meaning:\n"
-     "\n"
-     "    A  Added\n"
-     "    D  Deleted\n"
-     "    U  Updated\n"
-     "    C  Conflict\n"
-     "    G  Merged\n"
-     "    E  Existed\n"
-     "    R  Replaced\n"
-     "\n"
-     "  Characters in the first column report about the item itself.\n"
-     "  Characters in the second column report about properties of the item.\n"
-     "  A 'C' in the third column indicates a tree conflict, while a 'C' in\n"
-     "  the first and second columns indicate textual conflicts in files\n"
-     "  and in property values, respectively.\n"
-     "\n"
-     "  NOTE:  Subversion uses the svn:mergeinfo property to track merge\n"
-     "  history.  This property is considered at the start of a merge to\n"
-     "  determine what to merge and it is updated at the conclusion of the\n"
-     "  merge to describe the merge that took place.  Mergeinfo is used only\n"
-     "  if the two sources are on the same line of history -- if the first\n"
-     "  source is an ancestor of the second, or vice-versa.  This is guaranteed\n"
-     "  to be the case when using sync merges and reintegrate merges.\n"
-     "  The --ignore-ancestry option prevents merge tracking and thus\n"
-     "  ignores mergeinfo, neither considering it nor recording it.\n"),
+    ( /* For this large section, let's keep it unindented for easier
+       * viewing/editing. It has been vim-treated with a textwidth=75 and 'gw'
+       * (with quotes and newlines removed). */
+"Merge changes into a working copy.\n"
+"usage: 1. merge SOURCE[@REV] [TARGET_WCPATH]\n"
+"          (the 'sync' merge)\n"
+"       2. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
+"          (the 'cherry-pick' merge)\n"
+"       3. merge --reintegrate SOURCE[@REV] [TARGET_WCPATH]\n"
+"          (the 'reintegrate' merge)\n"
+"       4. merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
+"          (the '2-URL' merge)\n"
+"\n"
+"  1. This form is called a 'sync' (or 'catch-up') merge:\n"
+"\n"
+"       svn merge SOURCE[@REV] [TARGET_WCPATH]\n"
+"\n"
+"     A sync merge is used to fetch all the latest changes made on a parent\n"
+"     branch. In other words, the target branch has originally been created\n"
+"     by copying the source branch, and any changes committed on the source\n"
+"     branch since branching are applied to the target branch. This uses\n"
+"     merge tracking to skip all those revisions that have already been\n"
+"     merged, so a sync merge can be repeated periodically to stay up-to-\n"
+"     date with the source branch.\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"
+"     the changes will be applied. Normally SOURCE and TARGET_WCPATH should\n"
+"     each correspond to the root of a branch. (If you want to merge only a\n"
+"     subtree, then the subtree path must be included in both SOURCE and\n"
+"     TARGET_WCPATH; this is discouraged, to avoid subtree mergeinfo.)\n"
+"\n"
+"     SOURCE is usually a URL. The optional '@REV' specifies both the peg\n"
+"     revision of the URL and the latest revision that will be considered\n"
+"     for merging; if REV is not specified, the HEAD revision is assumed. If\n"
+"     SOURCE is a working copy path, the corresponding URL of the path is\n"
+"     used, and the default value of 'REV' is the base revision (usually the\n"
+"     revision last updated to).\n"
+"\n"
+"     TARGET_WCPATH is a working copy path; if omitted, '.' is assumed.\n"
+"\n"
+"       - Sync Merge Example -\n"
+"\n"
+"     A feature is being developed on a branch called 'feature', which has\n"
+"     originally been a copy of trunk. The feature branch has been regularly\n"
+"     synced with trunk to keep up with the changes made there. The previous\n"
+"     sync merges are not shown on this diagram, and the last of them was\n"
+"     done when HEAD was r100. Currently, HEAD is r200.\n"
+"\n"
+"                feature  +------------------------o-----\n"
+"                        /                         ^\n"
+"                       /            ............  |\n"
+"                      /            .            . /\n"
+"         trunk ------+------------L--------------R------\n"
+"                                r100           r200\n"
+"\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"
+"     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"
+"\n"
+"     To perform this sync merge, have a clean working copy of the feature\n"
+"     branch and run the following command in its top-level directory:\n"
+"\n"
+"         svn merge ^/trunk\n"
+"\n"
+"     Note that the merge is now only in your local working copy and still\n"
+"     needs to be committed to the repository so that it can be seen by\n"
+"     others. You can review the changes and you may have to resolve\n"
+"     conflicts before you commit the merge.\n"
+"\n"
+"\n"
+"  2. This form is called a 'cherry-pick' merge:\n"
+"\n"
+"       svn merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
+"\n"
+"     A cherry-pick merge is used to merge specific revisions (or revision\n"
+"     ranges) from one branch to another. By default, this uses merge\n"
+"     tracking to automatically skip any revisions that have already been\n"
+"     merged to the target; you can use the --ignore-ancestry option to\n"
+"     disable such skipping.\n"
+"\n"
+"     SOURCE is usually a URL. The optional '@REV' specifies only the peg\n"
+"     revision of the URL and does not affect the merge range; if REV is not\n"
+"     specified, the HEAD revision is assumed. If SOURCE is a working copy\n"
+"     path, the corresponding URL of the path is used, and the default value\n"
+"     of 'REV' is the base revision (usually the revision last updated to).\n"
+"\n"
+"     TARGET_WCPATH is a working copy path; if omitted, '.' is assumed.\n"
+"\n"
+"     The revision ranges to be merged are specified by the '-r' and/or '-c'\n"
+"     options. '-r N:M' refers to the difference in the history of the\n"
+"     source branch between revisions N and M. You can use '-c M' to merge\n"
+"     single revisions: '-c M' is equivalent to '-r <M-1>:M'. Each such\n"
+"     difference is applied to TARGET_WCPATH.\n"
+"\n"
+"     If the mergeinfo in TARGET_WCPATH indicates that revisions within the\n"
+"     range were already merged, changes made in those revisions are not\n"
+"     merged again. If needed, the range is broken into multiple sub-ranges,\n"
+"     and each sub-range is merged separately.\n"
+"\n"
+"     A 'reverse range' can be used to undo changes. For example, when\n"
+"     source and target refer to the same branch, a previously committed\n"
+"     revision can be 'undone'. In a reverse range, N is greater than M in\n"
+"     '-r N:M', or the '-c' option is used with a negative number: '-c -M'\n"
+"     is equivalent to '-r M:<M-1>'.\n"
+"\n"
+"     Multiple '-c' and/or '-r' options may be specified and mixing of\n"
+"     forward and reverse ranges is allowed.\n"
+"\n"
+"       - Cherry-pick Merge Example -\n"
+"\n"
+"     A bug has been fixed on trunk in revision 50. This fix needs to\n"
+"     be merged from trunk onto the release branch.\n"
+"\n"
+"            1.x-release  +-----------------------o-----\n"
+"                        /                        ^\n"
+"                       /                         |\n"
+"                      /                          |\n"
+"         trunk ------+--------------------------LR-----\n"
+"                                                r50\n"
+"\n"
+"     In the above diagram, L marks the left side (trunk@49) and R marks the\n"
+"     right side (trunk@50) of the merge. The difference between the left\n"
+"     and right side is applied to the target working copy path.\n"
+"\n"
+"     Note that the difference between revision 49 and 50 is exactly those\n"
+"     changes that were committed in revision 50, not including changes\n"
+"     committed in revision 49.\n"
+"\n"
+"     To perform the merge, have a clean working copy of the release branch\n"
+"     and run the following command in its top-level directory; remember\n"
+"     that the default target is '.':\n"
+"\n"
+"         svn merge -c50 ^/trunk\n"
+"\n"
+"     You can also cherry-pick several revisions and/or revision ranges:\n"
+"\n"
+"         svn merge -c50,54,60 -r65:68 ^/trunk\n"
+"\n"
+"\n"
+"  3. This form is called a 'reintegrate merge':\n"
+"\n"
+"       svn merge --reintegrate SOURCE[@REV] [TARGET_WCPATH]\n"
+"\n"
+"     In a reintegrate merge, an (e.g. feature) branch is merged back to its\n"
+"     originating branch. In other words, the source branch has originally\n"
+"     been created by copying the target branch, development has concluded\n"
+"     on the source branch and it should now be merged back into the target\n"
+"     branch.\n"
+"     \n"
+"     SOURCE is the URL of a branch to be merged back. If REV is specified,\n"
+"     it is used as the peg revision for SOURCE; if REV is not specified,\n"
+"     the HEAD revision is assumed.\n"
+"\n"
+"     TARGET_WCPATH is a working copy of the branch the changes will be\n"
+"     applied to.\n"
+"\n"
+"       - Reintegrate Merge Example -\n"
+"\n"
+"     A feature has been developed on a branch called 'feature'. The feature\n"
+"     branch started as a copy of trunk@W. Work on the feature has completed\n"
+"     and it should be merged back into the trunk.\n"
+"\n"
+"     The feature branch was last synced with trunk up to revision X. So the\n"
+"     difference between trunk@X and feature@HEAD contains the complete set\n"
+"     of changes that implement the feature, and no other changes. These\n"
+"     changes are applied to trunk.\n"
+"\n"
+"                feature  +--------------------------------R\n"
+"                        /                                . \\\n"
+"                       /                    .............   \\\n"
+"                      /                    .                 v\n"
+"         trunk ------+--------------------L------------------o\n"
+"                    rW                   rX\n"
+"\n"
+"     In the diagram above, L marks the left side (trunk@X) and R marks the\n"
+"     right side (feature@HEAD) of the merge. The difference between the\n"
+"     left and right side is merged into trunk, the target.\n"
+"\n"
+"     To perform the merge, have a clean working copy of trunk and run the\n"
+"     following command in its top-level directory:\n"
+"\n"
+"         svn merge --reintegrate ^/feature\n"
+"\n"
+"     To prevent unnecessary merge conflicts, a reintegrate merge requires\n"
+"     that TARGET_WCPATH is not a mixed-revision working copy, has no local\n"
+"     modifications, and has no switched subtrees.\n"
+"\n"
+"     A reintegrate merge also requires that the source branch is coherently\n"
+"     synced with the target -- in the above example, this means that all\n"
+"     revisions between the branch point W and the last merged revision X\n"
+"     are merged to the feature branch, so that there are no unmerged\n"
+"     revisions in-between.\n"
+"\n"
+"     After the reintegrate merge, the feature branch cannot be synced to\n"
+"     the trunk again without merge conflicts. If further work must be done\n"
+"     on the feature branch, it should be deleted and then re-created.\n"
+"\n"
+"\n"
+"  4. This form is called a '2-URL merge':\n"
+"\n"
+"       svn merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
+"\n"
+"     Two source URLs are specified, together with two revisions N and M.\n"
+"     The two sources are compared at the specified revisions, and the\n"
+"     difference is applied to TARGET_WCPATH, which is a path to a working\n"
+"     copy of another branch. The three branches involved can be completely\n"
+"     unrelated.\n"
+"\n"
+"     You should use this merge variant only if the other variants do not\n"
+"     apply to your situation, as this variant can be quite complex to\n"
+"     master.\n"
+"\n"
+"     If TARGET_WCPATH is omitted, a default value of '.' is assumed.\n"
+"     However, in the special case where both sources refer to a file node\n"
+"     with the same basename and a similarly named file is also found within\n"
+"     '.', the differences will be applied to that local file.  The source\n"
+"     revisions default to HEAD if omitted.\n"
+"\n"
+"     The sources can also be specified as working copy paths, in which case\n"
+"     the URLs of the merge sources are derived from the working copies.\n"
+"\n"
+"       - 2-URL Merge Example -\n"
+"\n"
+"     Two features have been developed on separate branches called 'foo' and\n"
+"     'bar'. It has since become clear that 'bar' should be combined with\n"
+"     the 'foo' branch for further development before reintegration.\n"
+"\n"
+"     Although both feature branches originate from trunk, they are not\n"
+"     directly related -- one is not a direct copy of the other. A 2-URL\n"
+"     merge is necessary.\n"
+"\n"
+"     The 'bar' branch has been synced with trunk up to revision 500. So the\n"
+"     difference between trunk@500 and bar@HEAD contains the complete\n"
+"     set of changes related to feature 'bar', and no other changes. These\n"
+"     changes are applied to the 'foo' branch.\n"
+"\n"
+"                           foo  +-----------------------------------o\n"
+"                               /                                    ^\n"
+"                              /                                    /\n"
+"                             /              r500                  /\n"
+"         trunk ------+------+-----------------L--------->        /\n"
+"                      \\                        .                /\n"
+"                       \\                        ............   /\n"
+"                        \\                                   . /\n"
+"                    bar  +-----------------------------------R\n"
+"\n"
+"     In the diagram above, L marks the left side (trunk@500) and R marks\n"
+"     the right side (bar@HEAD) of the merge. The difference between the\n"
+"     left and right side is applied to the target working copy path, in\n"
+"     this case a working copy of the 'foo' branch.\n"
+"\n"
+"     To perform the merge, have a clean working copy of the 'foo' branch\n"
+"     and run the following command in its top-level directory:\n"
+"\n"
+"         svn merge ^/trunk@500 ^/bar\n"
+"\n"
+"     The exact changes applied by a 2-URL merge can be previewed with svn's\n"
+"     diff command, which is a good idea to verify if you do not have the\n"
+"     luxury of a clean working copy to merge to. In this case:\n"
+"\n"
+"         svn diff ^/trunk@500 ^/bar@HEAD\n"
+"\n"
+"     Note that a 2-URL merge can also merge from foreign repositories.\n"
+"     While SOURCE1 and SOURCE2 must both come from the same repository,\n"
+"     TARGET_WCPATH may come from a different repository than the sources.\n"
+"     However, there are some caveats. Most notably, copies made in the\n"
+"     merge source will be transformed into plain additions in the merge\n"
+"     target. Also, merge-tracking is not supported when foreign\n"
+"     repositories are involved.\n"
+"\n"
+"\n"
+"  The following applies to all types of merges:\n"
+"\n"
+"  To prevent unnecessary merge conflicts, svn merge requires that\n"
+"  TARGET_WCPATH is not a mixed-revision working copy. Running 'svn update'\n"
+"  before starting a merge ensures that all items in the working copy are\n"
+"  based on the same revision.\n"
+"\n"
+"  If possible, you should have no local modifications in the merge's target\n"
+"  working copy prior to the merge, to keep things simpler. It will be\n"
+"  easier to revert the merge and to understand the branch's history.\n"
+"\n"
+"  Switched sub-paths should also be avoided during merging, as they may\n"
+"  cause incomplete merges and create subtree mergeinfo.\n"
+"\n"
+"  For each merged item a line will be printed with characters reporting the\n"
+"  action taken. These characters have the following meaning:\n"
+"\n"
+"    A  Added\n"
+"    D  Deleted\n"
+"    U  Updated\n"
+"    C  Conflict\n"
+"    G  Merged\n"
+"    E  Existed\n"
+"    R  Replaced\n"
+"\n"
+"  Characters in the first column report about the item itself.\n"
+"  Characters in the second column report about properties of the item.\n"
+"  A 'C' in the third column indicates a tree conflict, while a 'C' in\n"
+"  the first and second columns indicate textual conflicts in files\n"
+"  and in property values, respectively.\n"
+"\n"
+"    - Merge Tracking -\n"
+"\n"
+"  Subversion uses the svn:mergeinfo property to track merge history. This\n"
+"  property is considered at the start of a merge to determine what to merge\n"
+"  and it is updated at the conclusion of the merge to describe the merge\n"
+"  that took place. Mergeinfo is used only if the two sources are on the\n"
+"  same line of history -- if the first source is an ancestor of the second,\n"
+"  or vice-versa (i.e. if one has originally been created by copying the\n"
+"  other). This is verified and enforced when using sync merges and\n"
+"  reintegrate merges.\n"
+"\n"
+"  The --ignore-ancestry option prevents merge tracking and thus ignores\n"
+"  mergeinfo, neither considering it nor recording it.\n"),
     {'r', 'c', 'N', opt_depth, 'q', opt_force, opt_dry_run, opt_merge_cmd,
      opt_record_only, 'x', opt_ignore_ancestry, opt_accept, opt_reintegrate,
      opt_allow_mixed_revisions} },

Modified: subversion/branches/showing-merge-info/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/svn/merge-cmd.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/showing-merge-info/subversion/svn/merge-cmd.c Wed Dec  7 23:23:02 2011
@@ -418,11 +418,11 @@ svn_cl__merge(apr_getopt_t *os,
       else if (strcmp(sourcepath1, sourcepath2) == 0)
         {
           svn_node_kind_t kind;
-          const char *decoded_path = svn_path_uri_decode(sourcepath1, pool);
-          SVN_ERR(svn_io_check_path(decoded_path, &kind, pool));
+
+          SVN_ERR(svn_io_check_path(sourcepath1, &kind, pool));
           if (kind == svn_node_file)
             {
-              targetpath = decoded_path;
+              targetpath = sourcepath1;
             }
         }
     }

Modified: subversion/branches/showing-merge-info/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/svnlook/main.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/svnlook/main.c (original)
+++ subversion/branches/showing-merge-info/subversion/svnlook/main.c Wed Dec  7 23:23:02 2011
@@ -784,18 +784,25 @@ generate_label(const char **label,
    If TOKEN is empty, or is already terminated by an EOL marker,
    return TOKEN unmodified. Else, return a new string consisting
    of the concatenation of TOKEN and the system's default EOL marker.
-   The new string is allocated from POOL. */
+   The new string is allocated from POOL.
+   If HAD_EOL is not NULL, indicate in *HAD_EOL if the token had a EOL. */
 static const svn_string_t *
-maybe_append_eol(const svn_string_t *token, apr_pool_t *pool)
+maybe_append_eol(const svn_string_t *token, svn_boolean_t *had_eol,
+                 apr_pool_t *pool)
 {
   const char *curp;
 
+  if (had_eol)
+    *had_eol = FALSE;
+
   if (token->len == 0)
     return token;
 
   curp = token->data + token->len - 1;
   if (*curp == '\r')
     {
+      if (had_eol)
+        *had_eol = TRUE;
       return token;
     }
   else if (*curp != '\n')
@@ -804,6 +811,8 @@ maybe_append_eol(const svn_string_t *tok
     }
   else
     {
+      if (had_eol)
+        *had_eol = TRUE;
       return token;
     }
 }
@@ -860,19 +869,20 @@ display_prop_diffs(const apr_array_heade
         const svn_string_t *tmp;
         const svn_string_t *orig;
         const svn_string_t *val;
+        svn_boolean_t val_has_eol;
 
         SVN_ERR(svn_stream_for_stdout(&out, pool));
 
         /* The last character in a property is often not a newline.
-           Since the diff is not useful anyway for patching properties an
-           eol character is appended when needed to remove those pescious
-           ' \ No newline at end of file' lines. */
+           An eol character is appended to prevent the diff API to add a
+           ' \ No newline at end of file' line. We add 
+           ' \ No newline at end of property' manually if needed. */
         tmp = orig_value ? orig_value : svn_string_create_empty(pool);
-        orig = maybe_append_eol(tmp, pool);
+        orig = maybe_append_eol(tmp, NULL, pool);
 
         tmp = pc->value ? pc->value :
                                   svn_string_create_empty(pool);
-        val = maybe_append_eol(tmp, pool);
+        val = maybe_append_eol(tmp, &val_has_eol, pool);
 
         SVN_ERR(svn_diff_mem_string_diff(&diff, orig, val, &options, pool));
 
@@ -888,6 +898,12 @@ display_prop_diffs(const apr_array_heade
                                            svn_dirent_local_style(path, pool),
                                            svn_cmdline_output_encoding(pool),
                                            orig, val, pool));
+        if (!val_has_eol)
+          {
+            const char *s = "\\ No newline at end of property" APR_EOL_STR;
+            apr_size_t len = strlen(s);
+            SVN_ERR(svn_stream_write(out, s, &len));
+          }
       }
     }
   return svn_cmdline_fflush(stdout);

Modified: subversion/branches/showing-merge-info/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/svnserve/serve.c?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/svnserve/serve.c (original)
+++ subversion/branches/showing-merge-info/subversion/svnserve/serve.c Wed Dec  7 23:23:02 2011
@@ -243,6 +243,7 @@ svn_error_t *load_configs(svn_config_t *
   *pwdb = NULL;
   if (pwdb_path)
     {
+      pwdb_path = svn_dirent_canonicalize(pwdb_path, pool);
       pwdb_path = svn_dirent_join(base, pwdb_path, pool);
 
       err = svn_config_read2(pwdb, pwdb_path, TRUE, FALSE, pool);
@@ -290,6 +291,7 @@ svn_error_t *load_configs(svn_config_t *
     {
       const char *case_force_val;
 
+      authzdb_path = svn_dirent_canonicalize(authzdb_path, pool);
       authzdb_path = svn_dirent_join(base, authzdb_path, pool);
       err = svn_repos_authz_read(authzdb, authzdb_path, TRUE, pool);
       if (err)

Modified: subversion/branches/showing-merge-info/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/tests/cmdline/copy_tests.py?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/showing-merge-info/subversion/tests/cmdline/copy_tests.py Wed Dec  7 23:23:02 2011
@@ -5621,6 +5621,47 @@ def wc_wc_copy_incomplete(sbox):
                                         None,
                                         expected_status)
 
+def three_nested_moves(sbox):
+  "three nested moves"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('A/B'),
+                                     sbox.ospath('A/B2'))
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('A/B2/E'),
+                                     sbox.ospath('A/B2/E2'))
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('A/B2/E2/alpha'),
+                                     sbox.ospath('A/B2/E2/alpha2'))
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+      'A/B2'           : Item(status='  ', wc_rev=2),
+      'A/B2/E2'        : Item(status='  ', wc_rev=2),
+      'A/B2/E2/alpha2' : Item(status='  ', wc_rev=2),
+      'A/B2/E2/beta'   : Item(status='  ', wc_rev=2),
+      'A/B2/F'         : Item(status='  ', wc_rev=2),
+      'A/B2/lambda'    : Item(status='  ', wc_rev=2),
+      })
+  expected_status.remove('A/B', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
+                         'A/B/F', 'A/B/lambda')
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B'            : Item(verb='Deleting'),
+    'A/B2'           : Item(verb='Adding'),
+    'A/B2/E'         : Item(verb='Deleting'),
+    'A/B2/E2'        : Item(verb='Adding'),
+    'A/B2/E2/alpha'  : Item(verb='Deleting'),
+    'A/B2/E2/alpha2' : Item(verb='Adding'),
+    })
+
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None, wc_dir)
+
 ########################################################################
 # Run the tests
 
@@ -5734,6 +5775,7 @@ test_list = [ None,
               commit_copied_half_of_move,
               commit_deleted_half_of_move,
               wc_wc_copy_incomplete,
+              three_nested_moves,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/showing-merge-info/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/tests/cmdline/depth_tests.py?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/showing-merge-info/subversion/tests/cmdline/depth_tests.py Wed Dec  7 23:23:02 2011
@@ -1076,7 +1076,8 @@ def diff_in_depthy_wc(sbox):
     "___________________________________________________________________\n",
     "Deleted: foo\n",
     "## -1 +0,0 ##\n",
-    "-foo-val\n"]
+    "-foo-val\n",
+    "\\ No newline at end of property\n"]
 
   os.chdir(wc_empty)
 

Modified: subversion/branches/showing-merge-info/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/showing-merge-info/subversion/tests/cmdline/diff_tests.py?rev=1211703&r1=1211702&r2=1211703&view=diff
==============================================================================
--- subversion/branches/showing-merge-info/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/showing-merge-info/subversion/tests/cmdline/diff_tests.py Wed Dec  7 23:23:02 2011
@@ -146,15 +146,20 @@ def make_diff_prop_header(path):
     "___________________________________________________________________\n"
   ]
 
+def make_diff_prop_val(plus_minus, pval):
+  "Return diff for prop value PVAL, with leading PLUS_MINUS (+ or -)."
+  if len(pval) > 0 and pval[-1] != '\n':
+    return [plus_minus + pval + "\n","\\ No newline at end of property\n"]
+  return [plus_minus + pval]
+  
 def make_diff_prop_deleted(pname, pval):
   """Return a property diff for deletion of property PNAME, old value PVAL.
      PVAL is a single string with no embedded newlines.  Return the result
      as a list of newline-terminated strings."""
   return [
     "Deleted: " + pname + "\n",
-    "## -1 +0,0 ##\n",
-    "-" + pval + "\n"
-  ]
+    "## -1 +0,0 ##\n"
+  ] + make_diff_prop_val("-", pval)
 
 def make_diff_prop_added(pname, pval):
   """Return a property diff for addition of property PNAME, new value PVAL.
@@ -163,8 +168,7 @@ def make_diff_prop_added(pname, pval):
   return [
     "Added: " + pname + "\n",
     "## -0,0 +1 ##\n",
-    "+" + pval + "\n"
-  ]
+  ] + make_diff_prop_val("+", pval)
 
 def make_diff_prop_modified(pname, pval1, pval2):
   """Return a property diff for modification of property PNAME, old value
@@ -173,9 +177,7 @@ def make_diff_prop_modified(pname, pval1
   return [
     "Modified: " + pname + "\n",
     "## -1 +1 ##\n",
-    "-" + pval1 + "\n",
-    "+" + pval2 + "\n"
-  ]
+  ] + make_diff_prop_val("-", pval1) + make_diff_prop_val("+", pval2)
 
 ######################################################################
 # Diff output checker
@@ -1218,6 +1220,7 @@ def diff_deleted_in_head(sbox):
 
 
 #----------------------------------------------------------------------
+@Issue(2873)
 def diff_targets(sbox):
   "select diff targets"
 
@@ -2853,18 +2856,18 @@ def diff_with_depth(sbox):
   A_header = make_diff_header('A', "revision 1", "working copy")
   B_header = make_diff_header(B_path, "revision 1", "working copy")
 
-  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
-  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
-                                                  + iota_header + diff[7:12])
-  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:7])
+  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:7]
+                                                  + iota_header + diff[8:14])
+  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:7]
                                                        + iota_header
-                                                       + diff[7:12]
-                                                       +  A_header + diff[8:18])
-  expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                       + diff[8:14]
+                                                       + A_header + diff[15:21])
+  expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:7]
                                                        + iota_header
-                                                       + diff[7:12]
-                                                       +  A_header + diff[8:18]
-                                                       + B_header + diff[12:])
+                                                       + diff[8:14]
+                                                       + A_header + diff[15:21]
+                                                       + B_header + diff[22:])
 
   os.chdir(sbox.wc_dir)
 
@@ -2900,18 +2903,18 @@ def diff_with_depth(sbox):
   A_header = make_diff_header('A', "revision 1", "revision 2")
   B_header = make_diff_header(B_path, "revision 1", "revision 2")
 
-  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
-  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
-                                                  + iota_header + diff[7:12])
-  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:7])
+  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:7]
+                                                  + iota_header + diff[8:14])
+  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:7]
                                                        + iota_header
-                                                       + diff[7:12]
-                                                       +  A_header + diff[8:18])
+                                                       + diff[8:14]
+                                                       + A_header + diff[15:21])
   expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
                                                        + iota_header
-                                                       + diff[7:12]
-                                                       +  A_header + diff[8:18]
-                                                       + B_header + diff[12:])
+                                                       + diff[8:14]
+                                                       + A_header + diff[15:21]
+                                                       + B_header + diff[22:])
 
   # Test repos-repos diff.
   svntest.actions.run_and_verify_svn(None, expected_empty, [],
@@ -2944,10 +2947,10 @@ def diff_with_depth(sbox):
     make_diff_prop_header(".") + \
     make_diff_prop_modified("foo1", "bar1", "baz1")
 
-  expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[43:])
-  expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[29:])
-  expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[11:22]
-                                                       +diff_wc_repos[29:])
+  expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[49:])
+  expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[33:])
+  expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[13:26]
+                                                       +diff_wc_repos[33:])
   expected_infinity = svntest.verify.UnorderedOutput(diff_wc_repos[:])
 
   svntest.actions.run_and_verify_svn(None, None, [],



Mime
View raw message