subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1232025 [4/5] - in /subversion/branches/moves-scan-log: ./ notes/ notes/http-and-webdav/ subversion/bindings/swig/ruby/svn/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ subversion/libsv...
Date Mon, 16 Jan 2012 15:24:11 GMT
Modified: subversion/branches/moves-scan-log/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_repos/dump.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_repos/dump.c Mon Jan 16 15:24:08 2012
@@ -105,6 +105,9 @@ struct edit_baton
   svn_fs_root_t *fs_root;
   svn_revnum_t current_rev;
 
+  /* The fs, so we can grab historic information if needed. */
+  svn_fs_t *fs;
+
   /* True if dumped nodes should output deltas instead of full text. */
   svn_boolean_t use_deltas;
 
@@ -114,13 +117,13 @@ struct edit_baton
   /* The first revision dumped in this dumpstream. */
   svn_revnum_t oldest_dumped_rev;
 
-  /* Set to true if any references to revisions older than
+  /* If not NULL, set to true if any references to revisions older than
      OLDEST_DUMPED_REV were found in the dumpstream. */
-  svn_boolean_t found_old_reference;
+  svn_boolean_t *found_old_reference;
 
-  /* Set to true if any mergeinfo was dumped which contains revisions
-     older than OLDEST_DUMPED_REV. */
-  svn_boolean_t found_old_mergeinfo;
+  /* If not NULL, set to true if any mergeinfo was dumped which contains
+     revisions older than OLDEST_DUMPED_REV. */
+  svn_boolean_t *found_old_mergeinfo;
 
   /* reusable buffer for writing file contents */
   char buffer[SVN__STREAM_CHUNK_SIZE];
@@ -389,7 +392,8 @@ dump_node(struct edit_baton *eb,
                        " into an empty repository"
                        " will fail."),
                      cmp_rev, eb->oldest_dumped_rev);
-              eb->found_old_reference = TRUE;
+              if (eb->found_old_reference)
+                *eb->found_old_reference = TRUE;
               eb->notify_func(eb->notify_baton, notify, pool);
             }
 
@@ -494,7 +498,8 @@ dump_node(struct edit_baton *eb,
                       "mergeinfo."),
                     eb->oldest_dumped_rev);
 
-                  eb->found_old_mergeinfo = TRUE;
+                  if (eb->found_old_mergeinfo)
+                    *eb->found_old_mergeinfo = TRUE;
                   eb->notify_func(eb->notify_baton, notify, pool);
                 }
             }
@@ -850,9 +855,57 @@ change_dir_prop(void *parent_baton,
 }
 
 static svn_error_t *
+fetch_props_func(apr_hash_t **props,
+                 void *baton,
+                 const char *path,
+                 svn_revnum_t base_revision,
+                 apr_pool_t *result_pool,
+                 apr_pool_t *scratch_pool)
+{
+  struct edit_baton *eb = baton;
+  svn_error_t *err;
+
+  err = svn_fs_node_proplist(props, eb->fs_root, path, result_pool);
+  if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
+    {
+      svn_error_clear(err);
+      *props = apr_hash_make(result_pool);
+      return SVN_NO_ERROR;
+    }
+  else if (err)
+    return svn_error_trace(err);
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_kind_func(svn_kind_t *kind,
+                void *baton,
+                const char *path,
+                svn_revnum_t base_revision,
+                apr_pool_t *scratch_pool)
+{
+  struct edit_baton *eb = baton;
+  svn_node_kind_t node_kind;
+  svn_fs_root_t *fs_root;
+
+  if (!SVN_IS_VALID_REVNUM(base_revision))
+    fs_root = eb->fs_root;
+  else
+    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));
+  *kind = svn__kind_from_node_kind(node_kind, FALSE);
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
 fetch_base_func(const char **filename,
                 void *baton,
                 const char *path,
+                svn_revnum_t base_revision,
                 apr_pool_t *result_pool,
                 apr_pool_t *scratch_pool)
 {
@@ -861,8 +914,15 @@ fetch_base_func(const char **filename,
   svn_stream_t *file_stream;
   const char *tmp_filename;
   svn_error_t *err;
+  svn_fs_root_t *fs_root;
+
+  if (!SVN_IS_VALID_REVNUM(base_revision))
+    fs_root = eb->fs_root;
+  else
+    SVN_ERR(svn_fs_revision_root(&fs_root, eb->fs, base_revision,
+                                 scratch_pool));
 
-  err = svn_fs_file_contents(&contents, eb->fs_root, path, scratch_pool);
+  err = svn_fs_file_contents(&contents, fs_root, path, scratch_pool);
   if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
     {
       svn_error_clear(err);
@@ -889,6 +949,10 @@ get_dump_editor(const svn_delta_editor_t
                 svn_revnum_t to_rev,
                 const char *root_path,
                 svn_stream_t *stream,
+                svn_boolean_t *found_old_reference,
+                svn_boolean_t *found_old_mergeinfo,
+                svn_error_t *(*custom_close_directory)(void *dir_baton,
+                                  apr_pool_t *scratch_pool),
                 svn_repos_notify_func_t notify_func,
                 void *notify_baton,
                 svn_revnum_t oldest_dumped_rev,
@@ -912,16 +976,22 @@ get_dump_editor(const svn_delta_editor_t
   eb->bufsize = sizeof(eb->buffer);
   eb->path = apr_pstrdup(pool, root_path);
   SVN_ERR(svn_fs_revision_root(&(eb->fs_root), fs, to_rev, pool));
+  eb->fs = fs;
   eb->current_rev = to_rev;
   eb->use_deltas = use_deltas;
   eb->verify = verify;
+  eb->found_old_reference = found_old_reference;
+  eb->found_old_mergeinfo = found_old_mergeinfo;
 
   /* Set up the editor. */
   dump_editor->open_root = open_root;
   dump_editor->delete_entry = delete_entry;
   dump_editor->add_directory = add_directory;
   dump_editor->open_directory = open_directory;
-  dump_editor->close_directory = close_directory;
+  if (custom_close_directory)
+    dump_editor->close_directory = custom_close_directory;
+  else
+    dump_editor->close_directory = close_directory;
   dump_editor->change_dir_prop = change_dir_prop;
   dump_editor->add_file = add_file;
   dump_editor->open_file = open_file;
@@ -929,8 +999,10 @@ get_dump_editor(const svn_delta_editor_t
   *edit_baton = eb;
   *editor = dump_editor;
 
+  shim_callbacks->fetch_kind_func = fetch_kind_func;
+  shim_callbacks->fetch_props_func = fetch_props_func;
   shim_callbacks->fetch_base_func = fetch_base_func;
-  shim_callbacks->fetch_base_baton = eb;
+  shim_callbacks->fetch_baton = eb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks, pool, pool));
@@ -1132,7 +1204,9 @@ svn_repos_dump_fs3(svn_repos_t *repos,
          non-incremental dump. */
       use_deltas_for_rev = use_deltas && (incremental || i != start_rev);
       SVN_ERR(get_dump_editor(&dump_editor, &dump_edit_baton, fs, to_rev,
-                              "", stream, notify_func, notify_baton,
+                              "", stream, &found_old_reference,
+                              &found_old_mergeinfo, NULL,
+                              notify_func, notify_baton,
                               start_rev, use_deltas_for_rev, FALSE, subpool));
 
       /* Drive the editor in one way or another. */
@@ -1161,11 +1235,11 @@ svn_repos_dump_fs3(svn_repos_t *repos,
           SVN_ERR(svn_repos_replay2(to_root, "", SVN_INVALID_REVNUM, FALSE,
                                     dump_editor, dump_edit_baton,
                                     NULL, NULL, subpool));
-        }
 
-      /* While our editor close_edit implementation is a no-op, we still
-         do this for completeness. */
-      SVN_ERR(dump_editor->close_edit(dump_edit_baton, subpool));
+          /* While our editor close_edit implementation is a no-op, we still
+             do this for completeness. */
+          SVN_ERR(dump_editor->close_edit(dump_edit_baton, subpool));
+        }
 
     loop_end:
       if (notify_func)
@@ -1173,14 +1247,6 @@ svn_repos_dump_fs3(svn_repos_t *repos,
           notify->revision = to_rev;
           notify_func(notify_baton, notify, subpool);
         }
-
-      if (dump_edit_baton) /* We never get an edit baton for r0. */
-        {
-          if (((struct edit_baton *)dump_edit_baton)->found_old_reference)
-            found_old_reference = TRUE;
-          if (((struct edit_baton *)dump_edit_baton)->found_old_mergeinfo)
-            found_old_mergeinfo = TRUE;
-        }
     }
 
   if (notify_func)
@@ -1350,11 +1416,12 @@ svn_repos_verify_fs2(svn_repos_t *repos,
       SVN_ERR(get_dump_editor((const svn_delta_editor_t **)&dump_editor,
                               &dump_edit_baton, fs, rev, "",
                               svn_stream_empty(pool),
+                              NULL, NULL,
+                              verify_close_directory,
                               notify_func, notify_baton,
                               start_rev,
                               FALSE, TRUE, /* use_deltas, verify */
                               iterpool));
-      dump_editor->close_directory = verify_close_directory;
       SVN_ERR(svn_delta_get_cancellation_editor(cancel_func, cancel_baton,
                                                 dump_editor, dump_edit_baton,
                                                 &cancel_editor,

Modified: subversion/branches/moves-scan-log/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_subr/config_file.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_subr/config_file.c Mon Jan 16 15:24:08 2012
@@ -766,16 +766,20 @@ svn_config_ensure(const char *config_dir
         "###                              to authenticate against a"         NL
         "###                              Subversion server may be cached"   NL
         "###                              to disk in any way."               NL
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "###   store-plaintext-passwords  Specifies whether passwords may"   NL
         "###                              be cached on disk unencrypted."    NL
+#endif
         "###   store-ssl-client-cert-pp   Specifies whether passphrase used" NL
         "###                              to authenticate against a client"  NL
         "###                              certificate may be cached to disk" NL
         "###                              in any way"                        NL
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "###   store-ssl-client-cert-pp-plaintext"                           NL
         "###                              Specifies whether client cert"     NL
         "###                              passphrases may be cached on disk" NL
         "###                              unencrypted (i.e., as plaintext)." NL
+#endif
         "###   store-auth-creds           Specifies whether any auth info"   NL
         "###                              (passwords as well as server certs)"
                                                                              NL
@@ -783,15 +787,14 @@ svn_config_ensure(const char *config_dir
         "###   username                   Specifies the default username."   NL
         "###"                                                                NL
         "### Set store-passwords to 'no' to avoid storing passwords on disk" NL
-        "### in any way, including in password stores. It defaults to 'yes',"
-                                                                             NL
-        "### but Subversion will never save your password to disk in plaintext"
-                                                                             NL
-        "### unless you tell it to."                                         NL
+        "### in any way, including in password stores.  It defaults to"      NL
+        "### 'yes', but Subversion will never save your password to disk in" NL
+        "### plaintext unless explicitly configured to do so."               NL
         "### Note that this option only prevents saving of *new* passwords;" NL
         "### it doesn't invalidate existing passwords.  (To do that, remove" NL
         "### the cache files by hand as described in the Subversion book.)"  NL
         "###"                                                                NL
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "### Set store-plaintext-passwords to 'no' to avoid storing"         NL
         "### passwords in unencrypted form in the auth/ area of your config" NL
         "### directory. Set it to 'yes' to allow Subversion to store"        NL
@@ -801,11 +804,12 @@ svn_config_ensure(const char *config_dir
         "### this option has no effect if either 'store-passwords' or "      NL
         "### 'store-auth-creds' is set to 'no'."                             NL
         "###"                                                                NL
+#endif
         "### Set store-ssl-client-cert-pp to 'no' to avoid storing ssl"      NL
         "### client certificate passphrases in the auth/ area of your"       NL
         "### config directory.  It defaults to 'yes', but Subversion will"   NL
-        "### never save your passphrase to disk in plaintext unless you tell"NL
-        "### it to via 'store-ssl-client-cert-pp-plaintext' (see below)."    NL
+        "### never save your passphrase to disk in plaintext unless"         NL
+        "### explicitly configured to do so."                                NL
         "###"                                                                NL
         "### Note store-ssl-client-cert-pp only prevents the saving of *new*"NL
         "### passphrases; it doesn't invalidate existing passphrases.  To do"NL
@@ -814,6 +818,7 @@ svn_config_ensure(const char *config_dir
         "###                    svn.serverconfig.netmodel.html\\"            NL
         "###                    #svn.serverconfig.netmodel.credcache"        NL
         "###"                                                                NL
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "### Set store-ssl-client-cert-pp-plaintext to 'no' to avoid storing"NL
         "### passphrases in unencrypted form in the auth/ area of your"      NL
         "### config directory.  Set it to 'yes' to allow Subversion to"      NL
@@ -823,6 +828,7 @@ svn_config_ensure(const char *config_dir
         "### this option has no effect if either 'store-auth-creds' or "     NL
         "### 'store-ssl-client-cert-pp' is set to 'no'."                     NL
         "###"                                                                NL
+#endif
         "### Set store-auth-creds to 'no' to avoid storing any Subversion"   NL
         "### credentials in the auth/ area of your config directory."        NL
         "### Note that this includes SSL server certificates."               NL
@@ -858,7 +864,9 @@ svn_config_ensure(const char *config_dir
         "# http-auth-types = basic;digest;negotiate"                         NL
 #endif
         "# neon-debug-mask = 130"                                            NL
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "# store-plaintext-passwords = no"                                   NL
+#endif
         "# username = harry"                                                 NL
         ""                                                                   NL
         "### Information for the second group:"                              NL
@@ -904,9 +912,12 @@ svn_config_ensure(const char *config_dir
         "#"                                                                  NL
         "# Password / passphrase caching parameters:"                        NL
         "# store-passwords = no"                                             NL
-        "# store-plaintext-passwords = no"                                   NL
         "# store-ssl-client-cert-pp = no"                                    NL
-        "# store-ssl-client-cert-pp-plaintext = no"                          NL;
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
+        "# store-plaintext-passwords = no"                                   NL
+        "# store-ssl-client-cert-pp-plaintext = no"                          NL
+#endif
+        ;
 
       err = svn_io_file_open(&f, path,
                              (APR_WRITE | APR_CREATE | APR_EXCL),

Modified: subversion/branches/moves-scan-log/subversion/libsvn_subr/debug.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_subr/debug.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_subr/debug.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_subr/debug.c Mon Jan 16 15:24:08 2012
@@ -29,9 +29,6 @@
 #include "svn_types.h"
 #include "svn_string.h"
 
-/* We only build this code if SVN_DEBUG is defined. */
-#ifdef SVN_DEBUG
-
 #include "private/svn_debug.h"
 
 
@@ -98,6 +95,9 @@ svn_dbg__print_props(apr_hash_t *props,
                      const char *header_fmt,
                      ...)
 {
+/* We only build this code if SVN_DEBUG is defined. */
+#ifdef SVN_DEBUG
+
   apr_hash_index_t *hi;
   va_list ap;
 
@@ -105,6 +105,12 @@ svn_dbg__print_props(apr_hash_t *props,
   print_line(header_fmt, ap);
   va_end(ap);
 
+  if (props == NULL)
+    {
+      SVN_DBG(("    (null)\n"));
+      return;
+    }
+
   for (hi = apr_hash_first(apr_hash_pool_get(props), props); hi;
         hi = apr_hash_next(hi))
     {
@@ -113,6 +119,6 @@ svn_dbg__print_props(apr_hash_t *props,
 
       SVN_DBG(("    '%s' -> '%s'\n", name, val->data));
     }
+#endif /* SVN_DEBUG */
 }
 
-#endif

Modified: subversion/branches/moves-scan-log/subversion/libsvn_subr/gpg_agent.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_subr/gpg_agent.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_subr/gpg_agent.c Mon Jan 16 15:24:08 2012
@@ -378,8 +378,12 @@ password_get_gpg_agent(const char **pass
 }
 
 
-/* Implementation of svn_auth__password_set_t that stores the password in
-   GPG Agent. */
+/* Implementation of svn_auth__password_set_t that would store the
+   password in GPG Agent if that's how this particular integration
+   worked.  But it isn't.  GPG Agent stores the password provided by
+   the user via the pinentry program immediately upon its provision
+   (and regardless of its accuracy as passwords go), so there's
+   nothing really to do here.  */
 static svn_boolean_t
 password_set_gpg_agent(apr_hash_t *creds,
                        const char *realmstring,

Modified: subversion/branches/moves-scan-log/subversion/libsvn_subr/simple_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_subr/simple_providers.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_subr/simple_providers.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_subr/simple_providers.c Mon Jan 16 15:24:08 2012
@@ -314,15 +314,9 @@ svn_auth__simple_save_creds_helper(svn_b
     apr_hash_get(parameters,
                  SVN_AUTH_PARAM_DONT_STORE_PASSWORDS,
                  APR_HASH_KEY_STRING) != NULL;
-  const char *store_plaintext_passwords =
-    apr_hash_get(parameters,
-                 SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS,
-                 APR_HASH_KEY_STRING);
   svn_boolean_t non_interactive = apr_hash_get(parameters,
                                                SVN_AUTH_PARAM_NON_INTERACTIVE,
                                                APR_HASH_KEY_STRING) != NULL;
-  simple_provider_baton_t *b = (simple_provider_baton_t *)provider_baton;
-
   svn_boolean_t no_auth_cache =
     (! creds->may_save) || (apr_hash_get(parameters,
                                          SVN_AUTH_PARAM_NO_AUTH_CACHE,
@@ -365,6 +359,16 @@ svn_auth__simple_save_creds_helper(svn_b
         }
       else
         {
+#ifdef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
+          may_save_password = FALSE;
+#else
+          const char *store_plaintext_passwords =
+            apr_hash_get(parameters,
+                         SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS,
+                         APR_HASH_KEY_STRING);
+          simple_provider_baton_t *b =
+            (simple_provider_baton_t *)provider_baton;
+
           if (svn_cstring_casecmp(store_plaintext_passwords,
                                   SVN_CONFIG_ASK) == 0)
             {
@@ -449,6 +453,7 @@ svn_auth__simple_save_creds_helper(svn_b
                 store_plaintext_passwords,
                 SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS);
             }
+#endif
         }
 
       if (may_save_password)

Modified: subversion/branches/moves-scan-log/subversion/libsvn_subr/ssl_client_cert_pw_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_subr/ssl_client_cert_pw_providers.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_subr/ssl_client_cert_pw_providers.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_subr/ssl_client_cert_pw_providers.c Mon Jan 16 15:24:08 2012
@@ -176,16 +176,9 @@ svn_auth__ssl_client_cert_pw_file_save_c
     apr_hash_get(parameters,
                  SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP,
                  APR_HASH_KEY_STRING) != NULL;
-  const char *store_ssl_client_cert_pp_plaintext =
-    apr_hash_get(parameters,
-                 SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
-                 APR_HASH_KEY_STRING);
   svn_boolean_t non_interactive = apr_hash_get(parameters,
                                                SVN_AUTH_PARAM_NON_INTERACTIVE,
                                                APR_HASH_KEY_STRING) != NULL;
-  ssl_client_cert_pw_file_provider_baton_t *b =
-    (ssl_client_cert_pw_file_provider_baton_t *)provider_baton;
-
   svn_boolean_t no_auth_cache =
     (! creds->may_save) || (apr_hash_get(parameters,
                                          SVN_AUTH_PARAM_NO_AUTH_CACHE,
@@ -219,6 +212,16 @@ svn_auth__ssl_client_cert_pw_file_save_c
         }
       else
         {
+#ifdef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
+          may_save_passphrase = FALSE;
+#else
+          const char *store_ssl_client_cert_pp_plaintext =
+            apr_hash_get(parameters,
+                         SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
+                         APR_HASH_KEY_STRING);
+          ssl_client_cert_pw_file_provider_baton_t *b =
+            (ssl_client_cert_pw_file_provider_baton_t *)provider_baton;
+
           if (svn_cstring_casecmp(store_ssl_client_cert_pp_plaintext,
                                   SVN_CONFIG_ASK) == 0)
             {
@@ -297,6 +300,7 @@ svn_auth__ssl_client_cert_pw_file_save_c
                 store_ssl_client_cert_pp_plaintext,
                 SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT);
             }
+#endif
         }
 
       if (may_save_passphrase)

Modified: subversion/branches/moves-scan-log/subversion/libsvn_subr/svn_string.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_subr/svn_string.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_subr/svn_string.c Mon Jan 16 15:24:08 2012
@@ -724,6 +724,10 @@ svn_cstring_tokenize(const char *sep, ch
     const char * next;
     char csep;
 
+    /* check parameters */
+    if ((sep == NULL) || (str == NULL) || (*str == NULL))
+        return NULL;
+
     /* let APR handle edge cases and multiple separators */
     csep = *sep;
     if (csep == '\0' || sep[1] != '\0')

Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/adm_ops.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/adm_ops.c Mon Jan 16 15:24:08 2012
@@ -1460,11 +1460,11 @@ remove_conflict_file(svn_boolean_t *noti
 static int
 compare_revert_list_copied_children(const void *a, const void *b)
 {
-  const svn_wc__db_revert_list_copied_child_info_t *ca = a;
-  const svn_wc__db_revert_list_copied_child_info_t *cb = b;
+  const svn_wc__db_revert_list_copied_child_info_t * const *ca = a;
+  const svn_wc__db_revert_list_copied_child_info_t * const *cb = b;
   int i;
 
-  i = svn_path_compare_paths(ca->abspath, cb->abspath);
+  i = svn_path_compare_paths(ca[0]->abspath, cb[0]->abspath);
 
   /* Reverse the result of svn_path_compare_paths() to achieve
    * descending order. */

Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/diff_editor.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/diff_editor.c Mon Jan 16 15:24:08 2012
@@ -1880,6 +1880,7 @@ svn_wc_get_diff_editor6(const svn_delta_
   void *inner_baton;
   svn_delta_editor_t *tree_editor;
   const svn_delta_editor_t *inner_editor;
+  struct svn_wc__shim_fetch_baton_t *sfb;
   svn_delta_shim_callbacks_t *shim_callbacks =
                                 svn_delta_shim_callbacks_default(result_pool);
 
@@ -1933,6 +1934,17 @@ svn_wc_get_diff_editor6(const svn_delta_
                                             edit_baton,
                                             result_pool));
 
+  sfb = apr_palloc(result_pool, sizeof(*sfb));
+  sfb->db = wc_ctx->db;
+  sfb->base_abspath = eb->anchor_abspath;
+  sfb->fetch_base = FALSE;
+
+  shim_callbacks->fetch_kind_func = svn_wc__fetch_kind_func;
+  shim_callbacks->fetch_props_func = svn_wc__fetch_props_func;
+  shim_callbacks->fetch_base_func = svn_wc__fetch_base_func;
+  shim_callbacks->fetch_baton = sfb;
+
+
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks, result_pool, scratch_pool));
 

Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/externals.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/externals.c Mon Jan 16 15:24:08 2012
@@ -621,8 +621,13 @@ close_file(void *file_baton,
       {
         new_checksum = eb->original_checksum;
 
-        SVN_ERR(svn_wc__db_base_get_props(&actual_props, eb->db,
-                                          eb->local_abspath, pool, pool));
+        if (eb->had_props)
+          SVN_ERR(svn_wc__db_base_get_props(&base_props, eb->db,
+                                            eb->local_abspath,
+                                            pool, pool));
+
+        SVN_ERR(svn_wc__db_read_props(&actual_props, eb->db,
+                                      eb->local_abspath, pool, pool));
       }
 
     if (!base_props)
@@ -1138,7 +1143,7 @@ is_external_rolled_out(svn_boolean_t *is
   err = svn_wc__node_get_origin(NULL, NULL,
                                 &x_repos_relpath,
                                 &x_repos_root_url,
-                                NULL,
+                                NULL, NULL,
                                 wc_ctx, xinfo->local_abspath,
                                 FALSE, /* scan_deleted */
                                 scratch_pool, scratch_pool);

Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/info.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/info.c Mon Jan 16 15:24:08 2012
@@ -182,7 +182,7 @@ build_info_for_node(svn_wc__info2_t **in
           SVN_ERR(svn_wc__internal_get_origin(NULL, &tmpinfo->rev,
                                               &repos_relpath,
                                               &tmpinfo->repos_root_URL,
-                                              &tmpinfo->repos_UUID,
+                                              &tmpinfo->repos_UUID, NULL,
                                               db, local_abspath, TRUE,
                                               result_pool, scratch_pool));
         }

Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/node.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/node.c Mon Jan 16 15:24:08 2012
@@ -1349,6 +1349,7 @@ svn_wc__internal_get_origin(svn_boolean_
                             const char **repos_relpath,
                             const char **repos_root_url,
                             const char **repos_uuid,
+                            const char **copy_root_abspath,
                             svn_wc__db_t *db,
                             const char *local_abspath,
                             svn_boolean_t scan_deleted,
@@ -1399,7 +1400,8 @@ svn_wc__internal_get_origin(svn_boolean_
       if (repos_uuid)
         *repos_uuid = original_repos_uuid;
 
-      return SVN_NO_ERROR;
+      if (copy_root_abspath == NULL)
+        return SVN_NO_ERROR;
     }
 
   {
@@ -1428,13 +1430,19 @@ svn_wc__internal_get_origin(svn_boolean_
                                          result_pool, scratch_pool));
 
         if (status == svn_wc__db_status_added)
-          return SVN_NO_ERROR; /* Local addition */
+          {
+            if (is_copy)
+              *is_copy = FALSE;
+            return SVN_NO_ERROR; /* Local addition */
+          }
 
         *repos_relpath = svn_relpath_join(
                                 original_repos_relpath,
                                 svn_dirent_skip_ancestor(op_root_abspath,
                                                          local_abspath),
                                 result_pool);
+        if (copy_root_abspath)
+          *copy_root_abspath = op_root_abspath;
       }
     else /* Deleted, excluded, not-present, server-excluded, ... */
       {
@@ -1459,6 +1467,7 @@ svn_wc__node_get_origin(svn_boolean_t *i
                         const char **repos_relpath,
                         const char **repos_root_url,
                         const char **repos_uuid,
+                        const char **copy_root_abspath,
                         svn_wc_context_t *wc_ctx,
                         const char *local_abspath,
                         svn_boolean_t scan_deleted,
@@ -1467,6 +1476,7 @@ svn_wc__node_get_origin(svn_boolean_t *i
 {
   return svn_error_trace(svn_wc__internal_get_origin(is_copy, revision,
                            repos_relpath, repos_root_url, repos_uuid,
+                           copy_root_abspath,
                            wc_ctx->db, local_abspath, scan_deleted,
                            result_pool, scratch_pool));
 }

Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/status.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/status.c Mon Jan 16 15:24:08 2012
@@ -1649,7 +1649,7 @@ tweak_statushash(void *baton,
   return SVN_NO_ERROR;
 }
 
-/* Returns the URL for DB, or NULL: */
+/* Returns the URL for DB */
 static const char *
 find_dir_repos_relpath(const struct dir_baton *db, apr_pool_t *pool)
 {
@@ -1666,14 +1666,11 @@ find_dir_repos_relpath(const struct dir_
       /* Note that status->repos_relpath could be NULL in the case of a missing
        * directory, which means we need to recurse up another level to get
        * a useful relpath. */
-      if (status)
+      if (status && status->repos_relpath)
         return status->repos_relpath;
 
       repos_relpath = find_dir_repos_relpath(pb, pool);
-      if (repos_relpath)
-        return svn_relpath_join(repos_relpath, db->name, pool);
-      else
-        return NULL;
+      return svn_relpath_join(repos_relpath, db->name, pool);
     }
 }
 
@@ -2369,19 +2366,15 @@ close_file(void *file_baton,
           const char *dir_repos_relpath = find_dir_repos_relpath(fb->dir_baton,
                                                                  pool);
 
-          if (dir_repos_relpath)
-            {
-              /* repos_lock still uses the deprecated filesystem absolute path
-                 format */
-
-              const char *repos_relpath = svn_relpath_join(dir_repos_relpath,
-                                                           fb->name, pool);
-
-              repos_lock = apr_hash_get(fb->edit_baton->wb.repos_locks,
-                                        svn_fspath__join("/", repos_relpath,
-                                                         pool),
-                                        APR_HASH_KEY_STRING);
-            }
+          /* repos_lock still uses the deprecated filesystem absolute path
+             format */
+          const char *repos_relpath = svn_relpath_join(dir_repos_relpath,
+                                                       fb->name, pool);
+
+          repos_lock = apr_hash_get(fb->edit_baton->wb.repos_locks,
+                                    svn_fspath__join("/", repos_relpath,
+                                                     pool),
+                                    APR_HASH_KEY_STRING);
         }
     }
   else
@@ -2548,15 +2541,13 @@ svn_wc_get_status_editor5(const svn_delt
 
   sfb = apr_palloc(result_pool, sizeof(*sfb));
   sfb->db = wc_ctx->db;
-  sfb->base_abspath = eb->target_abspath;
+  sfb->base_abspath = eb->anchor_abspath;
   sfb->fetch_base = FALSE;
 
   shim_callbacks->fetch_kind_func = svn_wc__fetch_kind_func;
-  shim_callbacks->fetch_kind_baton = sfb;
   shim_callbacks->fetch_props_func = svn_wc__fetch_props_func;
-  shim_callbacks->fetch_props_baton = sfb;
   shim_callbacks->fetch_base_func = svn_wc__fetch_base_func;
-  shim_callbacks->fetch_base_baton = sfb;
+  shim_callbacks->fetch_baton = sfb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks,

Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/update_editor.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/update_editor.c Mon Jan 16 15:24:08 2012
@@ -5081,6 +5081,46 @@ close_edit(void *edit_baton,
 }
 
 
+static svn_error_t *
+fetch_props_func(apr_hash_t **props,
+                 void *baton,
+                 const char *path,
+                 svn_revnum_t base_revision,
+                 apr_pool_t *result_pool,
+                 apr_pool_t *scratch_pool)
+{
+  struct svn_wc__shim_fetch_baton_t *sfb = baton;
+  const char *local_abspath = svn_dirent_join(sfb->base_abspath, path,
+                                              scratch_pool);
+  svn_error_t *err;
+
+  if (sfb->fetch_base)
+    err = svn_wc__db_base_get_props(props, sfb->db, local_abspath, result_pool,
+                                    scratch_pool);
+  else
+    err = svn_wc__db_read_props(props, sfb->db, local_abspath,
+                                result_pool, scratch_pool);
+
+  /* If the path doesn't exist, just return an empty set of props. */
+  if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+    {
+      svn_error_clear(err);
+      *props = apr_hash_make(result_pool);
+    }
+  else if (err)
+    return svn_error_trace(err);
+
+  /* Add a bogus LOCK_TOKEN if we don't already have one, so as to catch
+     any deletions thereto. */
+  if (!apr_hash_get(*props, SVN_PROP_ENTRY_LOCK_TOKEN, APR_HASH_KEY_STRING))
+    {
+      apr_hash_set(*props, SVN_PROP_ENTRY_LOCK_TOKEN, APR_HASH_KEY_STRING,
+                   svn_string_create("This is completely bogus", result_pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 
 /*** Returning editors. ***/
 
@@ -5358,15 +5398,13 @@ make_editor(svn_revnum_t *target_revisio
 
   sfb = apr_palloc(result_pool, sizeof(*sfb));
   sfb->db = db;
-  sfb->base_abspath = eb->target_abspath;
+  sfb->base_abspath = eb->anchor_abspath;
   sfb->fetch_base = TRUE;
 
   shim_callbacks->fetch_kind_func = svn_wc__fetch_kind_func;
-  shim_callbacks->fetch_kind_baton = sfb;
-  shim_callbacks->fetch_props_func = svn_wc__fetch_props_func;
-  shim_callbacks->fetch_props_baton = sfb;
+  shim_callbacks->fetch_props_func = fetch_props_func;
   shim_callbacks->fetch_base_func = svn_wc__fetch_base_func;
-  shim_callbacks->fetch_base_baton = sfb;
+  shim_callbacks->fetch_baton = sfb;
 
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks, result_pool, scratch_pool));

Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/util.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/util.c Mon Jan 16 15:24:08 2012
@@ -542,6 +542,7 @@ svn_error_t *
 svn_wc__fetch_kind_func(svn_kind_t *kind,
                         void *baton,
                         const char *path,
+                        svn_revnum_t base_revision,
                         apr_pool_t *scratch_pool)
 {
   struct svn_wc__shim_fetch_baton_t *sfb = baton;
@@ -559,6 +560,7 @@ svn_error_t *
 svn_wc__fetch_props_func(apr_hash_t **props,
                          void *baton,
                          const char *path,
+                         svn_revnum_t base_revision,
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool)
 {
@@ -591,6 +593,7 @@ svn_error_t *
 svn_wc__fetch_base_func(const char **filename,
                         void *baton,
                         const char *path,
+                        svn_revnum_t base_revision,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
 {
@@ -615,6 +618,13 @@ svn_wc__fetch_base_func(const char **fil
     }
   else if (err)
     return svn_error_trace(err);
+
+  if (checksum == NULL)
+    {
+      *filename = NULL;
+      return SVN_NO_ERROR;
+    }
+
   SVN_ERR(svn_wc__db_pristine_read(&contents, NULL, sfb->db, local_abspath,
                                    checksum, scratch_pool, scratch_pool));
 

Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/wc.h?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/wc.h Mon Jan 16 15:24:08 2012
@@ -620,6 +620,7 @@ svn_wc__internal_get_origin(svn_boolean_
                             const char **repos_relpath,
                             const char **repos_root_url,
                             const char **repos_uuid,
+                            const char **copy_root_abspath,
                             svn_wc__db_t *db,
                             const char *local_abspath,
                             svn_boolean_t scan_deleted,
@@ -738,6 +739,7 @@ svn_error_t *
 svn_wc__fetch_kind_func(svn_kind_t *kind,
                         void *baton,
                         const char *path,
+                        svn_revnum_t base_revision,
                         apr_pool_t *scratch_pool);
 
 /* Using a BATON of struct shim_fetch_baton, return PROPS for PATH. */
@@ -745,6 +747,7 @@ svn_error_t *
 svn_wc__fetch_props_func(apr_hash_t **props,
                          void *baton,
                          const char *path,
+                         svn_revnum_t base_revision,
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);
 
@@ -753,6 +756,7 @@ svn_error_t *
 svn_wc__fetch_base_func(const char **filename,
                         void *baton,
                         const char *path,
+                        svn_revnum_t base_revision,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool);
 

Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/wc_db.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/wc_db.c Mon Jan 16 15:24:08 2012
@@ -6360,11 +6360,8 @@ delete_node(void *baton,
           /* The node has already been moved, possibly along with a parent,
            * and is being moved again. Update the existing moved_to path
            * in the BASE node. */
-          SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                            STMT_UPDATE_MOVED_TO_RELPATH));
-          SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
-                                    moved_from_relpath, b->moved_to_relpath));
-          SVN_ERR(svn_sqlite__step_done(stmt));
+          SVN_ERR(delete_update_movedto(wcroot, moved_from_relpath,
+                                        b->moved_to_relpath, scratch_pool));
         }
 
       /* If a subtree is being moved-away, we need to update moved-to
@@ -6553,12 +6550,8 @@ delete_node(void *baton,
       if (b->moved_to_relpath)
         {
           /* Record moved-to relpath in BASE. */
-          SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                            STMT_UPDATE_MOVED_TO_RELPATH));
-          SVN_ERR(svn_sqlite__bindf(stmt, "iss",
-                                    wcroot->wc_id, local_relpath,
-                                    b->moved_to_relpath));
-          SVN_ERR(svn_sqlite__step_done(stmt));
+          SVN_ERR(delete_update_movedto(wcroot, local_relpath,
+                                        b->moved_to_relpath, scratch_pool));
         }
 
       /* Delete the node and possible descendants. */
@@ -7300,7 +7293,6 @@ read_children_info(void *baton,
           else
             {
               const char *last_repos_root_url = NULL;
-              const char *last_repos_uuid = NULL;
 
               apr_int64_t repos_id = svn_sqlite__column_int64(stmt, 1);
               if (!repos_root_url ||
@@ -7308,7 +7300,6 @@ read_children_info(void *baton,
                    repos_id != last_repos_id))
                 {
                   last_repos_root_url = repos_root_url;
-                  last_repos_uuid = repos_uuid;
                   err = fetch_repos_info(&repos_root_url, &repos_uuid,
                                          wcroot->sdb, repos_id, result_pool);
                   if (err)

Modified: subversion/branches/moves-scan-log/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/mod_dav_svn/dav_svn.h?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/moves-scan-log/subversion/mod_dav_svn/dav_svn.h Mon Jan 16 15:24:08 2012
@@ -737,7 +737,7 @@ dav_svn__authz_read_func(dav_svn__authz_
 dav_error *
 dav_svn__new_error_tag(apr_pool_t *pool,
                        int status,
-                       int errno_id,
+                       int error_id,
                        const char *desc,
                        const char *namespace,
                        const char *tagname);
@@ -752,7 +752,7 @@ dav_svn__new_error_tag(apr_pool_t *pool,
 dav_error *
 dav_svn__new_error(apr_pool_t *pool,
                    int status,
-                   int errno_id,
+                   int error_id,
                    const char *desc);
 
 

Modified: subversion/branches/moves-scan-log/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/mod_dav_svn/lock.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/moves-scan-log/subversion/mod_dav_svn/lock.c Mon Jan 16 15:24:08 2012
@@ -149,7 +149,7 @@ unescape_xml(const char **output,
 
   apr_xml_to_text(pool, xml_doc->root, APR_XML_X2T_INNER,
                   xml_doc->namespaces, NULL, output, NULL);
-  return SVN_NO_ERROR;
+  return NULL;
 }
 
 

Modified: subversion/branches/moves-scan-log/subversion/mod_dav_svn/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/mod_dav_svn/merge.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/mod_dav_svn/merge.c (original)
+++ subversion/branches/moves-scan-log/subversion/mod_dav_svn/merge.c Mon Jan 16 15:24:08 2012
@@ -362,5 +362,5 @@ dav_svn__merge_response(ap_filter_t *out
   /* send whatever is left in the brigade */
   (void) ap_pass_brigade(output, bb);
 
-  return SVN_NO_ERROR;
+  return NULL;
 }

Modified: subversion/branches/moves-scan-log/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/mod_dav_svn/util.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/moves-scan-log/subversion/mod_dav_svn/util.c Mon Jan 16 15:24:08 2012
@@ -53,9 +53,11 @@ dav_svn__new_error(apr_pool_t *pool,
  * > 2.2 below perpetuates this.
  */
 #if AP_MODULE_MAGIC_AT_LEAST(20091119,0)
-  /* old code assumed errno was valid; keep assuming */
-  return dav_new_error(pool, status, error_id, errno, desc);
+  return dav_new_error(pool, status, error_id, 0, desc);
 #else
+
+  errno = 0; /* For the same reason as in dav_svn__new_error_tag */
+
   return dav_new_error(pool, status, error_id, desc);
 #endif
 }

Modified: subversion/branches/moves-scan-log/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/mod_dav_svn/version.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/moves-scan-log/subversion/mod_dav_svn/version.c Mon Jan 16 15:24:08 2012
@@ -1180,7 +1180,7 @@ dav_svn__build_lock_hash(apr_hash_t **lo
   if (! doc)
     {
       *locks = hash;
-      return SVN_NO_ERROR;
+      return NULL;
     }
 
   /* Sanity check. */
@@ -1191,7 +1191,7 @@ dav_svn__build_lock_hash(apr_hash_t **lo
          definitely no lock-tokens to harvest.  This is likely a
          request from an old client. */
       *locks = hash;
-      return SVN_NO_ERROR;
+      return NULL;
     }
 
   if ((doc->root->ns == ns)
@@ -1217,7 +1217,7 @@ dav_svn__build_lock_hash(apr_hash_t **lo
   if (! child)
     {
       *locks = hash;
-      return SVN_NO_ERROR;
+      return NULL;
     }
 
   /* Then look for N different <lock> structures within. */
@@ -1262,7 +1262,7 @@ dav_svn__build_lock_hash(apr_hash_t **lo
     }
 
   *locks = hash;
-  return SVN_NO_ERROR;
+  return NULL;
 }
 
 

Modified: subversion/branches/moves-scan-log/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/svn/status.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/svn/status.c (original)
+++ subversion/branches/moves-scan-log/subversion/svn/status.c Mon Jan 16 15:24:08 2012
@@ -432,7 +432,8 @@ svn_cl__print_status_xml(const char *cwd
   const char *local_abspath = status->local_abspath;
   svn_boolean_t tree_conflicted = FALSE;
 
-  if (status->node_status == svn_wc_status_none)
+  if (status->node_status == svn_wc_status_none
+      && status->repos_node_status == svn_wc_status_none)
     return SVN_NO_ERROR;
 
   if (status->conflicted)

Modified: subversion/branches/moves-scan-log/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/svn/util.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/svn/util.c (original)
+++ subversion/branches/moves-scan-log/subversion/svn/util.c Mon Jan 16 15:24:08 2012
@@ -947,7 +947,7 @@ svn_cl__try(svn_error_t *err,
       va_list ap;
 
       va_start(ap, quiet);
-      while ((apr_err = va_arg(ap, apr_status_t)) != SVN_NO_ERROR)
+      while ((apr_err = va_arg(ap, apr_status_t)) != APR_SUCCESS)
         {
           if (errors_seen)
             {

Modified: subversion/branches/moves-scan-log/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/svnadmin/main.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/svnadmin/main.c (original)
+++ subversion/branches/moves-scan-log/subversion/svnadmin/main.c Mon Jan 16 15:24:08 2012
@@ -40,6 +40,7 @@
 #include "svn_props.h"
 #include "svn_time.h"
 #include "svn_user.h"
+#include "svn_xml.h"
 
 #include "private/svn_opt_private.h"
 
@@ -152,6 +153,7 @@ static svn_opt_subcommand_t
   subcommand_load,
   subcommand_list_dblogs,
   subcommand_list_unused_dblogs,
+  subcommand_lock,
   subcommand_lslocks,
   subcommand_lstxns,
   subcommand_pack,
@@ -161,6 +163,7 @@ static svn_opt_subcommand_t
   subcommand_setlog,
   subcommand_setrevprop,
   subcommand_setuuid,
+  subcommand_unlock,
   subcommand_upgrade,
   subcommand_verify;
 
@@ -360,6 +363,13 @@ static const svn_opt_subcommand_desc2_t 
    {'q', 'r', svnadmin__ignore_uuid, svnadmin__force_uuid,
     svnadmin__use_pre_commit_hook, svnadmin__use_post_commit_hook,
     svnadmin__parent_dir, svnadmin__bypass_prop_validation, 'M'} },
+  
+  {"lock", subcommand_lock, {0}, N_
+   ("usage: svnadmin lock REPOS_PATH PATH USERNAME COMMENT-FILE [TOKEN]\n\n"
+    "Lock PATH by USERNAME setting comments from COMMENT-FILE.\n"
+    "If provided, use TOKEN as lock token.  Use --bypass-hooks to avoid\n"
+    "triggering the pre-lock and post-lock hook scripts.\n"),
+  {svnadmin__bypass_hooks} },
 
   {"lslocks", subcommand_lslocks, {0}, N_
    ("usage: svnadmin lslocks REPOS_PATH [PATH-IN-REPOS]\n\n"
@@ -426,6 +436,13 @@ static const svn_opt_subcommand_desc2_t 
     "generate a brand new UUID for the repository.\n"),
    {0} },
 
+  {"unlock", subcommand_unlock, {0}, N_
+   ("usage: svnadmin unlock REPOS_PATH LOCKED_PATH USERNAME TOKEN\n\n"
+    "Unlocked LOCKED_PATH (as USERNAME) after verifying that the token\n"
+    "associated with the lock matches TOKEN.  Use --bypass-hooks to avoid\n"
+    "triggering the pre-unlock and post-unlock hook scripts.\n"),
+   {svnadmin__bypass_hooks} },
+
   {"upgrade", subcommand_upgrade, {0}, N_
    ("usage: svnadmin upgrade REPOS_PATH\n\n"
     "Upgrade the repository located at REPOS_PATH to the latest supported\n"
@@ -1438,6 +1455,69 @@ subcommand_hotcopy(apr_getopt_t *os, voi
                             check_cancel, NULL, pool);
 }
 
+/* This implements `svn_opt_subcommand_t'. */
+static svn_error_t *
+subcommand_lock(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+  struct svnadmin_opt_state *opt_state = baton;
+  svn_repos_t *repos;
+  svn_fs_t *fs;
+  svn_fs_access_t *access;
+  apr_array_header_t *args;
+  const char *username;
+  const char *lock_path;
+  const char *comment_file_name;
+  svn_stringbuf_t *file_contents;
+  const char *lock_path_utf8;
+  svn_lock_t *lock;
+  const char *lock_token = NULL;
+
+  /* Expect three more arguments: PATH USERNAME COMMENT-FILE */
+  SVN_ERR(parse_args(&args, os, 3, 4, pool));
+  lock_path = APR_ARRAY_IDX(args, 0, const char *);
+  username = APR_ARRAY_IDX(args, 1, const char *);
+  comment_file_name = APR_ARRAY_IDX(args, 2, const char *);
+
+  /* Expect one more optional argument: TOKEN */
+  if (args->nelts == 4)
+    lock_token = APR_ARRAY_IDX(args, 3, const char *);
+
+  SVN_ERR(target_arg_to_dirent(&comment_file_name, comment_file_name, pool));
+  
+  SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
+  fs = svn_repos_fs(repos);
+
+  /* Create an access context describing the user. */
+  SVN_ERR(svn_fs_create_access(&access, username, pool));
+
+  /* Attach the access context to the filesystem. */
+  SVN_ERR(svn_fs_set_access(fs, access));
+
+  SVN_ERR(svn_stringbuf_from_file2(&file_contents, comment_file_name, pool));
+
+  SVN_ERR(svn_utf_cstring_to_utf8(&lock_path_utf8, lock_path, pool));
+  
+  if (opt_state->bypass_hooks)
+    SVN_ERR(svn_fs_lock(&lock, fs, lock_path_utf8,
+                        lock_token,          
+                        file_contents->data, /* comment */
+                        0,                   /* is_dav_comment */
+                        0,                   /* no expiration time. */
+                        SVN_INVALID_REVNUM,
+                        FALSE, pool));
+  else
+    SVN_ERR(svn_repos_fs_lock(&lock, repos, lock_path_utf8,
+                              lock_token,          
+                              file_contents->data, /* comment */
+                              0,                   /* is_dav_comment */
+                              0,                   /* no expiration time. */
+                              SVN_INVALID_REVNUM,
+                              FALSE, pool));
+
+  SVN_ERR(svn_cmdline_printf(pool, _("'%s' locked by user '%s'.\n"),
+                             lock_path, username));
+  return SVN_NO_ERROR;
+}
 
 static svn_error_t *
 subcommand_lslocks(apr_getopt_t *os, void *baton, apr_pool_t *pool)
@@ -1582,6 +1662,47 @@ subcommand_rmlocks(apr_getopt_t *os, voi
 
 /* This implements `svn_opt_subcommand_t'. */
 static svn_error_t *
+subcommand_unlock(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+  struct svnadmin_opt_state *opt_state = baton;
+  svn_repos_t *repos;
+  svn_fs_t *fs;
+  svn_fs_access_t *access;
+  apr_array_header_t *args;
+  const char *username;
+  const char *lock_path;
+  const char *lock_path_utf8;
+  const char *lock_token = NULL;
+
+  /* Expect three more arguments: PATH USERNAME TOKEN */
+  SVN_ERR(parse_args(&args, os, 3, 3, pool));
+  lock_path = APR_ARRAY_IDX(args, 0, const char *);
+  username = APR_ARRAY_IDX(args, 1, const char *);
+  lock_token = APR_ARRAY_IDX(args, 2, const char *);
+
+  /* Open the repos/FS, and associate an access context containing
+     USERNAME. */
+  SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
+  fs = svn_repos_fs(repos);
+  SVN_ERR(svn_fs_create_access(&access, username, pool));
+  SVN_ERR(svn_fs_set_access(fs, access));
+
+  SVN_ERR(svn_utf_cstring_to_utf8(&lock_path_utf8, lock_path, pool));
+  if (opt_state->bypass_hooks)
+    SVN_ERR(svn_fs_unlock(fs, lock_path_utf8, lock_token,
+                          FALSE, pool));
+  else
+    SVN_ERR(svn_repos_fs_unlock(repos, lock_path_utf8, lock_token,
+                                FALSE, pool));
+
+  SVN_ERR(svn_cmdline_printf(pool, _("'%s' unlocked by user '%s'.\n"),
+                             lock_path, username));
+  return SVN_NO_ERROR;
+}
+
+
+/* This implements `svn_opt_subcommand_t'. */
+static svn_error_t *
 subcommand_upgrade(apr_getopt_t *os, void *baton, apr_pool_t *pool)
 {
   svn_error_t *err;

Modified: subversion/branches/moves-scan-log/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/svnrdump/dump_editor.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/moves-scan-log/subversion/svnrdump/dump_editor.c Mon Jan 16 15:24:08 2012
@@ -846,6 +846,18 @@ close_edit(void *edit_baton, apr_pool_t 
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+fetch_base_func(const char **filename,
+                void *baton,
+                const char *path,
+                svn_revnum_t base_revision,
+                apr_pool_t *result_pool,
+                apr_pool_t *scratch_pool)
+{
+  *filename = NULL;
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_rdump__get_dump_editor(const svn_delta_editor_t **editor,
                            void **edit_baton,
@@ -893,6 +905,9 @@ svn_rdump__get_dump_editor(const svn_del
   SVN_ERR(svn_delta_get_cancellation_editor(cancel_func, cancel_baton,
                                             de, eb, editor, edit_baton, pool));
 
+  shim_callbacks->fetch_base_func = fetch_base_func;
+  shim_callbacks->fetch_baton = eb;
+
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
                                    shim_callbacks, pool, pool));
 

Modified: subversion/branches/moves-scan-log/subversion/svnsync/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/svnsync/main.c?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/svnsync/main.c (original)
+++ subversion/branches/moves-scan-log/subversion/svnsync/main.c Mon Jan 16 15:24:08 2012
@@ -1051,8 +1051,6 @@ replay_rev_started(svn_revnum_t revision
   apr_hash_t *filtered;
   int filtered_count;
   int normalized_count;
-  svn_delta_shim_callbacks_t *shim_callbacks =
-                                    svn_delta_shim_callbacks_default(pool);
 
   /* We set this property so that if we error out for some reason
      we can later determine where we were in the process of
@@ -1120,9 +1118,6 @@ replay_rev_started(svn_revnum_t revision
   *editor = cancel_editor;
   *edit_baton = cancel_baton;
 
-  SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   shim_callbacks, pool, pool));
-
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/moves-scan-log/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/tests/cmdline/basic_tests.py?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/moves-scan-log/subversion/tests/cmdline/basic_tests.py Mon Jan 16 15:24:08 2012
@@ -2886,6 +2886,43 @@ def quiet_commits(sbox):
                                         expected_disk,
                                         expected_status)
 
+# Regression test for issue #4023: on Windows, 'svn rm' incorrectly deletes
+# on-disk file if it is case-clashing with intended (non-on-disk) target.
+@Issue(4023)
+@XFail(svntest.main.is_fs_case_insensitive)
+def rm_missing_with_case_clashing_ondisk_item(sbox):
+  """rm missing item with case-clashing ondisk item"""
+
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+
+  iota_path = os.path.join(wc_dir, 'iota')
+  IOTA_path = os.path.join(wc_dir, 'IOTA')
+  
+  # Out-of-svn move, to make iota missing, while IOTA appears as unversioned.
+  os.rename(iota_path, IOTA_path)
+  
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+    'iota'              : Item(status='! ', wc_rev='1'),
+    'IOTA'              : Item(status='? '),
+    })
+  svntest.actions.run_and_verify_unquiet_status(wc_dir, expected_status)
+    
+  # 'svn rm' iota, should leave IOTA alone.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'rm', iota_path)
+
+  # Test status: the unversioned IOTA should still be there.
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+    'iota'              : Item(status='D ', wc_rev='1'),
+    'IOTA'              : Item(status='? '),
+    })
+  svntest.actions.run_and_verify_unquiet_status(wc_dir, expected_status)
+
+
+
 ########################################################################
 # Run the tests
 
@@ -2950,6 +2987,7 @@ test_list = [ None,
               ls_multiple_and_non_existent_targets,
               add_multiple_targets,
               quiet_commits,
+              rm_missing_with_case_clashing_ondisk_item,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/moves-scan-log/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/tests/cmdline/commit_tests.py?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/moves-scan-log/subversion/tests/cmdline/commit_tests.py Mon Jan 16 15:24:08 2012
@@ -1145,7 +1145,7 @@ def commit_in_dir_scheduled_for_addition
   svntest.actions.run_and_verify_commit(wc_dir,
                                         None,
                                         None,
-                                        "not under version control",
+                                        "not known to exist in the repository",
                                         mu_path)
 
   Q_path = os.path.join(wc_dir, 'Q')
@@ -1160,7 +1160,7 @@ def commit_in_dir_scheduled_for_addition
   svntest.actions.run_and_verify_commit(wc_dir,
                                         None,
                                         None,
-                                        "not under version control",
+                                        "not known to exist in the repository",
                                         bloo_path)
 
 #----------------------------------------------------------------------
@@ -2832,32 +2832,27 @@ def commit_incomplete(sbox):
 #   From: Fergus Slorach <sugref@gmail.com>
 #   Subject: svn commit --targets behaviour change in 1.7?
 @Issue(4059)
-@XFail()
 def commit_add_subadd(sbox):
   "committing add with explicit subadd targets"
 
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  A_path = os.path.join(wc_dir, 'A')
-  A2_path = os.path.join(wc_dir, 'A2')
-
   targets_file = sbox.ospath('targets') # ### better tempdir?
   targets_file = os.path.abspath(targets_file)
 
   # prepare targets file
-  targets = "A2/D A2/D/H A2/D/H/chi A2/D/H/omega A2/D/H/psi".split()
+  targets = "A/D A/D/H A/D/H/chi A/D/H/omega A/D/H/psi".split()
   open(targets_file, 'w').write("\n".join(targets))
 
-  # r2: add some stuff, with specific invocation
-  import shutil
-  shutil.copytree(A_path, A2_path)
-
-  # hack to copy A to A2, without creating .svn dirs when running against 1.6
-  svntest.main.run_svn(None, 'cp', A_path, A2_path)
-  svntest.main.run_svn(None, 'revert', '-R', A2_path)
+  # r2: rm A/D
+  sbox.simple_rm('A/D')
+  sbox.simple_commit(message='rm')
 
+  # r3: revert r2, with specific invocation
   os.chdir(wc_dir)
+  svntest.main.run_svn(None, 'up')
+  svntest.main.run_svn(None, 'merge', '-c', '-2', './')
   svntest.main.run_svn(None, 'commit', '--targets', targets_file, '-mm')
 
 

Modified: subversion/branches/moves-scan-log/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/tests/cmdline/externals_tests.py?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/moves-scan-log/subversion/tests/cmdline/externals_tests.py Mon Jan 16 15:24:08 2012
@@ -2670,6 +2670,39 @@ def shadowing(sbox):
   if not raised:
     raise svntest.Failure("Creating conflicting child 'C' of 'A' didn't error")
 
+# Test for issue #4093 'remapping a file external can segfault due to
+# "deleted" props'.
+@Issue(4093)
+def remap_file_external_with_prop_del(sbox):
+  "file external remap segfaults due to deleted props"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  A_path  = os.path.join(wc_dir, "A")
+  mu_path = os.path.join(wc_dir, "A", "mu")
+
+  # Add a property to A/mu
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'ps', 'propname', 'propval', mu_path)
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'commit', '-m', 'New property on a file',
+                                     wc_dir)
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+  # Add a new file external A/external pointing to ^/A/mu
+  externals_prop = "^/A/mu external\n"
+  change_external(A_path, externals_prop)
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+  # Change A/external to point to ^/iota
+  externals_prop = "^/iota external\n"
+  change_external(A_path, externals_prop)
+
+  # Now update to bring the new external down.
+  # This previously segfaulted as described in
+  # http://subversion.tigris.org/issues/show_bug.cgi?id=4093#desc1
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
 ########################################################################
 # Run the tests
@@ -2715,6 +2748,7 @@ test_list = [ None,
               include_externals,
               include_immediate_dir_externals,
               shadowing,
+              remap_file_external_with_prop_del,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/moves-scan-log/subversion/tests/cmdline/input_validation_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/tests/cmdline/input_validation_tests.py?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/tests/cmdline/input_validation_tests.py (original)
+++ subversion/branches/moves-scan-log/subversion/tests/cmdline/input_validation_tests.py Mon Jan 16 15:24:08 2012
@@ -161,13 +161,13 @@ def invalid_merge_args(sbox):
                ('A@HEAD', '^/A')]:
     run_and_verify_svn_in_wc(sbox, "svn: E205000: Merge sources must both "
                              "be either paths or URLs", 'merge', *args)
-  run_and_verify_svn_in_wc(sbox, "svn: E155010: Path '.*' does not exist",
+  run_and_verify_svn_in_wc(sbox, "svn: E155010: .* was not found",
                            'merge', '^/@0', '^/@1', 'nonexistent')
   run_and_verify_svn_in_wc(sbox, "svn: E205000: Too many arguments given",
                           'merge', '-c42', '^/A/B', '^/A/C', 'iota')
   run_and_verify_svn_in_wc(sbox, "svn: E205000: Cannot specify a revision range with" +
                            " two URLs", 'merge', '-c42', '^/mu', '^/')
-  run_and_verify_svn_in_wc(sbox, "svn: E155010: Path '.*' does not exist",
+  run_and_verify_svn_in_wc(sbox, "svn: E155010: .* was not found",
                            'merge', '-c42', '^/mu', 'nonexistent')
 
 def invalid_wcpath_upgrade(sbox):

Modified: subversion/branches/moves-scan-log/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/tests/cmdline/log_tests.py?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/moves-scan-log/subversion/tests/cmdline/log_tests.py Mon Jan 16 15:24:08 2012
@@ -697,6 +697,42 @@ def check_log_chain(chain, revlist, path
                             missing_revs, chain)
 
 
+def parse_diff(output):
+  """Return a set containing the various diff bits, broken up by file."""
+
+  diff_set = []
+  current_diff = []
+  for line in output:
+    if line.startswith('Index: ') and current_diff:
+      diff_set.append(current_diff)
+      current_diff = []
+    current_diff.append(line)
+  diff_set.append(current_diff)
+
+  return diff_set
+
+
+def setify(diff_list):
+  """Take a list of lists and make it a set of tuples."""
+  s = set()
+  for diff in diff_list:
+    s.add(tuple(diff))
+  return s
+
+
+def compare_diff_output(expected_diffs, output):
+  """Compare the diffs in EXPECTED_DIFFS (which is a Python set) with the
+  text in OUTPUT, remembering that there is no canonical ordering for diffs."""
+
+  diffs = parse_diff(output)
+  diffs = setify(diffs)
+  expected_diffs = setify(expected_diffs)
+
+  if diffs.issubset(expected_diffs) and diffs.issuperset(expected_diffs):
+    return
+
+  raise svntest.Failure("Diffs not equal")
+
 
 ######################################################################
 # Tests
@@ -2146,25 +2182,25 @@ def log_diff(sbox):
                                                               '-r10:8', 'A2')
   os.chdir(was_cwd)
 
-  r9diff = make_no_diff_deleted_header('A2/B/E/alpha', 8, 9) \
-           + make_diff_header('A2/B/E/beta', 'revision 8', 'revision 9') \
-           + [ "@@ -1 +1,2 @@\n",
-               " This is the file 'beta'.\n",
-               "+9\n",
-               "\ No newline at end of file\n",
-             ]
-  r8diff = make_diff_header('A2/D/G/rho', 'revision 0', 'revision 8') \
-           + [ "@@ -0,0 +1 @@\n",
-               "+88\n",
-               "\ No newline at end of file\n",
-             ]
+  r9diff = [ make_no_diff_deleted_header('A2/B/E/alpha', 8, 9),
+              make_diff_header('A2/B/E/beta', 'revision 8', 'revision 9')
+               + [ "@@ -1 +1,2 @@\n",
+                   " This is the file 'beta'.\n",
+                   "+9\n",
+                   "\ No newline at end of file\n",
+                 ]
+           ]
+  r8diff = [ make_diff_header('A2/D/G/rho', 'revision 0', 'revision 8')
+              + [ "@@ -0,0 +1 @@\n",
+                  "+88\n",
+                  "\ No newline at end of file\n",
+                ]
+           ]
   log_chain = parse_log_output(output, with_diffs=True)
   if len(log_chain) != 3:
     raise SVNLogParseError("%d logs found, 3 expected" % len(log_chain))
-  svntest.verify.compare_and_display_lines(None, "diff for r9",
-                                           r9diff, log_chain[1]['diff_lines'])
-  svntest.verify.compare_and_display_lines(None, "diff for r8",
-                                           r8diff, log_chain[2]['diff_lines'])
+  compare_diff_output(r9diff, log_chain[1]['diff_lines'])
+  compare_diff_output(r8diff, log_chain[2]['diff_lines'])
 
 
 ########################################################################

Modified: subversion/branches/moves-scan-log/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/tests/cmdline/patch_tests.py?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/moves-scan-log/subversion/tests/cmdline/patch_tests.py Mon Jan 16 15:24:08 2012
@@ -230,7 +230,7 @@ def patch(sbox):
 def patch_absolute_paths(sbox):
   "patch containing absolute paths"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
   patch_file_path = make_patch_path(sbox)
@@ -932,7 +932,7 @@ def patch_no_index_line(sbox):
 def patch_add_new_dir(sbox):
   "patch with missing dirs"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
   patch_file_path = make_patch_path(sbox)
@@ -1032,7 +1032,7 @@ def patch_add_new_dir(sbox):
 def patch_remove_empty_dirs(sbox):
   "patch deleting all children of a directory"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
   patch_file_path = make_patch_path(sbox)
@@ -1581,7 +1581,7 @@ def patch_reverse(sbox):
 def patch_no_svn_eol_style(sbox):
   "patch target with no svn:eol-style"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
   patch_file_path = make_patch_path(sbox)
@@ -1798,7 +1798,7 @@ def patch_with_svn_eol_style(sbox):
 def patch_with_svn_eol_style_uncommitted(sbox):
   "patch target with uncommitted svn:eol-style"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
   patch_file_path = make_patch_path(sbox)
@@ -2571,7 +2571,7 @@ def patch_dir_properties(sbox):
 def patch_add_path_with_props(sbox):
   "patch that adds paths with props"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
   patch_file_path = make_patch_path(sbox)
@@ -2993,7 +2993,7 @@ def patch_prop_with_fuzz(sbox):
 def patch_git_empty_files(sbox):
   "patch that contains empty files"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
   patch_file_path = make_patch_path(sbox)
 
@@ -3363,7 +3363,7 @@ def patch_one_property(sbox, trailing_eo
   """Helper.  Apply a patch that sets the property 'k' to 'v\n' or to 'v',
    and check the results."""
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
   patch_file_path = make_patch_path(sbox)
@@ -3438,7 +3438,7 @@ def patch_set_prop_no_eol(sbox):
 def patch_add_symlink(sbox):
   "patch that adds a symlink"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
   patch_file_path = make_patch_path(sbox)
@@ -3755,7 +3755,7 @@ def patch_deletes_prop(sbox):
 def patch_reversed_add_with_props(sbox):
   "reverse patch new file+props atop uncommitted"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
   patch_file_path = make_patch_path(sbox)
 
@@ -3858,7 +3858,7 @@ def patch_reversed_add_with_props2(sbox)
 def patch_dev_null(sbox):
   "patch with /dev/null filenames"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
   patch_file_path = make_patch_path(sbox)
@@ -3914,7 +3914,7 @@ def patch_dev_null(sbox):
 def patch_delete_and_skip(sbox):
   "patch that deletes and skips"
 
-  sbox.build()
+  sbox.build(read_only = True)
   wc_dir = sbox.wc_dir
 
   patch_file_path = make_patch_path(sbox)
@@ -4045,6 +4045,59 @@ def patch_target_no_eol_at_eof(sbox):
                                        1, # check-props
                                        1) # dry-run
 
+def patch_add_and_delete(sbox):
+  "patch add multiple levels and delete"
+
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+  patch_file_path = make_patch_path(sbox)
+
+  unidiff_patch = [
+    "Index: foo\n",
+    "===================================================================\n",
+    "--- P/Q/foo\t(revision 0)\n"
+    "+++ P/Q/foo\t(working copy)\n"
+    "@@ -0,0 +1 @@\n",
+    "+This is the file 'foo'.\n",
+    "Index: iota\n"
+    "===================================================================\n",
+    "--- iota\t(revision 1)\n"
+    "+++ iota\t(working copy)\n"
+    "@@ -1 +0,0 @@\n",
+    "-This is the file 'iota'.\n",
+    ]
+
+  svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+  expected_output = [
+    'A         %s\n' % os.path.join(wc_dir, 'P'),
+    'A         %s\n' % os.path.join(wc_dir, 'P', 'Q'),
+    'A         %s\n' % os.path.join(wc_dir, 'P', 'Q', 'foo'),
+    'D         %s\n' % os.path.join(wc_dir, 'iota'),
+  ]
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.remove('iota')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_disk.add({'P/Q/foo' : Item(contents="This is the file 'foo'.\n")})
+  expected_status.tweak('iota', status='D ')
+  expected_status.add({
+      'P'       : Item(status='A ', wc_rev=0),
+      'P/Q'     : Item(status='A ', wc_rev=0),
+      'P/Q/foo' : Item(status='A ', wc_rev=0),
+      })
+  expected_skip = wc.State('', { })
+
+  # Failed with "The node 'P' was not found" when erroneously checking
+  # whether 'P/Q' should be deleted.
+  svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+                                       expected_output,
+                                       expected_disk,
+                                       expected_status,
+                                       expected_skip,
+                                       None, # expected err
+                                       1, # check-props
+                                       1) # dry-run
+
 ########################################################################
 #Run the tests
 
@@ -4088,6 +4141,7 @@ test_list = [ None,
               patch_dev_null,
               patch_delete_and_skip,
               patch_target_no_eol_at_eof,
+              patch_add_and_delete,
             ]
 
 if __name__ == '__main__':

Modified: subversion/branches/moves-scan-log/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/tests/cmdline/stat_tests.py?rev=1232025&r1=1232024&r2=1232025&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/moves-scan-log/subversion/tests/cmdline/stat_tests.py Mon Jan 16 15:24:08 2012
@@ -117,6 +117,12 @@ def status_update_with_nested_adds(sbox)
   svntest.actions.run_and_verify_unquiet_status(wc_backup,
                                                 expected_status)
 
+  # At one time an obstructing 'newdir' caused a SEGV on 'newdir/newfile'
+  os.makedirs(os.path.join(wc_backup, 'newdir'))
+  expected_status.tweak('newdir', status='? ')
+  svntest.actions.run_and_verify_unquiet_status(wc_backup,
+                                                expected_status)
+
 #----------------------------------------------------------------------
 
 # svn status -vN should include all entries in a directory
@@ -899,7 +905,7 @@ def missing_dir_in_anchor(sbox):
 def status_in_xml(sbox):
   "status output in XML format"
 
-  sbox.build(read_only = True)
+  sbox.build()
   wc_dir = sbox.wc_dir
 
   file_name = "iota"
@@ -951,6 +957,44 @@ def status_in_xml(sbox):
       print("ERROR: expected: %s actual: %s" % (template[i], output[i]))
       raise svntest.Failure
 
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'cp', '-m', 'repo-to-repo copy',
+                                     sbox.repo_url + '/iota',
+                                     sbox.repo_url + '/iota2')
+  
+  file_path = sbox.ospath('iota2')
+
+  template = ['<?xml version="1.0" encoding="UTF-8"?>\n',
+              "<status>\n",
+              "<target\n",
+              "   path=\"%s\">\n" % (file_path),
+              "<entry\n",
+              "   path=\"%s\">\n" % (file_path),
+              "<wc-status\n",
+              "   props=\"none\"\n",
+              "   item=\"none\">\n",
+              "</wc-status>\n",
+              "<repos-status\n",
+              "   props=\"none\"\n",
+              "   item=\"added\">\n",
+              "</repos-status>\n",
+              "</entry>\n",
+              "<against\n",
+              "   revision=\"2\"/>\n",
+              "</target>\n",
+              "</status>\n",
+             ]
+
+  exit_code, output, error = svntest.actions.run_and_verify_svn(None, None, [],
+                                                                'status',
+                                                                file_path,
+                                                                '--xml', '-u')
+
+  for i in range(0, len(output)):
+    if output[i] != template[i]:
+      print("ERROR: expected: %s actual: %s" % (template[i], output[i]))
+      raise svntest.Failure
+
 #----------------------------------------------------------------------
 
 def status_ignored_dir(sbox):



Mime
View raw message