subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1606774 [2/3] - in /subversion/branches/svn-auth-x509: ./ subversion/bindings/javahl/native/ subversion/bindings/javahl/native/jniwrapper/ subversion/bindings/javahl/src/org/apache/subversion/javahl/types/ subversion/bindings/javahl/tests/...
Date Mon, 30 Jun 2014 15:16:03 GMT
Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.c Mon Jun 30 15:16:01 2014
@@ -1291,7 +1291,6 @@ l2p_index_lookup(apr_off_t *offset,
       svn_revnum_t last_revision
         = info_baton.first_revision
           + (key.is_packed ? ffd->max_files_per_dir : 1);
-      apr_pool_t *iterpool = svn_pool_create(pool);
       svn_boolean_t end;
       apr_off_t max_offset
         = APR_ALIGN(info_baton.entry.offset + info_baton.entry.size,
@@ -1306,39 +1305,44 @@ l2p_index_lookup(apr_off_t *offset,
       SVN_ERR(svn_cache__set(ffd->l2p_page_cache, &key, page, pool));
       SVN_ERR(l2p_page_get_entry(&page_baton, page, page->offsets, pool));
 
-      /* prefetch pages from following and preceding revisions */
-      pages = apr_array_make(pool, 16, sizeof(l2p_page_table_entry_t));
-      end = FALSE;
-      for (prefetch_revision = revision;
-           prefetch_revision < last_revision && !end;
-           ++prefetch_revision)
+      if (ffd->use_block_read)
         {
-          int excluded_page_no = prefetch_revision == revision
-                               ? info_baton.page_no
-                               : -1;
-          svn_pool_clear(iterpool);
-
-          SVN_ERR(prefetch_l2p_pages(&end, fs, rev_file,
-                                     info_baton.first_revision,
-                                     prefetch_revision, pages,
-                                     excluded_page_no, min_offset,
-                                     max_offset, iterpool));
-        }
+          apr_pool_t *iterpool = svn_pool_create(pool);
 
-      end = FALSE;
-      for (prefetch_revision = revision-1;
-           prefetch_revision >= info_baton.first_revision && !end;
-           --prefetch_revision)
-        {
-          svn_pool_clear(iterpool);
+          /* prefetch pages from following and preceding revisions */
+          pages = apr_array_make(pool, 16, sizeof(l2p_page_table_entry_t));
+          end = FALSE;
+          for (prefetch_revision = revision;
+              prefetch_revision < last_revision && !end;
+              ++prefetch_revision)
+            {
+              int excluded_page_no = prefetch_revision == revision
+                                  ? info_baton.page_no
+                                  : -1;
+              svn_pool_clear(iterpool);
+
+              SVN_ERR(prefetch_l2p_pages(&end, fs, rev_file,
+                                        info_baton.first_revision,
+                                        prefetch_revision, pages,
+                                        excluded_page_no, min_offset,
+                                        max_offset, iterpool));
+            }
 
-          SVN_ERR(prefetch_l2p_pages(&end, fs, rev_file,
-                                     info_baton.first_revision,
-                                     prefetch_revision, pages, -1,
-                                     min_offset, max_offset, iterpool));
-        }
+          end = FALSE;
+          for (prefetch_revision = revision-1;
+              prefetch_revision >= info_baton.first_revision && !end;
+              --prefetch_revision)
+            {
+              svn_pool_clear(iterpool);
 
-      svn_pool_destroy(iterpool);
+              SVN_ERR(prefetch_l2p_pages(&end, fs, rev_file,
+                                        info_baton.first_revision,
+                                        prefetch_revision, pages, -1,
+                                        min_offset, max_offset, iterpool));
+            }
+
+          svn_pool_destroy(iterpool);
+        }
     }
 
   *offset = page_baton.offset;
@@ -1432,7 +1436,7 @@ svn_fs_fs__l2p_get_max_ids(apr_array_hea
 
   /* read index master data structure for the index covering START_REV */
   SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, start_rev,
-                                           header_pool));
+                                           header_pool, header_pool));
   SVN_ERR(get_l2p_header(&header, rev_file, fs, start_rev, header_pool));
   SVN_ERR(svn_fs_fs__close_revision_file(rev_file));
 
@@ -1453,7 +1457,7 @@ svn_fs_fs__l2p_get_max_ids(apr_array_hea
            * issue here. */
           svn_pool_clear(header_pool);
           SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, revision,
-                                                  header_pool));
+                                                  header_pool, header_pool));
           SVN_ERR(get_l2p_header(&header, rev_file, fs, revision,
                                  header_pool));
           SVN_ERR(svn_fs_fs__close_revision_file(rev_file));
@@ -1649,7 +1653,8 @@ svn_fs_fs__p2l_index_append(svn_fs_t *fs
 
           entry.offset = last_entry_end;
           entry.size = APR_ALIGN(entry.offset, page_size) - entry.offset;
-          entry.type = 0;
+          entry.type = SVN_FS_FS__ITEM_TYPE_UNUSED;
+          entry.fnv1_checksum = 0;
           entry.item.revision = last_revision;
           entry.item.number = 0;
         }
@@ -2322,16 +2327,19 @@ p2l_index_lookup(apr_array_header_t *ent
        */
 
       /* pre-fetch preceding pages */
-      end = FALSE;
-      prefetch_info.offset = original_page_start;
-      while (prefetch_info.offset >= prefetch_info.page_size && !end)
+      if (ffd->use_block_read)
         {
-          svn_pool_clear(iterpool);
+          end = FALSE;
+          prefetch_info.offset = original_page_start;
+          while (prefetch_info.offset >= prefetch_info.page_size && !end)
+            {
+              svn_pool_clear(iterpool);
 
-          prefetch_info.offset -= prefetch_info.page_size;
-          SVN_ERR(prefetch_p2l_page(&end, &leaking_bucket, fs, rev_file,
-                                    &prefetch_info, min_offset,
-                                    iterpool));
+              prefetch_info.offset -= prefetch_info.page_size;
+              SVN_ERR(prefetch_p2l_page(&end, &leaking_bucket, fs, rev_file,
+                                        &prefetch_info, min_offset,
+                                        iterpool));
+            }
         }
 
       /* fetch page from disk and put it into the cache */
@@ -2349,20 +2357,23 @@ p2l_index_lookup(apr_array_header_t *ent
       append_p2l_entries(entries, page_entries, block_start, block_end);
 
       /* pre-fetch following pages */
-      end = FALSE;
-      leaking_bucket = 4;
-      prefetch_info = page_info;
-      prefetch_info.offset = original_page_start;
-      while (   prefetch_info.next_offset < max_offset
-             && prefetch_info.page_no + 1 < prefetch_info.page_count
-             && !end)
+      if (ffd->use_block_read)
         {
-          svn_pool_clear(iterpool);
+          end = FALSE;
+          leaking_bucket = 4;
+          prefetch_info = page_info;
+          prefetch_info.offset = original_page_start;
+          while (   prefetch_info.next_offset < max_offset
+                && prefetch_info.page_no + 1 < prefetch_info.page_count
+                && !end)
+            {
+              svn_pool_clear(iterpool);
 
-          prefetch_info.offset += prefetch_info.page_size;
-          SVN_ERR(prefetch_p2l_page(&end, &leaking_bucket, fs, rev_file,
-                                    &prefetch_info, min_offset,
-                                    iterpool));
+              prefetch_info.offset += prefetch_info.page_size;
+              SVN_ERR(prefetch_p2l_page(&end, &leaking_bucket, fs, rev_file,
+                                        &prefetch_info, min_offset,
+                                        iterpool));
+            }
         }
 
       svn_pool_destroy(iterpool);
@@ -2611,6 +2622,182 @@ svn_fs_fs__p2l_get_max_offset(apr_off_t 
                                             pool));
 }
 
+/* Calculate the FNV1 checksum over the offset range in REV_FILE, covered by
+ * ENTRY.  Store the result in ENTRY->FNV1_CHECKSUM.  Use POOL for temporary
+ * allocations. */
+static svn_error_t *
+calc_fnv1(svn_fs_fs__p2l_entry_t *entry,
+          svn_fs_fs__revision_file_t *rev_file,
+          apr_pool_t *pool)
+{
+  unsigned char buffer[4096];
+  svn_checksum_t *checksum;
+  svn_checksum_ctx_t *context
+    = svn_checksum_ctx_create(svn_checksum_fnv1a_32x4, pool);
+  apr_off_t size = entry->size;
+
+  /* Special rules apply to unused sections / items.  The data must be a
+   * sequence of NUL bytes (not checked here) and the checksum is fixed to 0.
+   */
+  if (entry->type == SVN_FS_FS__ITEM_TYPE_UNUSED)
+    {
+      entry->fnv1_checksum = 0;
+      return SVN_NO_ERROR;
+    }
+
+  /* Read the block and feed it to the checksum calculator. */
+  SVN_ERR(svn_io_file_seek(rev_file->file, APR_SET, &entry->offset, pool));
+  while (size > 0)
+    {
+      apr_size_t to_read = size > sizeof(buffer)
+                         ? sizeof(buffer)
+                         : (apr_size_t)size;
+      SVN_ERR(svn_io_file_read_full2(rev_file->file, buffer, to_read, NULL,
+                                     NULL, pool));
+      SVN_ERR(svn_checksum_update(context, buffer, to_read));
+      size -= to_read;
+    }
+
+  /* Store final checksum in ENTRY. */
+  SVN_ERR(svn_checksum_final(&checksum, context, pool));
+  entry->fnv1_checksum = ntohl(*(const apr_uint32_t *)checksum->digest);
+
+  return SVN_NO_ERROR;
+}
+
+/*
+ * Index (re-)creation utilities.
+ */
+
+svn_error_t *
+svn_fs_fs__p2l_index_from_p2l_entries(const char **protoname,
+                                      svn_fs_t *fs,
+                                      svn_fs_fs__revision_file_t *rev_file,
+                                      apr_array_header_t *entries,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool)
+{
+  apr_file_t *proto_index;
+
+  /* Use a subpool for immediate temp file cleanup at the end of this
+   * function. */
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  int i;
+
+  /* Create a proto-index file. */
+  SVN_ERR(svn_io_open_unique_file3(NULL, protoname, NULL,
+                                   svn_io_file_del_on_pool_cleanup,
+                                   result_pool, scratch_pool));
+  SVN_ERR(svn_fs_fs__p2l_proto_index_open(&proto_index, *protoname,
+                                          scratch_pool));
+
+  /* Write ENTRIES to proto-index file and calculate checksums as we go. */
+  for (i = 0; i < entries->nelts; ++i)
+    {
+      svn_fs_fs__p2l_entry_t *entry
+        = APR_ARRAY_IDX(entries, i, svn_fs_fs__p2l_entry_t *);
+      svn_pool_clear(iterpool);
+
+      SVN_ERR(calc_fnv1(entry, rev_file, iterpool));
+      SVN_ERR(svn_fs_fs__p2l_proto_index_add_entry(proto_index, entry,
+                                                   iterpool));
+    }
+
+  /* Convert proto-index into final index and move it into position.
+   * Note that REV_FILE contains the start revision of the shard file if it
+   * has been packed while REVISION may be somewhere in the middle.  For
+   * non-packed shards, they will have identical values. */
+  SVN_ERR(svn_io_file_close(proto_index, iterpool));
+
+  /* Temp file cleanup. */
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+
+/* A svn_sort__array compatible comparator function, sorting the
+ * svn_fs_fs__p2l_entry_t** given in LHS, RHS by revision. */
+static int
+compare_p2l_entry_revision(const void *lhs,
+                           const void *rhs)
+{
+  const svn_fs_fs__p2l_entry_t *lhs_entry
+    =*(const svn_fs_fs__p2l_entry_t **)lhs;
+  const svn_fs_fs__p2l_entry_t *rhs_entry
+    =*(const svn_fs_fs__p2l_entry_t **)rhs;
+
+  if (lhs_entry->item.revision < rhs_entry->item.revision)
+    return -1;
+
+  return lhs_entry->item.revision == rhs_entry->item.revision ? 0 : 1;
+}
+
+svn_error_t *
+svn_fs_fs__l2p_index_from_p2l_entries(const char **protoname,
+                                      svn_fs_t *fs,
+                                      apr_array_header_t *entries,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool)
+{
+  apr_file_t *proto_index;
+
+  /* Use a subpool for immediate temp file cleanup at the end of this
+   * function. */
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  int i;
+  svn_revnum_t last_revision = SVN_INVALID_REVNUM;
+  svn_revnum_t revision = SVN_INVALID_REVNUM;
+
+  /* L2P index must be written in revision order.
+   * Sort ENTRIES accordingly. */
+  svn_sort__array(entries, compare_p2l_entry_revision);
+
+  /* Find the first revision in the index
+   * (must exist since no truly empty revs are allowed). */
+  for (i = 0; i < entries->nelts && !SVN_IS_VALID_REVNUM(revision); ++i)
+    revision = APR_ARRAY_IDX(entries, i, const svn_fs_fs__p2l_entry_t *)
+               ->item.revision;
+
+  /* Create the temporary proto-rev file. */
+  SVN_ERR(svn_io_open_unique_file3(NULL, protoname, NULL,
+                                   svn_io_file_del_on_pool_cleanup,
+                                   result_pool, scratch_pool));
+  SVN_ERR(svn_fs_fs__l2p_proto_index_open(&proto_index, *protoname,
+                                          scratch_pool));
+
+  /*  Write all entries. */
+  for (i = 0; i < entries->nelts; ++i)
+    {
+      const svn_fs_fs__p2l_entry_t *entry
+        = APR_ARRAY_IDX(entries, i, const svn_fs_fs__p2l_entry_t *);
+      svn_pool_clear(iterpool);
+
+      if (entry->type == SVN_FS_FS__ITEM_TYPE_UNUSED)
+        continue;
+
+      if (last_revision != entry->item.revision)
+        {
+          SVN_ERR(svn_fs_fs__l2p_proto_index_add_revision(proto_index,
+                                                          scratch_pool));
+          last_revision = entry->item.revision;
+        }
+
+      SVN_ERR(svn_fs_fs__l2p_proto_index_add_entry(proto_index,
+                                                   entry->offset,
+                                                   entry->item.number,
+                                                   iterpool));
+    }
+
+  /* Convert proto-index into final index and move it into position. */
+  SVN_ERR(svn_io_file_close(proto_index, iterpool));
+
+  /* Temp file cleanup. */
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+
+
 /*
  * Standard (de-)serialization functions
  */

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.h?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.h Mon Jun 30 15:16:01 2014
@@ -233,6 +233,37 @@ svn_fs_fs__p2l_get_max_offset(apr_off_t 
                               svn_revnum_t revision,
                               apr_pool_t *pool);
 
+/* Index (re-)creation utilities.
+ */
+
+/* For FS, create a new L2P auto-deleting proto index file in POOL and return
+ * its name in *PROTONAME.  All entries to write are given in ENTRIES and
+ * entries are of type svn_fs_fs__p2l_entry_t* (sic!).  The ENTRIES array
+ * will be reordered.  Give the proto index file the lifetime of RESULT_POOL
+ * and use SCRATCH_POOL for temporary allocations.
+ */
+svn_error_t *
+svn_fs_fs__l2p_index_from_p2l_entries(const char **protoname,
+                                      svn_fs_t *fs,
+                                      apr_array_header_t *entries,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool);
+
+/* For FS, create a new P2L auto-deleting proto index file in POOL and return
+ * its name in *PROTONAME.  All entries to write are given in ENTRIES and
+ * of type svn_fs_fs__p2l_entry_t*.  The FVN1 checksums are not taken from
+ * ENTRIES but are begin calculated from the current contents of REV_FILE
+ * as we go.  Give the proto index file the lifetime of RESULT_POOL and use
+ * SCRATCH_POOL for temporary allocations.
+ */
+svn_error_t *
+svn_fs_fs__p2l_index_from_p2l_entries(const char **protoname,
+                                      svn_fs_t *fs,
+                                      svn_fs_fs__revision_file_t *rev_file,
+                                      apr_array_header_t *entries,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool);
+
 /* Serialization and caching interface
  */
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/pack.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/pack.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/pack.c Mon Jun 30 15:16:01 2014
@@ -1293,7 +1293,7 @@ pack_range(pack_context_t *context,
 
       /* Get the rev file dimensions (mainly index locations). */
       SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, context->fs,
-                                               revision, revpool));
+                                               revision, revpool, iterpool));
       SVN_ERR(svn_fs_fs__auto_read_footer(rev_file));
 
       /* store the indirect array index */
@@ -1425,7 +1425,8 @@ append_revision(pack_context_t *context,
 
   /* Copy all the bits from the rev file to the end of the pack file. */
   SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, context->fs,
-                                           context->start_rev, pool));
+                                           context->start_rev, pool,
+                                           iterpool));
   SVN_ERR(copy_file_data(context, context->pack_file, rev_file->file,
                          finfo.size, iterpool));
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/recovery.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/recovery.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/recovery.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/recovery.c Mon Jun 30 15:16:01 2014
@@ -57,7 +57,8 @@ recover_get_largest_revision(svn_fs_t *f
       svn_fs_fs__revision_file_t *file;
       svn_pool_clear(iterpool);
 
-      err = svn_fs_fs__open_pack_or_rev_file(&file, fs, right, iterpool);
+      err = svn_fs_fs__open_pack_or_rev_file(&file, fs, right, iterpool,
+                                             iterpool);
       if (err && err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION)
         {
           svn_error_clear(err);
@@ -80,7 +81,8 @@ recover_get_largest_revision(svn_fs_t *f
       svn_fs_fs__revision_file_t *file;
       svn_pool_clear(iterpool);
 
-      err = svn_fs_fs__open_pack_or_rev_file(&file, fs, probe, iterpool);
+      err = svn_fs_fs__open_pack_or_rev_file(&file, fs, probe, iterpool,
+                                             iterpool);
       if (err && err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION)
         {
           svn_error_clear(err);
@@ -410,7 +412,8 @@ recover_body(void *baton, apr_pool_t *po
           if (b->cancel_func)
             SVN_ERR(b->cancel_func(b->cancel_baton));
 
-          SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, rev, pool));
+          SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, rev, pool,
+                                                   iterpool));
           SVN_ERR(recover_get_root_offset(&root_offset, rev, rev_file, pool));
           SVN_ERR(recover_find_max_ids(fs, rev, rev_file, root_offset,
                                        &next_node_id, &next_copy_id, pool));

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/rev_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/rev_file.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/rev_file.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/rev_file.c Mon Jun 30 15:16:01 2014
@@ -28,6 +28,7 @@
 
 #include "../libsvn_fs/fs-loader.h"
 
+#include "private/svn_io_private.h"
 #include "svn_private_config.h"
 
 static void
@@ -54,14 +55,80 @@ init_revision_file(svn_fs_fs__revision_f
   file->pool = pool;
 }
 
+/* Baton type for set_read_only() */
+typedef struct set_read_only_baton_t
+{
+  /* File to set to read-only. */
+  const char *file_path;
+
+  /* Scratch pool sufficient life time.
+   * Ideally the pool that we registered the cleanup on. */
+  apr_pool_t *pool;
+} set_read_only_baton_t;
+
+/* APR pool cleanup callback taking a set_read_only_baton_t baton and then
+ * (trying to) set the specified file to r/o mode. */
+static apr_status_t
+set_read_only(void *baton)
+{
+  set_read_only_baton_t *ro_baton = baton;
+  apr_status_t status;
+  svn_error_t *err;
+
+  err = svn_io_set_file_read_only(ro_baton->file_path, TRUE, ro_baton->pool);
+  if (err)
+    {
+      status = err->apr_err;
+      svn_error_clear(err);
+    }
+
+  return status;
+}
+
+/* If the file at PATH is read-only, attempt to make it writable.  The
+ * original state will be restored with RESULT_POOL gets cleaned up.
+ * SCRATCH_POOL is for temporary allocations. */
+static svn_error_t *
+auto_make_writable(const char *path,
+                   apr_pool_t *result_pool,
+                   apr_pool_t *scratch_pool)
+{
+  svn_boolean_t is_read_only;
+  apr_finfo_t finfo;
+
+  SVN_ERR(svn_io_stat(&finfo, path, SVN__APR_FINFO_READONLY, scratch_pool));
+  SVN_ERR(svn_io__is_finfo_read_only(&is_read_only, &finfo, scratch_pool));
+
+  if (is_read_only)
+    {
+      /* Tell the pool to restore the r/o state upon cleanup
+         (assuming the file will still exist, failing silently otherwise). */
+      set_read_only_baton_t *baton = apr_pcalloc(result_pool,
+                                                  sizeof(*baton));
+      baton->pool = result_pool;
+      baton->file_path = apr_pstrdup(result_pool, path);
+      apr_pool_cleanup_register(result_pool, baton,
+                                set_read_only, apr_pool_cleanup_null);
+
+      /* Finally, allow write access (undoing it has already been scheduled
+         and is idempotent). */
+      SVN_ERR(svn_io_set_file_read_write(path, FALSE, scratch_pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* Core implementation of svn_fs_fs__open_pack_or_rev_file working on an
- * existing, initialized FILE structure.
+ * existing, initialized FILE structure.  If WRITABLE is TRUE, give write
+ * access to the file - temporarily resetting the r/o state if necessary.
  */
 static svn_error_t *
 open_pack_or_rev_file(svn_fs_fs__revision_file_t *file,
                       svn_fs_t *fs,
                       svn_revnum_t rev,
-                      apr_pool_t *pool)
+                      svn_boolean_t writable,
+                      apr_pool_t *result_pool,
+                      apr_pool_t *scratch_pool)
 {
   fs_fs_data_t *ffd = fs->fsap_data;
   svn_error_t *err;
@@ -69,16 +136,26 @@ open_pack_or_rev_file(svn_fs_fs__revisio
 
   do
     {
-      const char *path = svn_fs_fs__path_rev_absolute(fs, rev, pool);
+      const char *path = svn_fs_fs__path_rev_absolute(fs, rev, scratch_pool);
       apr_file_t *apr_file;
+      apr_int32_t flags = writable
+                        ? APR_READ | APR_WRITE | APR_BUFFERED
+                        : APR_READ | APR_BUFFERED;
+
+      /* We may have to *temporarily* enable write access. */
+      err = writable ? auto_make_writable(path, result_pool, scratch_pool)
+                     : SVN_NO_ERROR; 
+
+      /* open the revision file in buffered r/o or r/w mode */
+      if (!err)
+        err = svn_io_file_open(&apr_file, path, flags, APR_OS_DEFAULT,
+                               result_pool);
 
-      /* open the revision file in buffered r/o mode */
-      err = svn_io_file_open(&apr_file, path,
-                             APR_READ | APR_BUFFERED, APR_OS_DEFAULT, pool);
       if (!err)
         {
           file->file = apr_file;
-          file->stream = svn_stream_from_aprfile2(apr_file, TRUE, pool);
+          file->stream = svn_stream_from_aprfile2(apr_file, TRUE,
+                                                  result_pool);
           file->is_packed = svn_fs_fs__is_packed_rev(fs, rev);
 
           return SVN_NO_ERROR;
@@ -98,7 +175,7 @@ open_pack_or_rev_file(svn_fs_fs__revisio
                                          _("No such revision %ld"), rev);
 
               /* We failed for the first time. Refresh cache & retry. */
-              SVN_ERR(svn_fs_fs__update_min_unpacked_rev(fs, pool));
+              SVN_ERR(svn_fs_fs__update_min_unpacked_rev(fs, scratch_pool));
 
               retry = TRUE;
             }
@@ -123,12 +200,28 @@ svn_error_t *
 svn_fs_fs__open_pack_or_rev_file(svn_fs_fs__revision_file_t **file,
                                  svn_fs_t *fs,
                                  svn_revnum_t rev,
-                                 apr_pool_t *pool)
+                                 apr_pool_t *result_pool,
+                                 apr_pool_t *scratch_pool)
+{
+  *file = apr_palloc(result_pool, sizeof(**file));
+  init_revision_file(*file, fs, rev, result_pool);
+
+  return svn_error_trace(open_pack_or_rev_file(*file, fs, rev, FALSE,
+                                               result_pool, scratch_pool));
+}
+
+svn_error_t *
+svn_fs_fs__open_pack_or_rev_file_writable(svn_fs_fs__revision_file_t** file,
+                                          svn_fs_t* fs,
+                                          svn_revnum_t rev,
+                                          apr_pool_t* result_pool,
+                                          apr_pool_t *scratch_pool)
 {
-  *file = apr_palloc(pool, sizeof(**file));
-  init_revision_file(*file, fs, rev, pool);
+  *file = apr_palloc(result_pool, sizeof(**file));
+  init_revision_file(*file, fs, rev, result_pool);
 
-  return svn_error_trace(open_pack_or_rev_file(*file, fs, rev, pool));
+  return svn_error_trace(open_pack_or_rev_file(*file, fs, rev, TRUE,
+                                               result_pool, scratch_pool));
 }
 
 svn_error_t *
@@ -172,18 +265,21 @@ svn_error_t *
 svn_fs_fs__open_proto_rev_file(svn_fs_fs__revision_file_t **file,
                                svn_fs_t *fs,
                                const svn_fs_fs__id_part_t *txn_id,
-                               apr_pool_t *pool)
+                               apr_pool_t* result_pool,
+                               apr_pool_t *scratch_pool)
 {
   apr_file_t *apr_file;
   SVN_ERR(svn_io_file_open(&apr_file,
-                           svn_fs_fs__path_txn_proto_rev(fs, txn_id, pool),
-                           APR_READ | APR_BUFFERED, APR_OS_DEFAULT, pool));
+                           svn_fs_fs__path_txn_proto_rev(fs, txn_id,
+                                                         scratch_pool),
+                           APR_READ | APR_BUFFERED, APR_OS_DEFAULT,
+                           result_pool));
 
-  *file = apr_pcalloc(pool, sizeof(**file));
+  *file = apr_pcalloc(result_pool, sizeof(**file));
   (*file)->file = apr_file;
   (*file)->is_packed = FALSE;
   (*file)->start_revision = SVN_INVALID_REVNUM;
-  (*file)->stream = svn_stream_from_aprfile2(apr_file, TRUE, pool);
+  (*file)->stream = svn_stream_from_aprfile2(apr_file, TRUE, result_pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/rev_file.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/rev_file.h?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/rev_file.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/rev_file.h Mon Jun 30 15:16:01 2014
@@ -89,12 +89,28 @@ typedef struct svn_fs_fs__revision_file_
 /* Open the correct revision file for REV.  If the filesystem FS has
  * been packed, *FILE will be set to the packed file; otherwise, set *FILE
  * to the revision file for REV.  Return SVN_ERR_FS_NO_SUCH_REVISION if the
- * file doesn't exist.  Use POOL for allocations. */
+ * file doesn't exist.  Allocate *FILE in RESULT_POOL and use SCRATCH_POOL
+ * for temporaries. */
 svn_error_t *
 svn_fs_fs__open_pack_or_rev_file(svn_fs_fs__revision_file_t **file,
                                  svn_fs_t *fs,
                                  svn_revnum_t rev,
-                                 apr_pool_t *pool);
+                                 apr_pool_t *result_pool,
+                                 apr_pool_t *scratch_pool);
+
+/* Open the correct revision file for REV with read and write access.
+ * If necessary, temporarily reset the file's read-only state.  If the
+ * filesystem FS has been packed, *FILE will be set to the packed file;
+ * otherwise, set *FILE to the revision file for REV.
+ *
+ * Return SVN_ERR_FS_NO_SUCH_REVISION if the file doesn't exist.
+ * Allocate *FILE in RESULT_POOL and use SCRATCH_POOLfor temporaries. */
+svn_error_t *
+svn_fs_fs__open_pack_or_rev_file_writable(svn_fs_fs__revision_file_t **file,
+                                          svn_fs_t *fs,
+                                          svn_revnum_t rev,
+                                          apr_pool_t *result_pool,
+                                          apr_pool_t *scratch_pool);
 
 /* If the footer data in FILE has not been read, yet, do so now.
  * Index locations will only be read upon request as we assume they get
@@ -105,12 +121,13 @@ svn_error_t *
 svn_fs_fs__auto_read_footer(svn_fs_fs__revision_file_t *file);
 
 /* Open the proto-rev file of transaction TXN_ID in FS and return it in *FILE.
- * Use POOL for allocations. */
+ * Allocate *FILE in RESULT_POOL use and SCRATCH_POOL for temporaries.. */
 svn_error_t *
 svn_fs_fs__open_proto_rev_file(svn_fs_fs__revision_file_t **file,
                                svn_fs_t *fs,
                                const svn_fs_fs__id_part_t *txn_id,
-                               apr_pool_t *pool);
+                               apr_pool_t* result_pool,
+                               apr_pool_t *scratch_pool);
 
 /* Close all files and streams in FILE.
  */

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c Mon Jun 30 15:16:01 2014
@@ -3587,12 +3587,12 @@ svn_fs_fs__add_index_data(svn_fs_t *fs,
 
   /* Append the actual index data to the pack file. */
   l2p_offset = 0;
-  SVN_ERR(svn_io_file_seek(file, APR_CUR, &l2p_offset, pool));
+  SVN_ERR(svn_io_file_seek(file, APR_END, &l2p_offset, pool));
   SVN_ERR(svn_fs_fs__l2p_index_append(fs, file, l2p_proto_index, revision,
                                       pool));
 
   p2l_offset = 0;
-  SVN_ERR(svn_io_file_seek(file, APR_CUR, &p2l_offset, pool));
+  SVN_ERR(svn_io_file_seek(file, APR_END, &p2l_offset, pool));
   SVN_ERR(svn_fs_fs__p2l_index_append(fs, file, p2l_proto_index, revision,
                                       pool));
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/verify.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/verify.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/verify.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/verify.c Mon Jun 30 15:16:01 2014
@@ -178,7 +178,8 @@ compare_l2p_to_p2l_index(svn_fs_t *fs,
 
   /* common file access structure */
   svn_fs_fs__revision_file_t *rev_file;
-  SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, start, pool));
+  SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, start, pool,
+                                           iterpool));
 
   /* determine the range of items to check for each revision */
   SVN_ERR(svn_fs_fs__l2p_get_max_ids(&max_ids, fs, start, count, pool));
@@ -261,7 +262,8 @@ compare_p2l_to_l2p_index(svn_fs_t *fs,
 
   /* common file access structure */
   svn_fs_fs__revision_file_t *rev_file;
-  SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, start, pool));
+  SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, start, pool,
+                                           iterpool));
 
   /* get the size of the rev / pack file as covered by the P2L index */
   SVN_ERR(svn_fs_fs__p2l_get_max_offset(&max_offset, fs, rev_file, start,
@@ -500,7 +502,8 @@ compare_p2l_to_rev(svn_fs_t *fs,
   svn_fs_fs__revision_file_t *rev_file;
 
   /* open the pack / rev file that is covered by the p2l index */
-  SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, start, pool));
+  SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, fs, start, pool,
+                                           iterpool));
 
   /* check file size vs. range covered by index */
   SVN_ERR(svn_fs_fs__auto_read_footer(rev_file));

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c Mon Jun 30 15:16:01 2014
@@ -301,7 +301,7 @@ capabilities_headers_iterator_callback(v
           /* May contain multiple values, separated by commas. */
           int i;
           apr_array_header_t *vals = svn_cstring_split(val, ",", TRUE,
-                                                       opt_ctx->pool);
+                                                       session->pool);
 
           for (i = 0; i < vals->nelts; i++)
             {

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_wc/diff_editor.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_wc/diff_editor.c Mon Jun 30 15:16:01 2014
@@ -717,6 +717,9 @@ walk_local_nodes_diff(struct edit_baton_
           if (!info->have_base)
             {
               local_only = TRUE; /* Only report additions */
+
+              if (info->status == svn_wc__db_status_deleted)
+                continue; /* Nothing added (deleted copy) */
             }
           else if (info->status == svn_wc__db_status_normal)
             {

Modified: subversion/branches/svn-auth-x509/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/mod_dav_svn/version.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/svn-auth-x509/subversion/mod_dav_svn/version.c Mon Jun 30 15:16:01 2014
@@ -972,7 +972,7 @@ dav_svn__checkin(dav_resource *resource,
             {
               const char *post_commit_err = svn_repos__post_commit_error_str
                                               (serr, resource->pool);
-              ap_log_perror(APLOG_MARK, APLOG_ERR, serr->apr_err,
+              ap_log_perror(APLOG_MARK, APLOG_ERR, APR_EGENERAL,
                             resource->pool,
                             "commit of r%ld succeeded, but an error occurred "
                             "after the commit: '%s'",
@@ -1497,6 +1497,11 @@ merge(dav_resource *target,
              ### client some other way than hijacking the post-commit
              ### error message.*/
           post_commit_err = svn_repos__post_commit_error_str(serr, pool);
+          ap_log_perror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, pool,
+                        "commit of r%ld succeeded, but an error occurred "
+                        "after the commit: '%s'",
+                        new_rev,
+                        post_commit_err);
           svn_error_clear(serr);
           serr = SVN_NO_ERROR;
         }

Modified: subversion/branches/svn-auth-x509/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/svn/cl.h?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/svn/cl.h (original)
+++ subversion/branches/svn-auth-x509/subversion/svn/cl.h Mon Jun 30 15:16:01 2014
@@ -223,7 +223,6 @@ typedef struct svn_cl__opt_state_t
                                     (not converted to UTF-8) */
   svn_boolean_t parents;         /* create intermediate directories */
   svn_boolean_t use_merge_history; /* use/display extra merge information */
-  svn_boolean_t auto_moves;      /* interpret unique DEL/ADD pairs as moves */
   svn_cl__accept_t accept_which;   /* how to handle conflicts */
   svn_cl__show_revs_t show_revs;   /* mergeinfo flavor */
   svn_depth_t set_depth;           /* new sticky ambient depth value */

Modified: subversion/branches/svn-auth-x509/subversion/svn/copy-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/svn/copy-cmd.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/svn/copy-cmd.c (original)
+++ subversion/branches/svn-auth-x509/subversion/svn/copy-cmd.c Mon Jun 30 15:16:01 2014
@@ -150,8 +150,7 @@ svn_cl__copy(apr_getopt_t *os,
     }
   else
     {
-      /* URL -> URL, meaning that no notification is needed. */
-      ctx->notify_func2 = NULL;
+      /* URL -> URL */
     }
 
   if (! dst_is_url)

Modified: subversion/branches/svn-auth-x509/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/svn/notify.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/svn/notify.c (original)
+++ subversion/branches/svn-auth-x509/subversion/svn/notify.c Mon Jun 30 15:16:01 2014
@@ -1060,8 +1060,8 @@ notify_body(struct notify_baton *nb,
       if (nb->sent_first_txdelta)
         {
           SVN_ERR(svn_cmdline_printf(pool, _("done\n")));
-          SVN_ERR(svn_cmdline_printf(pool, _("Committing transaction...")));
         }
+      SVN_ERR(svn_cmdline_printf(pool, _("Committing transaction...\n")));
       break;
 
     default:

Modified: subversion/branches/svn-auth-x509/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/svn/svn.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/svn/svn.c (original)
+++ subversion/branches/svn-auth-x509/subversion/svn/svn.c Mon Jun 30 15:16:01 2014
@@ -120,7 +120,6 @@ typedef enum svn_cl__longopt_t {
   opt_with_revprop,
   opt_with_all_revprops,
   opt_with_no_revprops,
-  opt_auto_moves,
   opt_parents,
   opt_accept,
   opt_show_revs,
@@ -298,10 +297,6 @@ const apr_getopt_option_t svn_cl__option
                     N_("set revision property ARG in new revision\n"
                        "                             "
                        "using the name[=value] format")},
-  {"auto-moves",    opt_auto_moves, 0,
-                    N_("attempt to interpret matching unique DEL+ADD\n"
-                       "                             "
-                       "pairs as moves")},
   {"parents",       opt_parents, 0, N_("make intermediate directories")},
   {"use-merge-history", 'g', 0,
                     N_("use/display additional information from merge\n"
@@ -804,12 +799,14 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "    Show the log message for the revision in which /branches/foo\n"
      "    was created:\n"
      "      svn log --stop-on-copy --limit 1 -r0:HEAD ^/branches/foo\n"),
-    {'r', 'q', 'v', 'g', 'c', opt_targets, opt_stop_on_copy, opt_incremental,
+    {'r', 'c', 'q', 'v', 'g', opt_targets, opt_stop_on_copy, opt_incremental,
      opt_xml, 'l', opt_with_all_revprops, opt_with_no_revprops,
-     opt_with_revprop, opt_auto_moves, opt_depth, opt_diff, opt_diff_cmd,
+     opt_with_revprop, opt_depth, opt_diff, opt_diff_cmd,
      opt_internal_diff, 'x', opt_search, opt_search_and },
     {{opt_with_revprop, N_("retrieve revision property ARG")},
-     {'c', N_("the change made in revision ARG")}} },
+     {'c', N_("the change made in revision ARG")},
+     {'v', N_("also print all affected paths")},
+     {'q', N_("do not print the log message")}} },
 
   { "merge", svn_cl__merge, {0}, N_
     ( /* For this large section, let's keep it unindented for easier
@@ -1402,6 +1399,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "        ^/   to the repository root\n"
      "        /    to the server root\n"
      "        //   to the URL scheme\n"
+     "      ^/../  to a sibling repository beneath the same SVNParentPath location\n"
      "      Use of the following format is discouraged but is supported for\n"
      "      interoperability with Subversion 1.4 and earlier clients:\n"
      "        LOCALPATH [-r PEG] URL\n"
@@ -2253,9 +2251,6 @@ sub_main(int *exit_code, int argc, const
       case 'g':
         opt_state.use_merge_history = TRUE;
         break;
-      case opt_auto_moves:
-        opt_state.auto_moves = TRUE;
-        break;
       case opt_accept:
         SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
         opt_state.accept_which = svn_cl__accept_from_word(utf8_opt_arg);

Modified: subversion/branches/svn-auth-x509/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/svn/util.c?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/svn/util.c (original)
+++ subversion/branches/svn-auth-x509/subversion/svn/util.c Mon Jun 30 15:16:01 2014
@@ -76,7 +76,7 @@ svn_cl__print_commit_info(const svn_comm
                           apr_pool_t *pool)
 {
   if (SVN_IS_VALID_REVNUM(commit_info->revision))
-    SVN_ERR(svn_cmdline_printf(pool, _("\nCommitted revision %ld%s.\n"),
+    SVN_ERR(svn_cmdline_printf(pool, _("Committed revision %ld%s.\n"),
                                commit_info->revision,
                                commit_info->revision == 42 &&
                                getenv("SVN_I_LOVE_PANGALACTIC_GARGLE_BLASTERS")

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/basic_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/basic_tests.py Mon Jun 30 15:16:01 2014
@@ -241,7 +241,8 @@ def basic_mkdir_url(sbox):
   Y_Z_url = sbox.repo_url + '/Y/Z'
 
   svntest.actions.run_and_verify_svn("mkdir URL URL/subdir",
-                                     ["\n", "Committed revision 2.\n"], [],
+                                     ["Committing transaction...\n",
+                                      "Committed revision 2.\n"], [],
                                      'mkdir', '-m', 'log_msg', Y_url, Y_Z_url)
 
   expected_output = wc.State(sbox.wc_dir, {
@@ -279,18 +280,20 @@ def basic_mkdir_url_with_parents(sbox):
   U_V_url = sbox.repo_url + '/U/V'
   U_V_W_url = sbox.repo_url + '/U/V/W'
   svntest.actions.run_and_verify_svn("erroneous mkdir sans --parents",
-                                     [],
+                                     None,
                                      ".*Try 'svn mkdir --parents' instead.*",
                                      'mkdir', '-m', 'log_msg',
                                      X_Y_Z_url, X_Y_Z2_url, X_T_C_url, U_V_W_url)
 
   svntest.actions.run_and_verify_svn("mkdir",
-                                     ["\n", "Committed revision 2.\n"], [],
+                                     ["Committing transaction...\n",
+                                      "Committed revision 2.\n"], [],
                                      'mkdir', '-m', 'log_msg',
                                      X_url, U_url)
 
   svntest.actions.run_and_verify_svn("mkdir --parents",
-                                     ["\n", "Committed revision 3.\n"], [],
+                                     ["Committing transaction...\n",
+                                      "Committed revision 3.\n"], [],
                                      'mkdir', '-m', 'log_msg', '--parents',
                                      X_Y_Z_url, X_Y_Z2_url, X_T_C_url, U_V_W_url)
 
@@ -1263,7 +1266,8 @@ def basic_delete(sbox):
   iota_URL = sbox.repo_url + '/iota'
 
   svntest.actions.run_and_verify_svn(None,
-                                     ["\n", "Committed revision 2.\n"], [],
+                                     ["Committing transaction...\n",
+                                      "Committed revision 2.\n"], [],
                                      'rm', '-m', 'delete iota URL',
                                      iota_URL)
 

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/blame_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/blame_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/blame_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/blame_tests.py Mon Jun 30 15:16:01 2014
@@ -631,7 +631,8 @@ def blame_output_after_merge(sbox):
   A_url = sbox.repo_url + '/A'
 
   # r2: mv greek tree in trunk.
-  svntest.actions.run_and_verify_svn(None, ["\n","Committed revision 2.\n"], [],
+  svntest.actions.run_and_verify_svn(None, ["Committing transaction...\n",
+                                            "Committed revision 2.\n"], [],
                                      'mv', "--parents", A_url, trunk_A_url,
                                      "-m", "move greek tree to trunk")
 
@@ -655,7 +656,8 @@ def blame_output_after_merge(sbox):
 
   # r4: create branches/br from trunk
   branches_br_url = sbox.repo_url + "/branches/br"
-  svntest.actions.run_and_verify_svn(None, ["\n","Committed revision 4.\n"], [],
+  svntest.actions.run_and_verify_svn(None, ["Committing transaction...\n",
+                                            "Committed revision 4.\n"], [],
                                     'cp', '--parents',
                                      trunk_url, branches_br_url,
                                      "-m", "create branch")

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/copy_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/copy_tests.py Mon Jun 30 15:16:01 2014
@@ -1095,7 +1095,8 @@ def url_copy_parent_into_child(sbox):
 
   # Issue 1367 parent/child URL-to-URL was rejected.
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 2.\n'], [],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 2.\n'], [],
                                      'cp',
                                      '-m', 'a can of worms',
                                      B_url, F_url)
@@ -1157,7 +1158,8 @@ def wc_copy_parent_into_child(sbox):
 
   svntest.actions.run_and_verify_svn(None,
                                      ['Adding copy of        .\n',
-                                     '\n', 'Committed revision 2.\n'], [],
+                                      'Committing transaction...\n',
+                                      'Committed revision 2.\n'], [],
                                      'cp',
                                      '-m', 'a larger can',
                                      '.', F_B_url)

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/diff_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/diff_tests.py Mon Jun 30 15:16:01 2014
@@ -4728,6 +4728,61 @@ def diff_parent_dir(sbox):
   finally:
     os.chdir(was_cwd)
 
+def diff_deleted_in_move_against_repos(sbox):
+  "diff deleted in move against repository"
+
+  sbox.build()
+  sbox.simple_move('A/B', 'BB')
+  sbox.simple_move('BB/E/alpha', 'BB/q')
+  sbox.simple_rm('BB/E/beta')
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'mkdir', sbox.repo_url + '/BB/E',
+                                     '--parents', '-m', 'Create dir')
+
+  # OK. Local diff
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'diff', sbox.wc_dir)
+
+  # OK. Walks nodes locally from wc-root, notices ancestry
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'diff', sbox.wc_dir, '-r1',
+                                     '--notice-ancestry')
+
+  # OK. Walks nodes locally from BB, notices ancestry
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'diff', sbox.wc_dir, '-r2',
+                                     '--notice-ancestry')
+
+  # OK. Walks nodes locally from wc-root
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'diff', sbox.wc_dir, '-r1')
+
+  # Assertion. Walks nodes locally from BB.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'diff', sbox.wc_dir, '-r2')
+
+def diff_replaced_moved(sbox):
+  "diff against a replaced moved node"
+
+  sbox.build(read_only=True)
+  sbox.simple_move('A', 'AA')
+  sbox.simple_rm('AA/B')
+  sbox.simple_move('AA/D', 'AA/B')
+
+  # Ok
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'diff', sbox.ospath('.'), '-r1')
+
+  # Ok (rhuijben: Works through a hack assuming some BASE knowledge)
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'diff', sbox.ospath('AA'), '-r1')
+
+  # Error (misses BASE node because the diff editor is driven incorrectly)
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'diff', sbox.ospath('AA/B'), '-r1')
+
+
 
 ########################################################################
 #Run the tests
@@ -4816,6 +4871,8 @@ test_list = [ None,
               diff_repo_repo_added_file_mime_type,
               diff_switched_file,
               diff_parent_dir,
+              diff_deleted_in_move_against_repos,
+              diff_replaced_moved,
               ]
 
 if __name__ == '__main__':

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Mon Jun 30 15:16:01 2014
@@ -82,11 +82,11 @@ Valid options:
                                 'BASE'       base rev of item's working copy
                                 'COMMITTED'  last commit at or before BASE
                                 'PREV'       revision just before COMMITTED
-  -q [--quiet]             : print nothing, or only summary information
-  -v [--verbose]           : print extra information
+  -c [--change] ARG        : the change made in revision ARG
+  -q [--quiet]             : do not print the log message
+  -v [--verbose]           : also print all affected paths
   -g [--use-merge-history] : use/display additional information from merge
                              history
-  -c [--change] ARG        : the change made in revision ARG
   --targets ARG            : pass contents of file ARG as additional args
   --stop-on-copy           : do not cross copies while traversing history
   --incremental            : give output suitable for concatenation
@@ -95,8 +95,6 @@ Valid options:
   --with-all-revprops      : retrieve all revision properties
   --with-no-revprops       : retrieve no revision properties
   --with-revprop ARG       : retrieve revision property ARG
-  --auto-moves             : attempt to interpret matching unique DEL+ADD
-                             pairs as moves
   --depth ARG              : limit operation by depth ARG ('empty', 'files',
                              'immediates', or 'infinity')
   --diff                   : produce diff output

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_reintegrate_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_reintegrate_tests.py Mon Jun 30 15:16:01 2014
@@ -278,7 +278,8 @@ def basic_reintegrate(sbox):
   # mergeinfo and the A-->A_MOVED path difference.
   svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 9.\n'],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 9.\n'],
                                      [], 'move',
                                      sbox.repo_url + '/A',
                                      sbox.repo_url + '/A_MOVED',

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_tests.py Mon Jun 30 15:16:01 2014
@@ -686,7 +686,8 @@ def simple_property_merges(sbox):
   A_url = sbox.repo_url + '/A'
   A2_url = sbox.repo_url + '/A2'
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 5.\n'], [],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 5.\n'], [],
                                      'copy', '-m', 'copy A to A2',
                                      A_url, A2_url)
 
@@ -4227,7 +4228,7 @@ def obey_reporter_api_semantics_while_do
 
   copy_of_A_D_wc_rev = cur_rev
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n',
+                                     ['Committing transaction...\n',
                                       'Committed revision ' + str(cur_rev+1) +
                                       '.\n'],
                                      [],
@@ -6460,10 +6461,12 @@ def update_loses_mergeinfo(sbox):
   A_B_url = sbox.repo_url + '/A/B'
   A_B_J_url = sbox.repo_url + '/A/B/J'
   A_B_K_url = sbox.repo_url + '/A/B/K'
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 2.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 2.\n'],
                                      [],
                                      'mkdir', '-m', 'rev 2', A_B_J_url)
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 3.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 3.\n'],
                                      [],
                                      'mkdir', '-m', 'rev 3', A_B_K_url)
 
@@ -6580,10 +6583,12 @@ def merge_loses_mergeinfo(sbox):
   A_B_url = sbox.repo_url + '/A/B'
   A_B_J_url = sbox.repo_url + '/A/B/J'
   A_B_K_url = sbox.repo_url + '/A/B/K'
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 2.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 2.\n'],
                                      [],
                                      'mkdir', '-m', 'rev 2', A_B_J_url)
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 3.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 3.\n'],
                                      [],
                                      'mkdir', '-m', 'rev 3', A_B_K_url)
 
@@ -7724,7 +7729,8 @@ def merge_old_and_new_revs_from_renamed_
                                         wc_status, None, wc_dir)
 
   # Move A to A_MOVED
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 4.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 4.\n'],
                                      [], 'mv', '-m', 'mv A to A_MOVED',
                                      A_url, A_MOVED_url)
 
@@ -8132,7 +8138,8 @@ def merge_old_and_new_revs_from_renamed_
   mu_MOVED_path = sbox.ospath('A/mu_MOVED')
 
   # Copy mu to mu_COPY
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 2.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 2.\n'],
                                      [], 'cp', '-m', 'cp mu to mu_COPY',
                                      mu_url, mu_COPY_url)
 
@@ -8145,7 +8152,8 @@ def merge_old_and_new_revs_from_renamed_
                                         expected_status, None, wc_dir)
 
   # Move mu to mu_MOVED
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 4.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 4.\n'],
                                      [], 'mv', '-m', 'mv mu to mu_MOVED',
                                      mu_url, mu_MOVED_url)
 
@@ -8223,7 +8231,8 @@ def merge_with_auto_rev_range_detection(
                                         expected_status, None, wc_dir)
 
   # Copy A to A_COPY
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 3.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 3.\n'],
                                      [], 'cp', '-m', 'cp A to A_COPY',
                                      A_url, A_COPY_url)
 
@@ -9143,7 +9152,8 @@ def merge_source_normalization_and_subtr
   wc_disk, wc_status = set_up_branch(sbox)
 
   # r7 - Move A to A_MOVED
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 7.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 7.\n'],
                                      [], 'mv', '-m', 'mv A to A_MOVED',
                                      sbox.repo_url + '/A',
                                      sbox.repo_url + '/A_MOVED')
@@ -9889,7 +9899,8 @@ def dont_add_mergeinfo_from_own_history(
   # out, leaving the only the mergeinfo created from the merge itself:
   # '/A_COPY:7'.
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 8.\n'],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 8.\n'],
                                      [], 'move',
                                      sbox.repo_url + '/A',
                                      sbox.repo_url + '/A_MOVED',
@@ -10543,9 +10554,11 @@ def merge_added_subtree(sbox):
   A_COPY_url = url + "/A_COPY"
   A_path = sbox.ospath('A')
 
-  svntest.actions.run_and_verify_svn("",["\n", "Committed revision 2.\n"], [],
+  svntest.actions.run_and_verify_svn("",["Committing transaction...\n",
+                                         "Committed revision 2.\n"], [],
                                      "cp", "-m", "", A_url, A_COPY_url)
-  svntest.actions.run_and_verify_svn("",["\n", "Committed revision 3.\n"], [],
+  svntest.actions.run_and_verify_svn("",["Committing transaction...\n",
+                                         "Committed revision 3.\n"], [],
                                      "cp", "-m", "",
                                      A_COPY_url + '/D',
                                      A_COPY_url + '/D2')
@@ -10804,7 +10817,8 @@ def dont_merge_revs_into_subtree_that_pr
 
   # Copy 'A/D/H' to 'H_COPY' in r6.
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 6.\n'],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 6.\n'],
                                      [], 'copy',
                                      sbox.repo_url + "/A/D/H",
                                      sbox.repo_url + "/H_COPY",
@@ -10956,7 +10970,8 @@ def set_up_renamed_subtree(sbox):
 
   # Copy 'A/D/H' to 'H_COPY' in r5.
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 5.\n'],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 5.\n'],
                                      [], 'copy',
                                      sbox.repo_url + "/A/D/H",
                                      sbox.repo_url + "/H_COPY",
@@ -13557,7 +13572,8 @@ def no_self_referential_filtering_on_add
 
   # r10: Move A/C to A/C_MOVED.
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 10.\n'],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 10.\n'],
                                      [], 'move',
                                      sbox.repo_url + '/A/C',
                                      sbox.repo_url + '/A/C_MOVED',
@@ -13770,7 +13786,7 @@ def merge_range_prior_to_rename_source_e
                                         wc_status, None, wc_dir)
 
   # r12 - Move A/D/H/nu to A/D/H/nu_moved
-  svntest.actions.run_and_verify_svn(None, ["\n",
+  svntest.actions.run_and_verify_svn(None, ["Committing transaction...\n",
                                             "Committed revision 12.\n"], [],
                                      'move', sbox.repo_url + '/A/D/H/nu',
                                      sbox.repo_url + '/A/D/H/nu_moved',
@@ -14020,18 +14036,21 @@ def set_up_natural_history_gap(sbox):
 
   # r6: Delete 'A'
   exit_code, out, err = svntest.actions.run_and_verify_svn(
-    None, "(Committed revision 6.)|(\n)", [],
+    None, ["Committing transaction...\n",
+           "Committed revision 6.\n"], [],
     'delete', sbox.repo_url + '/A', '-m', 'Delete A')
 
   # r7: Resurrect 'A' by copying 'A@2' to 'A'.
   exit_code, out, err = svntest.actions.run_and_verify_svn(
-    None, "(Committed revision 7.)|(\n)", [],
+    None, ["Committing transaction...\n",
+           "Committed revision 7.\n"], [],
     'copy', sbox.repo_url + '/A@2', sbox.repo_url + '/A',
     '-m', 'Resurrect A from A@2')
 
   # r8: Branch the resurrected 'A' to 'A_COPY'.
   exit_code, out, err = svntest.actions.run_and_verify_svn(
-    None, "(Committed revision 8.)|(\n)", [],
+    None, ["Committing transaction...\n",
+           "Committed revision 8.\n"], [],
     'copy', sbox.repo_url + '/A', sbox.repo_url + '/A_COPY',
     '-m', 'Copy A to A_COPY')
 
@@ -15093,7 +15112,8 @@ def committed_case_only_move_and_revert(
 
   # r3: A case-only file rename on the server
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 3.\n'],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 3.\n'],
                                      [], 'move',
                                      sbox.repo_url + '/A/mu',
                                      sbox.repo_url + '/A/MU',
@@ -15197,7 +15217,8 @@ def committed_case_only_move_and_revert(
 
   # r5: A case-only directory rename on the server
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 5.\n'],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 5.\n'],
                                      [], 'move',
                                      sbox.repo_url + '/A/C',
                                      sbox.repo_url + '/A/c',
@@ -17158,7 +17179,8 @@ def reverse_merge_with_rename(sbox):
 
   # r7 - Rename ^/A to ^/trunk.
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 7.\n'],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 7.\n'],
                                      [], 'move',
                                      sbox.repo_url + '/A',
                                      sbox.repo_url + '/trunk',

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_tree_conflict_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_tree_conflict_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/merge_tree_conflict_tests.py Mon Jun 30 15:16:01 2014
@@ -1456,10 +1456,10 @@ def merge_replace_setup(sbox):
 
   # make a branch of A
   # svn cp $URL/A $URL/branch
-  expected_stdout = verify.UnorderedOutput([
-    '\n',
+  expected_stdout = [
+    'Committing transaction...\n',
     'Committed revision 2.\n',
-  ])
+  ]
 
   actions.run_and_verify_svn2('OUTPUT', expected_stdout, [], 0, 'cp', url_A,
     url_branch, '-m', 'copy log')

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/stat_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/stat_tests.py Mon Jun 30 15:16:01 2014
@@ -951,7 +951,9 @@ def status_ignored_dir(sbox):
   new_dir = sbox.ospath('dir.o')
   new_dir_url = sbox.repo_url + "/dir.o"
 
-  svntest.actions.run_and_verify_svn("Create dir", "\n|Committed revision 2.", [],
+  svntest.actions.run_and_verify_svn("Create dir",
+                                     ["Committing transaction...\n",
+                                      "Committed revision 2.\n"], [],
                                      'mkdir', new_dir_url, '-m', 'msg')
 
   # Make a dir that is ignored by the default ignore patterns.

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnadmin_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnadmin_tests.py Mon Jun 30 15:16:01 2014
@@ -262,40 +262,76 @@ def load_dumpstream(sbox, dump, *varargs
   return load_and_verify_dumpstream(sbox, None, None, None, False, dump,
                                     *varargs)
 
-def read_l2p(contents, item):
-  """ For the format 7+ revision file CONTENTS, return the physical offset
-      of ITEM.  This code supports only small, nonpacked revs. """
-
-  # decode numbers
-  numbers = []
-  value = 0
-  shift = 0
-  for c in contents:
-    char = ord(c)
-    value += (char & 127) << shift
-    if char < 128:
-      numbers.append(value)
-      shift = 0
-      value = 0
-    else:
-      shift += 7
-
-  # decode offsets
-  numbers[7] = -1
-  for i in range(8, len(numbers)):
-    if numbers[i] & 1 == 1:
-      numbers[i] = - (numbers[i] + 1) / 2
-    else:
-      numbers[i] = numbers[i] / 2
-    numbers[i] += numbers[i-1]
+class FSFS_Index:
+  """Manages indexes of a rev file in a FSFS format 7 repository.
+  The interface returns P2L information and allows for item offsets
+  and lengths to be modified. """
+
+  by_item = { }
+  revision = -1
+  repo_dir = None
+
+  def __init__(self, sbox, revision):
+    self.revision = revision
+    self.repo_dir = sbox.repo_dir
+
+    self._read()
+
+  def _read(self):
+    """ Read P2L index using svnfsfs. """
+    exit_code, output, errput = svntest.main.run_svnfsfs('dump-index',
+                                                  '-r' + str(self.revision),
+                                                  self.repo_dir)
+    svntest.verify.verify_outputs("Error while dumping index",
+                                  [], errput, [], [])
+    svntest.verify.verify_exit_code(None, exit_code, 0)
+
+    self.by_item.clear()
+    for line in output:
+      values = line.split()
+      if len(values) >= 4 and values[0] != 'Start':
+        item = long(values[4])
+        self.by_item[item] = values
+
+  def _write(self):
+    """ Rewrite indexes using svnfsfs. """
+    by_offset = {}
+    for values in self.by_item.itervalues():
+      by_offset[long(values[0], 16)] = values
+
+    lines = []
+    for (offset, values) in sorted(by_offset.items()):
+      values = by_offset[offset]
+      line = values[0] + ' ' + values[1] + ' ' + values[2] + ' ' + \
+             values[3] + ' ' + values[4] + '\n';
+      lines.append(line)
+
+    exit_code, output, errput = svntest.main.run_command_stdin(
+      svntest.main.svnfsfs_binary, 0, 0, True, lines,
+      'load-index', self.repo_dir)
+
+    svntest.verify.verify_outputs("Error while rewriting index",
+                                  output, errput, [], [])
+    svntest.verify.verify_exit_code(None, exit_code, 0)
+
+  def get_item(self, item):
+    """ Return offset, length and type of ITEM. """
+    values = self.by_item[item]
+
+    offset = long(values[0], 16)
+    len = long(values[1], 16)
+    type = values[2]
+
+    return (offset, len, type)
+
+  def modify_item(self, item, offset, len):
+    """ Modify offset and length of ITEM. """
+    values = self.by_item[item]
 
-  # we support only small, unpacked rev files
-  if numbers[1] < len(numbers) or numbers[3] != 1 :
-    raise svntest.Failure("More than 1 page in %s" % filename)
-  if numbers[2] != 1:
-    raise svntest.Failure("More than 1 rev in %s" % filename)
+    values[0] = '%x' % offset
+    values[1] = '%s' % len
 
-  return numbers[item + 7]
+    self._write()
 
 def repo_format(sbox):
   """ Return the repository format number for SBOX."""
@@ -310,6 +346,8 @@ def set_changed_path_list(sbox, revision
   """ Replace the changed paths list in the revision file REVISION in SBOX
       with the text CHANGES."""
 
+  idx = None
+
   # read full file
   fp = open(fsfs_file(sbox.repo_dir, 'revs', str(revision)), 'r+b')
   contents = fp.read()
@@ -331,8 +369,11 @@ def set_changed_path_list(sbox, revision
     l2p_offset = long(footer.split(' ')[0])
     p2l_offset = long(footer.split(' ')[1])
 
+    idx = FSFS_Index(sbox, revision)
+    (offset, item_len, item_type) = idx.get_item(1)
+
     # split file contents
-    body_len = read_l2p(contents[l2p_offset:], 1)
+    body_len = offset
     indexes = contents[l2p_offset:length - footer_length - 1]
 
     # construct new footer, include indexes as are
@@ -351,6 +392,9 @@ def set_changed_path_list(sbox, revision
   fp.truncate()
   fp.close()
 
+  if repo_format(sbox) >= 7:
+    idx.modify_item(1, offset, len(changes) + 1)
+
 ######################################################################
 # Tests
 
@@ -982,7 +1026,8 @@ def load_with_parent_dir(sbox):
 
   # Create 'sample' dir in sbox.repo_url, and load the dump stream there.
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 1.\n'],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 1.\n'],
                                      [], "mkdir", sbox.repo_url + "/sample",
                                      "-m", "Create sample dir")
   load_dumpstream(sbox, dumpfile, '--parent-dir', '/sample')
@@ -1004,7 +1049,8 @@ def load_with_parent_dir(sbox):
   # This time, don't include a leading slash on the --parent-dir argument.
   # See issue #3547.
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 11.\n'],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 11.\n'],
                                      [], "mkdir", sbox.repo_url + "/sample-2",
                                      "-m", "Create sample-2 dir")
   load_dumpstream(sbox, dumpfile, '--parent-dir', 'sample-2')
@@ -1077,7 +1123,8 @@ def reflect_dropped_renumbered_revs(sbox
   dumpfile = open(dumpfile_location).read()
 
   # Create 'toplevel' dir in sbox.repo_url
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 1.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 1.\n'],
                                      [], "mkdir", sbox.repo_url + "/toplevel",
                                      "-m", "Create toplevel dir")
 
@@ -2183,6 +2230,8 @@ def verify_invalid_path_changes(sbox):
                                            ".*r18: E160013:.*"])
   if (svntest.main.fs_has_rep_sharing()):
     exp_out.insert(0, ".*Verifying.*metadata.*")
+    if svntest.main.is_fs_log_addressing():
+      exp_out.insert(1, ".*Verifying.*metadata.*")
 
   exp_err = svntest.verify.RegexListOutput(["svnadmin: E160020:.*",
                                             "svnadmin: E145001:.*",
@@ -2196,19 +2245,16 @@ def verify_invalid_path_changes(sbox):
   exit_code, output, errput = svntest.main.run_svnadmin("verify",
                                                         sbox.repo_dir)
 
-  if svntest.main.is_fs_log_addressing():
-    exp_out = svntest.verify.RegexListOutput([])
-    exp_err = svntest.verify.RegexListOutput(["svnadmin: E160058:.*",
-                                              "svnadmin: E165011:.*"], False)
-  else:
-    exp_out = svntest.verify.RegexListOutput([".*Verified revision 0.",
-                                              ".*Verified revision 1.",
-                                              ".*Error verifying revision 2."])
-    exp_err = svntest.verify.RegexListOutput(["svnadmin: E160020:.*",
-                                              "svnadmin: E165011:.*"], False)
+  exp_out = svntest.verify.RegexListOutput([".*Verified revision 0.",
+                                            ".*Verified revision 1.",
+                                            ".*Error verifying revision 2."])
+  exp_err = svntest.verify.RegexListOutput(["svnadmin: E160020:.*",
+                                            "svnadmin: E165011:.*"], False)
 
   if (svntest.main.fs_has_rep_sharing()):
     exp_out.insert(0, ".*Verifying.*metadata.*")
+    if svntest.main.is_fs_log_addressing():
+      exp_out.insert(1, ".*Verifying.*metadata.*")
   if svntest.verify.verify_outputs("Unexpected error while running 'svnadmin verify'.",
                                    output, errput, exp_out, exp_err):
     raise svntest.Failure

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnrdump_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnrdump_tests.py Mon Jun 30 15:16:01 2014
@@ -431,7 +431,8 @@ def reflect_dropped_renumbered_revs(sbox
 
   # Create the 'toplevel' directory in repository and then load the same
   # dumpfile into that subtree.
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 10.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 10.\n'],
                                     [], "mkdir", sbox.repo_url + "/toplevel",
                                      "-m", "Create toplevel dir to load into")
   svntest.actions.run_and_verify_svnrdump(svnrdump_dumpfile,
@@ -727,7 +728,8 @@ def svnrdump_load_partial_incremental_du
 
   # Create the 'A' directory in repository and then load the partial
   # incremental dump into the root of the repository.
-  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 1.\n'],
+  svntest.actions.run_and_verify_svn(None, ['Committing transaction...\n',
+                                            'Committed revision 1.\n'],
                                     [], "mkdir", sbox.repo_url + "/A",
                                      "-m", "Create toplevel dir to load into")
 

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/svntest/main.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/svntest/main.py Mon Jun 30 15:16:01 2014
@@ -171,6 +171,14 @@ svnauthz_validate_binary = os.path.abspa
     '../../../tools/server-side/svnauthz-validate' + _exe
 )
 
+######################################################################
+# The location of svnfsfs binary, relative to the only scripts that
+# import this file right now (they live in ../).
+# Use --tools to overide these defaults.
+svnfsfs_binary = os.path.abspath(
+    '../../../tools/server-side/svnfsfs/svnfsfs' + _exe
+)
+
 # Location to the pristine repository, will be calculated from test_area_url
 # when we know what the user specified for --url.
 pristine_greek_repos_url = None
@@ -759,6 +767,11 @@ def run_svnauthz_validate(*varargs):
   stderr as list of lines (including line terminators)."""
   return run_command(svnauthz_validate_binary, 1, False, *varargs)
 
+def run_svnfsfs(*varargs):
+  """Run svnfsfs with VARARGS, returns exit code as int; stdout, stderr
+  as list of lines (including line terminators)."""
+  return run_command(svnfsfs_binary, 1, False, *varargs)
+
 def run_lock_helper(repo, path, user, seconds):
   """Run lock-helper to lock path in repo by username for seconds"""
 

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/switch_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/switch_tests.py Mon Jun 30 15:16:01 2014
@@ -352,11 +352,13 @@ def delete_subdir(sbox):
   A2_B_F_url = sbox.repo_url + '/A2/B/F'
 
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 2.\n'], [],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 2.\n'], [],
                                      'cp', '-m', 'make copy', A_url, A2_url)
 
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 3.\n'], [],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 3.\n'], [],
                                      'rm', '-m', 'delete subdir', A2_B_F_url)
 
   expected_output = svntest.wc.State(wc_dir, {
@@ -482,7 +484,8 @@ def failed_anchor_is_target(sbox):
   G_url = sbox.repo_url + '/A/D/G'
   G_psi_url = G_url + '/psi'
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 2.\n'], [],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 2.\n'], [],
                                      'mkdir', '-m', 'log msg', G_psi_url)
 
   # Modify the file 'H/psi' locally.
@@ -543,7 +546,8 @@ def bad_intermediate_urls(sbox):
   # First, make an extra subdirectory in C to match one in the root, plus
   # another one inside of that.
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 2.\n'], [],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 2.\n'], [],
                                      'mkdir', '-m', 'log msg',
                                      url_A_C_A, url_A_C_A_Z)
 
@@ -642,10 +646,10 @@ def obstructed_switch(sbox):
   url_A_B_Esave = url + '/A/B/Esave'
 
   # svn cp -m msgcopy url/A/B/E url/A/B/Esave
-  expected_stdout = verify.UnorderedOutput([
-    '\n',
+  expected_stdout = [
+    'Committing transaction...\n',
     'Committed revision 2.\n',
-  ])
+  ]
 
   actions.run_and_verify_svn2('OUTPUT', expected_stdout, [], 0, 'cp', '-m',
     'msgcopy', url_A_B_E, url_A_B_Esave)
@@ -783,7 +787,8 @@ def refresh_read_only_attribute(sbox):
   url = sbox.repo_url + '/A'
   branch_url = sbox.repo_url + '/A-branch'
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 2.\n'], [],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 2.\n'], [],
                                      'cp', '-m', 'svn:needs-lock not set',
                                      url, branch_url)
 
@@ -1106,7 +1111,7 @@ def forced_switch_failures(sbox):
   # Make dir A/D/H/I in repos.
   # svn mkdir -m "Log message" url/A/D/H/I
   expected_stdout = verify.UnorderedOutput([
-    '\n',
+    'Committing transaction...\n',
     'Committed revision 2.\n',
   ])
 
@@ -2039,7 +2044,8 @@ def tolerate_local_mods(sbox):
   A2_url = sbox.repo_url + '/A2'
 
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 2.\n'], [],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 2.\n'], [],
                                      'cp', '-m', 'make copy', A_url, A2_url)
 
   os.mkdir(L_path)

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/update_tests.py?rev=1606774&r1=1606773&r2=1606774&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/update_tests.py Mon Jun 30 15:16:01 2014
@@ -1238,7 +1238,8 @@ def another_hudson_problem(sbox):
 
   # Delete directory G from the repository
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 3.\n'], [],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 3.\n'], [],
                                      'rm', '-m', 'log msg',
                                      sbox.repo_url + '/A/D/G')
 
@@ -1340,7 +1341,8 @@ def new_dir_with_spaces(sbox):
 
   # Create a new directory ("spacey dir") directly in repository
   svntest.actions.run_and_verify_svn(None,
-                                     ['\n', 'Committed revision 2.\n'], [],
+                                     ['Committing transaction...\n',
+                                      'Committed revision 2.\n'], [],
                                      'mkdir', '-m', 'log msg',
                                      sbox.repo_url
                                      + '/A/spacey%20dir')
@@ -1983,7 +1985,7 @@ def update_copy_of_old_rev(sbox):
 
   # Commit, and check that it says it's committing the right thing
   exp_out = ['Adding         ' + dir2 + '\n',
-             '\n',
+             'Committing transaction...\n',
              'Committed revision 3.\n']
   svntest.actions.run_and_verify_svn(None, exp_out, [],
                                      'ci', '-m', '', wc_dir)



Mime
View raw message