subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1416996 [9/13] - in /subversion/branches/wc-collate-path: ./ build/ build/ac-macros/ build/generator/ contrib/client-side/svnmerge/ contrib/server-side/svncutter/ notes/ subversion/bindings/cxxhl/ subversion/bindings/javahl/native/ subvers...
Date Tue, 04 Dec 2012 15:35:57 GMT
Modified: subversion/branches/wc-collate-path/subversion/svn/add-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/add-cmd.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/add-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/add-cmd.c Tue Dec  4 15:35:13 2012
@@ -75,10 +75,11 @@ svn_cl__add(apr_getopt_t *os,
       svn_pool_clear(iterpool);
       SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
       SVN_ERR(svn_cl__try
-              (svn_client_add4(target,
+              (svn_client_add5(target,
                                opt_state->depth,
                                opt_state->force, opt_state->no_ignore,
-                               opt_state->parents, ctx, iterpool),
+                               opt_state->no_autoprops, opt_state->parents,
+                               ctx, iterpool),
                errors, opt_state->quiet,
                SVN_ERR_ENTRY_EXISTS,
                SVN_ERR_WC_PATH_NOT_FOUND,

Modified: subversion/branches/wc-collate-path/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/cl.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/cl.h (original)
+++ subversion/branches/wc-collate-path/subversion/svn/cl.h Tue Dec  4 15:35:13 2012
@@ -462,33 +462,6 @@ svn_cl__print_status_xml(const char *cwd
                          svn_client_ctx_t *ctx,
                          apr_pool_t *pool);
 
-
-/* Print to stdout a hash that maps property names (char *) to property
-   values (svn_string_t *).  The names are assumed to be in UTF-8 format;
-   the values are either in UTF-8 (the special Subversion props) or
-   plain binary values.
-
-   If OUT is not NULL, then write to it rather than stdout.
-
-   If NAMES_ONLY is true, print just names, else print names and
-   values. */
-svn_error_t *
-svn_cl__print_prop_hash(svn_stream_t *out,
-                        apr_hash_t *prop_hash,
-                        svn_boolean_t names_only,
-                        apr_pool_t *pool);
-
-/* Similar to svn_cl__print_prop_hash(), only output xml to *OUTSTR.
-   If INHERITED_PROPS is true, then PROP_HASH contains inherited properties,
-   otherwise PROP_HASH contains explicit properties.  If *OUTSTR is NULL,
-   allocate it first from POOL, otherwise append to it. */
-svn_error_t *
-svn_cl__print_xml_prop_hash(svn_stringbuf_t **outstr,
-                            apr_hash_t *prop_hash,
-                            svn_boolean_t names_only,
-                            svn_boolean_t inherited_props,
-                            apr_pool_t *pool);
-
 /* Output a commit xml element to *OUTSTR.  If *OUTSTR is NULL, allocate it
    first from POOL, otherwise append to it.  If AUTHOR or DATE is
    NULL, it will be omitted. */
@@ -767,6 +740,22 @@ const char *
 svn_cl__operation_str_human_readable(svn_wc_operation_t operation,
                                      apr_pool_t *pool);
 
+/* If PROPNAME looks like but is not identical to one of the svn:
+ * poperties, raise an error and suggest a better spelling. Names that
+ * raise errors look like this:
+ *
+ *   - start with svn: but do not exactly match a known property; or,
+ *   - start with a 3-letter prefix that differs in only one letter
+ *     from "svn:", and the rest exactly matches a known propery.
+ *
+ * If REVPROP is TRUE, only check revision property names; otherwise
+ * only check node property names.
+ *
+ * Use SCRATCH_POOL for temporary allocations.
+ */
+svn_error_t *
+svn_cl__check_svn_prop_name(const char *propname, svn_boolean_t revprop,
+                            apr_pool_t *scratch_pool);
 
 /* If PROPNAME is one of the svn: properties with a boolean value, and
  * PROPVAL looks like an attempt to turn the property off (i.e., it's
@@ -804,15 +793,6 @@ svn_cl__args_to_target_array_print_reser
                                             svn_boolean_t keep_dest_origpath_on_truepath_collision,
                                             apr_pool_t *pool);
 
-/* Return a string allocated in POOL that is a copy of STR but with each
- * line prefixed with INDENT. A line is all characters up to the first
- * CR-LF, LF-CR, CR or LF, or the end of STR if sooner. */
-const char *
-svn_cl__indent_string(const char *str,
-                      const char *indent,
-                      apr_pool_t *pool);
-
-
 /* Return a string showing NODE's kind, URL and revision, to the extent that
  * that information is available in NODE. If NODE itself is NULL, this prints
  * just a 'none' node kind.

Modified: subversion/branches/wc-collate-path/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/conflict-callbacks.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/conflict-callbacks.c Tue Dec  4 15:35:13 2012
@@ -281,6 +281,160 @@ launch_resolver(svn_boolean_t *performed
   return SVN_NO_ERROR;
 }
 
+
+/* Maximum line length for the prompt string. */
+#define MAX_PROMPT_WIDTH 70
+
+/* Description of a resolver option */
+typedef struct resolver_option_t
+{
+  const char *code;        /* one or two characters */
+  const char *short_desc;  /* short description */
+  const char *long_desc;   /* longer description */
+} resolver_option_t;
+
+/* Resolver options for a text conflict */
+static const resolver_option_t text_conflict_options[] =
+{
+  { "e",  "edit",             N_("change merged file in an editor") },
+  { "df", "diff-full",        N_("show all changes made to merged file") },
+  { "r",  "resolved",         N_("accept merged version of file") },
+  { "" },
+  { "dc", "display-conflict", N_("show all conflicts (ignoring merged version)") },
+  { "mc", "mine-conflict",    N_("accept my version for all conflicts (same)") },
+  { "tc", "theirs-conflict",  N_("accept their version for all conflicts (same)") },
+  { "" },
+  { "mf", "mine-full",        N_("accept my version of entire file (even "
+                                 "non-conflicts)") },
+  { "tf", "theirs-full",      N_("accept their version of entire file (same)") },
+  { "" },
+  { "p",  "postpone",         N_("mark the conflict to be resolved later") },
+  { "m",  "merge",            N_("use internal merge tool to resolve conflict") },
+  { "l",  "launch",           N_("launch external tool to resolve conflict") },
+  { "s",  "show all options", N_("show this list") },
+  { NULL }
+};
+
+/* Resolver options for a property conflict */
+static const resolver_option_t prop_conflict_options[] =
+{
+  { "p",  "postpone",         N_("mark the conflict to be resolved later") },
+  { "mf", "mine-full",        N_("accept my version of entire file (even "
+                                "non-conflicts)") },
+  { "tf", "theirs-full",      N_("accept their version of entire file (same)") },
+  { NULL }
+};
+
+/* Resolver options for an obstructued addition */
+static const resolver_option_t obstructed_add_options[] =
+{
+  { "p",  "postpone",         N_("resolve the conflict later") },
+  { "mf", "mine-full",        N_("accept pre-existing item (ignore upstream addition)") },
+  { "tf", "theirs-full",      N_("accept incoming item (overwrite pre-existing item)") },
+  { "h",  "help",             N_("show this help") },
+  { NULL }
+};
+
+/* Resolver options for a tree conflict */
+static const resolver_option_t tree_conflict_options[] =
+{
+  { "p",  "postpone",         N_("resolve the conflict later") },
+  { "r",  "resolved",         N_("accept current working copy state") },
+  { "mc", "mine-conflict",    N_("prefer local change") },
+  { "tc", "theirs-conflict",  N_("prefer incoming change") },
+  { "h",  "show help",        N_("show this help") },
+  { NULL }
+};
+
+/* Return a pointer to the option description in OPTIONS matching the
+ * one- or two-character OPTION_CODE.  Return NULL if not found. */
+static const resolver_option_t *
+find_option(const resolver_option_t *options,
+            const char *option_code)
+{
+  const resolver_option_t *opt;
+
+  for (opt = options; opt->code; opt++)
+    {
+      if (strcmp(opt->code, option_code) == 0)
+        return opt;
+    }
+  return NULL;
+}
+
+/* Return a prompt string listing the options OPTIONS. If OPTION_CODES is
+ * non-null, select only the options whose codes are mentioned in it. */
+static const char *
+prompt_string(const resolver_option_t *options,
+              const char *const *option_codes,
+              apr_pool_t *pool)
+{
+  const char *result = "Select:";
+  int this_line_len = strlen(result);
+  svn_boolean_t first = TRUE;
+
+  while (1)
+    {
+      const resolver_option_t *opt;
+      const char *s;
+
+      if (option_codes)
+        {
+          if (! *option_codes)
+            break;
+          opt = find_option(options, *option_codes++);
+        }
+      else
+        {
+          opt = options++;
+          if (! opt->code)
+            break;
+        }
+
+      if (! first)
+        result = apr_pstrcat(pool, result, ",", (char *)NULL);
+      /* Break the line if adding the next option would make it too long */
+      if ((this_line_len + strlen(opt->short_desc) + 6) > MAX_PROMPT_WIDTH)
+        {
+          result = apr_pstrcat(pool, result, "\n       ", (char *)NULL);
+          this_line_len = 7;
+        }
+      s = apr_psprintf(pool, " (%s) %s",
+                       opt->code, opt->short_desc);
+      result = apr_pstrcat(pool, result, s, (char *)NULL);
+      this_line_len += strlen(s);
+      first = FALSE;
+    }
+  return apr_pstrcat(pool, result, ": ", (char *)NULL);
+}
+
+/* Return a help string listing the OPTIONS. */
+static const char *
+help_string(const resolver_option_t *options,
+            apr_pool_t *pool)
+{
+  const char *result = "";
+  const resolver_option_t *opt;
+
+  for (opt = options; opt->code; opt++)
+    {
+      /* Append a line describing OPT, or a blank line if its code is "". */
+      if (opt->code[0])
+        {
+          const char *s = apr_psprintf(pool, "  (%s)", opt->code);
+
+          result = apr_psprintf(pool, "%s%-6s %-16s - %s\n",
+                                result, s, opt->short_desc, opt->long_desc);
+        }
+      else
+        {
+          result = apr_pstrcat(pool, result, "\n", (char *)NULL);
+        }
+    }
+  return result;
+}
+
+
 /* Ask the user what to do about the text conflict described by DESC.
  * Return the answer in RESULT. B is the conflict baton for this
  * conflict resolution session.
@@ -291,8 +445,7 @@ handle_text_conflict(svn_wc_conflict_res
                      svn_cl__interactive_conflict_baton_t *b,
                      apr_pool_t *scratch_pool)
 {
-  const char *answer;
-  char *prompt;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_boolean_t diff_allowed = FALSE;
   /* Have they done something that might have affected the merged
      file (so that we need to save a .edited copy)? */
@@ -319,73 +472,45 @@ handle_text_conflict(svn_wc_conflict_res
 
   while (TRUE)
     {
-      svn_pool_clear(scratch_pool);
+      const char *options[12];  /* size of array must be big enough */
+      const char **next_option = options;
+      const char *prompt;
+      const char *answer;
 
-      prompt = apr_pstrdup(scratch_pool, _("Select: (p) postpone"));
+      svn_pool_clear(iterpool);
 
+      *next_option++ = "p";
       if (diff_allowed)
         {
-          prompt = apr_pstrcat(scratch_pool, prompt,
-                               _(", (df) diff-full, (e) edit, (m) merge"),
-                               (char *)NULL);
+          *next_option++ = "df";
+          *next_option++ = "e";
+          *next_option++ = "m";
 
           if (knows_something)
-            prompt = apr_pstrcat(scratch_pool, prompt, _(", (r) resolved"),
-                                 (char *)NULL);
+            *next_option++ = "r";
 
           if (! desc->is_binary)
-            prompt = apr_pstrcat(scratch_pool, prompt,
-                                 _(",\n        (mc) mine-conflict, "
-                                   "(tc) theirs-conflict"),
-                                 (char *)NULL);
+            *next_option++ = "mc";
+            *next_option++ = "tc";
         }
       else
         {
           if (knows_something)
-            prompt = apr_pstrcat(scratch_pool, prompt, _(", (r) resolved"),
-                                 (char *)NULL);
-          prompt = apr_pstrcat(scratch_pool, prompt,
-                               _(",\n        "
-                                 "(mf) mine-full, (tf) theirs-full"),
-                               (char *)NULL);
-        }
-
-      prompt = apr_pstrcat(scratch_pool, prompt, ",\n        ", (char *)NULL);
-      prompt = apr_pstrcat(scratch_pool, prompt,
-                           _("(s) show all options: "),
-                           (char *)NULL);
+            *next_option++ = "r";
+          *next_option++ = "mf";
+          *next_option++ = "tf";
+        }
+      *next_option++ = "s";
+      *next_option++ = NULL;
+      prompt = prompt_string(text_conflict_options, options, iterpool);
 
-      SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, scratch_pool));
+      SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, iterpool));
 
       if (strcmp(answer, "s") == 0)
         {
-          /* These are used in svn_cl__accept_from_word(). */
-          SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
-          _("\n"
-            "  (e)  edit             - change merged file in an editor\n"
-            "  (df) diff-full        - show all changes made to merged "
-                                      "file\n"
-            "  (r)  resolved         - accept merged version of file\n"
-            "\n"
-            "  (dc) display-conflict - show all conflicts "
-                                      "(ignoring merged version)\n"
-            "  (mc) mine-conflict    - accept my version for all "
-                                      "conflicts (same)\n"
-            "  (tc) theirs-conflict  - accept their version for all "
-                                      "conflicts (same)\n"
-            "\n"
-            "  (mf) mine-full        - accept my version of entire file "
-                                      "(even non-conflicts)\n"
-            "  (tf) theirs-full      - accept their version of entire "
-                                      "file (same)\n"
-            "\n"
-            "  (p)  postpone         - mark the conflict to be "
-                                      "resolved later\n"
-            "  (m)  merge            - use internal merge tool to "
-                                      "resolve conflict\n"
-            "  (l)  launch           - launch external tool to "
-                                      "resolve conflict\n"
-            "  (s)  show all         - show this list\n\n")));
+          SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "\n%s\n",
+                                      help_string(text_conflict_options,
+                                                  iterpool)));
         }
       else if (strcmp(answer, "p") == 0 || strcmp(answer, ":-P") == 0)
         {
@@ -397,7 +522,7 @@ handle_text_conflict(svn_wc_conflict_res
         {
           if (desc->is_binary)
             {
-              SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+              SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                                           _("Invalid option; cannot choose "
                                             "based on conflicts in a "
                                             "binary file.\n\n")));
@@ -412,7 +537,7 @@ handle_text_conflict(svn_wc_conflict_res
         {
           if (desc->is_binary)
             {
-              SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+              SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                                           _("Invalid option; cannot choose "
                                             "based on conflicts in a "
                                             "binary file.\n\n")));
@@ -441,7 +566,7 @@ handle_text_conflict(svn_wc_conflict_res
         {
           if (desc->is_binary)
             {
-              SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+              SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                                           _("Invalid option; cannot "
                                             "display conflicts for a "
                                             "binary file.\n\n")));
@@ -450,30 +575,30 @@ handle_text_conflict(svn_wc_conflict_res
           else if (! (desc->my_abspath && desc->base_abspath &&
                       desc->their_abspath))
             {
-              SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+              SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                                           _("Invalid option; original "
                                             "files not available.\n\n")));
               continue;
             }
-          SVN_ERR(show_conflicts(desc, scratch_pool));
+          SVN_ERR(show_conflicts(desc, iterpool));
           knows_something = TRUE;
         }
       else if (strcmp(answer, "df") == 0)
         {
           if (! diff_allowed)
             {
-              SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+              SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                              _("Invalid option; there's no "
                                 "merged version to diff.\n\n")));
               continue;
             }
 
-          SVN_ERR(show_diff(desc, scratch_pool));
+          SVN_ERR(show_diff(desc, iterpool));
           knows_something = TRUE;
         }
       else if (strcmp(answer, "e") == 0 || strcmp(answer, ":-E") == 0)
         {
-          SVN_ERR(open_editor(&performed_edit, desc, b, scratch_pool));
+          SVN_ERR(open_editor(&performed_edit, desc, b, iterpool));
           if (performed_edit)
             knows_something = TRUE;
         }
@@ -482,7 +607,7 @@ handle_text_conflict(svn_wc_conflict_res
         {
           if (desc->kind != svn_wc_conflict_kind_text)
             {
-              SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+              SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                                           _("Invalid option; can only "
                                             "resolve text conflicts with "
                                             "the internal merge tool."
@@ -504,11 +629,11 @@ handle_text_conflict(svn_wc_conflict_res
                                          b->editor_cmd,
                                          b->config,
                                          &remains_in_conflict,
-                                         scratch_pool));
+                                         iterpool));
               knows_something = !remains_in_conflict;
             }
           else
-            SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+            SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                                         _("Invalid option.\n\n")));
         }
       else if (strcmp(answer, "l") == 0 || strcmp(answer, ":-l") == 0)
@@ -516,12 +641,12 @@ handle_text_conflict(svn_wc_conflict_res
           if (desc->base_abspath && desc->their_abspath &&
               desc->my_abspath && desc->merged_file)
             {
-              SVN_ERR(launch_resolver(&performed_edit, desc, b, scratch_pool));
+              SVN_ERR(launch_resolver(&performed_edit, desc, b, iterpool));
               if (performed_edit)
                 knows_something = TRUE;
             }
           else
-            SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+            SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                                         _("Invalid option.\n\n")));
         }
       else if (strcmp(answer, "r") == 0)
@@ -535,10 +660,11 @@ handle_text_conflict(svn_wc_conflict_res
               break;
             }
           else
-            SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+            SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                                         _("Invalid option.\n\n")));
         }
     }
+  svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
 }
@@ -553,9 +679,8 @@ handle_prop_conflict(svn_wc_conflict_res
                      svn_cl__interactive_conflict_baton_t *b,
                      apr_pool_t *scratch_pool)
 {
-  const char *answer;
-  const char *prompt;
-  svn_stringbuf_t *prop_reject;
+  const char *prompt
+    = prompt_string(prop_conflict_options, NULL, scratch_pool);
   apr_pool_t *iterpool;
 
   SVN_ERR_ASSERT(desc->kind == svn_wc_conflict_kind_property);
@@ -575,6 +700,8 @@ handle_prop_conflict(svn_wc_conflict_res
    * ### This needs to be fixed so we can present better options here. */
   if (desc->their_abspath)
     {
+      svn_stringbuf_t *prop_reject;
+
       /* ### The library dumps an svn_string_t into a temp file, and
        * ### we read it back from the file into an svn_stringbuf_t here.
        * ### That's rather silly. We should be passed svn_string_t's
@@ -596,9 +723,9 @@ handle_prop_conflict(svn_wc_conflict_res
   iterpool = svn_pool_create(scratch_pool);
   while (TRUE)
     {
-      svn_pool_clear(iterpool);
+      const char *answer;
 
-      prompt = _("Select: (p) postpone, (mf) mine-full, (tf) theirs-full: ");
+      svn_pool_clear(iterpool);
 
       SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, iterpool));
 
@@ -794,7 +921,8 @@ svn_cl__conflict_func_interactive(svn_wc
            && (desc->reason == svn_wc_conflict_reason_obstructed))
     {
       const char *answer;
-      const char *prompt;
+      const char *prompt
+        = prompt_string(obstructed_add_options, NULL, scratch_pool);
 
       SVN_ERR(svn_cmdline_fprintf(
                    stderr, subpool,
@@ -803,8 +931,6 @@ svn_cl__conflict_func_interactive(svn_wc
                    svn_cl__local_style_skip_ancestor(b->path_prefix,
                                                      desc->local_abspath,
                                                      subpool)));
-      prompt = _("Select: (p) postpone, (mf) mine-full, "
-                 "(tf) theirs-full, (h) help: ");
 
       while (1)
         {
@@ -814,13 +940,9 @@ svn_cl__conflict_func_interactive(svn_wc
 
           if (strcmp(answer, "h") == 0 || strcmp(answer, "?") == 0)
             {
-              SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
-              _("  (p)  postpone    - resolve the conflict later\n"
-                "  (mf) mine-full   - accept pre-existing item "
-                "(ignore upstream addition)\n"
-                "  (tf) theirs-full - accept incoming item "
-                "(overwrite pre-existing item)\n"
-                "  (h)  help        - show this help\n\n")));
+              SVN_ERR(svn_cmdline_fprintf(stderr, subpool, "%s\n",
+                                          help_string(obstructed_add_options,
+                                                      subpool)));
             }
           if (strcmp(answer, "p") == 0 || strcmp(answer, ":-P") == 0)
             {
@@ -843,7 +965,8 @@ svn_cl__conflict_func_interactive(svn_wc
   else if (desc->kind == svn_wc_conflict_kind_tree)
     {
       const char *answer;
-      const char *prompt;
+      const char *prompt
+        = prompt_string(tree_conflict_options, NULL, scratch_pool);
       const char *readable_desc;
 
       SVN_ERR(svn_cl__get_human_readable_tree_conflict_description(
@@ -856,10 +979,6 @@ svn_cl__conflict_func_interactive(svn_wc
                                                      scratch_pool),
                    readable_desc));
 
-      prompt = _("Select: (p) postpone, (r) mark-resolved, "
-                 "(mc) mine-conflict,\n"
-                 "        (tc) theirs-conflict, (h) help: ");
-
       while (1)
         {
           svn_pool_clear(subpool);
@@ -868,11 +987,9 @@ svn_cl__conflict_func_interactive(svn_wc
 
           if (strcmp(answer, "h") == 0 || strcmp(answer, "?") == 0)
             {
-              SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
-              _("  (p) postpone         - resolve the conflict later\n"
-                "  (r) resolved         - accept current working copy state\n"
-                "  (mc) mine-conflict   - prefer local change\n"
-                "  (tc) theirs-conflict - prefer incoming change\n")));
+              SVN_ERR(svn_cmdline_fprintf(stderr, subpool, "%s",
+                                          help_string(tree_conflict_options,
+                                                      subpool)));
             }
           if (strcmp(answer, "p") == 0 || strcmp(answer, ":-p") == 0)
             {

Modified: subversion/branches/wc-collate-path/subversion/svn/import-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/import-cmd.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/import-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/import-cmd.c Tue Dec  4 15:35:13 2012
@@ -118,6 +118,7 @@ svn_cl__import(apr_getopt_t *os,
                               url,
                               opt_state->depth,
                               opt_state->no_ignore,
+                              opt_state->no_autoprops,
                               opt_state->force,
                               opt_state->revprop_table,
                               NULL, NULL,  /* filter callback / baton */

Modified: subversion/branches/wc-collate-path/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/info-cmd.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/info-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/info-cmd.c Tue Dec  4 15:35:13 2012
@@ -102,8 +102,22 @@ print_info_xml(void *baton,
                         "revision", rev_str,
                         NULL);
 
+  /* "<url> xx </url>" */
   svn_cl__xml_tagged_cdata(&sb, pool, "url", info->URL);
 
+  if (info->repos_root_URL)
+    {
+      /* "<relative-url> xx </relative-url>" */
+      svn_cl__xml_tagged_cdata(&sb, pool, "relative-url",
+                               apr_pstrcat(pool, "^/",
+                                           svn_path_uri_encode(
+                                               svn_uri_skip_ancestor(
+                                                   info->repos_root_URL,
+                                                   info->URL, pool),
+                                               pool),
+                                           NULL));
+    }
+
   if (info->repos_root_URL || info->repos_UUID)
     {
       /* "<repository>" */
@@ -308,6 +322,13 @@ print_info(void *baton,
   if (info->URL)
     SVN_ERR(svn_cmdline_printf(pool, _("URL: %s\n"), info->URL));
 
+  if (info->URL && info->repos_root_URL)
+    SVN_ERR(svn_cmdline_printf(pool, _("Relative URL: ^/%s\n"),
+                               svn_path_uri_encode(
+                                   svn_uri_skip_ancestor(info->repos_root_URL,
+                                                         info->URL, pool),
+                                   pool)));
+
   if (info->repos_root_URL)
     SVN_ERR(svn_cmdline_printf(pool, _("Repository Root: %s\n"),
                                info->repos_root_URL));

Modified: subversion/branches/wc-collate-path/subversion/svn/list-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/list-cmd.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/list-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/list-cmd.c Tue Dec  4 15:35:13 2012
@@ -42,9 +42,14 @@
 struct print_baton {
   svn_boolean_t verbose;
   svn_client_ctx_t *ctx;
+  
+  /* To keep track of last seen external information. */
+  const char *last_external_parent_url;
+  const char *last_external_target;
+  svn_boolean_t in_external;
 };
 
-/* This implements the svn_client_list_func_t API, printing a single
+/* This implements the svn_client_list_func2_t API, printing a single
    directory entry in text format. */
 static svn_error_t *
 print_dirent(void *baton,
@@ -52,13 +57,18 @@ print_dirent(void *baton,
              const svn_dirent_t *dirent,
              const svn_lock_t *lock,
              const char *abs_path,
-             apr_pool_t *pool)
+             const char *external_parent_url,
+             const char *external_target,
+             apr_pool_t *scratch_pool)
 {
   struct print_baton *pb = baton;
   const char *entryname;
   static const char *time_format_long = NULL;
   static const char *time_format_short = NULL;
 
+  SVN_ERR_ASSERT((external_parent_url == NULL && external_target == NULL) ||
+                 (external_parent_url && external_target));
+
   if (time_format_long == NULL)
     time_format_long = _("%b %d %H:%M");
   if (time_format_short == NULL)
@@ -70,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
@@ -79,6 +89,24 @@ print_dirent(void *baton,
     }
   else
     entryname = path;
+  
+  if (external_parent_url && external_target)
+    {
+      if ((pb->last_external_parent_url == NULL 
+           && pb->last_external_target == NULL) 
+          || (strcmp(pb->last_external_parent_url, external_parent_url) != 0
+              || strcmp(pb->last_external_target, external_target) != 0))
+        {
+          SVN_ERR(svn_cmdline_printf(scratch_pool,
+                                     _("Listing external '%s'"
+                                       " defined on '%s':\n"), 
+                                     external_target,
+                                     external_parent_url));
+
+          pb->last_external_parent_url = external_parent_url;
+          pb->last_external_target = external_target;
+        }
+    }
 
   if (pb->verbose)
     {
@@ -110,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' : ' ',
@@ -126,14 +155,14 @@ 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)
                                 ? "/" : "");
     }
 }
 
 
-/* This implements the svn_client_list_func_t API, printing a single dirent
+/* This implements the svn_client_list_func2_t API, printing a single dirent
    in XML format. */
 static svn_error_t *
 print_dirent_xml(void *baton,
@@ -141,18 +170,21 @@ print_dirent_xml(void *baton,
                  const svn_dirent_t *dirent,
                  const svn_lock_t *lock,
                  const char *abs_path,
-                 apr_pool_t *pool)
+                 const char *external_parent_url,
+                 const char *external_target,
+                 apr_pool_t *scratch_pool)
 {
   struct print_baton *pb = baton;
   const char *entryname;
-  svn_stringbuf_t *sb;
+  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));
 
   if (strcmp(path, "") == 0)
     {
       if (dirent->kind == svn_node_file)
-        entryname = svn_dirent_basename(abs_path, pool);
-      else if (pb->verbose)
-        entryname = ".";
+        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;
@@ -162,49 +194,73 @@ print_dirent_xml(void *baton,
 
   if (pb->ctx->cancel_func)
     SVN_ERR(pb->ctx->cancel_func(pb->ctx->cancel_baton));
+  
+  if (external_parent_url && external_target)
+    {
+      if ((pb->last_external_parent_url == NULL 
+           && pb->last_external_target == NULL)
+          || (strcmp(pb->last_external_parent_url, external_parent_url) != 0
+              || strcmp(pb->last_external_target, external_target) != 0))
+        {
+          if (pb->in_external)
+            {
+              /* The external item being listed is different from the previous
+                 one, so close the tag. */
+              svn_xml_make_close_tag(&sb, scratch_pool, "external");
+              pb->in_external = FALSE;
+            }
+
+          svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal, "external",
+                                "parent_url", external_parent_url,
+                                "target", external_target,
+                                NULL);
 
-  sb = svn_stringbuf_create_empty(pool);
+          pb->last_external_parent_url = external_parent_url;
+          pb->last_external_target = external_target;
+          pb->in_external = TRUE;
+        }
+    }
 
-  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);
 }
@@ -225,6 +281,8 @@ svn_cl__list(apr_getopt_t *os,
   struct print_baton pb;
   svn_boolean_t seen_nonexistent_target = FALSE;
   svn_error_t *err;
+  svn_error_t *externals_err = SVN_NO_ERROR;
+  struct svn_cl__check_externals_failed_notify_baton nwb;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -266,12 +324,27 @@ svn_cl__list(apr_getopt_t *os,
   if (opt_state->depth == svn_depth_unknown)
     opt_state->depth = svn_depth_immediates;
 
+  if (opt_state->include_externals)
+    {
+      nwb.wrapped_func = ctx->notify_func2;
+      nwb.wrapped_baton = ctx->notify_baton2;
+      nwb.had_externals_error = FALSE;
+      ctx->notify_func2 = svn_cl__check_externals_failed_notify_wrapper;
+      ctx->notify_baton2 = &nwb;
+    }
+
   /* For each target, try to list it. */
   for (i = 0; i < targets->nelts; i++)
     {
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
       const char *truepath;
       svn_opt_revision_t peg_revision;
+      
+      /* Initialize the following variables for 
+         every list target. */
+      pb.last_external_parent_url = NULL;
+      pb.last_external_target = NULL;
+      pb.in_external = FALSE;
 
       svn_pool_clear(subpool);
 
@@ -290,11 +363,12 @@ svn_cl__list(apr_getopt_t *os,
           SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
         }
 
-      err = svn_client_list2(truepath, &peg_revision,
+      err = svn_client_list3(truepath, &peg_revision,
                              &(opt_state->start_revision),
                              opt_state->depth,
                              dirent_fields,
                              (opt_state->xml || opt_state->verbose),
+                             opt_state->include_externals,
                              opt_state->xml ? print_dirent_xml : print_dirent,
                              &pb, ctx, subpool);
 
@@ -316,20 +390,35 @@ svn_cl__list(apr_getopt_t *os,
       if (opt_state->xml)
         {
           svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool);
+          
+          if (pb.in_external)
+            {
+              /* close the final external item's tag */ 
+              svn_xml_make_close_tag(&sb, pool, "external");
+              pb.in_external = FALSE;
+            }
+
           svn_xml_make_close_tag(&sb, pool, "list");
           SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
         }
     }
 
   svn_pool_destroy(subpool);
+  
+  if (opt_state->include_externals && nwb.had_externals_error)
+    {
+      externals_err = svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+                                       NULL,
+                                       _("Failure occurred processing one or "
+                                         "more externals definitions"));
+    }
 
   if (opt_state->xml && ! opt_state->incremental)
     SVN_ERR(svn_cl__xml_print_footer("lists", pool));
 
   if (seen_nonexistent_target)
-    return svn_error_create(
-      SVN_ERR_ILLEGAL_TARGET, NULL,
-      _("Could not list all targets because some targets don't exist"));
-  else
-    return SVN_NO_ERROR;
+    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/wc-collate-path/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/log-cmd.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/log-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/log-cmd.c Tue Dec  4 15:35:13 2012
@@ -39,6 +39,8 @@
 #include "svn_props.h"
 #include "svn_pools.h"
 
+#include "private/svn_cmdline_private.h"
+
 #include "cl.h"
 
 #include "svn_private_config.h"
@@ -653,9 +655,9 @@ log_entry_receiver_xml(void *baton,
   if (log_entry->revprops && apr_hash_count(log_entry->revprops) > 0)
     {
       svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "revprops", NULL);
-      SVN_ERR(svn_cl__print_xml_prop_hash(&sb, log_entry->revprops,
-                                          FALSE, /* name_only */
-                                          FALSE, pool));
+      SVN_ERR(svn_cmdline__print_xml_prop_hash(&sb, log_entry->revprops,
+                                               FALSE, /* name_only */
+                                               FALSE, pool));
       svn_xml_make_close_tag(&sb, pool, "revprops");
     }
 

Modified: subversion/branches/wc-collate-path/subversion/svn/mergeinfo-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/mergeinfo-cmd.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/mergeinfo-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/mergeinfo-cmd.c Tue Dec  4 15:35:13 2012
@@ -37,7 +37,6 @@
 #include "cl.h"
 
 #include "svn_private_config.h"
-#include "private/svn_client_private.h"
 
 
 /*** Code. ***/
@@ -60,10 +59,15 @@ print_log_rev(void *baton,
  * of merging between two branches, given the merge description
  * indicated by YCA, BASE, RIGHT, TARGET, REINTEGRATE_LIKE. */
 static svn_error_t *
-mergeinfo_diagram(svn_client__pathrev_t *yca,
-                  svn_client__pathrev_t *base,
-                  svn_client__pathrev_t *right,
-                  svn_client__pathrev_t *target,
+mergeinfo_diagram(const char *yca_url,
+                  const char *base_url,
+                  const char *right_url,
+                  const char *target_url,
+                  svn_revnum_t yca_rev,
+                  svn_revnum_t base_rev,
+                  svn_revnum_t right_rev,
+                  svn_revnum_t target_rev,
+                  const char *repos_root_url,
                   svn_boolean_t target_is_wc,
                   svn_boolean_t reintegrate_like,
                   apr_pool_t *pool)
@@ -82,16 +86,16 @@ mergeinfo_diagram(svn_client__pathrev_t 
 
   /* The YCA (that is, the branching point).  And an ellipsis, because we
    * don't show information about earlier merges */
-  g[0][0] = apr_psprintf(pool, "  %-8ld  ", yca->rev);
+  g[0][0] = apr_psprintf(pool, "  %-8ld  ", yca_rev);
   g[1][0] =     "  |         ";
-  if (strcmp(yca->url, right->url) == 0)
+  if (strcmp(yca_url, right_url) == 0)
     {
       g[2][0] = "-------| |--";
       g[3][0] = "   \\        ";
       g[4][0] = "    \\       ";
       g[5][0] = "     --| |--";
     }
-  else if (strcmp(yca->url, target->url) == 0)
+  else if (strcmp(yca_url, target_url) == 0)
     {
       g[2][0] = "     --| |--";
       g[3][0] = "    /       ";
@@ -107,18 +111,18 @@ mergeinfo_diagram(svn_client__pathrev_t 
     }
 
   /* The last full merge */
-  if ((base->rev > yca->rev) && reintegrate_like)
+  if ((base_rev > yca_rev) && reintegrate_like)
     {
       g[2][2] = "---------";
       g[3][2] = "  /      ";
       g[4][2] = " /       ";
       g[5][2] = "---------";
       g[6][2] = "|        ";
-      g[7][2] = apr_psprintf(pool, "%-8ld ", base->rev);
+      g[7][2] = apr_psprintf(pool, "%-8ld ", base_rev);
     }
-  else if (base->rev > yca->rev)
+  else if (base_rev > yca_rev)
     {
-      g[0][2] = apr_psprintf(pool, "%-8ld ", base->rev);
+      g[0][2] = apr_psprintf(pool, "%-8ld ", base_rev);
       g[1][2] = "|        ";
       g[2][2] = "---------";
       g[3][2] = " \\       ";
@@ -135,7 +139,7 @@ mergeinfo_diagram(svn_client__pathrev_t 
 
   /* The tips of the branches */
     {
-      g[0][3] = apr_psprintf(pool, "%-8ld", right->rev);
+      g[0][3] = apr_psprintf(pool, "%-8ld", right_rev);
       g[1][3] = "|       ";
       g[2][3] = "-       ";
       g[3][3] = "        ";
@@ -143,7 +147,7 @@ mergeinfo_diagram(svn_client__pathrev_t 
       g[5][3] = "-       ";
       g[6][3] = "|       ";
       g[7][3] = target_is_wc ? "WC      "
-                             : apr_psprintf(pool, "%-8ld", target->rev);
+                             : apr_psprintf(pool, "%-8ld", target_rev);
     }
 
   /* Find the width of each column, so we know how to print blank cells */
@@ -183,10 +187,10 @@ mergeinfo_diagram(svn_client__pathrev_t 
         }
       if (row == 2)
         SVN_ERR(svn_cmdline_printf(pool, "  %s",
-                svn_client__pathrev_relpath(right, pool)));
+                svn_uri_skip_ancestor(repos_root_url, right_url, pool)));
       if (row == 5)
         SVN_ERR(svn_cmdline_printf(pool, "  %s",
-                svn_client__pathrev_relpath(target, pool)));
+                svn_uri_skip_ancestor(repos_root_url, target_url, pool)));
       SVN_ERR(svn_cmdline_fputs("\n", stdout, pool));
     }
 
@@ -206,7 +210,9 @@ mergeinfo_summary(
                   apr_pool_t *pool)
 {
   svn_client_automatic_merge_t *the_merge;
-  svn_client__pathrev_t *yca, *base, *right, *target;
+  const char *yca_url, *base_url, *right_url, *target_url;
+  svn_revnum_t yca_rev, base_rev, right_rev, target_rev;
+  const char *repos_root_url;
   svn_boolean_t target_is_wc, reintegrate_like;
 
   target_is_wc = (! svn_path_is_url(target_path_or_url))
@@ -226,12 +232,18 @@ mergeinfo_summary(
               target_path_or_url, target_revision,
               ctx, pool, pool));
 
-  SVN_ERR(svn_client__automatic_merge_get_locations(
-            &yca, &base, &right, &target, the_merge, pool));
+  SVN_ERR(svn_client_automatic_merge_get_locations(
+            &yca_url, &yca_rev,
+            &base_url, &base_rev,
+            &right_url, &right_rev,
+            &target_url, &target_rev,
+            &repos_root_url,
+            the_merge, pool));
   reintegrate_like = svn_client_automatic_merge_is_reintegrate_like(the_merge);
 
-  SVN_ERR(mergeinfo_diagram(yca, base, right, target,
-                            target_is_wc, reintegrate_like,
+  SVN_ERR(mergeinfo_diagram(yca_url, base_url, right_url, target_url,
+                            yca_rev, base_rev, right_rev, target_rev,
+                            repos_root_url, target_is_wc, reintegrate_like,
                             pool));
 
   return SVN_NO_ERROR;

Modified: subversion/branches/wc-collate-path/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/propedit-cmd.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/propedit-cmd.c Tue Dec  4 15:35:13 2012
@@ -84,6 +84,9 @@ svn_cl__propedit(apr_getopt_t *os,
     return svn_error_createf(SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
                              _("'%s' is not a valid Subversion property name"),
                              pname_utf8);
+  if (!opt_state->force)
+    SVN_ERR(svn_cl__check_svn_prop_name(pname_utf8, opt_state->revprop, pool));
+
   if (opt_state->encoding && !svn_prop_needs_translation(pname_utf8))
       return svn_error_create
           (SVN_ERR_UNSUPPORTED_FEATURE, NULL,

Modified: subversion/branches/wc-collate-path/subversion/svn/propget-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/propget-cmd.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/propget-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/propget-cmd.c Tue Dec  4 15:35:13 2012
@@ -147,6 +147,7 @@ print_properties_xml(const char *pname,
    All other arguments are as per print_properties. */
 static svn_error_t *
 print_single_prop(svn_string_t *propval,
+                  const char *target_abspath_or_url,
                   const char *abspath_or_URL,
                   const char *wc_path_prefix,
                   svn_stream_t *out,
@@ -171,9 +172,24 @@ print_single_prop(svn_string_t *propval,
       /* In verbose mode, print exactly same as "proplist" does;
        * otherwise, print a brief header. */
       if (inherited_property)
-        header = apr_psprintf(scratch_pool, like_proplist
-                              ? _("Properties inherited from '%s':\n")
-                              : "%s - ", abspath_or_URL);
+        {
+          if (like_proplist)
+            {
+              if (! svn_path_is_url(target_abspath_or_url))
+                target_abspath_or_url =
+                  svn_cl__local_style_skip_ancestor(wc_path_prefix,
+                                                    target_abspath_or_url,
+                                                    scratch_pool);
+              header = apr_psprintf(
+                scratch_pool,
+                _("Inherited properties on '%s',\nfrom '%s':\n"),
+                target_abspath_or_url, abspath_or_URL);
+            }
+          else
+            {
+              header = apr_psprintf(scratch_pool, "%s - ", abspath_or_URL);
+            }
+        }
       else
         header = apr_psprintf(scratch_pool, like_proplist
                               ? _("Properties on '%s':\n")
@@ -194,7 +210,7 @@ print_single_prop(svn_string_t *propval,
       apr_hash_t *hash = apr_hash_make(scratch_pool);
 
       apr_hash_set(hash, pname_utf8, APR_HASH_KEY_STRING, propval);
-      SVN_ERR(svn_cl__print_prop_hash(out, hash, FALSE, scratch_pool));
+      SVN_ERR(svn_cmdline__print_prop_hash(out, hash, FALSE, scratch_pool));
     }
   else
     {
@@ -218,6 +234,8 @@ print_single_prop(svn_string_t *propval,
    value.  INHERITED_PROPS is a depth-first ordered array of
    svn_prop_inherited_item_t * structures.
 
+   TARGET_ABSPATH_OR_URL is the path which inherits INHERITED_PROPS.
+
    PROPS may be an empty hash, but is never null.  INHERITED_PROPS may be
    null.
 
@@ -234,6 +252,7 @@ print_single_prop(svn_string_t *propval,
    like "svn proplist -v" does. */
 static svn_error_t *
 print_properties(svn_stream_t *out,
+                 const char *target_abspath_or_url,
                  const char *pname_utf8,
                  apr_hash_t *props,
                  apr_array_header_t *inherited_props,
@@ -259,7 +278,7 @@ print_properties(svn_stream_t *out,
             APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
           svn_string_t *propval = svn__apr_hash_index_val(apr_hash_first(pool,
                                                           iprop->prop_hash));
-          SVN_ERR(print_single_prop(propval,
+          SVN_ERR(print_single_prop(propval, target_abspath_or_url,
                                     iprop->path_or_url,
                                     path_prefix, out, pname_utf8,
                                     print_filenames, omit_newline,
@@ -276,8 +295,8 @@ print_properties(svn_stream_t *out,
 
       svn_pool_clear(iterpool);
 
-      SVN_ERR(print_single_prop(propval, filename, path_prefix,
-                                out, pname_utf8, print_filenames,
+      SVN_ERR(print_single_prop(propval, target_abspath_or_url, filename,
+                                path_prefix, out, pname_utf8, print_filenames,
                                 omit_newline, like_proplist, FALSE,
                                 iterpool));
     }
@@ -443,7 +462,8 @@ svn_cl__propget(apr_getopt_t *os,
           print_filenames = ((opt_state->depth > svn_depth_empty
                               || targets->nelts > 1
                               || apr_hash_count(props) > 1
-                              || opt_state->verbose)
+                              || opt_state->verbose
+                              || opt_state->show_inherited_props)
                              && (! opt_state->strict));
           omit_newline = opt_state->strict;
           like_proplist = opt_state->verbose && !opt_state->strict;
@@ -455,7 +475,7 @@ svn_cl__propget(apr_getopt_t *os,
               subpool));
           else
             SVN_ERR(print_properties(
-              out, pname_utf8,
+              out, truepath, pname_utf8,
               props,
               opt_state->show_inherited_props ? inherited_props : NULL,
               print_filenames,

Modified: subversion/branches/wc-collate-path/subversion/svn/proplist-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/proplist-cmd.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/proplist-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/proplist-cmd.c Tue Dec  4 15:35:13 2012
@@ -38,6 +38,8 @@
 #include "svn_props.h"
 #include "cl.h"
 
+#include "private/svn_cmdline_private.h"
+
 #include "svn_private_config.h"
 
 typedef struct proplist_baton_t
@@ -82,9 +84,9 @@ proplist_receiver_xml(void *baton,
 
           svn_xml_make_open_tag(&sb, iterpool, svn_xml_normal, "target",
                             "path", name_local, NULL);
-          SVN_ERR(svn_cl__print_xml_prop_hash(&sb, iprop->prop_hash,
-                                              (! opt_state->verbose),
-                                              TRUE, iterpool));
+          SVN_ERR(svn_cmdline__print_xml_prop_hash(&sb, iprop->prop_hash,
+                                                   (! opt_state->verbose),
+                                                   TRUE, iterpool));
           svn_xml_make_close_tag(&sb, iterpool, "target");
           SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
         }
@@ -105,9 +107,9 @@ proplist_receiver_xml(void *baton,
         svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "target",
                               "path", name_local, NULL);
 
-        SVN_ERR(svn_cl__print_xml_prop_hash(&sb, prop_hash,
-                                            (! opt_state->verbose),
-                                            FALSE, pool));
+        SVN_ERR(svn_cmdline__print_xml_prop_hash(&sb, prop_hash,
+                                                 (! opt_state->verbose),
+                                                 FALSE, pool));
 
         /* "</target>" */
         svn_xml_make_close_tag(&sb, pool, "target");
@@ -151,16 +153,18 @@ proplist_receiver(void *baton,
             {
               if (svn_path_is_url(iprop->path_or_url))
                 SVN_ERR(svn_cmdline_printf(
-                  iterpool, _("Properties inherited from '%s':\n"),
-                  iprop->path_or_url));
+                  iterpool, _("Inherited properties on '%s',\nfrom '%s':\n"),
+                  name_local, iprop->path_or_url));
               else
                 SVN_ERR(svn_cmdline_printf(
-                  iterpool, _("Properties inherited from '%s':\n"),
-                  svn_dirent_local_style(iprop->path_or_url, iterpool)));
+                  iterpool, _("Inherited properties on '%s',\nfrom '%s':\n"),
+                  name_local, svn_dirent_local_style(iprop->path_or_url,
+                                                     iterpool)));
             }
 
-          SVN_ERR(svn_cl__print_prop_hash(NULL, iprop->prop_hash,
-                                          (! opt_state->verbose), iterpool));
+          SVN_ERR(svn_cmdline__print_prop_hash(NULL, iprop->prop_hash,
+                                               (! opt_state->verbose),
+                                               iterpool));
         }
       svn_pool_destroy(iterpool);
     }
@@ -170,8 +174,8 @@ proplist_receiver(void *baton,
       if (!opt_state->quiet)
         SVN_ERR(svn_cmdline_printf(pool, _("Properties on '%s':\n"),
                                    name_local));
-      SVN_ERR(svn_cl__print_prop_hash(NULL, prop_hash, (! opt_state->verbose),
-                                      pool));
+      SVN_ERR(svn_cmdline__print_prop_hash(NULL, prop_hash,
+                                           (! opt_state->verbose), pool));
     }
 
   return SVN_NO_ERROR;
@@ -227,9 +231,9 @@ svn_cl__proplist(apr_getopt_t *os,
           svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal,
                                 "revprops",
                                 "rev", revstr, NULL);
-          SVN_ERR(svn_cl__print_xml_prop_hash(&sb, proplist,
-                                              (! opt_state->verbose), FALSE,
-                                              scratch_pool));
+          SVN_ERR(svn_cmdline__print_xml_prop_hash(&sb, proplist,
+                                                   (! opt_state->verbose),
+                                                   FALSE, scratch_pool));
           svn_xml_make_close_tag(&sb, scratch_pool, "revprops");
 
           SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
@@ -242,8 +246,9 @@ svn_cl__proplist(apr_getopt_t *os,
                                 _("Unversioned properties on revision %ld:\n"),
                                 rev));
 
-          SVN_ERR(svn_cl__print_prop_hash
-                  (NULL, proplist, (! opt_state->verbose), scratch_pool));
+          SVN_ERR(svn_cmdline__print_prop_hash(NULL, proplist,
+                                               (! opt_state->verbose),
+                                               scratch_pool));
         }
     }
   else  /* operate on normal, versioned properties (not revprops) */

Modified: subversion/branches/wc-collate-path/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/props.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/props.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/props.c Tue Dec  4 15:35:13 2012
@@ -27,6 +27,8 @@
 
 /*** Includes. ***/
 
+#include <stdlib.h>
+
 #include <apr_hash.h>
 #include "svn_cmdline.h"
 #include "svn_string.h"
@@ -40,10 +42,10 @@
 #include "svn_base64.h"
 #include "cl.h"
 
+#include "private/svn_string_private.h"
 #include "private/svn_cmdline_private.h"
 
 #include "svn_private_config.h"
-
 
 
 svn_error_t *
@@ -81,121 +83,6 @@ svn_cl__revprop_prepare(const svn_opt_re
   return SVN_NO_ERROR;
 }
 
-
-svn_error_t *
-svn_cl__print_prop_hash(svn_stream_t *out,
-                        apr_hash_t *prop_hash,
-                        svn_boolean_t names_only,
-                        apr_pool_t *pool)
-{
-  apr_array_header_t *sorted_props;
-  int i;
-
-  sorted_props = svn_sort__hash(prop_hash, svn_sort_compare_items_lexically,
-                                pool);
-  for (i = 0; i < sorted_props->nelts; i++)
-    {
-      svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
-      const char *pname = item.key;
-      svn_string_t *propval = item.value;
-      const char *pname_stdout;
-
-      if (svn_prop_needs_translation(pname))
-        SVN_ERR(svn_subst_detranslate_string(&propval, propval,
-                                             TRUE, pool));
-
-      SVN_ERR(svn_cmdline_cstring_from_utf8(&pname_stdout, pname, pool));
-
-      if (out)
-        {
-          pname_stdout = apr_psprintf(pool, "  %s\n", pname_stdout);
-          SVN_ERR(svn_subst_translate_cstring2(pname_stdout, &pname_stdout,
-                                              APR_EOL_STR,  /* 'native' eol */
-                                              FALSE, /* no repair */
-                                              NULL,  /* no keywords */
-                                              FALSE, /* no expansion */
-                                              pool));
-
-          SVN_ERR(svn_stream_puts(out, pname_stdout));
-        }
-      else
-        {
-          /* ### We leave these printfs for now, since if propval wasn't
-             translated above, we don't know anything about its encoding.
-             In fact, it might be binary data... */
-          printf("  %s\n", pname_stdout);
-        }
-
-      if (!names_only)
-        {
-          /* Add an extra newline to the value before indenting, so that
-           * every line of output has the indentation whether the value
-           * already ended in a newline or not. */
-          const char *newval = apr_psprintf(pool, "%s\n", propval->data);
-          const char *indented_newval = svn_cl__indent_string(newval,
-                                                              "    ",
-                                                              pool);
-          if (out)
-            {
-              SVN_ERR(svn_stream_puts(out, indented_newval));
-            }
-          else
-            {
-              printf("%s", indented_newval);
-            }
-        }
-    }
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_cl__print_xml_prop_hash(svn_stringbuf_t **outstr,
-                            apr_hash_t *prop_hash,
-                            svn_boolean_t names_only,
-                            svn_boolean_t inherited_props,
-                            apr_pool_t *pool)
-{
-  apr_array_header_t *sorted_props;
-  int i;
-
-  if (*outstr == NULL)
-    *outstr = svn_stringbuf_create_empty(pool);
-
-  sorted_props = svn_sort__hash(prop_hash, svn_sort_compare_items_lexically,
-                                pool);
-  for (i = 0; i < sorted_props->nelts; i++)
-    {
-      svn_sort__item_t item = APR_ARRAY_IDX(sorted_props, i, svn_sort__item_t);
-      const char *pname = item.key;
-      svn_string_t *propval = item.value;
-
-      if (names_only)
-        {
-          svn_xml_make_open_tag(
-            outstr, pool, svn_xml_self_closing,
-            inherited_props ? "inherited_property" : "property",
-            "name", pname, NULL);
-        }
-      else
-        {
-          const char *pname_out;
-
-          if (svn_prop_needs_translation(pname))
-            SVN_ERR(svn_subst_detranslate_string(&propval, propval,
-                                                 TRUE, pool));
-
-          SVN_ERR(svn_cmdline_cstring_from_utf8(&pname_out, pname, pool));
-
-          svn_cmdline__print_xml_prop(outstr, pname_out, propval,
-                                      inherited_props, pool);
-        }
-    }
-
-    return SVN_NO_ERROR;
-}
-
-
 void
 svn_cl__check_boolean_prop_val(const char *propname, const char *propval,
                                apr_pool_t *pool)
@@ -209,9 +96,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,
@@ -223,3 +111,191 @@ svn_cl__check_boolean_prop_val(const cha
     }
 }
 
+
+/* Context for sorting property names */
+struct simprop_context_t
+{
+  svn_string_t name;    /* The name of the property we're comparing with */
+  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: 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() */
+};
+
+/* Similarity test between two property names */
+static APR_INLINE unsigned int
+simprop_key_diff(const svn_string_t *key, const svn_string_t *ctx,
+                 svn_membuf_t *buffer, apr_size_t *diff)
+{
+  apr_size_t lcs;
+  const unsigned int score = svn_string__similarity(key, ctx, buffer, &lcs);
+  if (key->len > ctx->len)
+    *diff = key->len - lcs;
+  else
+    *diff = ctx->len - lcs;
+  return score;
+}
+
+/* Key comparator for qsort for simprop_t */
+static int
+simprop_compare(const void *pkeya, const void *pkeyb)
+{
+  struct simprop_t *const keya = *(struct simprop_t *const *)pkeya;
+  struct simprop_t *const keyb = *(struct simprop_t *const *)pkeyb;
+  struct simprop_context_t *const context = keya->context;
+
+  if (keya->score == -1)
+    keya->score = simprop_key_diff(&keya->name, &context->name,
+                                   &context->buffer, &keya->diff);
+  if (keyb->score == -1)
+    keyb->score = simprop_key_diff(&keyb->name, &context->name,
+                                   &context->buffer, &keyb->diff);
+
+  return (keya->score < keyb->score ? 1
+          : (keya->score > keyb->score ? -1
+             : (keya->diff > keyb->diff ? 1
+                : (keya->diff < keyb->diff ? -1 : 0))));
+}
+
+svn_error_t *
+svn_cl__check_svn_prop_name(const char *propname, svn_boolean_t revprop,
+                            apr_pool_t *scratch_pool)
+{
+  static const char *const nodeprops[] =
+    {
+      SVN_PROP_NODE_ALL_PROPS
+    };
+  static const apr_size_t nodeprops_len = sizeof(nodeprops)/sizeof(*nodeprops);
+
+  static const char *const revprops[] =
+    {
+      SVN_PROP_REVISION_ALL_PROPS
+    };
+  static const apr_size_t revprops_len = sizeof(revprops)/sizeof(*revprops);
+
+  const char *const *const proplist = (revprop ? revprops : nodeprops);
+  const apr_size_t numprops = (revprop ? revprops_len : nodeprops_len);
+
+  struct simprop_t **propkeys;
+  struct simprop_t *propbuf;
+  apr_size_t i;
+
+  struct simprop_context_t context;
+  svn_string_t prefix;
+
+  context.name.data = propname;
+  context.name.len = strlen(propname);
+  prefix.data = SVN_PROP_PREFIX;
+  prefix.len = strlen(SVN_PROP_PREFIX);
+
+  svn_membuf__create(&context.buffer, 0, scratch_pool);
+
+  /* First, check if the name is even close to being in the svn: namespace.
+     It must contain a colon in the right place, and we only allow
+     one-char typos or a single transposition. */
+  if (context.name.len < prefix.len
+      || context.name.data[prefix.len - 1] != prefix.data[prefix.len - 1])
+    return SVN_NO_ERROR;        /* Wrong prefix, ignore */
+  else
+    {
+      apr_size_t lcs;
+      const apr_size_t name_len = context.name.len;
+      context.name.len = prefix.len; /* Only check up to the prefix length */
+      svn_string__similarity(&context.name, &prefix, &context.buffer, &lcs);
+      context.name.len = name_len; /* Restore the original propname length */
+      if (lcs < prefix.len - 1)
+        return SVN_NO_ERROR;    /* Wrong prefix, ignore */
+
+      /* If the prefix is slightly different, the rest must be
+         identical in order to trigger the error. */
+      if (lcs == prefix.len - 1)
+        {
+          for (i = 0; i < numprops; ++i)
+            {
+              if (0 == strcmp(proplist[i] + prefix.len, propname + prefix.len))
+                return svn_error_createf(
+                  SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
+                  _("'%s' is not a valid %s property name; did you mean '%s'?"
+                    "\n(To set the '%s' property, re-run with '--force'.)"),
+                  propname, SVN_PROP_PREFIX, proplist[i], propname);
+            }
+          return SVN_NO_ERROR;
+        }
+    }
+
+  /* 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. */
+  propkeys = apr_palloc(scratch_pool,
+                        numprops * sizeof(struct simprop_t*));
+  propbuf = apr_palloc(scratch_pool,
+                       numprops * sizeof(struct simprop_t));
+  context.name.data += prefix.len;
+  context.name.len -= prefix.len;
+  for (i = 0; i < numprops; ++i)
+    {
+      propkeys[i] = &propbuf[i];
+      propbuf[i].propname = proplist[i];
+      propbuf[i].name.data = proplist[i] + prefix.len;
+      propbuf[i].name.len = strlen(propbuf[i].name.data);
+      propbuf[i].score = (unsigned int)-1;
+      propbuf[i].context = &context;
+    }
+
+  qsort(propkeys, numprops, sizeof(*propkeys), simprop_compare);
+
+  if (0 == propkeys[0]->diff)
+    return SVN_NO_ERROR;        /* We found an exact match. */
+
+  /* See if we can suggest a sane alternative spelling */
+  for (i = 0; i < numprops; ++i)
+    if (propkeys[i]->score < 666) /* 2/3 similarity required */
+      break;
+
+  switch (i)
+    {
+    case 0:
+      /* The best alternative isn't good enough */
+      return svn_error_createf(
+        SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
+        _("'%s' is not a valid %s property name;"
+          " re-run with '--force' to set it"),
+        propname, SVN_PROP_PREFIX);
+
+    case 1:
+      /* There is only one good candidate */
+      return svn_error_createf(
+        SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
+        _("'%s' is not a valid %s property name; did you mean '%s'?\n"
+          "(To set the '%s' property, re-run with '--force'.)"),
+        propname, SVN_PROP_PREFIX, propkeys[0]->propname, propname);
+
+    case 2:
+      /* Suggest a list of the most likely candidates */
+      return svn_error_createf(
+        SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
+        _("'%s' is not a valid %s property name\n"
+          "Did you mean '%s' or '%s'?\n"
+          "(To set the '%s' property, re-run with '--force'.)"),
+        propname, SVN_PROP_PREFIX,
+        propkeys[0]->propname, propkeys[1]->propname, propname);
+
+    default:
+      /* Never suggest more than three candidates */
+      return svn_error_createf(
+        SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
+        _("'%s' is not a valid %s property name\n"
+          "Did you mean '%s', '%s' or '%s'?\n"
+          "(To set the '%s' property, re-run with '--force'.)"),
+        propname, SVN_PROP_PREFIX,
+        propkeys[0]->propname, propkeys[1]->propname, propkeys[2]->propname,
+        propname);
+    }
+}

Modified: subversion/branches/wc-collate-path/subversion/svn/propset-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/propset-cmd.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/propset-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/propset-cmd.c Tue Dec  4 15:35:13 2012
@@ -67,6 +67,9 @@ svn_cl__propset(apr_getopt_t *os,
     return svn_error_createf(SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
                              _("'%s' is not a valid Subversion property name"),
                              pname_utf8);
+  if (!opt_state->force)
+    SVN_ERR(svn_cl__check_svn_prop_name(pname_utf8, opt_state->revprop,
+                                        scratch_pool));
 
   /* Get the PROPVAL from either an external file, or from the command
      line. */

Modified: subversion/branches/wc-collate-path/subversion/svn/schema/info.rnc
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/schema/info.rnc?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/schema/info.rnc (original)
+++ subversion/branches/wc-collate-path/subversion/svn/schema/info.rnc Tue Dec  4 15:35:13 2012
@@ -27,8 +27,8 @@ info = element info { entry* }
 
 entry =
   element entry {
-    attlist.entry, url?, repository?, wc-info?, commit?, conflict?, lock?,
-    tree-conflict?
+    attlist.entry, url?, relative-url?, repository?, wc-info?,
+    commit?, conflict?, lock?, tree-conflict?
   }
 attlist.entry &=
   ## Local path.
@@ -41,6 +41,9 @@ attlist.entry &=
 ## URL of this item in the repository.
 url = element url { xsd:anyURI }
 
+## Repository relative URL (^/...) of this item in the repository.
+relative-url = element relative-url { string }
+
 ## Information of this item's repository.
 repository = element repository { root?, uuid? }
 

Modified: subversion/branches/wc-collate-path/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/util.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/util.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/util.c Tue Dec  4 15:35:13 2012
@@ -1264,56 +1264,6 @@ svn_cl__time_cstring_to_human_cstring(co
   return SVN_NO_ERROR;
 }
 
-
-/* Return a copy, allocated in POOL, of the next line of text from *STR
- * up to and including a CR and/or an LF. Change *STR to point to the
- * remainder of the string after the returned part. If there are no
- * characters to be returned, return NULL; never return an empty string.
- */
-static const char *
-next_line(const char **str, apr_pool_t *pool)
-{
-  const char *start = *str;
-  const char *p = *str;
-
-  /* n.b. Throughout this fn, we never read any character after a '\0'. */
-  /* Skip over all non-EOL characters, if any. */
-  while (*p != '\r' && *p != '\n' && *p != '\0')
-    p++;
-  /* Skip over \r\n or \n\r or \r or \n, if any. */
-  if (*p == '\r' || *p == '\n')
-    {
-      char c = *p++;
-
-      if ((c == '\r' && *p == '\n') || (c == '\n' && *p == '\r'))
-        p++;
-    }
-
-  /* Now p points after at most one '\n' and/or '\r'. */
-  *str = p;
-
-  if (p == start)
-    return NULL;
-
-  return svn_string_ncreate(start, p - start, pool)->data;
-}
-
-const char *
-svn_cl__indent_string(const char *str,
-                      const char *indent,
-                      apr_pool_t *pool)
-{
-  svn_stringbuf_t *out = svn_stringbuf_create_empty(pool);
-  const char *line;
-
-  while ((line = next_line(&str, pool)))
-    {
-      svn_stringbuf_appendcstr(out, indent);
-      svn_stringbuf_appendcstr(out, line);
-    }
-  return out->data;
-}
-
 const char *
 svn_cl__node_description(const svn_wc_conflict_version_t *node,
                          const char *wc_repos_root_URL,

Modified: subversion/branches/wc-collate-path/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svnmucc/svnmucc.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/wc-collate-path/subversion/svnmucc/svnmucc.c Tue Dec  4 15:35:13 2012
@@ -203,15 +203,14 @@ change_props(const svn_delta_editor_t *e
       for (hi = apr_hash_first(pool, child->prop_mods);
            hi; hi = apr_hash_next(hi))
         {
-          const void *key;
-          void *val;
+          const char *propname = svn__apr_hash_index_key(hi);
+          const svn_string_t *val = svn__apr_hash_index_val(hi);
 
           svn_pool_clear(iterpool);
-          apr_hash_this(hi, &key, NULL, &val);
           if (child->kind == svn_node_dir)
-            SVN_ERR(editor->change_dir_prop(baton, key, val, iterpool));
+            SVN_ERR(editor->change_dir_prop(baton, propname, val, iterpool));
           else
-            SVN_ERR(editor->change_file_prop(baton, key, val, iterpool));
+            SVN_ERR(editor->change_file_prop(baton, propname, val, iterpool));
         }
     }
 
@@ -234,14 +233,11 @@ drive(struct operation *operation,
   for (hi = apr_hash_first(pool, operation->children);
        hi; hi = apr_hash_next(hi))
     {
-      const void *key;
-      void *val;
-      struct operation *child;
+      const char *key = svn__apr_hash_index_key(hi);
+      struct operation *child = svn__apr_hash_index_val(hi);
       void *file_baton = NULL;
 
       svn_pool_clear(subpool);
-      apr_hash_this(hi, &key, NULL, &val);
-      child = val;
 
       /* Deletes and replacements are simple -- delete something. */
       if (child->operation == OP_DELETE || child->operation == OP_REPLACE)
@@ -284,22 +280,18 @@ drive(struct operation *operation,
           svn_txdelta_window_handler_t handler;
           void *handler_baton;
           svn_stream_t *contents;
-          apr_file_t *f = NULL;
 
           SVN_ERR(editor->apply_textdelta(file_baton, NULL, subpool,
                                           &handler, &handler_baton));
-          if (strcmp(child->src_file, "-"))
+          if (strcmp(child->src_file, "-") != 0)
             {
-              SVN_ERR(svn_io_file_open(&f, child->src_file, APR_READ,
-                                       APR_OS_DEFAULT, pool));
+              SVN_ERR(svn_stream_open_readonly(&contents, child->src_file,
+                                               pool, pool));
             }
           else
             {
-              apr_status_t apr_err = apr_file_open_stdin(&f, pool);
-              if (apr_err)
-                return svn_error_wrap_apr(apr_err, "Can't open stdin");
+              SVN_ERR(svn_stream_for_stdin(&contents, pool));
             }
-          contents = svn_stream_from_aprfile2(f, FALSE, pool);
           SVN_ERR(svn_txdelta_send_stream(contents, handler,
                                           handler_baton, NULL, pool));
         }
@@ -316,15 +308,12 @@ drive(struct operation *operation,
       /* If we opened, added, or replaced a directory, we need to
          recurse, apply outstanding propmods, and then close it. */
       if ((child->kind == svn_node_dir)
-          && (child->operation == OP_OPEN
-              || child->operation == OP_ADD
-              || child->operation == OP_REPLACE))
+          && child->operation != OP_DELETE)
         {
+          SVN_ERR(change_props(editor, child->baton, child, subpool));
+
           SVN_ERR(drive(child, head, editor, subpool));
-          if (child->kind == svn_node_dir)
-            {
-              SVN_ERR(change_props(editor, child->baton, child, subpool));
-            }
+
           SVN_ERR(editor->close_directory(child->baton, subpool));
         }
     }
@@ -766,12 +755,27 @@ execute(const apr_array_header_t *action
                               pool));
   SVN_ERR(svn_ra_open4(&session, NULL, anchor, NULL, ra_callbacks,
                        NULL, config, pool));
+  /* Open, then reparent to avoid AUTHZ errors when opening the reposroot */
   SVN_ERR(svn_ra_open4(&aux_session, NULL, anchor, NULL, ra_callbacks,
                        NULL, config, pool));
   SVN_ERR(svn_ra_get_repos_root2(aux_session, &repos_root, pool));
   SVN_ERR(svn_ra_reparent(aux_session, repos_root, pool));
-
   SVN_ERR(svn_ra_get_latest_revnum(session, &head, pool));
+
+  /* Reparent to ANCHOR's dir, if ANCHOR is not a directory. */
+  {
+    svn_node_kind_t kind;
+
+    SVN_ERR(svn_ra_check_path(aux_session,
+                              svn_uri_skip_ancestor(repos_root, anchor, pool),
+                              head, &kind, pool));
+    if (kind != svn_node_dir)
+      {
+        anchor = svn_uri_dirname(anchor, pool);
+        SVN_ERR(svn_ra_reparent(session, anchor, pool));
+      }
+  }
+
   if (SVN_IS_VALID_REVNUM(base_revision))
     {
       if (base_revision > head)
@@ -781,8 +785,13 @@ execute(const apr_array_header_t *action
       head = base_revision;
     }
 
+  memset(&root, 0, sizeof(root));
   root.children = apr_hash_make(pool);
   root.operation = OP_OPEN;
+  root.kind = svn_node_dir; /* For setting properties */
+  root.prop_mods = apr_hash_make(pool);
+  root.prop_dels = apr_array_make(pool, 1, sizeof(const char *));
+
   for (i = 0; i < actions->nelts; ++i)
     {
       struct action *action = APR_ARRAY_IDX(actions, i, struct action *);
@@ -845,11 +854,17 @@ execute(const apr_array_header_t *action
                                     commit_callback, NULL, NULL, FALSE, pool));
 
   SVN_ERR(editor->open_root(editor_baton, head, pool, &root.baton));
-  err = drive(&root, head, editor, pool);
+  err = change_props(editor, root.baton, &root, pool);
+  if (!err)
+    err = drive(&root, head, editor, pool);
+  if (!err)
+    err = editor->close_directory(root.baton, pool);
   if (!err)
     err = editor->close_edit(editor_baton, pool);
+
   if (err)
-    svn_error_clear(editor->abort_edit(editor_baton, pool));
+    err = svn_error_compose_create(err,
+                                   editor->abort_edit(editor_baton, pool));
 
   return err;
 }
@@ -861,11 +876,8 @@ read_propvalue_file(const svn_string_t *
 {
   svn_stringbuf_t *value;
   apr_pool_t *scratch_pool = svn_pool_create(pool);
-  apr_file_t *f;
 
-  SVN_ERR(svn_io_file_open(&f, filename, APR_READ | APR_BINARY | APR_BUFFERED,
-                           APR_OS_DEFAULT, scratch_pool));
-  SVN_ERR(svn_stringbuf_from_aprfile(&value, f, scratch_pool));
+  SVN_ERR(svn_stringbuf_from_file2(&value, filename, scratch_pool));
   *value_p = svn_string_create_from_buf(value, pool);
   svn_pool_destroy(scratch_pool);
   return SVN_NO_ERROR;
@@ -914,7 +926,7 @@ usage(apr_pool_t *pool, int exit_val)
     "  -X, --extra-args ARG  append arguments from file ARG (one per line;\n"
     "                        use \"-\" to read from standard input)\n"
     "  --config-dir ARG      use ARG to override the config directory\n"
-    "  --config-option ARG   use ARG so override a configuration option\n"
+    "  --config-option ARG   use ARG to override a configuration option\n"
     "  --no-auth-cache       do not cache authentication tokens\n"
     "  --version             print version information\n";
   svn_error_clear(svn_cmdline_fputs(msg, stream, pool));
@@ -1133,7 +1145,7 @@ main(int argc, const char **argv)
     {
       int j, num_url_args;
       const char *action_string = APR_ARRAY_IDX(action_args, i, const char *);
-      struct action *action = apr_palloc(pool, sizeof(*action));
+      struct action *action = apr_pcalloc(pool, sizeof(*action));
 
       /* First, parse the action. */
       if (! strcmp(action_string, "mv"))
@@ -1195,8 +1207,8 @@ main(int argc, const char **argv)
       if (action->action == ACTION_PUT)
         {
           action->path[1] =
-            svn_dirent_canonicalize(APR_ARRAY_IDX(action_args, i,
-                                                  const char *), pool);
+            svn_dirent_internal_style(APR_ARRAY_IDX(action_args, i,
+                                                    const char *), pool);
           if (++i == action_args->nelts)
             insufficient(pool);
         }
@@ -1226,8 +1238,8 @@ main(int argc, const char **argv)
           else
             {
               const char *propval_file =
-                svn_dirent_canonicalize(APR_ARRAY_IDX(action_args, i,
-                                                      const char *), pool);
+                svn_dirent_internal_style(APR_ARRAY_IDX(action_args, i,
+                                                        const char *), pool);
 
               if (++i == action_args->nelts)
                 insufficient(pool);
@@ -1291,16 +1303,19 @@ main(int argc, const char **argv)
           url = sanitize_url(url, pool);
           action->path[j] = url;
 
-          /* The cp source could be the anchor, but the other URLs should be
-             children of the anchor. */
-          if (! (action->action == ACTION_CP && j == 0))
+          /* The first URL arguments to 'cp', 'pd', 'ps' could be the anchor,
+             but the other URLs should be children of the anchor. */
+          if (! (action->action == ACTION_CP && j == 0)
+              && action->action != ACTION_PROPDEL
+              && action->action != ACTION_PROPSET
+              && action->action != ACTION_PROPSETF)
             url = svn_uri_dirname(url, pool);
           if (! anchor)
             anchor = url;
           else
             anchor = svn_uri_get_longest_ancestor(anchor, url, pool);
 
-          if ((++i == action_args->nelts) && (j >= num_url_args))
+          if ((++i == action_args->nelts) && (j + 1 < num_url_args))
             insufficient(pool);
         }
       APR_ARRAY_PUSH(actions, struct action *) = action;



Mime
View raw message