subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@apache.org
Subject svn commit: r1325461 [2/3] - in /subversion/branches/master-passphrase: ./ contrib/client-side/emacs/ contrib/client-side/vim/ notes/ subversion/bindings/swig/ruby/test/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversi...
Date Thu, 12 Apr 2012 19:37:47 GMT
Modified: subversion/branches/master-passphrase/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_fs_fs/fs_fs.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_fs_fs/fs_fs.c Thu Apr 12 19:37:45 2012
@@ -71,7 +71,7 @@
 
 /* The default maximum number of files per directory to store in the
    rev and revprops directory.  The number below is somewhat arbitrary,
-   and can be overriden by defining the macro while compiling; the
+   and can be overridden by defining the macro while compiling; the
    figure of 1000 is reasonable for VFAT filesystems, which are by far
    the worst performers in this area. */
 #ifndef SVN_FS_FS_DEFAULT_MAX_FILES_PER_DIR
@@ -80,7 +80,7 @@
 
 /* Begin deltification after a node history exceeded this this limit.
    Useful values are 4 to 64 with 16 being a good compromise between
-   computational overhead and pository size savings.
+   computational overhead and repository size savings.
    Should be a power of 2.
    Values < 2 will result in standard skip-delta behavior. */
 #define SVN_FS_FS_MAX_LINEAR_DELTIFICATION 16
@@ -432,7 +432,7 @@ path_and_offset_of(apr_file_t *file, apr
 }
 
 
-
+
 /* Functions for working with shared transaction data. */
 
 /* Return the transaction object for transaction TXN_ID from the
@@ -1082,6 +1082,34 @@ read_config(svn_fs_t *fs,
   else
     ffd->rep_sharing_allowed = FALSE;
 
+  /* Initialize ffd->deltify_directories. */
+  if (ffd->format >= SVN_FS_FS__MIN_DELTIFICATION_FORMAT)
+    {
+      SVN_ERR(svn_config_get_bool(ffd->config, &ffd->deltify_directories,
+                                  CONFIG_SECTION_DELTIFICATION,
+                                  CONFIG_OPTION_ENABLE_DIR_DELTIFICATION,
+                                  FALSE));
+      SVN_ERR(svn_config_get_bool(ffd->config, &ffd->deltify_properties,
+                                  CONFIG_SECTION_DELTIFICATION,
+                                  CONFIG_OPTION_ENABLE_PROPS_DELTIFICATION,
+                                  FALSE));
+      SVN_ERR(svn_config_get_int64(ffd->config, &ffd->max_deltification_walk,
+                                   CONFIG_SECTION_DELTIFICATION,
+                                   CONFIG_OPTION_MAX_DELTIFICATION_WALK,
+                                   SVN_FS_FS_MAX_DELTIFICATION_WALK));
+      SVN_ERR(svn_config_get_int64(ffd->config, &ffd->max_linear_deltification,
+                                   CONFIG_SECTION_DELTIFICATION,
+                                   CONFIG_OPTION_MAX_LINEAR_DELTIFICATION,
+                                   SVN_FS_FS_MAX_LINEAR_DELTIFICATION));
+    }
+  else
+    {
+      ffd->deltify_directories = FALSE;
+      ffd->deltify_properties = FALSE;
+      ffd->max_deltification_walk = SVN_FS_FS_MAX_DELTIFICATION_WALK;
+      ffd->max_linear_deltification = SVN_FS_FS_MAX_LINEAR_DELTIFICATION;
+    }
+
   return SVN_NO_ERROR;
 }
 
@@ -1130,7 +1158,67 @@ write_config(svn_fs_t *fs,
 "### 'svnadmin verify' will check the rep-cache regardless of this setting." NL
 "### rep-sharing is enabled by default."                                     NL
 "# " CONFIG_OPTION_ENABLE_REP_SHARING " = true"                              NL
-
+""                                                                           NL
+"[" CONFIG_SECTION_DELTIFICATION "]"                                         NL
+"### To conserve space, the filesystem stores data as differences against"   NL
+"### existing representations.  This comes at a slight cost in performance," NL
+"### as calculating differences can increase commit times.  Reading data"    NL
+"### will also create higher CPU load and the data will be fragmented."      NL
+"### Since deltification tends to save significant amounts of disk space,"   NL
+"### the overall I/O load can actually be lower."                            NL
+"###"                                                                        NL
+"### The options in this section allow for tuning the deltification"         NL
+"### strategy.  Their effects on data size and server performance may vary"  NL
+"### from one repository to another.  Versions prior to 1.8 will ignore"     NL
+"### this section."                                                          NL
+"###"                                                                        NL
+"### The following parameter enables deltification for directories. It can"  NL
+"### be switched on and off at will, but for best space-saving results"      NL
+"### should be enabled consistently over the life of the repository."        NL
+"### Repositories containing large directories will benefit greatly."        NL
+"### In rarely read repositories, the I/O overhead may be significant as"    NL
+"### cache hit rates will most likely be low"                                NL
+"### directory deltification is disabled by default."                        NL
+"# " CONFIG_OPTION_ENABLE_DIR_DELTIFICATION " = true"                        NL
+"###"                                                                        NL
+"### The following parameter enables deltification for properties on files"  NL
+"### and directories.  Overall, this is a minor tuning option but can save"  NL
+"### some disk space if frequently merge or if you frequently change node"   NL
+"### properties.  You should not activate this if rep-sharing has been"      NL
+"### disabled."                                                              NL
+"### property deltification is disabled by default."                         NL
+"# " CONFIG_OPTION_ENABLE_PROPS_DELTIFICATION " = true"                      NL
+"###"                                                                        NL
+"### During commit, the server may need to walk the whole change history of" NL
+"### of a given node to find a suitable deltification base.  This linear"    NL
+"### process can impact commit times, svnadmin load and similar operations." NL
+"### This setting limits the depth of the deltification history.  If the"    NL
+"### threshold has been reached, the node will be stored as fulltext and a"  NL
+"### new deltification history begins."                                      NL
+"### Note, this is unrelated to svn log."                                    NL
+"### Very large values rarely provide significant additional savings but"    NL
+"### can impact performance greatly - in particular if directory"            NL
+"### deltification has been activated.  Very small values may be useful in"  NL
+"### repositories that are dominated by large, changing binaries."           NL
+"### Should be a power of two minus 1.  A value of 0 will effectively"       NL
+"### disable deltification."                                                 NL
+"### For 1.8, the default value is 1023; earlier versions have no limit."    NL
+"# " CONFIG_OPTION_MAX_DELTIFICATION_WALK " = 1023"                          NL
+"###"                                                                        NL
+"### The skip-delta scheme used by FSFS tends to repeatably store redundant" NL
+"### delta information where a simple delta against the latest version is"   NL
+"### often smaller.  By default, 1.8+ will therefore use skip deltas only"   NL
+"### after the linear chain of deltas has grown beyond the threshold"        NL
+"### specified by this setting."                                             NL
+"### Values up to 64 can result in some reduction in repository size for"    NL
+"### the cost of quickly increasing I/O and CPU costs. Similarly, smaller"   NL
+"### numbers can reduce those costs at the cost of more disk space.  For"    NL
+"### rarely read repositories or those containing larger binaries, this may" NL
+"### present a better trade-off."                                            NL
+"### Should be a power of two.  A value of 1 or smaller will cause the"      NL
+"### exclusive use of skip-deltas (as in pre-1.8)."                          NL
+"### For 1.8, the default value is 16; earlier versions use 1."              NL
+"# " CONFIG_OPTION_MAX_LINEAR_DELTIFICATION " = 16"                          NL
 ;
 #undef NL
   return svn_io_file_create(svn_dirent_join(fs->path, PATH_CONFIG, pool),
@@ -5265,6 +5353,7 @@ choose_delta_base(representation_t **rep
   int count;
   int walk;
   node_revision_t *base;
+  fs_fs_data_t *ffd = fs->fsap_data;
 
   /* If we have no predecessors, then use the empty stream as a
      base. */
@@ -5285,14 +5374,14 @@ choose_delta_base(representation_t **rep
      along very long node histories.  Close to HEAD however, we create
      a linear history to minimize delta size.  */
   walk = noderev->predecessor_count - count;
-  if (walk < SVN_FS_FS_MAX_LINEAR_DELTIFICATION)
+  if (walk < (int)ffd->max_linear_deltification)
     count = noderev->predecessor_count - 1;
 
   /* Finding the delta base over a very long distance can become extremely
      expensive for very deep histories, possibly causing client timeouts etc.
      OTOH, this is a rare operation and its gains are minimal. Lets simply
      start deltification anew close every other 1000 changes or so.  */
-  if (walk > SVN_FS_FS_MAX_DELTIFICATION_WALK)
+  if (walk > (int)ffd->max_deltification_walk)
     {
       *rep = NULL;
       return SVN_NO_ERROR;
@@ -5772,7 +5861,6 @@ write_hash_rep(representation_t *rep,
    earlier reps with the same content.  When such existing reps can be found,
    we will truncate the one just written from the file and return the existing
    rep.  Perform temporary allocations in POOL. */
-#ifdef SVN_FS_FS_DELTIFY_DIRECTORIES
 static svn_error_t *
 write_hash_delta_rep(representation_t *rep,
                      apr_file_t *file,
@@ -5873,7 +5961,6 @@ write_hash_delta_rep(representation_t *r
 
   return SVN_NO_ERROR;
 }
-#endif
 
 /* Sanity check ROOT_NODEREV, a candidate for being the root node-revision
    of (not yet committed) revision REV in FS.  Use POOL for temporary
@@ -6026,14 +6113,13 @@ write_final_rev(const svn_fs_id_t **new_
           noderev->data_rep->txn_id = NULL;
           noderev->data_rep->revision = rev;
 
-#ifdef SVN_FS_FS_DELTIFY_DIRECTORIES
-          SVN_ERR(write_hash_delta_rep(noderev->data_rep, file,
-                                       str_entries, fs, noderev, NULL,
-                                       pool));
-#else
-          SVN_ERR(write_hash_rep(noderev->data_rep, file, str_entries,
-                                 fs, NULL, pool));
-#endif
+          if (ffd->deltify_directories)
+            SVN_ERR(write_hash_delta_rep(noderev->data_rep, file,
+                                         str_entries, fs, noderev, NULL,
+                                         pool));
+          else
+            SVN_ERR(write_hash_rep(noderev->data_rep, file, str_entries,
+                                   fs, NULL, pool));
         }
     }
   else
@@ -6066,14 +6152,13 @@ write_final_rev(const svn_fs_id_t **new_
       noderev->prop_rep->txn_id = NULL;
       noderev->prop_rep->revision = rev;
 
-#ifdef SVN_FS_FS_DELTIFY_PROPS
-      SVN_ERR(write_hash_delta_rep(noderev->prop_rep, file,
-                                   proplist, fs, noderev, reps_hash,
-                                   pool));
-#else
-      SVN_ERR(write_hash_rep(noderev->prop_rep, file, proplist,
-                             fs, reps_hash, pool));
-#endif
+      if (ffd->deltify_properties)
+        SVN_ERR(write_hash_delta_rep(noderev->prop_rep, file,
+                                     proplist, fs, noderev, reps_hash,
+                                     pool));
+      else
+        SVN_ERR(write_hash_rep(noderev->prop_rep, file, proplist,
+                               fs, reps_hash, pool));
     }
 
 
@@ -7960,7 +8045,7 @@ svn_fs_fs__verify(svn_fs_t *fs,
         svn_pool_clear(iterpool);
 
       	/* ### TODO: Make sure caches are disabled.
-      	   
+
       	   When this code is called in the library, we want to ensure we
       	   use the on-disk data --- rather than some data that was read
       	   in the possibly-distance past and cached since. */

Modified: subversion/branches/master-passphrase/subversion/libsvn_fs_fs/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_fs_fs/temp_serializer.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_fs_fs/temp_serializer.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_fs_fs/temp_serializer.c Thu Apr 12 19:37:45 2012
@@ -184,7 +184,7 @@ serialize_checksum(svn_temp_serializer__
 /* Utility function to deserialize the checksum CS inside the BUFFER.
  */
 static void
-deserialize_checksum(void *buffer, svn_checksum_t * const *cs)
+deserialize_checksum(void *buffer, svn_checksum_t **cs)
 {
   svn_temp_deserializer__resolve(buffer, (void **)cs);
   if (*cs == NULL)
@@ -852,7 +852,7 @@ svn_fs_fs__get_sharded_offset(void **out
                               void *baton,
                               apr_pool_t *pool)
 {
-  apr_off_t *manifest = (apr_off_t *)data;
+  const apr_off_t *manifest = data;
   apr_int64_t shard_pos = *(apr_int64_t *)baton;
 
   *(apr_off_t *)out = manifest[shard_pos];
@@ -879,9 +879,9 @@ find_entry(svn_fs_dirent_t **entries,
   for (middle = upper / 2; lower < upper; middle = (upper + lower) / 2)
     {
       const svn_fs_dirent_t *entry =
-          svn_temp_deserializer__ptr(entries, (const void **)&entries[middle]);
+          svn_temp_deserializer__ptr(entries, (const void *const *)&entries[middle]);
       const char* entry_name =
-          svn_temp_deserializer__ptr(entry, (const void **)&entry->name);
+          svn_temp_deserializer__ptr(entry, (const void *const *)&entry->name);
 
       int diff = strcmp(entry_name, name);
       if (diff < 0)
@@ -895,9 +895,9 @@ find_entry(svn_fs_dirent_t **entries,
   if (lower < count)
     {
       const svn_fs_dirent_t *entry =
-          svn_temp_deserializer__ptr(entries, (const void **)&entries[lower]);
+          svn_temp_deserializer__ptr(entries, (const void *const *)&entries[lower]);
       const char* entry_name =
-          svn_temp_deserializer__ptr(entry, (const void **)&entry->name);
+          svn_temp_deserializer__ptr(entry, (const void *const *)&entry->name);
 
       if (strcmp(entry_name, name) == 0)
         *found = TRUE;
@@ -913,17 +913,17 @@ svn_fs_fs__extract_dir_entry(void **out,
                              void *baton,
                              apr_pool_t *pool)
 {
-  hash_data_t *hash_data = (hash_data_t *)data;
+  const hash_data_t *hash_data = data;
   const char* name = baton;
   svn_boolean_t found;
 
   /* resolve the reference to the entries array */
   const svn_fs_dirent_t * const *entries =
-    svn_temp_deserializer__ptr(data, (const void **)&hash_data->entries);
+    svn_temp_deserializer__ptr(data, (const void *const *)&hash_data->entries);
 
   /* resolve the reference to the lengths array */
   const apr_uint32_t *lengths =
-    svn_temp_deserializer__ptr(data, (const void **)&hash_data->lengths);
+    svn_temp_deserializer__ptr(data, (const void *const *)&hash_data->lengths);
 
   /* binary search for the desired entry by name */
   apr_size_t pos = find_entry((svn_fs_dirent_t **)entries,
@@ -936,7 +936,7 @@ svn_fs_fs__extract_dir_entry(void **out,
   if (found)
     {
       const svn_fs_dirent_t *source =
-          svn_temp_deserializer__ptr(entries, (const void **)&entries[pos]);
+          svn_temp_deserializer__ptr(entries, (const void *const *)&entries[pos]);
 
       /* Entries have been serialized one-by-one, each time including all
        * nestes structures and strings. Therefore, they occupy a single
@@ -1007,12 +1007,12 @@ svn_fs_fs__replace_dir_entry(void **data
   /* resolve the reference to the entries array */
   entries = (svn_fs_dirent_t **)
     svn_temp_deserializer__ptr((const char *)hash_data,
-                               (const void **)&hash_data->entries);
+                               (const void *const *)&hash_data->entries);
 
   /* resolve the reference to the lengths array */
   lengths = (apr_uint32_t *)
     svn_temp_deserializer__ptr((const char *)hash_data,
-                               (const void **)&hash_data->lengths);
+                               (const void *const *)&hash_data->lengths);
 
   /* binary search for the desired entry by name */
   pos = find_entry(entries, replace_baton->name, hash_data->count, &found);
@@ -1081,7 +1081,7 @@ svn_fs_fs__replace_dir_entry(void **data
   hash_data = (hash_data_t *)*data;
   lengths = (apr_uint32_t *)
     svn_temp_deserializer__ptr((const char *)hash_data,
-                               (const void **)&hash_data->lengths);
+                               (const void *const *)&hash_data->lengths);
   lengths[pos] = length;
 
   return SVN_NO_ERROR;

Modified: subversion/branches/master-passphrase/subversion/libsvn_ra/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_ra/compat.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_ra/compat.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_ra/compat.c Thu Apr 12 19:37:45 2012
@@ -141,7 +141,7 @@ prev_log_path(const char **prev_path_p,
               svn_sort__item_t item = APR_ARRAY_IDX(paths,
                                                     i - 1, svn_sort__item_t);
               const char *ch_path = item.key;
-              int len = strlen(ch_path);
+              size_t len = strlen(ch_path);
 
               /* See if our path is the child of this change path.  If
                  not, keep looking.  */

Modified: subversion/branches/master-passphrase/subversion/libsvn_ra_neon/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_ra_neon/commit.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_ra_neon/commit.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_ra_neon/commit.c Thu Apr 12 19:37:45 2012
@@ -1620,7 +1620,8 @@ svn_error_t * svn_ra_neon__get_commit_ed
   *edit_baton = cc;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   ras->shim_callbacks, pool, pool));
+                                   NULL, NULL, ras->shim_callbacks,
+                                   pool, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/master-passphrase/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_ra_serf/commit.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_ra_serf/commit.c Thu Apr 12 19:37:45 2012
@@ -2322,6 +2322,7 @@ svn_ra_serf__get_commit_editor(svn_ra_se
   svn_delta_editor_t *editor;
   commit_context_t *ctx;
   apr_hash_index_t *hi;
+  const char *repos_root;
 
   ctx = apr_pcalloc(pool, sizeof(*ctx));
 
@@ -2368,9 +2369,11 @@ svn_ra_serf__get_commit_editor(svn_ra_se
   *ret_editor = editor;
   *edit_baton = ctx;
 
+  SVN_ERR(svn_ra_serf__get_repos_root(ra_session, &repos_root, pool));
+
   SVN_ERR(svn_editor__insert_shims(ret_editor, edit_baton, *ret_editor,
-                                   *edit_baton, session->shim_callbacks,
-                                   pool, pool));
+                                   *edit_baton, repos_root, NULL,
+                                   session->shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/master-passphrase/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_ra_serf/ra_serf.h?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_ra_serf/ra_serf.h Thu Apr 12 19:37:45 2012
@@ -1425,6 +1425,12 @@ svn_ra_serf__create_sb_bucket(svn_spillb
                               apr_pool_t *scratch_pool);
 
 
+svn_error_t *
+svn_ra_serf__get_repos_root(svn_ra_session_t *ra_session,
+                            const char **url,
+                            apr_pool_t *pool);
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/master-passphrase/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_ra_serf/serf.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_ra_serf/serf.c Thu Apr 12 19:37:45 2012
@@ -1063,7 +1063,7 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *
+svn_error_t *
 svn_ra_serf__get_repos_root(svn_ra_session_t *ra_session,
                             const char **url,
                             apr_pool_t *pool)

Modified: subversion/branches/master-passphrase/subversion/libsvn_ra_svn/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_ra_svn/cyrus_auth.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_ra_svn/cyrus_auth.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_ra_svn/cyrus_auth.c Thu Apr 12 19:37:45 2012
@@ -533,7 +533,7 @@ static svn_error_t *try_auth(svn_ra_svn_
       clear_sasl_errno();
       result = sasl_client_step(sasl_ctx,
                                 in->data,
-                                in->len,
+                                (const unsigned int) in->len,
                                 &client_interact,
                                 &out, /* Filled in by SASL. */
                                 &outlen);
@@ -620,7 +620,7 @@ static svn_error_t *sasl_read_cb(void *b
           return SVN_NO_ERROR;
         }
       clear_sasl_errno();
-      result = sasl_decode(sasl_baton->ctx, buffer, len2,
+      result = sasl_decode(sasl_baton->ctx, buffer, (unsigned int) len2,
                            &sasl_baton->read_buf,
                            &sasl_baton->read_len);
       if (result != SASL_OK)
@@ -662,7 +662,7 @@ sasl_write_cb(void *baton, const char *b
       /* Make sure we don't write too much. */
       *len = (*len > sasl_baton->maxsize) ? sasl_baton->maxsize : *len;
       clear_sasl_errno();
-      result = sasl_encode(sasl_baton->ctx, buffer, *len,
+      result = sasl_encode(sasl_baton->ctx, buffer, (unsigned int) *len,
                            &sasl_baton->write_buf,
                            &sasl_baton->write_len);
 
@@ -755,9 +755,8 @@ svn_error_t *svn_ra_svn__enable_sasl_enc
             {
               clear_sasl_errno();
               result = sasl_decode(sasl_ctx, conn->read_ptr,
-                                   conn->read_end - conn->read_ptr,
-                                   &sasl_baton->read_buf,
-                                   &sasl_baton->read_len);
+                             (unsigned int) (conn->read_end - conn->read_ptr),
+                             &sasl_baton->read_buf, &sasl_baton->read_len);
               if (result != SASL_OK)
                 return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
                                         get_sasl_error(sasl_ctx, result, pool));

Modified: subversion/branches/master-passphrase/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_ra_svn/editorp.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_ra_svn/editorp.c Thu Apr 12 19:37:45 2012
@@ -437,7 +437,8 @@ void svn_ra_svn_get_editor(const svn_del
   *edit_baton = eb;
 
   svn_error_clear(svn_editor__insert_shims(editor, edit_baton, *editor,
-                                           *edit_baton, conn->shim_callbacks,
+                                           *edit_baton, NULL, NULL,
+                                           conn->shim_callbacks,
                                            pool, pool));
 }
 

Modified: subversion/branches/master-passphrase/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_repos/commit.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_repos/commit.c Thu Apr 12 19:37:45 2012
@@ -783,33 +783,6 @@ abort_edit(void *edit_baton,
 
 
 static svn_error_t *
-rationalize_shim_path(const char **fs_path,
-                      struct edit_baton *eb,
-                      const char *path,
-                      apr_pool_t *result_pool,
-                      apr_pool_t *scratch_pool)
-{
-  if (svn_path_is_url(path))
-    {
-      /* This is a copyfrom URL. */
-      path = svn_uri_skip_ancestor(eb->repos_url, path, scratch_pool);
-      *fs_path = svn_fspath__canonicalize(path, scratch_pool);
-    }
-  else
-    {
-      /* This is a base-relative path. */
-      if (path[0] != '/')
-        /* Get an absolute path for use in the FS. */
-        *fs_path = svn_fspath__join(eb->base_path, path, scratch_pool);
-      else
-        *fs_path = path;
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
 fetch_props_func(apr_hash_t **props,
                  void *baton,
                  const char *path,
@@ -821,7 +794,6 @@ fetch_props_func(apr_hash_t **props,
   svn_fs_root_t *fs_root;
   svn_error_t *err;
 
-  SVN_ERR(rationalize_shim_path(&path, eb, path, scratch_pool, scratch_pool));
   SVN_ERR(svn_fs_revision_root(&fs_root, eb->fs,
                                svn_fs_txn_base_revision(eb->txn),
                                scratch_pool));
@@ -852,7 +824,6 @@ fetch_kind_func(svn_kind_t *kind,
   if (!SVN_IS_VALID_REVNUM(base_revision))
     base_revision = svn_fs_txn_base_revision(eb->txn);
 
-  SVN_ERR(rationalize_shim_path(&path, eb, path, scratch_pool, scratch_pool));
   SVN_ERR(svn_fs_revision_root(&fs_root, eb->fs, base_revision, scratch_pool));
 
   SVN_ERR(svn_fs_check_path(&node_kind, fs_root, path, scratch_pool));
@@ -879,7 +850,6 @@ fetch_base_func(const char **filename,
   if (!SVN_IS_VALID_REVNUM(base_revision))
     base_revision = svn_fs_txn_base_revision(eb->txn);
 
-  SVN_ERR(rationalize_shim_path(&path, eb, path, scratch_pool, scratch_pool));
   SVN_ERR(svn_fs_revision_root(&fs_root, eb->fs, base_revision, scratch_pool));
 
   err = svn_fs_file_contents(&contents, fs_root, path, scratch_pool);
@@ -981,6 +951,7 @@ svn_repos_get_commit_editor5(const svn_d
   shim_callbacks->fetch_baton = eb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
+                                   eb->repos_url, eb->base_path,
                                    shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;

Modified: subversion/branches/master-passphrase/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_repos/dump.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_repos/dump.c Thu Apr 12 19:37:45 2012
@@ -1009,7 +1009,7 @@ get_dump_editor(const svn_delta_editor_t
   shim_callbacks->fetch_baton = eb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   shim_callbacks, pool, pool));
+                                   NULL, NULL, shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/config.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/config.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/config.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/config.c Thu Apr 12 19:37:45 2012
@@ -34,6 +34,7 @@
 #include "config_impl.h"
 
 #include "svn_private_config.h"
+#include "private/svn_dep_compat.h"
 
 
 
@@ -697,6 +698,33 @@ svn_config_set_bool(svn_config_t *cfg,
 }
 
 svn_error_t *
+svn_config_get_int64(svn_config_t *cfg,
+                     apr_int64_t *valuep,
+                     const char *section,
+                     const char *option,
+                     apr_int64_t default_value)
+{
+  const char *tmp_value;
+  svn_config_get(cfg, &tmp_value, section, option, NULL);
+  if (tmp_value)
+    return svn_cstring_strtoi64(valuep, tmp_value,
+                                APR_INT64_MIN, APR_INT64_MAX, 10);
+
+  *valuep = default_value;
+  return SVN_NO_ERROR;
+}
+
+void
+svn_config_set_int64(svn_config_t *cfg,
+                     const char *section,
+                     const char *option,
+                     apr_int64_t value)
+{
+  svn_config_set(cfg, section, option,
+                 apr_psprintf(cfg->pool, "%" APR_INT64_T_FMT, value));
+}
+
+svn_error_t *
 svn_config_get_yes_no_ask(svn_config_t *cfg, const char **valuep,
                           const char *section, const char *option,
                           const char* default_value)

Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/crypto.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/crypto.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/crypto.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/crypto.c Thu Apr 12 19:37:45 2012
@@ -23,11 +23,13 @@
 
 #include "crypto.h"
 
-#if APU_HAVE_CRYPTO
+#ifdef SVN_HAVE_CRYPTO
 #include <apr_random.h>
 #include <apr_crypto.h>
+#endif /* SVN_HAVE_CRYPTO */
 
 #include "svn_types.h"
+#include "svn_checksum.h"
 
 #include "svn_private_config.h"
 #include "private/svn_atomic.h"
@@ -44,6 +46,7 @@
 /* A structure for containing Subversion's cryptography-related bits
    (so we can avoid passing around APR-isms outside this module). */
 struct svn_crypto__ctx_t {
+#ifdef SVN_HAVE_CRYPTO
   apr_crypto_t *crypto;  /* APR cryptography context. */
 
 #if 0
@@ -53,12 +56,16 @@ struct svn_crypto__ctx_t {
      ### apr_generate_random_bytes() to generate entropy for seeding
      ### apr_random_t. See httpd/server/core.c:ap_init_rng()  */
   apr_random_t *rand;
-#endif
+#endif /* 0 */
+#else /* SVN_HAVE_CRYPTO */
+  int unused_but_required_to_satisfy_c_compilers;
+#endif /* SVN_HAVE_CRYPTO */
 };
 
 
 
-/*** Initialization ***/
+/*** Helper Functions ***/
+#ifdef SVN_HAVE_CRYPTO
 
 
 /* One-time initialization of the cryptography subsystem. */
@@ -90,10 +97,6 @@ crypto_init(void *baton, apr_pool_t *any
 }
 
 
-
-/*** Helper Functions ***/
-
-
 /* If APU_ERR is non-NULL, create and return a Subversion error using
    APR_ERR and APU_ERR. */
 static svn_error_t *
@@ -142,7 +145,6 @@ get_random_bytes(const unsigned char **r
                  apr_size_t rand_len,
                  apr_pool_t *result_pool)
 {
-#if APR_HAS_RANDOM
   apr_status_t apr_err;
   unsigned char *bytes;
 
@@ -153,10 +155,42 @@ get_random_bytes(const unsigned char **r
 
   *rand_bytes = bytes;
   return SVN_NO_ERROR;
-#else
-  return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
-                          _("No support for random data generation found"));
-#endif
+}
+
+
+/* Return an svn_string_t allocated from RESULT_POOL, with its .data
+   and .len members set to DATA and LEN, respective.
+
+   WARNING: No lifetime management of DATA is offered here, so you
+   probably want to ensure that that information is allocated in a
+   sufficiently long-lived pool (such as, for example, RESULT_POOL). */
+static const svn_string_t *
+wrap_as_string(const unsigned char *data,
+               apr_size_t len,
+               apr_pool_t *result_pool)
+{
+  svn_string_t *s = apr_palloc(result_pool, sizeof(*s));
+
+  s->data = (const char *)data;  /* better already be in RESULT_POOL  */
+  s->len = len;
+  return s;
+}
+
+
+#endif /* SVN_HAVE_CRYPTO */
+
+
+
+/*** Semi-public APIs ***/
+
+/* Return TRUE iff Subversion's cryptographic support is available. */
+svn_boolean_t svn_crypto__is_available(void)
+{
+#ifdef SVN_HAVE_CRYPTO
+  return TRUE;
+#else /* SVN_HAVE_CRYPTO */
+  return FALSE;
+#endif /* SVN_HAVE_CRYPTO */
 }
 
 
@@ -166,6 +200,7 @@ svn_error_t *
 svn_crypto__context_create(svn_crypto__ctx_t **ctx,
                            apr_pool_t *result_pool)
 {
+#ifdef SVN_HAVE_CRYPTO
   apr_status_t apr_err;
   const apu_err_t *apu_err = NULL;
   apr_crypto_t *apr_crypto;
@@ -203,25 +238,10 @@ svn_crypto__context_create(svn_crypto__c
   (*ctx)->crypto = apr_crypto;
 
   return SVN_NO_ERROR;
-}
-
-
-/* Return an svn_string_t allocated from RESULT_POOL, with its .data
-   and .len members set to DATA and LEN, respective.
-
-   WARNING: No lifetime management of DATA is offered here, so you
-   probably want to ensure that that information is allocated in a
-   sufficiently long-lived pool (such as, for example, RESULT_POOL). */
-static const svn_string_t *
-wrap_as_string(const unsigned char *data,
-               apr_size_t len,
-               apr_pool_t *result_pool)
-{
-  svn_string_t *s = apr_palloc(result_pool, sizeof(*s));
-
-  s->data = (const char *)data;  /* better already be in RESULT_POOL  */
-  s->len = len;
-  return s;
+#else /* SVN_HAVE_CRYPTO */
+  return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                          "Cryptographic support is not available");
+#endif /* SVN_HAVE_CRYPTO */
 }
 
 
@@ -235,6 +255,7 @@ svn_crypto__encrypt_password(const svn_s
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool)
 {
+#ifdef SVN_HAVE_CRYPTO
   svn_error_t *err = SVN_NO_ERROR;
   const unsigned char *salt_vector;
   const unsigned char *iv_vector;
@@ -359,6 +380,10 @@ svn_crypto__encrypt_password(const svn_s
  cleanup:
   apr_crypto_block_cleanup(block_ctx);
   return err;
+#else /* SVN_HAVE_CRYPTO */
+  return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                          "Cryptographic support is not available");
+#endif /* SVN_HAVE_CRYPTO */
 }
 
 
@@ -372,6 +397,7 @@ svn_crypto__decrypt_password(const char 
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool)
 {
+#ifdef SVN_HAVE_CRYPTO
   svn_error_t *err = SVN_NO_ERROR;
   apr_status_t apr_err;
   apr_crypto_block_t *block_ctx = NULL;
@@ -448,6 +474,232 @@ svn_crypto__decrypt_password(const char 
  cleanup:
   apr_crypto_block_cleanup(block_ctx);
   return err;
+#else /* SVN_HAVE_CRYPTO */
+  return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                          "Cryptographic support is not available");
+#endif /* SVN_HAVE_CRYPTO */
 }
 
-#endif  /* APU_HAVE_CRYPTO */
+
+svn_error_t *
+svn_crypto__generate_secret_checktext(const svn_string_t **ciphertext,
+                                      const svn_string_t **iv,
+                                      const svn_string_t **salt,
+                                      const char **checktext,
+                                      svn_crypto__ctx_t *ctx,
+                                      const svn_string_t *master,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool)
+{
+#ifdef SVN_HAVE_CRYPTO
+  svn_error_t *err = SVN_NO_ERROR;
+  const unsigned char *salt_vector;
+  const unsigned char *iv_vector;
+  const unsigned char *stuff_vector;
+  apr_size_t iv_len;
+  apr_crypto_key_t *key = NULL;
+  apr_status_t apr_err;
+  apr_crypto_block_t *block_ctx = NULL;
+  apr_size_t block_size;
+  apr_size_t result_len;
+  unsigned char *result;
+  apr_size_t ignored_result_len = 0;
+  apr_size_t stuff_len;
+  svn_checksum_t *stuff_sum;
+
+  SVN_ERR_ASSERT(ctx != NULL);
+
+  /* Generate the salt. */
+  SVN_ERR(get_random_bytes(&salt_vector, ctx, SALT_LEN, result_pool));
+
+  /* Initialize the passphrase.  */
+  apr_err = apr_crypto_passphrase(&key, &iv_len,
+                                  master->data, master->len,
+                                  salt_vector, SALT_LEN,
+                                  APR_KEY_AES_256, APR_MODE_CBC,
+                                  FALSE /* doPad */, NUM_ITERATIONS,
+                                  ctx->crypto,
+                                  scratch_pool);
+  if (apr_err != APR_SUCCESS)
+    return svn_error_trace(crypto_error_create(
+                               ctx, apr_err,
+                               _("Error creating derived key")));
+  if (! key)
+    return svn_error_create(APR_EGENERAL, NULL,
+                            _("Error creating derived key"));
+  if (iv_len == 0)
+    return svn_error_create(APR_EGENERAL, NULL,
+                            _("Unexpected IV length returned"));
+
+  /* Generate the proper length IV.  */
+  SVN_ERR(get_random_bytes(&iv_vector, ctx, iv_len, result_pool));
+
+  /* Initialize block encryption. */
+  apr_err = apr_crypto_block_encrypt_init(&block_ctx, &iv_vector, key,
+                                          &block_size, scratch_pool);
+  if ((apr_err != APR_SUCCESS) || (! block_ctx))
+    return svn_error_trace(crypto_error_create(
+                             ctx, apr_err,
+                             _("Error initializing block encryption")));
+
+  /* Generate a blob of random data, block-aligned per the
+     requirements of the encryption algorithm, but with a minimum size
+     of our choosing.  */
+#define MIN_STUFF_LEN 32
+  if (MIN_STUFF_LEN % block_size)
+    stuff_len = MIN_STUFF_LEN + (block_size - (MIN_STUFF_LEN % block_size));
+  else
+    stuff_len = MIN_STUFF_LEN;
+  SVN_ERR(get_random_bytes(&stuff_vector, ctx, stuff_len, scratch_pool));
+
+  /* ### FIXME:  This should be a SHA-256.  */
+  SVN_ERR(svn_checksum(&stuff_sum, svn_checksum_sha1, stuff_vector,
+                       stuff_len, scratch_pool));
+
+  /* Get the length that we need to allocate.  */
+  apr_err = apr_crypto_block_encrypt(NULL, &result_len, stuff_vector,
+                                     stuff_len, block_ctx);
+  if (apr_err != APR_SUCCESS)
+    {
+      err = crypto_error_create(ctx, apr_err,
+                                _("Error fetching result length"));
+      goto cleanup;
+    }
+
+  /* Allocate our result buffer.  */
+  result = apr_palloc(result_pool, result_len);
+
+  /* Encrypt the block. */
+  apr_err = apr_crypto_block_encrypt(&result, &result_len, stuff_vector,
+                                     stuff_len, block_ctx);
+  if (apr_err != APR_SUCCESS)
+    {
+      err = crypto_error_create(ctx, apr_err,
+                                _("Error during block encryption"));
+      goto cleanup;
+    }
+
+  /* Finalize the block encryption. Since we padded everything, this should
+     not produce any more encrypted output.  */
+  apr_err = apr_crypto_block_encrypt_finish(NULL,
+                                            &ignored_result_len,
+                                            block_ctx);
+  if (apr_err != APR_SUCCESS)
+    {
+      err = crypto_error_create(ctx, apr_err,
+                                _("Error finalizing block encryption"));
+      goto cleanup;
+    }
+
+  *ciphertext = wrap_as_string(result, result_len, result_pool);
+  *iv = wrap_as_string(iv_vector, iv_len, result_pool);
+  *salt = wrap_as_string(salt_vector, SALT_LEN, result_pool);
+  *checktext = svn_checksum_to_cstring(stuff_sum, result_pool);
+
+ cleanup:
+  apr_crypto_block_cleanup(block_ctx);
+  return err;
+#else /* SVN_HAVE_CRYPTO */
+  return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                          "Cryptographic support is not available");
+#endif /* SVN_HAVE_CRYPTO */
+}
+
+
+svn_error_t *
+svn_crypto__verify_secret(svn_boolean_t *is_valid,
+                          svn_crypto__ctx_t *ctx,
+                          const svn_string_t *master,
+                          const svn_string_t *ciphertext,
+                          const svn_string_t *iv,
+                          const svn_string_t *salt,
+                          const char *checktext,
+                          apr_pool_t *scratch_pool)
+{
+#ifdef SVN_HAVE_CRYPTO
+  svn_error_t *err = SVN_NO_ERROR;
+  apr_status_t apr_err;
+  apr_crypto_block_t *block_ctx = NULL;
+  apr_size_t block_size, iv_len;
+  apr_crypto_key_t *key = NULL;
+  unsigned char *result;
+  apr_size_t result_len = 0, final_len = 0;
+  svn_checksum_t *result_sum;
+
+  *is_valid = FALSE;
+
+  /* Initialize the passphrase.  */
+  apr_err = apr_crypto_passphrase(&key, &iv_len,
+                                  master->data, master->len,
+                                  (unsigned char *)salt->data, salt->len,
+                                  APR_KEY_AES_256, APR_MODE_CBC,
+                                  FALSE /* doPad */, NUM_ITERATIONS,
+                                  ctx->crypto, scratch_pool);
+  if (apr_err != APR_SUCCESS)
+    return svn_error_trace(crypto_error_create(
+                               ctx, apr_err,
+                               _("Error creating derived key")));
+  if (! key)
+    return svn_error_create(APR_EGENERAL, NULL,
+                            _("Error creating derived key"));
+  if (iv_len == 0)
+    return svn_error_create(APR_EGENERAL, NULL,
+                            _("Unexpected IV length returned"));
+  if (iv_len != iv->len)
+    return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
+                            _("Provided IV has incorrect length"));
+  
+  apr_err = apr_crypto_block_decrypt_init(&block_ctx, &block_size,
+                                          (unsigned char *)iv->data,
+                                          key, scratch_pool);
+  if ((apr_err != APR_SUCCESS) || (! block_ctx))
+    return svn_error_trace(crypto_error_create(
+                             ctx, apr_err,
+                             _("Error initializing block decryption")));
+
+  apr_err = apr_crypto_block_decrypt(NULL, &result_len,
+                                     (unsigned char *)ciphertext->data,
+                                     ciphertext->len, block_ctx);
+  if (apr_err != APR_SUCCESS)
+    {
+      err = crypto_error_create(ctx, apr_err,
+                                _("Error fetching result length"));
+      goto cleanup;
+    }
+
+  result = apr_palloc(scratch_pool, result_len);
+  apr_err = apr_crypto_block_decrypt(&result, &result_len,
+                                     (unsigned char *)ciphertext->data,
+                                     ciphertext->len, block_ctx);
+  if (apr_err != APR_SUCCESS)
+    {
+      err = crypto_error_create(ctx, apr_err,
+                                _("Error during block decryption"));
+      goto cleanup;
+    }
+
+  apr_err = apr_crypto_block_decrypt_finish(result + result_len, &final_len,
+                                            block_ctx);
+  if (apr_err != APR_SUCCESS)
+    {
+      err = crypto_error_create(ctx, apr_err,
+                                _("Error finalizing block decryption"));
+      goto cleanup;
+    }
+
+  /* ### FIXME:  This should be a SHA-256.  */
+  SVN_ERR(svn_checksum(&result_sum, svn_checksum_sha1, result,
+                       result_len + final_len, scratch_pool));
+
+  *is_valid = strcmp(checktext,
+                     svn_checksum_to_cstring(result_sum, scratch_pool)) == 0;
+
+ cleanup:
+  apr_crypto_block_cleanup(block_ctx);
+  return err;
+#else /* SVN_HAVE_CRYPTO */
+  *is_valid = FALSE;
+  return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                          "Cryptographic support is not available");
+#endif /* SVN_HAVE_CRYPTO */
+}

Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/crypto.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/crypto.h?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/crypto.h (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/crypto.h Thu Apr 12 19:37:45 2012
@@ -24,9 +24,15 @@
 #ifndef SVN_LIBSVN_SUBR_CRYPTO_H
 #define SVN_LIBSVN_SUBR_CRYPTO_H
 
-#include <apu.h>  /* for APU_HAVE_CRYPTO */
-
+/* Test for APR crypto and RNG support */
+#undef SVN_HAVE_CRYPTO
+#include <apr.h> /* for APR_HAS_RANDOM */
+#include <apu.h> /* for APU_HAVE_CRYPTO */
+#if APR_HAS_RANDOM
 #if APU_HAVE_CRYPTO
+#define SVN_HAVE_CRYPTO
+#endif
+#endif
 
 #include "svn_types.h"
 #include "svn_string.h"
@@ -40,6 +46,10 @@ extern "C" {
 typedef struct svn_crypto__ctx_t svn_crypto__ctx_t;
 
 
+/* Return TRUE iff Subversion's cryptographic support is available. */
+svn_boolean_t svn_crypto__is_available(void);
+
+
 /* Set *CTX to new Subversion cryptographic context, based on an
    APR-managed OpenSSL cryptography context object allocated
    within RESULT_POOL.  */
@@ -85,10 +95,47 @@ svn_crypto__decrypt_password(const char 
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool);
 
+/* Generate the stuff Subversion needs to store in order to validate a
+   user-provided MASTER password:
+
+   Set *CIPHERTEXT to a block of encrypted data.
+
+   Set *IV and *SALT to the initialization vector and salt used for
+   encryption.
+
+   Set *CHECKTEXT to the check text used for validation.
+
+   CTX is a Subversion cryptographic context.  MASTER is the
+   encryption secret.
+*/
+svn_error_t *
+svn_crypto__generate_secret_checktext(const svn_string_t **ciphertext,
+                                      const svn_string_t **iv,
+                                      const svn_string_t **salt,
+                                      const char **checktext,
+                                      svn_crypto__ctx_t *ctx,
+                                      const svn_string_t *master,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool);
+
+/* Set *IS_VALID to TRUE iff the encryption secret MASTER successfully
+   validates using Subversion cryptographic context CTX against
+   CIPHERTEXT, IV, SALT, and CHECKTEXT (which where probably generated
+   via previous call to svn_crypto__generate_secret_checktext()).
+
+   Use SCRATCH_POOL for necessary allocations. */
+svn_error_t *
+svn_crypto__verify_secret(svn_boolean_t *is_valid,
+                          svn_crypto__ctx_t *ctx,
+                          const svn_string_t *master,
+                          const svn_string_t *ciphertext,
+                          const svn_string_t *iv,
+                          const svn_string_t *salt,
+                          const char *checktext,
+                          apr_pool_t *scratch_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
 
-#endif  /* APU_HAVE_CRYPTO */
-
-#endif  /* SVN_CRYPTO_H */
+#endif  /* SVN_LIBSVN_SUBR_CRYPTO_H */

Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/svn_temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/svn_temp_serializer.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/svn_temp_serializer.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/svn_temp_serializer.c Thu Apr 12 19:37:45 2012
@@ -352,7 +352,7 @@ svn_temp_deserializer__resolve(void *buf
 }
 
 const void *
-svn_temp_deserializer__ptr(const void *buffer, const void **ptr)
+svn_temp_deserializer__ptr(const void *buffer, const void *const *ptr)
 {
   return (apr_size_t)*ptr == 0
       ? NULL

Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/diff_editor.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/diff_editor.c Thu Apr 12 19:37:45 2012
@@ -1946,7 +1946,8 @@ svn_wc__get_diff_editor(const svn_delta_
 
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   shim_callbacks, result_pool, scratch_pool));
+                                   NULL, NULL, shim_callbacks,
+                                   result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/node.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/node.c Thu Apr 12 19:37:45 2012
@@ -882,7 +882,6 @@ get_base_rev(svn_revnum_t *base_revision
              const char *local_abspath,
              apr_pool_t *scratch_pool)
 {
-  svn_boolean_t have_base;
   svn_error_t *err;
 
   err = svn_wc__db_base_get_info(NULL, NULL, base_revision, NULL,
@@ -896,13 +895,7 @@ get_base_rev(svn_revnum_t *base_revision
 
   svn_error_clear(err);
 
-  SVN_ERR(svn_wc__db_read_info(NULL, NULL, base_revision,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, &have_base, NULL,
-                               NULL, NULL, NULL, NULL, NULL,
-                               db, local_abspath,
-                               scratch_pool, scratch_pool));
+  *base_revision = SVN_INVALID_REVNUM;
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/status.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/status.c Thu Apr 12 19:37:45 2012
@@ -2588,7 +2588,7 @@ svn_wc__get_status_editor(const svn_delt
   shim_callbacks->fetch_baton = sfb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   shim_callbacks,
+                                   NULL, NULL, shim_callbacks,
                                    result_pool, scratch_pool));
 
   return SVN_NO_ERROR;

Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/update_editor.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/update_editor.c Thu Apr 12 19:37:45 2012
@@ -4996,7 +4996,8 @@ make_editor(svn_revnum_t *target_revisio
   shim_callbacks->fetch_baton = sfb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   shim_callbacks, result_pool, scratch_pool));
+                                   NULL, NULL, shim_callbacks,
+                                   result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c Thu Apr 12 19:37:45 2012
@@ -3662,11 +3662,42 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
                     dst_parent_relpath,
                     presence_map, dst_presence));
 
-      /* ### What about other results from scan_addition()?
-       * ### 'cp A B; mv B C' currently results in C being marked moved-here
-       * ### with no corresponding moved-from. */
-      if (is_move && status != svn_wc__db_status_added)
-        SVN_ERR(svn_sqlite__bind_int64(stmt, 7, 1));
+      if (is_move)
+        {
+          if (dst_op_depth == relpath_depth(dst_relpath))
+            {
+              /* We're moving the root of the move operation.
+               *
+               * When an added node or the op-root of a copy is moved,
+               * there is no 'moved-from' corresponding to the moved-here
+               * node. So the net effect is the same as copy+delete.
+               * Perform a normal copy operation in these cases. */
+              if (!(status == svn_wc__db_status_added ||
+                    (status == svn_wc__db_status_copied && op_root)))
+                SVN_ERR(svn_sqlite__bind_int64(stmt, 7, 1));
+            }
+          else
+            {
+              svn_sqlite__stmt_t *info_stmt;
+              svn_boolean_t have_row;
+
+              /* We're moving a child along with the root of the move.
+               *
+               * Set moved-here depending on dst_parent, propagating
+               * the above decision to moved-along children.
+               * We can't use scan_addition() to detect moved-here because
+               * the delete-half of the move might not yet exist. */
+              SVN_ERR(svn_sqlite__get_statement(&info_stmt, dst_wcroot->sdb,
+                                                STMT_SELECT_NODE_INFO));
+              SVN_ERR(svn_sqlite__bindf(info_stmt, "is", dst_wcroot->wc_id,
+                                        dst_parent_relpath));
+              SVN_ERR(svn_sqlite__step(&have_row, info_stmt));
+              SVN_ERR_ASSERT(have_row);
+              if (svn_sqlite__column_boolean(info_stmt, 15))
+                SVN_ERR(svn_sqlite__bind_int64(stmt, 7, 1));
+              SVN_ERR(svn_sqlite__reset(info_stmt));
+            }
+        }
 
       SVN_ERR(svn_sqlite__step_done(stmt));
 

Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h Thu Apr 12 19:37:45 2012
@@ -2600,10 +2600,10 @@ svn_wc__db_scan_addition(svn_wc__db_stat
    MOVED_TO_ABSPATH will specify the path where this node was moved to
    if the node has moved-away.
 
-   If the node was moved-away, MOVED_TO_OP_ROOT_ABSPATH will specify the root
-   of the copy operation that created the move destination.
-   If LOCAL_ABSPATH itself is the root of the copy, MOVED_TO_OP_ROOT_ABSPATH
-   equals MOVED_TO_ABSPATH.
+   If the node was moved-away, MOVED_TO_OP_ROOT_ABSPATH will specify the
+   target path of the root of the move operation.  If LOCAL_ABSPATH itself
+   is the source path of the root of the move operation, then
+   MOVED_TO_OP_ROOT_ABSPATH equals MOVED_TO_ABSPATH.
 
    All OUT parameters may be set to NULL to indicate a lack of interest in
    that piece of information.

Modified: subversion/branches/master-passphrase/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/diff-cmd.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/diff-cmd.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/diff-cmd.c Thu Apr 12 19:37:45 2012
@@ -249,6 +249,12 @@ svn_cl__diff(apr_getopt_t *os,
 
       SVN_ERR(svn_cl__args_to_target_array_print_reserved(&tmp2, os, tmp,
                                                           ctx, FALSE, pool));
+
+      /* Check if either or both targets were skipped (e.g. because they
+       * were .svn directories). */
+      if (tmp2->nelts < 2)
+        return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, NULL, NULL);
+
       SVN_ERR(svn_opt_parse_path(&old_rev, &old_target,
                                  APR_ARRAY_IDX(tmp2, 0, const char *),
                                  pool));

Modified: subversion/branches/master-passphrase/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnrdump/dump_editor.c?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/master-passphrase/subversion/svnrdump/dump_editor.c Thu Apr 12 19:37:45 2012
@@ -1063,7 +1063,7 @@ svn_rdump__get_dump_editor(const svn_del
   shim_callbacks->fetch_baton = eb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   shim_callbacks, pool, pool));
+                                   NULL, NULL, shim_callbacks, pool, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/basic_tests.py?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/basic_tests.py Thu Apr 12 19:37:45 2012
@@ -25,7 +25,9 @@
 ######################################################################
 
 # General modules
-import shutil, stat, re, os
+import shutil, stat, re, os, logging
+
+logger = logging.getLogger()
 
 # Our testing module
 import svntest
@@ -659,8 +661,8 @@ def basic_conflict(sbox):
     # probably reveal the cause for the failure, if they were
     # uncommented:
     #
-    # print("Not all extra reject files have been accounted for:")
-    # print(extra_files)
+    # logger.warn("Not all extra reject files have been accounted for:")
+    # logger.warn(extra_files)
     ### we should raise a less generic error here. which?
     raise svntest.Failure
 
@@ -780,17 +782,17 @@ def basic_revert(sbox):
   fp = open(beta_path, 'r')
   lines = fp.readlines()
   if not ((len (lines) == 1) and (lines[0] == "This is the file 'beta'.\n")):
-    print("Revert failed to restore original text.")
+    logger.warn("Revert failed to restore original text.")
     raise svntest.Failure
   fp = open(iota_path, 'r')
   lines = fp.readlines()
   if not ((len (lines) == 1) and (lines[0] == "This is the file 'iota'.\n")):
-    print("Revert failed to restore original text.")
+    logger.warn("Revert failed to restore original text.")
     raise svntest.Failure
   fp = open(rho_path, 'r')
   lines = fp.readlines()
   if not ((len (lines) == 1) and (lines[0] == "This is the file 'rho'.\n")):
-    print("Revert failed to restore original text.")
+    logger.warn("Revert failed to restore original text.")
     raise svntest.Failure
   fp = open(zeta_path, 'r')
   lines = fp.readlines()
@@ -989,7 +991,7 @@ def verify_file_deleted(message, path):
   except IOError:
     return
   if message is not None:
-    print(message)
+    logger.warn(message)
   ###TODO We should raise a less generic error here. which?
   raise svntest.Failure
 
@@ -1168,11 +1170,11 @@ def basic_delete(sbox):
 
   # check unversioned and added dirs has been removed
   if verify_dir_deleted(Q_path):
-    print("Failed to remove unversioned dir")
+    logger.warn("Failed to remove unversioned dir")
     ### we should raise a less generic error here. which?
     raise svntest.Failure
   if verify_dir_deleted(X_path):
-    print("Failed to remove added dir")
+    logger.warn("Failed to remove added dir")
     ### we should raise a less generic error here. which?
     raise svntest.Failure
 
@@ -1673,8 +1675,8 @@ def basic_info(sbox):
       if line.startswith('Path: '):
         paths.append(line[6:].rstrip())
     if paths != expected_paths:
-      print("Reported paths: %s" % paths)
-      print("Expected paths: %s" % expected_paths)
+      logger.warn("Reported paths: %s" % paths)
+      logger.warn("Expected paths: %s" % expected_paths)
       raise svntest.Failure
 
   sbox.build(read_only = True)
@@ -1697,7 +1699,7 @@ def repos_root(sbox):
       if line == "Repository Root: " + sbox.repo_url + "\n":
         break
     else:
-      print("Bad or missing repository root")
+      logger.warn("Bad or missing repository root")
       raise svntest.Failure
 
   sbox.build(read_only = True)
@@ -1920,7 +1922,7 @@ def delete_keep_local_twice(sbox):
   svntest.actions.run_and_verify_svn(None, None, [], 'rm', '--keep-local', dir)
 
   if not os.path.isdir(dir):
-    print('Directory was really deleted')
+    logger.warn('Directory was really deleted')
     raise svntest.Failure
 
 def windows_paths_in_repos(sbox):
@@ -2194,8 +2196,8 @@ def automatic_conflict_resolution(sbox):
     # probably reveal the cause for the failure, if they were
     # uncommented:
     #
-    # print("Not all extra reject files have been accounted for:")
-    # print(extra_files)
+    # logger.warn("Not all extra reject files have been accounted for:")
+    # logger.warn(extra_files)
     ### we should raise a less generic error here. which?
     raise svntest.Failure
 

Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/diff_tests.py?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/diff_tests.py Thu Apr 12 19:37:45 2012
@@ -26,7 +26,9 @@
 ######################################################################
 
 # General modules
-import sys, re, os, time, shutil
+import sys, re, os, time, shutil, logging
+
+logger = logging.getLogger()
 
 # Our testing module
 import svntest
@@ -45,16 +47,28 @@ Item = svntest.wc.StateItem
 ######################################################################
 # Generate expected output
 
-def make_diff_header(path, old_tag, new_tag):
+def make_diff_header(path, old_tag, new_tag, src_label=None, dst_label=None):
   """Generate the expected diff header for file PATH, with its old and new
-  versions described in parentheses by OLD_TAG and NEW_TAG. Return the header
-  as an array of newline-terminated strings."""
+  versions described in parentheses by OLD_TAG and NEW_TAG. SRC_LABEL and
+  DST_LABEL are paths or urls that are added to the diff labels if we're
+  diffing against the repository or diffing two arbitrary paths.
+  Return the header as an array of newline-terminated strings."""
+  if src_label:
+    src_label = src_label.replace('\\', '/')
+    src_label = '\t(.../' + src_label + ')'
+  else:
+    src_label = ''
+  if dst_label:
+    dst_label = dst_label.replace('\\', '/')
+    dst_label = '\t(.../' + dst_label + ')'
+  else:
+    dst_label = ''
   path_as_shown = path.replace('\\', '/')
   return [
     "Index: " + path_as_shown + "\n",
     "===================================================================\n",
-    "--- " + path_as_shown + "\t(" + old_tag + ")\n",
-    "+++ " + path_as_shown + "\t(" + new_tag + ")\n",
+    "--- " + path_as_shown + src_label + "\t(" + old_tag + ")\n",
+    "+++ " + path_as_shown + dst_label + "\t(" + new_tag + ")\n",
     ]
 
 def make_no_diff_deleted_header(path, old_tag, new_tag):
@@ -268,8 +282,8 @@ def verify_excluded_output(diff_output, 
   "verify given line does not exist in diff output as diff line"
   for line in diff_output:
     if re.match("^(\\+|-)%s" % re.escape(excluded), line):
-      print('Sought: %s' % excluded)
-      print('Found:  %s' % line)
+      logger.warn('Sought: %s' % excluded)
+      logger.warn('Found:  %s' % line)
       raise svntest.Failure
 
 def extract_diff_path(line):
@@ -1570,7 +1584,7 @@ def check_for_omitted_prefix_in_path_com
   good_dest = ".../prefix_other/mytag"
 
   if ((src != good_src) or (dest != good_dest)):
-    print("src is '%s' instead of '%s' and dest is '%s' instead of '%s'" %
+    logger.warn("src is '%s' instead of '%s' and dest is '%s' instead of '%s'" %
           (src, good_src, dest, good_dest))
     raise svntest.Failure
 
@@ -1768,6 +1782,7 @@ def diff_prop_on_named_dir(sbox):
 
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'propdel', 'p', 'A')
+
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'ci', '-m', '')
 
@@ -3760,6 +3775,108 @@ def no_spurious_conflict(sbox):
   expected_status.tweak('3449_spurious', status='  ')
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
+def diff_two_working_copies(sbox):
+  "diff between two working copies"
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Create a pristine working copy that will remain mostly unchanged
+  wc_dir_old = sbox.add_wc_path('old')
+  svntest.main.run_svn(None, 'co', sbox.repo_url, wc_dir_old)
+  # Add a property to A/B/F in the pristine working copy
+  svntest.main.run_svn(None, 'propset', 'newprop', 'propval-old\n',
+                       os.path.join(wc_dir_old, 'A', 'B', 'F'))
+
+  # Make changes to the first working copy:
+
+  # removed nodes
+  sbox.simple_rm('A/mu')
+  sbox.simple_rm('A/D/H')
+
+  # new nodes
+  sbox.simple_mkdir('newdir')
+  svntest.main.file_append(sbox.ospath('newdir/newfile'), 'new text\n')
+  sbox.simple_add('newdir/newfile')
+  sbox.simple_mkdir('newdir/newdir2') # should not show up in the diff
+
+  # modified nodes
+  sbox.simple_propset('newprop', 'propval', 'A/D')
+  sbox.simple_propset('newprop', 'propval', 'A/D/gamma')
+  svntest.main.file_append(sbox.ospath('A/B/lambda'), 'new text\n')
+
+  # replaced nodes (files vs. directories) with property mods
+  sbox.simple_rm('A/B/F')
+  svntest.main.file_append(sbox.ospath('A/B/F'), 'new text\n')
+  sbox.simple_add('A/B/F')
+  sbox.simple_propset('newprop', 'propval-new\n', 'A/B/F')
+  sbox.simple_rm('A/D/G/pi')
+  sbox.simple_mkdir('A/D/G/pi')
+  sbox.simple_propset('newprop', 'propval', 'A/D/G/pi')
+
+  src_label = os.path.basename(wc_dir_old)
+  dst_label = os.path.basename(wc_dir)
+  expected_output = make_diff_header('newdir/newfile', 'working copy',
+                                     'working copy',
+                                     src_label, dst_label) + [
+                      "@@ -0,0 +1 @@\n",
+                      "+new text\n",
+                    ] + make_diff_header('A/mu', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +0,0 @@\n",
+                      "-This is the file 'mu'.\n",
+                    ] + make_diff_header('A/B/F', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -0,0 +1 @@\n",
+                      "+new text\n",
+                    ] + make_diff_prop_header('A/B/F') + \
+                        make_diff_prop_modified("newprop", "propval-old\n",
+                                                "propval-new\n") + \
+                    make_diff_header('A/B/lambda', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +1,2 @@\n",
+                      " This is the file 'lambda'.\n",
+                      "+new text\n",
+                    ] + make_diff_header('A/D', 'working copy', 'working copy',
+                                         src_label, dst_label) + \
+                        make_diff_prop_header('A/D') + \
+                        make_diff_prop_added("newprop", "propval") + \
+                    make_diff_header('A/D/gamma', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + \
+                        make_diff_prop_header('A/D/gamma') + \
+                        make_diff_prop_added("newprop", "propval") + \
+                    make_diff_header('A/D/G/pi', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +0,0 @@\n",
+                      "-This is the file 'pi'.\n",
+                    ] + make_diff_prop_header('A/D/G/pi') + \
+                        make_diff_prop_added("newprop", "propval") + \
+                    make_diff_header('A/D/H/chi', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +0,0 @@\n",
+                      "-This is the file 'chi'.\n",
+                    ] + make_diff_header('A/D/H/omega', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +0,0 @@\n",
+                      "-This is the file 'omega'.\n",
+                    ] + make_diff_header('A/D/H/psi', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +0,0 @@\n",
+                      "-This is the file 'psi'.\n",
+                    ]
+                    
+  # Files in diff may be in any order.
+  expected_output = svntest.verify.UnorderedOutput(expected_output)
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'diff', '--old', wc_dir_old,
+                                     '--new', wc_dir)
 
 ########################################################################
 #Run the tests
@@ -3828,6 +3945,7 @@ test_list = [ None,
               diff_abs_localpath_from_wc_folder,
               no_spurious_conflict,
               diff_correct_wc_base_revnum,
+              diff_two_working_copies,
               ]
 
 if __name__ == '__main__':

Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/info_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/info_tests.py?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/info_tests.py Thu Apr 12 19:37:45 2012
@@ -27,7 +27,9 @@
 # See basic-tests.py for more svn info tests.
 
 # General modules
-import shutil, stat, re, os
+import shutil, stat, re, os, logging
+
+logger = logging.getLogger()
 
 # Our testing module
 import svntest
@@ -74,9 +76,9 @@ def verify_xml_elements(lines, exprs):
     str = str[m.end():] # skip xml version tag
   (unmatched_str, unmatched_exprs) = match_xml_element(str, exprs)
   if unmatched_exprs:
-    print("Failed to find the following expressions:")
+    logger.warn("Failed to find the following expressions:")
     for expr in unmatched_exprs:
-      print(expr)
+      logger.warn(expr)
     raise svntest.tree.SVNTreeUnequal
 
 def match_xml_element(str, exprs):
@@ -115,7 +117,7 @@ def match_xml_element(str, exprs):
     content_re = re.compile(content_re_str % name, re.DOTALL)
     m = content_re.match(str)
     if not m:
-      print("No XML end-tag for '%s' found in '%s...'" % (name, str[:100]))
+      logger.warn("No XML end-tag for '%s' found in '%s...'" % (name, str[:100]))
       raise(svntest.tree.SVNTreeUnequal)
     content = m.group('content')
     str = str[m.end():]
@@ -299,13 +301,13 @@ def info_wcroot_abspaths(sbox):
       target = "(UNKNOWN)"
 
     if path is None:
-      print "No WC root path for '%s'" % (target)
+      logger.warn("No WC root path for '%s'", target)
       raise svntest.Failure
 
     if path != wcroot_abspath:
-      print("For target '%s'..." % (target))
-      print("   Reported WC root path: %s" % (path))
-      print("   Expected WC root path: %s" % (wcroot_abspath))
+      logger.warn("For target '%s'...", target)
+      logger.warn("   Reported WC root path: %s", path)
+      logger.warn("   Expected WC root path: %s", wcroot_abspath)
       raise svntest.Failure
 
   sbox.build(read_only=True)

Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/stat_tests.py?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/stat_tests.py Thu Apr 12 19:37:45 2012
@@ -29,6 +29,9 @@ import os
 import re
 import time
 import datetime
+import logging
+
+logger = logging.getLogger()
 
 # Our testing module
 import svntest
@@ -644,7 +647,7 @@ def get_last_changed_date(path):
   for line in out:
     if re.match("^Last Changed Date", line):
       return line
-  print("Didn't find Last Changed Date for " + path)
+  logger.warn("Didn't find Last Changed Date for %s", path)
   raise svntest.Failure
 
 # Helper for timestamp_behaviour test
@@ -655,7 +658,7 @@ def get_text_timestamp(path):
   for line in out:
     if re.match("^Text Last Updated", line):
       return line
-  print("Didn't find text-time for " + path)
+  logger.warn("Didn't find text-time for %s", path)
   raise svntest.Failure
 
 # Helper for timestamp_behaviour test
@@ -789,9 +792,9 @@ use-commit-times = yes
       or fmt[23:25] != iota_ts[23:25]):
     # NOTE: the two strings below won't *exactly* match (see just above),
     #   but the *numeric* portions of them should.
-    print("File timestamp on 'iota' does not match.")
-    print("  EXPECTED: %s" % iota_ts)
-    print("    ACTUAL: %s" % fmt)
+    logger.warn("File timestamp on 'iota' does not match.")
+    logger.warn("  EXPECTED: %s", iota_ts)
+    logger.warn("    ACTUAL: %s", fmt)
     raise svntest.Failure
 
 #----------------------------------------------------------------------
@@ -1750,18 +1753,19 @@ def status_with_tree_conflicts(sbox):
       # check if the path should be a victim
       m = re.search('tree-conflicted="true"', entry)
       if (m is None) and should_be_victim[path]:
-        print("ERROR: expected '%s' to be a tree conflict victim." % path)
-        print("ACTUAL STATUS OUTPUT:")
-        print(output_str)
+        logger.warn("ERROR: expected '%s' to be a tree conflict victim.", path)
+        logger.warn("ACTUAL STATUS OUTPUT:")
+        logger.warn(output_str)
         raise svntest.Failure
       if m and not should_be_victim[path]:
-        print("ERROR: did NOT expect '%s' to be a tree conflict victim." % path)
-        print("ACTUAL STATUS OUTPUT:")
-        print(output_str)
+        logger.warn("ERROR: did NOT expect '%s' to be a tree conflict victim.",
+                    path)
+        logger.warn("ACTUAL STATUS OUTPUT:")
+        logger.warn(output_str)
         raise svntest.Failure
 
   if real_entry_count != len(should_be_victim):
-    print("ERROR: 'status --xml' output is incomplete.")
+    logger.warn("ERROR: 'status --xml' output is incomplete.")
     raise svntest.Failure
 
 

Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svnadmin_tests.py?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svnadmin_tests.py Thu Apr 12 19:37:45 2012
@@ -30,6 +30,9 @@ import re
 import shutil
 import sys
 import threading
+import logging
+
+logger = logging.getLogger()
 
 # Our testing module
 import svntest
@@ -458,7 +461,7 @@ def hotcopy_format(sbox):
                                                         sbox.repo_dir,
                                                         backup_dir)
   if errput:
-    print("Error: hotcopy failed")
+    logger.warn("Error: hotcopy failed")
     raise svntest.Failure
 
   # verify that the db/format files are the same
@@ -471,7 +474,7 @@ def hotcopy_format(sbox):
   fp2.close()
 
   if contents1 != contents2:
-    print("Error: db/format file contents do not match after hotcopy")
+    logger.warn("Error: db/format file contents do not match after hotcopy")
     raise svntest.Failure
 
 #----------------------------------------------------------------------
@@ -488,7 +491,7 @@ def setrevprop(sbox):
                                                         "--bypass-hooks",
                                                         iota_path)
   if errput:
-    print("Error: 'setlog' failed")
+    logger.warn("Error: 'setlog' failed")
     raise svntest.Failure
 
   # Verify that the revprop value matches what we set when retrieved
@@ -507,7 +510,7 @@ def setrevprop(sbox):
                                                         "-r0", "svn:author",
                                                         foo_path)
   if errput:
-    print("Error: 'setrevprop' failed")
+    logger.warn("Error: 'setrevprop' failed")
     raise svntest.Failure
 
   # Verify that the revprop value matches what we set when retrieved
@@ -860,7 +863,7 @@ def set_uuid(sbox):
     raise SVNUnexpectedStderr(errput)
   new_uuid = output[0].rstrip()
   if new_uuid == orig_uuid:
-    print("Error: new UUID matches the original one")
+    logger.warn("Error: new UUID matches the original one")
     raise svntest.Failure
 
   # Now, try setting the UUID back to the original value.
@@ -871,7 +874,7 @@ def set_uuid(sbox):
     raise SVNUnexpectedStderr(errput)
   new_uuid = output[0].rstrip()
   if new_uuid != orig_uuid:
-    print("Error: new UUID doesn't match the original one")
+    logger.warn("Error: new UUID doesn't match the original one")
     raise svntest.Failure
 
 #----------------------------------------------------------------------

Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svnlook_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svnlook_tests.py?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svnlook_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svnlook_tests.py Thu Apr 12 19:37:45 2012
@@ -25,7 +25,9 @@
 ######################################################################
 
 # General modules
-import re, os
+import re, os, logging
+
+logger = logging.getLogger()
 
 # Our testing module
 import svntest
@@ -56,9 +58,9 @@ def run_svnlook(*varargs):
 
 def expect(tag, expected, got):
   if expected != got:
-    print("When testing: %s" % tag)
-    print("Expected: %s" % expected)
-    print("     Got: %s" % got)
+    logger.warn("When testing: %s", tag)
+    logger.warn("Expected: %s", expected)
+    logger.warn("     Got: %s", got)
     raise svntest.Failure
 
 
@@ -165,7 +167,7 @@ def test_misc(sbox):
   # We cannot rely on svn:author's presence. ra_svn doesn't set it.
   if not (proplist == [ 'svn:author', 'svn:date', 'svn:log' ]
       or proplist == [ 'svn:date', 'svn:log' ]):
-    print("Unexpected result from proplist: %s" % proplist)
+    logger.warn("Unexpected result from proplist: %s", proplist)
     raise svntest.Failure
 
   prop_name = 'foo:bar-baz-quux'
@@ -415,12 +417,12 @@ def tree_non_recursive(sbox):
   treelist = run_svnlook('tree', '--non-recursive', repo_dir)
   for entry in treelist:
     if not entry.rstrip() in expected_results_root:
-      print("Unexpected result from tree with --non-recursive:")
-      print("  entry            : %s" % entry.rstrip())
+      logger.warn("Unexpected result from tree with --non-recursive:")
+      logger.warn("  entry            : %s", entry.rstrip())
       raise svntest.Failure
   if len(treelist) != len(expected_results_root):
-    print("Expected %i output entries, found %i"
-          % (len(expected_results_root), len(treelist)))
+    logger.warn("Expected %i output entries, found %i",
+          len(expected_results_root), len(treelist))
     raise svntest.Failure
 
   # check the output of svnlook --non-recursive on a
@@ -428,12 +430,12 @@ def tree_non_recursive(sbox):
   treelist = run_svnlook('tree', '--non-recursive', repo_dir, '/A/B')
   for entry in treelist:
     if not entry.rstrip() in expected_results_deep:
-      print("Unexpected result from tree with --non-recursive:")
-      print("  entry            : %s" % entry.rstrip())
+      logger.warn("Unexpected result from tree with --non-recursive:")
+      logger.warn("  entry            : %s", entry.rstrip())
       raise svntest.Failure
   if len(treelist) != len(expected_results_deep):
-    print("Expected %i output entries, found %i"
-          % (len(expected_results_deep), len(treelist)))
+    logger.warn("Expected %i output entries, found %i",
+          len(expected_results_deep), len(treelist))
     raise svntest.Failure
 
 #----------------------------------------------------------------------

Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/trans_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/trans_tests.py?rev=1325461&r1=1325460&r2=1325461&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/trans_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/trans_tests.py Thu Apr 12 19:37:45 2012
@@ -25,7 +25,9 @@
 ######################################################################
 
 # General modules
-import os, re
+import os, re, logging
+
+logger = logging.getLogger()
 
 # Our testing module
 import svntest
@@ -92,13 +94,13 @@ def check_keywords(actual_kw, expected_k
   """A Helper function to compare two keyword lists"""
 
   if len(actual_kw) != len(expected_kw):
-    print("Keyword lists are different by size")
+    logger.warn("Keyword lists are different by size")
     raise svntest.Failure
 
   for i in range(0,len(actual_kw)):
     if actual_kw[i] != expected_kw[i]:
-      print('%s item %s, Expected: %s' % (name, i, expected_kw[i][:-1]))
-      print('%s item %s, Got:      %s' % (name, i, actual_kw[i][:-1]))
+      logger.warn('%s item %s, Expected: %s', name, i, expected_kw[i][:-1])
+      logger.warn('%s item %s, Got:      %s', name, i, actual_kw[i][:-1])
       raise svntest.Failure
 
 def setup_working_copy(wc_dir, value_len):
@@ -304,7 +306,7 @@ def keywords_from_birth(sbox):
   if not ((len(lines) == 1)
           and (re.match("\$URL: (http|https|file|svn|svn\\+ssh)://",
                         lines[0]))):
-    print("URL expansion failed for %s" % url_unexp_path)
+    logger.warn("URL expansion failed for %s", url_unexp_path)
     raise svntest.Failure
   fp.close()
 
@@ -314,7 +316,7 @@ def keywords_from_birth(sbox):
   if not ((len(lines) == 1)
           and (re.match("\$URL: (http|https|file|svn|svn\\+ssh)://",
                         lines[0]))):
-    print("URL expansion failed for %s" % url_exp_path)
+    logger.warn("URL expansion failed for %s", url_exp_path)
     raise svntest.Failure
   fp.close()
 
@@ -323,7 +325,7 @@ def keywords_from_birth(sbox):
   lines = fp.readlines()
   if not ((len(lines) == 1)
           and (re.match("\$Id: id_unexp", lines[0]))):
-    print("Id expansion failed for %s" % id_exp_path)
+    logger.warn("Id expansion failed for %s", id_exp_path)
     raise svntest.Failure
   fp.close()
 
@@ -332,7 +334,7 @@ def keywords_from_birth(sbox):
   lines = fp.readlines()
   if not ((len(lines) == 1)
           and (re.match("\$Id: id_exp", lines[0]))):
-    print("Id expansion failed for %s" % id_exp_path)
+    logger.warn("Id expansion failed for %s", id_exp_path)
     raise svntest.Failure
   fp.close()
 
@@ -342,7 +344,7 @@ def keywords_from_birth(sbox):
   if not ((len(lines) == 1)
           and (re.match("\$Header: (https?|file|svn|svn\\+ssh)://.* jrandom",
                         lines[0]))):
-    print("Header expansion failed for %s" % header_unexp_path)
+    logger.warn("Header expansion failed for %s", header_unexp_path)
     raise svntest.Failure
   fp.close()
 
@@ -352,7 +354,7 @@ def keywords_from_birth(sbox):
   if not ((len(lines) == 1)
           and (re.match("\$Header: (https?|file|svn|svn\\+ssh)://.* jrandom",
                         lines[0]))):
-    print("Header expansion failed for %s" % header_exp_path)
+    logger.warn("Header expansion failed for %s", header_exp_path)
     raise svntest.Failure
   fp.close()
 
@@ -401,7 +403,7 @@ def keywords_from_birth(sbox):
   lines = fp.readlines()
   if not ((len(lines) == 1)
           and (re.match("\$Id: .*id with space", lines[0]))):
-    print("Id expansion failed for %s" % id_with_space_path)
+    logger.warn("Id expansion failed for %s", id_with_space_path)
     raise svntest.Failure
   fp.close()
 
@@ -411,7 +413,7 @@ def keywords_from_birth(sbox):
   if not ((len(lines) == 1)
           and (re.match("\$Id: .*id_exp with_\$_sign [^$]* jrandom \$",
                         lines[0]))):
-    print("Id expansion failed for %s" % id_exp_with_dollar_path)
+    logger.warn("Id expansion failed for %s", id_exp_with_dollar_path)
 
     raise svntest.Failure
   fp.close()
@@ -627,7 +629,7 @@ def keyword_expanded_on_checkout(sbox):
   if not ((len(lines) == 1)
           and (re.match("\$URL: (http|https|file|svn|svn\\+ssh)://",
                         lines[0]))):
-    print("URL expansion failed for %s" % other_url_path)
+    logger.warn("URL expansion failed for %s", other_url_path)
     raise svntest.Failure
   fp.close()
 
@@ -764,7 +766,7 @@ def propset_commit_checkout_nocrash(sbox
 
   mu_other_contents = open(mu_other_path).read()
   if mu_other_contents != "This is the file 'mu'.\n$Rev: 3 $":
-    print("'%s' does not have the expected contents" % mu_other_path)
+    logger.warn("'%s' does not have the expected contents", mu_other_path)
     raise svntest.Failure
 
 
@@ -878,7 +880,7 @@ def props_only_file_update(sbox):
     temps.remove('prop-base')
     temps.remove('props')
   if temps:
-    print('Temporary files leftover: %s' % (', '.join(temps),))
+    logger.warn('Temporary files leftover: %s', (', '.join(temps),))
     raise svntest.Failure
 
 



Mime
View raw message