You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/11/30 15:19:55 UTC

svn commit: r1415649 [2/2] - in /subversion/branches/in-repo-authz: ./ subversion/include/ subversion/libsvn_client/ subversion/libsvn_fs_fs/ subversion/libsvn_ra_serf/ subversion/libsvn_subr/ subversion/libsvn_wc/ subversion/mod_dav_svn/ subversion/sv...

Modified: subversion/branches/in-repo-authz/subversion/svn/list-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/svn/list-cmd.c?rev=1415649&r1=1415648&r2=1415649&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/svn/list-cmd.c (original)
+++ subversion/branches/in-repo-authz/subversion/svn/list-cmd.c Fri Nov 30 14:19:48 2012
@@ -59,7 +59,7 @@ print_dirent(void *baton,
              const char *abs_path,
              const char *external_parent_url,
              const char *external_target,
-             apr_pool_t *pool)
+             apr_pool_t *scratch_pool)
 {
   struct print_baton *pb = baton;
   const char *entryname;
@@ -80,7 +80,7 @@ print_dirent(void *baton,
   if (strcmp(path, "") == 0)
     {
       if (dirent->kind == svn_node_file)
-        entryname = svn_dirent_basename(abs_path, pool);
+        entryname = svn_dirent_basename(abs_path, scratch_pool);
       else if (pb->verbose)
         entryname = ".";
       else
@@ -97,7 +97,7 @@ print_dirent(void *baton,
           || (strcmp(pb->last_external_parent_url, external_parent_url) != 0
               || strcmp(pb->last_external_target, external_target) != 0))
         {
-          SVN_ERR(svn_cmdline_printf(pool,
+          SVN_ERR(svn_cmdline_printf(scratch_pool,
                                      _("Listing external '%s'"
                                        " defined on '%s':\n"), 
                                      external_target,
@@ -138,12 +138,13 @@ print_dirent(void *baton,
         timestr[0] = '\0';
 
       /* we need it in UTF-8. */
-      SVN_ERR(svn_utf_cstring_to_utf8(&utf8_timestr, timestr, pool));
+      SVN_ERR(svn_utf_cstring_to_utf8(&utf8_timestr, timestr, scratch_pool));
 
-      sizestr = apr_psprintf(pool, "%" SVN_FILESIZE_T_FMT, dirent->size);
+      sizestr = apr_psprintf(scratch_pool, "%" SVN_FILESIZE_T_FMT, 
+                             dirent->size);
 
       return svn_cmdline_printf
-              (pool, "%7ld %-8.8s %c %10s %12s %s%s\n",
+              (scratch_pool, "%7ld %-8.8s %c %10s %12s %s%s\n",
                dirent->created_rev,
                dirent->last_author ? dirent->last_author : " ? ",
                lock ? 'O' : ' ',
@@ -154,7 +155,7 @@ print_dirent(void *baton,
     }
   else
     {
-      return svn_cmdline_printf(pool, "%s%s\n", entryname,
+      return svn_cmdline_printf(scratch_pool, "%s%s\n", entryname,
                                 (dirent->kind == svn_node_dir)
                                 ? "/" : "");
     }
@@ -171,11 +172,11 @@ print_dirent_xml(void *baton,
                  const char *abs_path,
                  const char *external_parent_url,
                  const char *external_target,
-                 apr_pool_t *pool)
+                 apr_pool_t *scratch_pool)
 {
   struct print_baton *pb = baton;
   const char *entryname;
-  svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool);
+  svn_stringbuf_t *sb = svn_stringbuf_create_empty(scratch_pool);
   
   SVN_ERR_ASSERT((external_parent_url == NULL && external_target == NULL) ||
                  (external_parent_url && external_target));
@@ -183,7 +184,7 @@ print_dirent_xml(void *baton,
   if (strcmp(path, "") == 0)
     {
       if (dirent->kind == svn_node_file)
-        entryname = svn_dirent_basename(abs_path, pool);
+        entryname = svn_dirent_basename(abs_path, scratch_pool);
       else
         /* Don't bother to list if no useful information will be shown. */
         return SVN_NO_ERROR;
@@ -205,11 +206,11 @@ print_dirent_xml(void *baton,
             {
               /* The external item being listed is different from the previous
                  one, so close the tag. */
-              svn_xml_make_close_tag(&sb, pool, "external");
+              svn_xml_make_close_tag(&sb, scratch_pool, "external");
               pb->in_external = FALSE;
             }
 
-          svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "external",
+          svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal, "external",
                                 "parent_url", external_parent_url,
                                 "target", external_target,
                                 NULL);
@@ -220,46 +221,46 @@ print_dirent_xml(void *baton,
         }
     }
 
-  svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "entry",
+  svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal, "entry",
                         "kind", svn_cl__node_kind_str_xml(dirent->kind),
                         NULL);
 
-  svn_cl__xml_tagged_cdata(&sb, pool, "name", entryname);
+  svn_cl__xml_tagged_cdata(&sb, scratch_pool, "name", entryname);
 
   if (dirent->kind == svn_node_file)
     {
       svn_cl__xml_tagged_cdata
-        (&sb, pool, "size",
-         apr_psprintf(pool, "%" SVN_FILESIZE_T_FMT, dirent->size));
+        (&sb, scratch_pool, "size",
+         apr_psprintf(scratch_pool, "%" SVN_FILESIZE_T_FMT, dirent->size));
     }
 
-  svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "commit",
+  svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal, "commit",
                         "revision",
-                        apr_psprintf(pool, "%ld", dirent->created_rev),
+                        apr_psprintf(scratch_pool, "%ld", dirent->created_rev),
                         NULL);
-  svn_cl__xml_tagged_cdata(&sb, pool, "author", dirent->last_author);
+  svn_cl__xml_tagged_cdata(&sb, scratch_pool, "author", dirent->last_author);
   if (dirent->time)
-    svn_cl__xml_tagged_cdata(&sb, pool, "date",
-                             svn_time_to_cstring(dirent->time, pool));
-  svn_xml_make_close_tag(&sb, pool, "commit");
+    svn_cl__xml_tagged_cdata(&sb, scratch_pool, "date",
+                             svn_time_to_cstring(dirent->time, scratch_pool));
+  svn_xml_make_close_tag(&sb, scratch_pool, "commit");
 
   if (lock)
     {
-      svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "lock", NULL);
-      svn_cl__xml_tagged_cdata(&sb, pool, "token", lock->token);
-      svn_cl__xml_tagged_cdata(&sb, pool, "owner", lock->owner);
-      svn_cl__xml_tagged_cdata(&sb, pool, "comment", lock->comment);
-      svn_cl__xml_tagged_cdata(&sb, pool, "created",
+      svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal, "lock", NULL);
+      svn_cl__xml_tagged_cdata(&sb, scratch_pool, "token", lock->token);
+      svn_cl__xml_tagged_cdata(&sb, scratch_pool, "owner", lock->owner);
+      svn_cl__xml_tagged_cdata(&sb, scratch_pool, "comment", lock->comment);
+      svn_cl__xml_tagged_cdata(&sb, scratch_pool, "created",
                                svn_time_to_cstring(lock->creation_date,
-                                                   pool));
+                                                   scratch_pool));
       if (lock->expiration_date != 0)
-        svn_cl__xml_tagged_cdata(&sb, pool, "expires",
+        svn_cl__xml_tagged_cdata(&sb, scratch_pool, "expires",
                                  svn_time_to_cstring
-                                 (lock->expiration_date, pool));
-      svn_xml_make_close_tag(&sb, pool, "lock");
+                                 (lock->expiration_date, scratch_pool));
+      svn_xml_make_close_tag(&sb, scratch_pool, "lock");
     }
 
-  svn_xml_make_close_tag(&sb, pool, "entry");
+  svn_xml_make_close_tag(&sb, scratch_pool, "entry");
 
   return svn_cl__error_checked_fputs(sb->data, stdout);
 }
@@ -416,11 +417,8 @@ svn_cl__list(apr_getopt_t *os,
     SVN_ERR(svn_cl__xml_print_footer("lists", pool));
 
   if (seen_nonexistent_target)
-    {
-      err = svn_error_create(SVN_ERR_ILLEGAL_TARGET, NULL,
-            _("Could not list all targets because some targets don't exist"));
-      return svn_error_compose_create(externals_err, err);
-    }
-  else
-    return svn_error_compose_create(externals_err, err);
+    err = svn_error_create(SVN_ERR_ILLEGAL_TARGET, NULL,
+          _("Could not list all targets because some targets don't exist"));
+
+  return svn_error_compose_create(externals_err, err);
 }

Modified: subversion/branches/in-repo-authz/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/svn/props.c?rev=1415649&r1=1415648&r2=1415649&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/svn/props.c (original)
+++ subversion/branches/in-repo-authz/subversion/svn/props.c Fri Nov 30 14:19:48 2012
@@ -211,9 +211,10 @@ svn_cl__check_boolean_prop_val(const cha
   svn_stringbuf_strip_whitespace(propbuf);
 
   if (propbuf->data[0] == '\0'
-      || strcmp(propbuf->data, "no") == 0
-      || strcmp(propbuf->data, "off") == 0
-      || strcmp(propbuf->data, "false") == 0)
+      || svn_cstring_casecmp(propbuf->data, "0") == 0
+      || svn_cstring_casecmp(propbuf->data, "no") == 0
+      || svn_cstring_casecmp(propbuf->data, "off") == 0
+      || svn_cstring_casecmp(propbuf->data, "false") == 0)
     {
       svn_error_t *err = svn_error_createf
         (SVN_ERR_BAD_PROPERTY_VALUE, NULL,
@@ -230,13 +231,13 @@ svn_cl__check_boolean_prop_val(const cha
 struct simprop_context_t
 {
   svn_string_t name;    /* The name of the property we're comparing with */
-  svn_membuf_t buffer;  /* Buffer for similariry testing */
+  svn_membuf_t buffer;  /* Buffer for similarity testing */
 };
 
 struct simprop_t
 {
   const char *propname; /* The original svn: property name */
-  svn_string_t name;    /* The property name without the svn: prefx */
+  svn_string_t name;    /* The property name without the svn: prefix */
   unsigned int score;   /* The similarity score */
   apr_size_t diff;      /* Number of chars different from context.name */
   struct simprop_context_t *context; /* Sorting context for qsort() */
@@ -343,7 +344,7 @@ svn_cl__check_svn_prop_name(const char *
         }
     }
 
-  /* Now find the closest match from amongst a the set of reserved
+  /* Now find the closest match from amongst the set of reserved
      node or revision property names. Skip the prefix while matching,
      we already know that it's the same and looking at it would only
      skew the results. */

Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/info_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/info_tests.py?rev=1415649&r1=1415648&r2=1415649&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/info_tests.py Fri Nov 30 14:19:48 2012
@@ -221,6 +221,7 @@ def info_on_added_file(sbox):
   expected = {'Path' : re.escape(new_file),
               'Name' : 'new_file',
               'URL' : '.*/new_file',
+              'Relative URL' : '.*/new_file',
               'Repository Root' : '.*',
               'Node Kind' : 'file',
               'Schedule' : 'add',
@@ -240,6 +241,7 @@ def info_on_added_file(sbox):
                                      'path'     : new_file,
                                      'revision' : 'Resource is not under version control.'}),
                        ('url',      {}, '.*/new_file'),
+                       ('relative-url', {}, '.*/new_file'),
                        ('root',     {}, '.*'),
                        ('uuid',     {}, uuid_regex),
                        ('depth',    {}, 'infinity'),
@@ -259,6 +261,7 @@ def info_on_mkdir(sbox):
   # check that we have a Repository Root and Repository UUID
   expected = {'Path' : re.escape(new_dir),
               'URL' : '.*/new_dir',
+              'Relative URL' : '.*/new_dir',
               'Repository Root' : '.*',
               'Node Kind' : 'directory',
               'Schedule' : 'add',
@@ -277,6 +280,7 @@ def info_on_mkdir(sbox):
                                      'path'     : new_dir,
                                      'revision' : 'Resource is not under version control.'}),
                        ('url',      {}, '.*/new_dir'),
+                       ('relative-url', {}, '.*/new_dir'),
                        ('root',     {}, '.*'),
                        ('uuid',     {}, uuid_regex),
                        ('depth',    {}, 'infinity'),
@@ -396,6 +400,7 @@ def info_repos_root_url(sbox):
         'Path'              : re.escape(os.path.basename(sbox.repo_dir)),
         'Repository Root'   : re.escape(sbox.repo_url),
         'URL'               : re.escape(sbox.repo_url),
+        'Relative URL'      : '\^/', # escape ^ -- this isn't a regexp
         'Revision'          : '1',
         'Node Kind'         : 'directory',
         'Last Changed Rev'  : '1',
@@ -405,6 +410,7 @@ def info_repos_root_url(sbox):
         'Name'              : 'iota',
         'Repository Root'   : re.escape(sbox.repo_url),
         'URL'               : re.escape(sbox.repo_url + '/iota'),
+        'Relative URL'      : '\^/iota', # escape ^ -- this isn't a regexp
         'Revision'          : '1',
         'Node Kind'         : 'file',
         'Last Changed Rev'  : '1',

Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_tests.py?rev=1415649&r1=1415648&r2=1415649&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_tests.py Fri Nov 30 14:19:48 2012
@@ -526,6 +526,13 @@ def add_with_history(sbox):
 
   expected_skip = wc.State(C_path, { })
 
+  # Add some unversioned directory obstructions to the incoming
+  # additions.  This should be tolerated and *not* result in any
+  # difference between the --dry-run and actual merge.
+  # See http://svn.haxx.se/dev/archive-2012-11/0696.shtml
+  os.mkdir(sbox.ospath('A/C/Q'))
+  os.mkdir(sbox.ospath('A/C/Q2'))
+
   svntest.actions.run_and_verify_merge(C_path, '1', '2', F_url, None,
                                        expected_output,
                                        expected_mergeinfo_output,

Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/svntest/actions.py?rev=1415649&r1=1415648&r2=1415649&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/svntest/actions.py Fri Nov 30 14:19:48 2012
@@ -1918,7 +1918,11 @@ def get_wc_base_rev(wc_dir):
 def hook_failure_message(hook_name):
   """Return the error message that the client prints for failure of the
   specified hook HOOK_NAME. The wording changed with Subversion 1.5."""
-  if svntest.main.options.server_minor_version < 5:
+
+  # Output depends on the server version, not the repository version.
+  # This gets the wrong result for modern servers with old format
+  # repositories.
+  if svntest.main.options.server_minor_version < 5 and not svntest.main.is_ra_type_file():
     return "'%s' hook failed with error output:\n" % hook_name
   else:
     if hook_name in ["start-commit", "pre-commit"]:

Modified: subversion/branches/in-repo-authz/tools/server-side/svnauthz-validate.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/tools/server-side/svnauthz-validate.c?rev=1415649&r1=1415648&r2=1415649&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/tools/server-side/svnauthz-validate.c (original)
+++ subversion/branches/in-repo-authz/tools/server-side/svnauthz-validate.c Fri Nov 30 14:19:48 2012
@@ -88,10 +88,12 @@ main(int argc, const char **argv)
   /* Repeat svn_cmdline__getopt_init() inline. */
   apr_err = apr_getopt_init(&os, pool, argc, argv);
   if (apr_err)
-    return svn_cmdline_handle_exit_error(
-             svn_error_wrap_apr(apr_err,
-                                ("Error initializing command line arguments")),
-             pool, "svn-rep-sharing-stats: ");
+    {
+       err = svn_error_wrap_apr(apr_err,
+                                ("Error initializing command line arguments"));
+       svn_handle_warning2(stderr, err, "svnauthz-validate: ");
+       return 2;
+    }
 
   os->interleave = 1;
   while (1)
@@ -131,8 +133,14 @@ main(int argc, const char **argv)
     }
 
   /* Grab AUTHZ_FILE from argv. */
-  SVN_INT_ERR(svn_utf_cstring_to_utf8(&opts.authz_file, os->argv[os->ind],
-                                      pool));
+  err = svn_utf_cstring_to_utf8(&opts.authz_file, os->argv[os->ind], pool);
+  if (err)
+    {
+      svn_handle_warning2(stderr, err, "svnauthz-validate: ");
+      svn_error_clear(err);
+      return 2;
+    }
+
   opts.authz_file = svn_dirent_internal_style(opts.authz_file, pool);
 
   /* Read the access file and validate it. */