You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/12/02 21:55:18 UTC

svn commit: r1041580 [28/35] - in /subversion/branches/gpg-agent-password-store: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ build/win32/ contrib/hook-scripts/ contrib/server-side/ notes/http-and-webdav/ notes/wc-ng/ subversi...

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/add-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/add-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/add-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/add-cmd.c Thu Dec  2 20:55:08 2010
@@ -71,10 +71,8 @@ svn_cl__add(apr_getopt_t *os,
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
 
       if (svn_path_is_url(target))
-        return svn_error_return(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
-                                                  NULL,
-                                                  _("'%s' is not a local path"),
-                                                  target));
+        return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                 _("'%s' is not a local path"), target);
     }
 
   iterpool = svn_pool_create(pool);

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/cat-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/cat-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/cat-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/cat-cmd.c Thu Dec  2 20:55:08 2010
@@ -68,8 +68,8 @@ svn_cl__cat(apr_getopt_t *os,
       SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
 
       /* Get peg revisions. */
-      SVN_ERR(svn_opt_parse_path(&peg_revision, &truepath, target,
-                                 subpool));
+      SVN_ERR(svn_cl__opt_parse_path(&peg_revision, &truepath, target,
+                                     subpool));
 
       SVN_ERR(svn_cl__try(svn_client_cat2(out, truepath, &peg_revision,
                                           &(opt_state->start_revision),

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/changelist-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/changelist-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/changelist-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/changelist-cmd.c Thu Dec  2 20:55:08 2010
@@ -55,9 +55,6 @@ svn_cl__changelist(apr_getopt_t *os,
       apr_array_header_t *args;
       SVN_ERR(svn_opt_parse_num_args(&args, os, 1, pool));
       changelist_name = APR_ARRAY_IDX(args, 0, const char *);
-      if (changelist_name[0] == '\0')
-        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                _("Changelist names must not be empty"));
       SVN_ERR(svn_utf_cstring_to_utf8(&changelist_name,
                                       changelist_name, pool));
     }
@@ -79,10 +76,8 @@ svn_cl__changelist(apr_getopt_t *os,
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
 
       if (svn_path_is_url(target))
-        return svn_error_return(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
-                                                  NULL,
-                                                  _("'%s' is not a local path"),
-                                                  target));
+        return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                 _("'%s' is not a local path"), target);
     }
 
   if (opt_state->quiet)

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/checkout-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/checkout-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/checkout-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/checkout-cmd.c Thu Dec  2 20:55:08 2010
@@ -93,8 +93,6 @@ svn_cl__checkout(apr_getopt_t *os,
 
           /* Discard the peg-revision, if one was provided. */
           SVN_ERR(svn_opt_parse_path(&pegrev, &local_dir, local_dir, pool));
-          if (pegrev.kind != svn_opt_revision_unspecified)
-            local_dir = svn_uri_canonicalize(local_dir, pool);
 
           local_dir = svn_uri_basename(local_dir, pool);
           local_dir = svn_path_uri_decode(local_dir, pool);

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/cl.h?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/cl.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/cl.h Thu Dec  2 20:55:08 2010
@@ -221,15 +221,15 @@ typedef struct svn_cl__opt_state_t
   svn_boolean_t reintegrate;     /* use "reintegrate" merge-source heuristic */
   svn_boolean_t trust_server_cert; /* trust server SSL certs that would
                                       otherwise be rejected as "untrusted" */
-  int strip_count; /* number of leading path components to strip */
+  int strip; /* number of leading path components to strip */
   svn_boolean_t ignore_keywords;  /* do not expand keywords */
   svn_boolean_t reverse_diff;     /* reverse a diff (e.g. when patching) */
   svn_boolean_t ignore_whitespace; /* don't account for whitespace when
                                       patching */
-  svn_boolean_t show_diff;        /* produce diff output */
+  svn_boolean_t show_diff;        /* produce diff output (maps to --diff) */
   svn_boolean_t internal_diff;    /* override diff_cmd in config file */
   svn_boolean_t use_git_diff_format; /* Use git's extended diff format */
-  svn_boolean_t old_patch_target_names; /* Use target names from old side */
+  svn_boolean_t allow_mixed_rev; /* Allow operation on mixed-revision WC */
 } svn_cl__opt_state_t;
 
 
@@ -270,6 +270,7 @@ svn_opt_subcommand_t
   svn_cl__propget,
   svn_cl__proplist,
   svn_cl__propset,
+  svn_cl__relocate,
   svn_cl__revert,
   svn_cl__resolve,
   svn_cl__resolved,
@@ -568,6 +569,21 @@ svn_cl__notifier_mark_checkout(void *bat
 svn_error_t *
 svn_cl__notifier_mark_export(void *baton);
 
+/* Baton for use with svn_cl__check_externals_failed_notify_wrapper(). */
+struct svn_cl__check_externals_failed_notify_baton
+{
+  svn_wc_notify_func2_t wrapped_func; /* The "real" notify_func2. */
+  void *wrapped_baton;                /* The "real" notify_func2 baton. */
+  svn_boolean_t had_externals_error;  /* Did something fail in an external? */
+};
+
+/* Notification function wrapper (implements `svn_wc_notify_func2_t').
+   Use with an svn_cl__check_externals_failed_notify_baton BATON. */
+void
+svn_cl__check_externals_failed_notify_wrapper(void *baton,
+                                              const svn_wc_notify_t *n,
+                                              apr_pool_t *pool);
+
 /* Print conflict stats accumulated in NOTIFY_BATON.
  * Return any error encountered during printing.
  * Do all allocations in POOL.*/
@@ -629,7 +645,10 @@ svn_cl__cleanup_log_msg(void *log_msg_ba
 svn_error_t *
 svn_cl__may_need_force(svn_error_t *err);
 
-/* Write the STRING to the stdio STREAM, returning an error if it fails. */
+/* Write the STRING to the stdio STREAM, returning an error if it fails.
+
+   This function is equal to svn_cmdline_fputs() minus the utf8->local
+   encoding translation.  */
 svn_error_t *
 svn_cl__error_checked_fputs(const char *string, FILE* stream);
 
@@ -791,6 +810,13 @@ svn_cl__eat_peg_revisions(apr_array_head
                           const apr_array_header_t *targets,
                           apr_pool_t *pool);
 
+/* Like svn_opt_parse_path(), but canonicalizes dirent/URL */
+svn_error_t *
+svn_cl__opt_parse_path(svn_opt_revision_t *rev,
+                       const char **truepath,
+                       const char *path,
+                       apr_pool_t *pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/cleanup-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/cleanup-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/cleanup-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/cleanup-cmd.c Thu Dec  2 20:55:08 2010
@@ -64,10 +64,8 @@ svn_cl__cleanup(apr_getopt_t *os,
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
 
       if (svn_path_is_url(target))
-        return svn_error_return(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
-                                                  NULL,
-                                                  _("'%s' is not a local path"),
-                                                  target));
+        return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                 _("'%s' is not a local path"), target);
     }
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/conflict-callbacks.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/conflict-callbacks.c Thu Dec  2 20:55:08 2010
@@ -61,7 +61,7 @@ svn_cl__accept_from_word(const char *wor
 {
   /* Shorthand options are consistent with  svn_cl__conflict_handler(). */
   if (strcmp(word, SVN_CL__ACCEPT_POSTPONE) == 0
-      || strcmp(word, "p") == 0)
+      || strcmp(word, "p") == 0 || strcmp(word, ":-P") == 0)
     return svn_cl__accept_postpone;
   if (strcmp(word, SVN_CL__ACCEPT_BASE) == 0)
     /* ### shorthand? */
@@ -70,22 +70,22 @@ svn_cl__accept_from_word(const char *wor
     /* ### shorthand? */
     return svn_cl__accept_working;
   if (strcmp(word, SVN_CL__ACCEPT_MINE_CONFLICT) == 0
-      || strcmp(word, "mc") == 0)
+      || strcmp(word, "mc") == 0 || strcmp(word, "X-)") == 0)
     return svn_cl__accept_mine_conflict;
   if (strcmp(word, SVN_CL__ACCEPT_THEIRS_CONFLICT) == 0
-      || strcmp(word, "tc") == 0)
+      || strcmp(word, "tc") == 0 || strcmp(word, "X-(") == 0)
     return svn_cl__accept_theirs_conflict;
   if (strcmp(word, SVN_CL__ACCEPT_MINE_FULL) == 0
-      || strcmp(word, "mf") == 0)
+      || strcmp(word, "mf") == 0 || strcmp(word, ":-)") == 0)
     return svn_cl__accept_mine_full;
   if (strcmp(word, SVN_CL__ACCEPT_THEIRS_FULL) == 0
-      || strcmp(word, "tf") == 0)
+      || strcmp(word, "tf") == 0 || strcmp(word, ":-(") == 0)
     return svn_cl__accept_theirs_full;
   if (strcmp(word, SVN_CL__ACCEPT_EDIT) == 0
-      || strcmp(word, "e") == 0)
+      || strcmp(word, "e") == 0 || strcmp(word, ":-E") == 0)
     return svn_cl__accept_edit;
   if (strcmp(word, SVN_CL__ACCEPT_LAUNCH) == 0
-      || strcmp(word, "l") == 0)
+      || strcmp(word, "l") == 0 || strcmp(word, ":-l") == 0)
     return svn_cl__accept_launch;
   /* word is an invalid action. */
   return svn_cl__accept_invalid;
@@ -529,13 +529,13 @@ svn_cl__conflict_handler(svn_wc_conflict
                                           "resolve conflict\n"
                 "  (s)  show all         - show this list\n\n")));
             }
-          else if (strcmp(answer, "p") == 0)
+          else if (strcmp(answer, "p") == 0 || strcmp(answer, ":-P") == 0)
             {
               /* Do nothing, let file be marked conflicted. */
               (*result)->choice = svn_wc_conflict_choose_postpone;
               break;
             }
-          else if (strcmp(answer, "mc") == 0)
+          else if (strcmp(answer, "mc") == 0 || strcmp(answer, "X-)") == 0)
             {
               if (desc->is_binary)
                 {
@@ -559,7 +559,7 @@ svn_cl__conflict_handler(svn_wc_conflict
                 (*result)->save_merged = TRUE;
               break;
             }
-          else if (strcmp(answer, "tc") == 0)
+          else if (strcmp(answer, "tc") == 0 || strcmp(answer, "X-(") == 0)
             {
               if (desc->is_binary)
                 {
@@ -582,14 +582,14 @@ svn_cl__conflict_handler(svn_wc_conflict
                 (*result)->save_merged = TRUE;
               break;
             }
-          else if (strcmp(answer, "mf") == 0)
+          else if (strcmp(answer, "mf") == 0 || strcmp(answer, ":-)") == 0)
             {
               (*result)->choice = svn_wc_conflict_choose_mine_full;
               if (performed_edit)
                 (*result)->save_merged = TRUE;
               break;
             }
-          else if (strcmp(answer, "tf") == 0)
+          else if (strcmp(answer, "tf") == 0 || strcmp(answer, ":-(") == 0)
             {
               (*result)->choice = svn_wc_conflict_choose_theirs_full;
               if (performed_edit)
@@ -637,13 +637,13 @@ svn_cl__conflict_handler(svn_wc_conflict
               SVN_ERR(show_diff(desc, subpool));
               knows_something = TRUE;
             }
-          else if (strcmp(answer, "e") == 0)
+          else if (strcmp(answer, "e") == 0 || strcmp(answer, ":-E") == 0)
             {
               SVN_ERR(open_editor(&performed_edit, desc, b, subpool));
               if (performed_edit)
                 knows_something = TRUE;
             }
-          else if (strcmp(answer, "l") == 0)
+          else if (strcmp(answer, "l") == 0 || strcmp(answer, ":-l") == 0)
             {
               if (desc->kind == svn_wc_conflict_kind_property)
                 {
@@ -729,17 +729,17 @@ svn_cl__conflict_handler(svn_wc_conflict
                 "(overwrite pre-existing item)\n"
                 "  (h)  help        - show this help\n\n")));
             }
-          if (strcmp(answer, "p") == 0)
+          if (strcmp(answer, "p") == 0 || strcmp(answer, ":-P") == 0)
             {
               (*result)->choice = svn_wc_conflict_choose_postpone;
               break;
             }
-          if (strcmp(answer, "mf") == 0)
+          if (strcmp(answer, "mf") == 0 || strcmp(answer, ":-)") == 0)
             {
               (*result)->choice = svn_wc_conflict_choose_mine_full;
               break;
             }
-          if (strcmp(answer, "tf") == 0)
+          if (strcmp(answer, "tf") == 0 || strcmp(answer, ":-(") == 0)
             {
               (*result)->choice = svn_wc_conflict_choose_theirs_full;
               break;

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/export-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/export-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/export-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/export-cmd.c Thu Dec  2 20:55:08 2010
@@ -52,6 +52,7 @@ svn_cl__export(apr_getopt_t *os,
   svn_error_t *err;
   svn_opt_revision_t peg_revision;
   const char *truefrom;
+  struct svn_cl__check_externals_failed_notify_baton nwb;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -79,25 +80,27 @@ svn_cl__export(apr_getopt_t *os,
     {
       to = APR_ARRAY_IDX(targets, 1, const char *);
 
-      /* If given the cwd, pretend we weren't given anything. */
-      if (strcmp("", to) == 0)
-        to = svn_path_uri_decode(svn_uri_basename(truefrom, pool), pool);
-      else
+      if (strcmp("", to) != 0)
         /* svn_cl__eat_peg_revisions() but only on one target */
         SVN_ERR(svn_opt__split_arg_at_peg_revision(&to, NULL, to, pool));
     }
 
   if (svn_path_is_url(to))
-    return svn_error_return(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
-                                              NULL,
-                                              _("'%s' is not a local path"),
-                                              to));
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("'%s' is not a local path"), to);
+
   if (! opt_state->quiet)
     SVN_ERR(svn_cl__notifier_mark_export(ctx->notify_baton2));
 
   if (opt_state->depth == svn_depth_unknown)
     opt_state->depth = svn_depth_infinity;
 
+  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;
+
   /* Do the export. */
   err = svn_client_export5(NULL, truefrom, to, &peg_revision,
                            &(opt_state->start_revision),
@@ -109,5 +112,10 @@ svn_cl__export(apr_getopt_t *os,
               _("Destination directory exists; please remove "
                 "the directory or use --force to overwrite"));
 
+  if (nwb.had_externals_error)
+    return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
+                            _("Failure occurred processing one or more "
+                              "externals definitions"));
+
   return svn_error_return(err);
 }

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/import-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/import-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/import-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/import-cmd.c Thu Dec  2 20:55:08 2010
@@ -101,10 +101,9 @@ svn_cl__import(apr_getopt_t *os,
     }
 
   if (svn_path_is_url(path))
-    return svn_error_return(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
-                                              NULL,
-                                              _("'%s' is not a local path"),
-                                              path));
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("'%s' is not a local path"), path);
+
   if (! svn_path_is_url(url))
     return svn_error_createf
       (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/info-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/info-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/info-cmd.c Thu Dec  2 20:55:08 2010
@@ -126,6 +126,11 @@ print_info_xml(void *baton,
       /* "<wc-info>" */
       svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "wc-info", NULL);
 
+      /* "<wcroot-abspath> xx </wcroot-abspath>" */
+      if (info->wcroot_abspath)
+        svn_cl__xml_tagged_cdata(&sb, pool, "wcroot-abspath",
+                                 info->wcroot_abspath);
+
       /* "<schedule> xx </schedule>" */
       svn_cl__xml_tagged_cdata(&sb, pool, "schedule",
                                schedule_str(info->schedule));
@@ -256,6 +261,11 @@ print_info(void *baton,
     SVN_ERR(svn_cmdline_printf(pool, _("Name: %s\n"),
                                svn_dirent_basename(target, pool)));
 
+  if (info->wcroot_abspath)
+    SVN_ERR(svn_cmdline_printf(pool, _("Working Copy Root Path: %s\n"),
+                               svn_dirent_local_style(info->wcroot_abspath,
+                                                      pool)));
+
   if (info->URL)
     SVN_ERR(svn_cmdline_printf(pool, _("URL: %s\n"), info->URL));
 
@@ -539,13 +549,19 @@ svn_cl__info(apr_getopt_t *os,
       SVN_ERR(svn_opt_parse_path(&peg_revision, &truepath, target, subpool));
 
       /* If no peg-rev was attached to a URL target, then assume HEAD. */
-      if (svn_path_is_url(target))
+      if (svn_path_is_url(truepath))
         {
+          truepath = svn_uri_canonicalize(truepath, subpool);
+
           if (peg_revision.kind == svn_opt_revision_unspecified)
             peg_revision.kind = svn_opt_revision_head;
         }
       else
-        SVN_ERR(svn_dirent_get_absolute(&truepath, truepath, subpool));
+        {
+          truepath = svn_dirent_canonicalize(truepath, subpool);
+
+          SVN_ERR(svn_dirent_get_absolute(&truepath, truepath, subpool));
+        }
 
       err = svn_client_info3(truepath,
                              &peg_revision, &(opt_state->start_revision),

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/list-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/list-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/list-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/list-cmd.c Thu Dec  2 20:55:08 2010
@@ -268,8 +268,8 @@ svn_cl__list(apr_getopt_t *os,
       SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
 
       /* Get peg revisions. */
-      SVN_ERR(svn_opt_parse_path(&peg_revision, &truepath, target,
-                                 subpool));
+      SVN_ERR(svn_cl__opt_parse_path(&peg_revision, &truepath, target,
+                                     subpool));
 
       if (opt_state->xml)
         {

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/lock-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/lock-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/lock-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/lock-cmd.c Thu Dec  2 20:55:08 2010
@@ -89,6 +89,8 @@ svn_cl__lock(apr_getopt_t *os,
   svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
   apr_array_header_t *targets;
   const char *comment;
+  svn_boolean_t wc_present = FALSE, url_present = FALSE;
+  int i;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -98,6 +100,22 @@ svn_cl__lock(apr_getopt_t *os,
   if (! targets->nelts)
     return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
 
+  /* Check to see if at least one of our paths is a working copy
+   * path or a repository url. */
+  for (i = 0; i < targets->nelts; ++i)
+    {
+      const char *target = APR_ARRAY_IDX(targets, i, const char *);
+      if (! svn_path_is_url(target))
+       wc_present = TRUE;
+      else
+       url_present = TRUE;
+    }
+
+  if (url_present && wc_present)
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                        _("Cannot mix repository and working copy "
+                          "targets"));
+
   /* Get comment. */
   SVN_ERR(get_comment(&comment, ctx, opt_state, pool));
 

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/log-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/log-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/log-cmd.c Thu Dec  2 20:55:08 2010
@@ -57,7 +57,7 @@ struct log_receiver_baton
   /* Don't print log message body nor its line count. */
   svn_boolean_t omit_log_message;
 
-  /* Whether to show diffs in the log. */
+  /* Whether to show diffs in the log. (maps to --diff) */
   svn_boolean_t show_diff;
 
   /* Diff arguments received from command line. */
@@ -585,25 +585,25 @@ svn_cl__log(apr_getopt_t *os,
     {
       if (opt_state->show_diff)
         return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                _("'show-diff' option is not supported in "
+                                _("'diff' option is not supported in "
                                   "XML mode"));
     }
 
   if (opt_state->quiet && opt_state->show_diff)
     return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                            _("'quiet' and 'show-diff' options are "
+                            _("'quiet' and 'diff' options are "
                               "mutually exclusive"));
   if (opt_state->diff_cmd && (! opt_state->show_diff))
     return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                            _("'diff-cmd' option requires 'show-diff' "
+                            _("'diff-cmd' option requires 'diff' "
                               "option"));
   if (opt_state->internal_diff && (! opt_state->show_diff))
     return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                             _("'internal-diff' option requires "
-                              "'show-diff' option"));
+                              "'diff' option"));
   if (opt_state->extensions && (! opt_state->show_diff))
     return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                            _("'extensions' option requires 'show-diff' "
+                            _("'extensions' option requires 'diff' "
                               "option"));
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
@@ -647,12 +647,11 @@ svn_cl__log(apr_getopt_t *os,
           target = APR_ARRAY_IDX(targets, i, const char *);
 
           if (svn_path_is_url(target) || target[0] == '/')
-            return svn_error_return(svn_error_createf(
-                                      SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                      _("Only relative paths can be specified"
-                                        " after a URL for 'svn log', "
-                                        "but '%s' is not a relative path"),
-                                      target));
+            return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                     _("Only relative paths can be specified"
+                                       " after a URL for 'svn log', "
+                                       "but '%s' is not a relative path"),
+                                     target);
         }
     }
 
@@ -660,7 +659,7 @@ svn_cl__log(apr_getopt_t *os,
   lb.omit_log_message = opt_state->quiet;
   SVN_ERR(svn_client_url_from_path2(&lb.target_url, true_path, ctx,
                                     pool, pool));
-  lb.show_diff = (! opt_state->quiet) && opt_state->show_diff;
+  lb.show_diff = opt_state->show_diff;
   lb.diff_extensions = opt_state->extensions;
   lb.merge_stack = apr_array_make(pool, 0, sizeof(svn_revnum_t));
   lb.pool = pool;

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/main.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/main.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/main.c Thu Dec  2 20:55:08 2010
@@ -114,17 +114,19 @@ typedef enum {
   opt_show_revs,
   opt_reintegrate,
   opt_trust_server_cert,
-  opt_strip_count,
+  opt_strip,
   opt_show_copies_as_adds,
   opt_ignore_keywords,
   opt_reverse_diff,
   opt_ignore_whitespace,
-  opt_show_diff,
+  opt_diff,
   opt_internal_diff,
   opt_use_git_diff_format,
-  opt_old_patch_target_names,
+  opt_allow_mixed_revisions,
 } svn_cl__longopt_t;
 
+#define SVN_CL__OPTION_CONTINUATION_INDENT "                             "
+
 /* Option codes and descriptions for the command line client.
  *
  * The entire list must be terminated with an entry of nulls.
@@ -140,28 +142,31 @@ const apr_getopt_option_t svn_cl__option
   {"quiet",         'q', 0, N_("print nothing, or only summary information")},
   {"recursive",     'R', 0, N_("descend recursively, same as --depth=infinity")},
   {"non-recursive", 'N', 0, N_("obsolete; try --depth=files or --depth=immediates")},
-  {"change",        'c', 1, N_
-   ("the change made by revision ARG (like -r ARG-1:ARG)\n"
-    "                             If ARG is negative this is like -r ARG:ARG-1")
-  },
-  {"revision",      'r', 1, N_
-   ("ARG (some commands also take ARG1:ARG2 range)\n"
-    "                             A revision argument can be one of:\n"
-    "                                NUMBER       revision number\n"
-    "                                '{' DATE '}' revision at start of the date\n"
-    "                                'HEAD'       latest in repository\n"
-    "                                'BASE'       base rev of item's working copy\n"
-    "                                'COMMITTED'  last commit at or before BASE\n"
-    "                                'PREV'       revision just before COMMITTED")
-   /* spacing corresponds to svn_opt_format_option */
-  },
+  {"change",        'c', 1, 
+                    N_("the change made by revision ARG (like -r ARG-1:ARG)\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "If ARG is negative this is like -r ARG:ARG-1")},
+  {"revision",      'r', 1, 
+                    N_("ARG (some commands also take ARG1:ARG2 range)\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "A revision argument can be one of:\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   NUMBER       revision number\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   '{' DATE '}' revision at start of the date\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   'HEAD'       latest in repository\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   'BASE'       base rev of item's working copy\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   'COMMITTED'  last commit at or before BASE\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   'PREV'       revision just before COMMITTED")},
   {"file",          'F', 1, N_("read log message from file ARG")},
   {"incremental",   opt_incremental, 0,
                     N_("give output suitable for concatenation")},
   {"encoding",      opt_encoding, 1,
-                    N_("treat value as being in charset encoding ARG\n"
-                       "                             "
-                       "[alias: --enc]")},
+                    N_("treat value as being in charset encoding ARG")},
   {"version",       opt_version, 0, N_("show program version information")},
   {"verbose",       'v', 0, N_("print extra information")},
   {"show-updates",  'u', 0, N_("display update information")},
@@ -169,227 +174,171 @@ const apr_getopt_option_t svn_cl__option
   {"password",      opt_auth_password, 1, N_("specify a password ARG")},
   {"extensions",    'x', 1,
                     N_("Default: '-u'. When Subversion is invoking an\n"
-                       "                            "
-                       " external diff program, ARG is simply passed along\n"
-                       "                            "
-                       " to the program. But when Subversion is using its\n"
-                       "                            "
-                       " default internal diff implementation, or when\n"
-                       "                            "
-                       " Subversion is displaying blame annotations, ARG\n"
-                       "                            "
-                       " could be any of the following:\n"
-                       "                            "
-                       "    -u (--unified):\n"
-                       "                            "
-                       "       Output 3 lines of unified context.\n"
-                       "                            "
-                       "    -b (--ignore-space-change):\n"
-                       "                            "
-                       "       Ignore changes in the amount of white space.\n"
-                       "                            "
-                       "    -w (--ignore-all-space):\n"
-                       "                            "
-                       "       Ignore all white space.\n"
-                       "                            "
-                       "    --ignore-eol-style:\n"
-                       "                            "
-                       "       Ignore changes in EOL style.\n"
-                       "                            "
-                       "    -p (--show-c-function):\n"
-                       "                            "
-                       "       Show C function name in diff output.")},
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "external diff program, ARG is simply passed along\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "to the program. But when Subversion is using its\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "default internal diff implementation, or when\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "Subversion is displaying blame annotations, ARG\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "could be any of the following:\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   -u (--unified):\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "      Output 3 lines of unified context.\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   -b (--ignore-space-change):\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "      Ignore changes in the amount of white space.\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   -w (--ignore-all-space):\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "      Ignore all white space.\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   --ignore-eol-style:\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "      Ignore changes in EOL style.\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "   -p (--show-c-function):\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "      Show C function name in diff output.")},
   {"targets",       opt_targets, 1,
                     N_("pass contents of file ARG as additional args")},
   {"depth",         opt_depth, 1,
                     N_("limit operation by depth ARG ('empty', 'files',\n"
-                       "                            "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "'immediates', or 'infinity')")},
   {"set-depth",     opt_set_depth, 1,
                     N_("set new working copy depth to ARG ('exclude',\n"
-                       "                            "
-                       "'empty', 'files', 'immediates', or 'infinity')\n"
-                       "                            "
-                       "[alias: --sd]")},
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "'empty', 'files', 'immediates', or 'infinity')")},
   {"xml",           opt_xml, 0, N_("output in XML")},
   {"strict",        opt_strict, 0, N_("use strict semantics")},
   {"stop-on-copy",  opt_stop_on_copy, 0,
-                    N_("do not cross copies while traversing history\n"
-                       "                             "
-                       "[alias: --soc]")},
+                    N_("do not cross copies while traversing history")},
   {"no-ignore",     opt_no_ignore, 0,
                     N_("disregard default and svn:ignore property ignores")},
   {"no-auth-cache", opt_no_auth_cache, 0,
-                    N_("do not cache authentication tokens\n"
-                       "                             "
-                       "[alias: --nac]")},
+                    N_("do not cache authentication tokens")},
   {"trust-server-cert", opt_trust_server_cert, 0,
                     N_("accept unknown SSL server certificates without\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "prompting (but only with '--non-interactive')")},
   {"non-interactive", opt_non_interactive, 0,
                     N_("do no interactive prompting")},
   {"dry-run",       opt_dry_run, 0,
-                    N_("try operation but make no changes\n"
-                       "                             "
-                       "[alias: --dry]")},
+                    N_("try operation but make no changes")},
   {"no-diff-deleted", opt_no_diff_deleted, 0,
-                    N_("do not print differences for deleted files\n"
-                       "                             "
-                       "[alias: --ndd]")},
+                    N_("do not print differences for deleted files")},
   {"notice-ancestry", opt_notice_ancestry, 0,
-                    N_("notice ancestry when calculating differences\n"
-                       "                             "
-                       "[alias: --na]")},
+                    N_("notice ancestry when calculating differences")},
   {"ignore-ancestry", opt_ignore_ancestry, 0,
-                    N_("ignore ancestry when calculating merges\n"
-                       "                             "
-                       "[alias: --ia]")},
+                    N_("ignore ancestry when calculating merges")},
   {"ignore-externals", opt_ignore_externals, 0,
-                    N_("ignore externals definitions\n"
-                       "                             "
-                       "[alias: --ie]")},
+                    N_("ignore externals definitions")},
   {"diff-cmd",      opt_diff_cmd, 1, N_("use ARG as diff command")},
   {"diff3-cmd",     opt_merge_cmd, 1, N_("use ARG as merge command")},
   {"editor-cmd",    opt_editor_cmd, 1, N_("use ARG as external editor")},
   {"record-only",   opt_record_only, 0,
-                    N_("merge only mergeinfo differences\n"
-                       "                             "
-                       "[alias: --ro]")},
+                    N_("merge only mergeinfo differences")},
   {"old",           opt_old_cmd, 1, N_("use ARG as the older target")},
   {"new",           opt_new_cmd, 1, N_("use ARG as the newer target")},
   {"revprop",       opt_revprop, 0,
                     N_("operate on a revision property (use with -r)")},
   {"relocate",      opt_relocate, 0, N_("relocate via URL-rewriting")},
   {"config-dir",    opt_config_dir, 1,
-                    N_("read user configuration files from directory ARG\n"
-                       "                             "
-                       "[alias: --cd]")},
+                    N_("read user configuration files from directory ARG")},
   {"config-option", opt_config_options, 1,
                     N_("set user configuration option in the format:\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "    FILE:SECTION:OPTION=[VALUE]\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "For example:\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "    servers:global:http-library=serf")},
   {"auto-props",    opt_autoprops, 0, N_("enable automatic properties")},
   {"no-auto-props", opt_no_autoprops, 0, N_("disable automatic properties")},
   {"native-eol",    opt_native_eol, 1,
                     N_("use a different EOL marker than the standard\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "system marker for files with the svn:eol-style\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "property set to 'native'.\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "ARG may be one of 'LF', 'CR', 'CRLF'")},
   {"limit",         'l', 1, N_("maximum number of log entries")},
-  {"no-unlock",     opt_no_unlock, 0, N_("don't unlock the targets\n"
-                       "                             "
-                       "[aliases: --nul, --keep-lock]")},
+  {"no-unlock",     opt_no_unlock, 0, N_("don't unlock the targets")},
   {"summarize",     opt_summarize, 0, N_("show a summary of the results")},
   {"remove",         opt_remove, 0, N_("remove changelist association")},
   {"changelist",    opt_changelist, 1,
-                    N_("operate only on members of changelist ARG\n"
-                       "                             "
-                       "[alias: --cl]")},
+                    N_("operate only on members of changelist ARG")},
   {"keep-changelists", opt_keep_changelists, 0,
                     N_("don't delete changelists after commit")},
-  {"keep-local",    opt_keep_local, 0, N_("keep path in working copy\n"
-                       "                             "
-                       "[alias: --kl]")},
+  {"keep-local",    opt_keep_local, 0, N_("keep path in working copy")},
   {"with-all-revprops",  opt_with_all_revprops, 0,
                     N_("retrieve all revision properties")},
   {"with-no-revprops",  opt_with_no_revprops, 0,
                     N_("retrieve no revision properties")},
   {"with-revprop",  opt_with_revprop, 1,
                     N_("set revision property ARG in new revision\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "using the name[=value] format")},
   {"parents",       opt_parents, 0, N_("make intermediate directories")},
   {"use-merge-history", 'g', 0,
                     N_("use/display additional information from merge\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "history")},
   {"accept",        opt_accept, 1,
                     N_("specify automatic conflict resolution action\n"
-                       "                            "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "('postpone', 'base', 'mine-conflict',\n"
-                       "                            "
-                       " 'theirs-conflict', 'mine-full', 'theirs-full',\n"
-                       "                            "
-                       " 'edit', 'launch')")},
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "'theirs-conflict', 'mine-full', 'theirs-full',\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "'edit', 'launch')")},
   {"show-revs",     opt_show_revs, 1,
                     N_("specify which collection of revisions to display\n"
-                       "                             "
-                       "('merged', 'eligible')\n"
-                       "                             "
-                       "[alias: --sr]")},
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "('merged', 'eligible')")},
   {"reintegrate",   opt_reintegrate, 0,
-                    N_("lump-merge all of source URL's unmerged changes\n"
-                       "                             "
-                       "[alias: --ri]")},
-  {"strip-count",   opt_strip_count, 1,
+                    N_("merge a branch back into its parent branch")},
+  {"strip",         opt_strip, 1,
                     N_("number of leading path components to strip from\n"
-                       "                             "
-                       "paths parsed from the patch file. --strip-count 0\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "paths parsed from the patch file. --strip 0\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "is the default and leaves paths unmodified.\n"
-                       "                             "
-                       "--strip-count 1 would change the path\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "--strip 1 would change the path\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "'doc/fudge/crunchy.html' to 'fudge/crunchy.html'.\n"
-                       "                             "
-                       "--strip-count 2 would leave just 'crunchy.html'\n"
-                       "                             "
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "--strip 2 would leave just 'crunchy.html'\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
                        "The expected component separator is '/' on all\n"
-                       "                             "
-                       "platforms. A leading '/' counts as one component.\n"
-                       "                             "
-                       "[alias: --strip]")},
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "platforms. A leading '/' counts as one component.")},
   {"show-copies-as-adds", opt_show_copies_as_adds, 0,
-                    N_("don't diff copied or moved files with their source\n"
-                       "                             "
-                       "[alias: --sca]")},
+                    N_("don't diff copied or moved files with their source")},
   {"ignore-keywords", opt_ignore_keywords, 0,
-                    N_("don't expand keywords\n"
-                       "                             "
-                       "[alias: --ik]")},
+                    N_("don't expand keywords")},
   {"reverse-diff", opt_reverse_diff, 0,
-                    N_("apply the unidiff in reverse\n"
-                       "                             "
-                       "This option also reverses patch target names; the\n"
-                       "                             "
-                       "--old-patch-target-names option will prevent this.\n"
-                       "                             "
-                       "[alias: --rd]")},
+                    N_("apply the unidiff in reverse")},
   {"ignore-whitespace", opt_ignore_whitespace, 0,
-                       N_("ignore whitespace during pattern matching\n"
-                       "                             "
-                       "[alias: --iw]")},
-  {"show-diff", opt_show_diff, 0,
-                       N_("produce diff output\n"
-                       "                             "
-                       "[alias: --diff]")},
+                       N_("ignore whitespace during pattern matching")},
+  {"diff", opt_diff, 0, N_("produce diff output")}, /* maps to show_diff */
   {"internal-diff", opt_internal_diff, 0,
-                       N_("override diff-cmd specified in config file\n"
-                       "                             "
-                       "[alias: --idiff]")},
+                       N_("override diff-cmd specified in config file")},
   {"git", opt_use_git_diff_format, 0,
-                       N_("use git's extended diff format\n")},
-                  
-  {"old-patch-target-names", opt_old_patch_target_names, 0,
-                       N_("use target names from the old side of a patch.\n"
-                       "                             "
-                       "If a diff header contains\n"
-                       "                             "
-                       "  --- foo.c\n"
-                       "                             "
-                       "  +++ foo.c.new\n"
-                       "                             "
-                       "this option will cause the name \"foo.c\" to be used\n"
-                       "                             "
-                       "[alias: --optn]")},
+                       N_("use git's extended diff format")},
+  {"allow-mixed-revisions", opt_allow_mixed_revisions, 0,
+                       N_("Allow merge into mixed-revision working copy.\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "Use of this option is not recommended!\n"
+                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "Please run 'svn update' instead.")},
 
   /* Long-opt Aliases
    *
@@ -413,15 +362,12 @@ const apr_getopt_option_t svn_cl__option
   {"kl",            opt_keep_local, 0, NULL},
   {"sr",            opt_show_revs, 1, NULL},
   {"ri",            opt_reintegrate, 0, NULL},
-  {"strip",         opt_strip_count, 1, NULL},
   {"sca",           opt_show_copies_as_adds, 0, NULL},
   {"ik",            opt_ignore_keywords, 0, NULL},
   {"iw",            opt_ignore_whitespace, 0, NULL},
-  {"diff",          opt_show_diff, 0, NULL},
   {"idiff",         opt_internal_diff, 0, NULL},
-  {"nul",           opt_no_unlock, 0, NULL},
-  {"keep-lock",     opt_no_unlock, 0, NULL},
-  {"optn",          opt_old_patch_target_names, 0, NULL},
+  {"keep-locks",    opt_no_unlock, 0, NULL},
+  {"keep-cl",       opt_keep_changelists, 0, NULL},
 
   {0,               0, 0, 0},
 };
@@ -723,7 +669,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "    svn log http://www.example.com/repo/project@50 foo.c bar.c\n"),
     {'r', 'q', 'v', 'g', 'c', opt_targets, opt_stop_on_copy, opt_incremental,
      opt_xml, 'l', opt_with_all_revprops, opt_with_no_revprops, opt_with_revprop,
-     opt_show_diff, opt_diff_cmd, opt_internal_diff, 'x'},
+     opt_diff, opt_diff_cmd, opt_internal_diff, 'x'},
     {{opt_with_revprop, N_("retrieve revision property ARG")},
      {'c', N_("the change made in revision ARG")}} },
 
@@ -780,7 +726,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "  The --ignore-ancestry option overrides this, forcing Subversion to\n"
      "  regard the sources as unrelated and not to track the merge.\n"),
     {'r', 'c', 'N', opt_depth, 'q', opt_force, opt_dry_run, opt_merge_cmd,
-     opt_record_only, 'x', opt_ignore_ancestry, opt_accept, opt_reintegrate} },
+     opt_record_only, 'x', opt_ignore_ancestry, opt_accept, opt_reintegrate,
+     opt_allow_mixed_revisions} },
 
   { "mergeinfo", svn_cl__mergeinfo, {0}, N_
     ("Display merge-related information.\n"
@@ -870,8 +817,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "  for addition. Use 'svn revert' to undo deletions and additions you\n"
      "  do not agree with.\n"
      ),
-    {'q', opt_dry_run, opt_strip_count, opt_reverse_diff,
-     opt_ignore_whitespace, opt_old_patch_target_names} },
+    {'q', opt_dry_run, opt_strip, opt_reverse_diff,
+     opt_ignore_whitespace} },
 
   { "propdel", svn_cl__propdel, {"pdel", "pd"}, N_
     ("Remove a property from files, dirs, or revisions.\n"
@@ -959,10 +906,14 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "    svn:externals  - A newline separated list of module specifiers,\n"
      "      each of which consists of a URL and a relative directory path,\n"
      "      similar to the syntax of the 'svn checkout' command:\n"
-     "        http://example.com/repos/zag foo/bar\n"
-     "      An optional peg revision may be appended to the URL to pin the\n"
+     "        http://example.com/repos/zig foo/bar\n"
+     "      A revision to check out can optionally be specified to pin the\n"
      "      external to a known revision:\n"
-     "        http://example.com/repos/zig@42 foo\n"
+     "        -r25 http://example.com/repos/zig foo/bar\n"
+     "      To unambiguously identify an element at a path which has been\n"
+     "      deleted (possibly even deleted multiple times in its history),\n"
+     "      an optional peg revision can be appended to the URL:\n"
+     "        -r25 http://example.com/repos/zig@42 foo/bar\n"
      "      Relative URLs are indicated by starting the URL with one\n"
      "      of the following strings:\n"
      "        ../  to the parent directory of the extracted external\n"
@@ -993,6 +944,29 @@ const svn_opt_subcommand_desc2_t svn_cl_
      opt_force, opt_changelist },
     {{'F', N_("read property value from file ARG")}} },
 
+  { "relocate", svn_cl__relocate, {0}, N_
+    ("Relocate the working copy to point to a different repository root URL.\n"
+     "usage: 1. relocate FROM-PREFIX TO-PREFIX [PATH...]\n"
+     "       2. relocate TO-URL [PATH]\n"
+     "\n"
+     "  Rewrite working copy URL metadata to reflect a syntactic change only.\n"
+     "  This is used when repository's root URL changes (such as a scheme\n"
+     "  or hostname change) but your working copy still reflects the same\n"
+     "  directory within the same repository.\n"
+     "\n"
+     "  1. FROM-PREFIX and TO-PREFIX are initial substrings of the working\n"
+     "     copy's current and new URLs, respectively.  (You may specify the\n"
+     "     complete old and new URLs if you wish.)  Use 'svn info' to determine\n"
+     "     the current working copy URL.\n"
+     "\n"
+     "  2. TO-URL is the (complete) new repository URL to use for for PATH.\n"
+     "\n"
+     "  Examples:\n"
+     "    svn relocate http:// svn:// project1 project2\n"
+     "    svn relocate http://www.example.com/repo/project \\\n"
+     "                 svn://svn.example.com/repo/project\n"),
+    {opt_ignore_externals} },
+
   { "resolve", svn_cl__resolve, {0}, N_
     ("Resolve conflicts on working copy files or directories.\n"
      "usage: resolve --accept=ARG [PATH...]\n"
@@ -1000,10 +974,10 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "  Note:  the --accept option is currently required.\n"),
     {opt_targets, 'R', opt_depth, 'q', opt_accept},
     {{opt_accept, N_("specify automatic conflict resolution source\n"
-                             "                            "
-                             "('base', 'working', 'mine-conflict',\n"
-                             "                            "
-                             " 'theirs-conflict', 'mine-full', 'theirs-full')")}} },
+                     SVN_CL__OPTION_CONTINUATION_INDENT
+                     "('base', 'working', 'mine-conflict',\n"
+                     SVN_CL__OPTION_CONTINUATION_INDENT
+                     "'theirs-conflict', 'mine-full', 'theirs-full')")}} },
 
   { "resolved", svn_cl__resolved, {0}, N_
     ("Remove 'conflicted' state on working copy files or directories.\n"
@@ -1118,9 +1092,9 @@ const svn_opt_subcommand_desc2_t svn_cl_
       opt_ignore_externals, opt_changelist} },
 
   { "switch", svn_cl__switch, {"sw"}, N_
-    ("Update the working copy to a different URL.\n"
+    ("Update the working copy to a different URL within the same repository.\n"
      "usage: 1. switch URL[@PEGREV] [PATH]\n"
-     "       2. switch --relocate FROM TO [PATH...]\n"
+     "       2. switch --relocate FROM-PREFIX TO-PREFIX [PATH...]\n"
      "\n"
      "  1. Update the working copy to mirror a new URL within the repository.\n"
      "     This behavior is similar to 'svn update', and is the way to\n"
@@ -1142,22 +1116,15 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "     Use the --set-depth option to set a new working copy depth on the\n"
      "     targets of this operation.\n"
      "\n"
-     "  2. Rewrite working copy URL metadata to reflect a syntactic change only.\n"
-     "     This is used when repository's root URL changes (such as a scheme\n"
-     "     or hostname change) but your working copy still reflects the same\n"
-     "     directory within the same repository.\n"
-     "\n"
-     "     FROM is the root URL which will be relocated from.\n"
-     "     You can use 'svn info' to determine the root URL of the current\n"
-     "     working copy directory (look for 'URL:' in its output).\n"
-     "\n"
-     "     TO is the root URL which will be relocated to.\n"
+     "  2. The '--relocate' option is deprecated. This syntax is equivalent to\n"
+     "     'svn relocate FROM-PREFIX TO-PREFIX [PATH]'.\n"
      "\n"
      "  See also 'svn help update' for a list of possible characters\n"
      "  reporting the action taken.\n"
      "\n"
      "  Examples:\n"
      "    svn switch ^/branches/1.x-release\n"
+     "    svn switch --relocate http:// svn://\n"
      "    svn switch --relocate http://www.example.com/repo/project \\\n"
      "                          svn://svn.example.com/repo/project\n"),
     { 'r', 'N', opt_depth, opt_set_depth, 'q', opt_merge_cmd, opt_relocate,
@@ -1206,10 +1173,17 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "  are applied to the obstructing path.  Obstructing paths are reported\n"
      "  in the first column with code 'E'.\n"
      "\n"
+     "  If the specified update target is missing from the working copy but its\n"
+     "  immediate parent directory is present, checkout the target into its\n"
+     "  parent directory at the specified depth.  If --parents is specified,\n"
+     "  create any missing parent directories of the target by checking them\n"
+     "  out, too, at depth=empty.\n"
+     "\n"
      "  Use the --set-depth option to set a new working copy depth on the\n"
      "  targets of this operation.\n"),
     {'r', 'N', opt_depth, opt_set_depth, 'q', opt_merge_cmd, opt_force,
-     opt_ignore_externals, opt_changelist, opt_editor_cmd, opt_accept} },
+     opt_ignore_externals, opt_changelist, opt_editor_cmd, opt_accept,
+     opt_parents} },
 
   { "upgrade", svn_cl__upgrade, {0}, N_
     ("Upgrade the metadata storage format for a working copy.\n"
@@ -1371,11 +1345,10 @@ main(int argc, const char *argv[])
       switch (opt_id) {
       case 'l':
         {
-          char *end;
-          opt_state.limit = (int) strtol(opt_arg, &end, 10);
-          if (end == opt_arg || *end != '\0')
+          err = svn_cstring_atoi(&opt_state.limit, opt_arg);
+          if (err)
             {
-              err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+              err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, err,
                                      _("Non-numeric limit argument given"));
               return svn_cmdline_handle_exit_error(err, pool, "svn: ");
             }
@@ -1414,17 +1387,24 @@ main(int argc, const char *argv[])
               svn_opt_revision_range_t *range;
               const char *change_str =
                 APR_ARRAY_IDX(change_revs, i, const char *);
+              const char *s = change_str;
+              svn_boolean_t is_negative;
 
-              /* Allow any number of 'r's to prefix a revision number.
-                 ### TODO: Any reason we're not just using opt.c's
-                 ### revision-parsing code here?  Then -c could take
-                 ### "{DATE}" and the special words. */
-              while (*change_str == 'r')
-                change_str++;
-              changeno = changeno_end = strtol(change_str, &end, 10);
-              if (end != change_str && *end == '-')
+              /* Check for a leading minus to allow "-c -r42".
+               * The is_negative flag is used to handle "-c -42" and "-c -r42".
+               * The "-c r-42" case is handled by strtol() returning a
+               * negative number. */
+              is_negative = (*s == '-');
+              if (is_negative)
+                s++;
+
+              /* Allow any number of 'r's to prefix a revision number. */
+              while (*s == 'r')
+                s++;
+              changeno = changeno_end = strtol(s, &end, 10);
+              if (end != s && *end == '-')
                 {
-                  if (changeno < 0)
+                  if (changeno < 0 || is_negative)
                     {
                       err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                               _("Negative number in range (%s)"
@@ -1432,10 +1412,10 @@ main(int argc, const char *argv[])
                                               change_str);
                       return svn_cmdline_handle_exit_error(err, pool, "svn: ");
                     }
-                  change_str = end+1;
-                  while (*change_str == 'r')
-                    change_str++;
-                  changeno_end = strtol(change_str, &end, 10);
+                  s = end + 1;
+                  while (*s == 'r')
+                    s++;
+                  changeno_end = strtol(s, &end, 10);
                 }
               if (end == change_str || *end != '\0')
                 {
@@ -1452,6 +1432,9 @@ main(int argc, const char *argv[])
                   return svn_cmdline_handle_exit_error(err, pool, "svn: ");
                 }
 
+              if (is_negative)
+                changeno = -changeno;
+
               /* Figure out the range:
                     -c N  -> -r N-1:N
                     -c -N -> -r N:N-1
@@ -1794,22 +1777,19 @@ main(int argc, const char *argv[])
       case opt_reintegrate:
         opt_state.reintegrate = TRUE;
         break;
-      case opt_strip_count:
+      case opt_strip:
         {
-          char *end;
-          opt_state.strip_count = (int) strtol(opt_arg, &end, 10);
-          if (end == opt_arg || *end != '\0')
+          err = svn_cstring_atoi(&opt_state.strip, opt_arg);
+          if (err)
             {
-              err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+              err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
                                       _("Invalid strip count '%s'"), opt_arg);
               return svn_cmdline_handle_exit_error(err, pool, "svn: ");
             }
-          if (opt_state.strip_count < 0)
+          if (opt_state.strip < 0)
             {
-              err = svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
-                                      _("Negative strip count '%i' "
-                                        "(strip count must be positive)"),
-                                      opt_state.strip_count);
+              err = svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
+                                     _("Argument to --strip must be positive"));
               return svn_cmdline_handle_exit_error(err, pool, "svn: ");
             }
         }
@@ -1823,7 +1803,7 @@ main(int argc, const char *argv[])
       case opt_ignore_whitespace:
           opt_state.ignore_whitespace = TRUE;
           break;
-      case opt_show_diff:
+      case opt_diff:
           opt_state.show_diff = TRUE;
           break;
       case opt_internal_diff:
@@ -1832,8 +1812,8 @@ main(int argc, const char *argv[])
       case opt_use_git_diff_format:
         opt_state.use_git_diff_format = TRUE;
         break;
-      case opt_old_patch_target_names:
-        opt_state.old_patch_target_names = TRUE;
+      case opt_allow_mixed_revisions:
+        opt_state.allow_mixed_rev = TRUE;
         break;
       default:
         /* Hmmm. Perhaps this would be a good place to squirrel away

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/merge-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/merge-cmd.c Thu Dec  2 20:55:08 2010
@@ -293,6 +293,10 @@ svn_cl__merge(apr_getopt_t *os,
         return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                 _("--reintegrate can only be used with "
                                   "a single merge source"));
+      if (opt_state->allow_mixed_rev)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("--allow-mixed-revisions cannot be used "
+                                  "with --reintegrate"));
     }
 
   if (! two_sources_specified) /* TODO: Switch order of if */
@@ -322,7 +326,7 @@ svn_cl__merge(apr_getopt_t *os,
                                            opt_state->dry_run,
                                            options, ctx, pool);
       else
-        err = svn_client_merge_peg3(sourcepath1,
+        err = svn_client_merge_peg4(sourcepath1,
                                     ranges_to_merge,
                                     &peg_revision1,
                                     targetpath,
@@ -331,6 +335,7 @@ svn_cl__merge(apr_getopt_t *os,
                                     opt_state->force,
                                     opt_state->record_only,
                                     opt_state->dry_run,
+                                    opt_state->allow_mixed_rev,
                                     options,
                                     ctx,
                                     pool);
@@ -342,7 +347,7 @@ svn_cl__merge(apr_getopt_t *os,
                                                  NULL,
                                                  _("Merge sources must both be "
                                                    "either paths or URLs")));
-      err = svn_client_merge3(sourcepath1,
+      err = svn_client_merge4(sourcepath1,
                               &first_range_start,
                               sourcepath2,
                               &first_range_end,
@@ -352,6 +357,7 @@ svn_cl__merge(apr_getopt_t *os,
                               opt_state->force,
                               opt_state->record_only,
                               opt_state->dry_run,
+                              opt_state->allow_mixed_rev,
                               options,
                               ctx,
                               pool);

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/notify.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/notify.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/notify.c Thu Dec  2 20:55:08 2010
@@ -46,7 +46,7 @@ struct notify_baton
   svn_boolean_t received_some_change;
   svn_boolean_t is_checkout;
   svn_boolean_t is_export;
-  svn_boolean_t suppress_final_line;
+  svn_boolean_t suppress_summary_lines;
   svn_boolean_t sent_first_txdelta;
   svn_boolean_t in_external;
   svn_boolean_t had_print_error; /* Used to not keep printing error messages
@@ -547,9 +547,21 @@ notify(void *baton, const svn_wc_notify_
         }
       break;
 
+    case svn_wc_notify_update_started:
+      if (! (nb->suppress_summary_lines || 
+             nb->in_external ||
+             nb->is_checkout ||
+             nb->is_export))
+        {
+          if ((err = svn_cmdline_printf(pool, _("Updating '%s' ...\n"),
+                                        path_local)))
+            goto print_error;
+        }
+      break;
+
     case svn_wc_notify_update_completed:
       {
-        if (! nb->suppress_final_line)
+        if (! nb->suppress_summary_lines)
           {
             if (SVN_IS_VALID_REVNUM(n->revision))
               {
@@ -575,6 +587,7 @@ notify(void *baton, const svn_wc_notify_
                   {
                     if (nb->received_some_change)
                       {
+                        nb->received_some_change = FALSE;
                         if ((err = svn_cmdline_printf
                              (pool, nb->in_external
                               ? _("Updated external to revision %ld.\n")
@@ -912,7 +925,7 @@ notify(void *baton, const svn_wc_notify_
 svn_error_t *
 svn_cl__get_notifier(svn_wc_notify_func2_t *notify_func_p,
                      void **notify_baton_p,
-                     svn_boolean_t suppress_final_line,
+                     svn_boolean_t suppress_summary_lines,
                      apr_pool_t *pool)
 {
   struct notify_baton *nb = apr_palloc(pool, sizeof(*nb));
@@ -921,7 +934,7 @@ svn_cl__get_notifier(svn_wc_notify_func2
   nb->sent_first_txdelta = FALSE;
   nb->is_checkout = FALSE;
   nb->is_export = FALSE;
-  nb->suppress_final_line = suppress_final_line;
+  nb->suppress_summary_lines = suppress_summary_lines;
   nb->in_external = FALSE;
   nb->had_print_error = FALSE;
   nb->text_conflicts = 0;
@@ -952,3 +965,18 @@ svn_cl__notifier_mark_export(void *baton
   nb->is_export = TRUE;
   return SVN_NO_ERROR;
 }
+
+void
+svn_cl__check_externals_failed_notify_wrapper(void *baton,
+                                              const svn_wc_notify_t *n,
+                                              apr_pool_t *pool)
+{
+  struct svn_cl__check_externals_failed_notify_baton *nwb = baton;
+
+  if (n->action == svn_wc_notify_failed_external)
+    nwb->had_externals_error = TRUE;
+
+  if (nwb->wrapped_func)
+    nwb->wrapped_func(nwb->wrapped_baton, n, pool);
+}
+

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/patch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/patch-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/patch-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/patch-cmd.c Thu Dec  2 20:55:08 2010
@@ -48,33 +48,45 @@ svn_cl__patch(apr_getopt_t *os,
 {
   svn_cl__opt_state_t *opt_state;
   svn_client_ctx_t *ctx;
-  apr_array_header_t *args;
   apr_array_header_t *targets;
   const char *abs_patch_path;
+  const char *patch_path;
   const char *abs_target_path;
+  const char *target_path;
 
   opt_state = ((svn_cl__cmd_baton_t *)baton)->opt_state;
   ctx = ((svn_cl__cmd_baton_t *)baton)->ctx;
 
-  SVN_ERR(svn_opt_parse_num_args(&args, os, 1, pool));
-  SVN_ERR(svn_dirent_get_absolute(&abs_patch_path,
-                                  APR_ARRAY_IDX(args, 0, const char *),
-                                  pool));
-
-  SVN_ERR(svn_client_args_to_target_array(&targets, os, opt_state->targets,
-                                          ctx, pool));
-  if (targets->nelts > 1)
+  SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
+                                                      opt_state->targets,
+                                                      ctx, pool));
+  SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
+
+  if (targets->nelts > 2)
     return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0, NULL);
 
-  svn_opt_push_implicit_dot_target(targets, pool);
-  SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
-  SVN_ERR(svn_dirent_get_absolute(&abs_target_path,
-                                  APR_ARRAY_IDX(targets, 0, const char *),
-                                  pool));
+  patch_path = APR_ARRAY_IDX(targets, 0, const char *);
+
+  if (svn_path_is_url(patch_path))
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("'%s' is not a local path"), patch_path);
+
+  SVN_ERR(svn_dirent_get_absolute(&abs_patch_path, patch_path, pool));
+
+  if (targets->nelts == 1)
+    target_path = ""; /* "" is the canonical form of "." */
+  else
+    {
+      target_path = APR_ARRAY_IDX(targets, 1, const char *);
+
+      if (svn_path_is_url(target_path))
+        return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                 _("'%s' is not a local path"), target_path);
+    }
+  SVN_ERR(svn_dirent_get_absolute(&abs_target_path, target_path, pool));
 
   SVN_ERR(svn_client_patch(abs_patch_path, abs_target_path,
-                           opt_state->dry_run, opt_state->strip_count,
-                           opt_state->old_patch_target_names,
+                           opt_state->dry_run, opt_state->strip,
                            opt_state->reverse_diff,
                            opt_state->ignore_whitespace,
                            TRUE, NULL, NULL, ctx, pool, pool));

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/resolve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/resolve-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/resolve-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/resolve-cmd.c Thu Dec  2 20:55:08 2010
@@ -29,6 +29,7 @@
 #define APR_WANT_STDIO
 #include <apr_want.h>
 
+#include "svn_path.h"
 #include "svn_client.h"
 #include "svn_error.h"
 #include "svn_pools.h"
@@ -93,6 +94,17 @@ svn_cl__resolve(apr_getopt_t *os,
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, scratch_pool));
 
+  /* Don't even attempt to modify the working copy if any of the
+   * targets look like URLs. URLs are invalid input. */
+  for (i = 0; i < targets->nelts; i++)
+    {
+      const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+      if (svn_path_is_url(target))
+        return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                 _("'%s' is not a local path"), target);
+    }
+  
   iterpool = svn_pool_create(scratch_pool);
   for (i = 0; i < targets->nelts; i++)
     {

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/resolved-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/resolved-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/resolved-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/resolved-cmd.c Thu Dec  2 20:55:08 2010
@@ -29,6 +29,7 @@
 #define APR_WANT_STDIO
 #include <apr_want.h>
 
+#include "svn_path.h"
 #include "svn_client.h"
 #include "svn_error.h"
 #include "svn_pools.h"
@@ -64,6 +65,16 @@ svn_cl__resolved(apr_getopt_t *os,
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, scratch_pool));
 
+  /* URLs are invalid input. */
+  for (i = 0; i < targets->nelts; i++)
+    {
+      const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+      if (svn_path_is_url(target))
+        return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                 _("'%s' is not a local path"), target);
+    }
+  
   iterpool = svn_pool_create(scratch_pool);
   for (i = 0; i < targets->nelts; i++)
     {

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/revert-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/revert-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/revert-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/revert-cmd.c Thu Dec  2 20:55:08 2010
@@ -27,6 +27,7 @@
 
 /*** Includes. ***/
 
+#include "svn_path.h"
 #include "svn_client.h"
 #include "svn_error_codes.h"
 #include "svn_error.h"
@@ -47,6 +48,7 @@ svn_cl__revert(apr_getopt_t *os,
   svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
   apr_array_header_t *targets = NULL;
   svn_error_t *err;
+  int i;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -63,9 +65,19 @@ svn_cl__revert(apr_getopt_t *os,
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, scratch_pool));
 
+  /* Don't even attempt to modify the working copy if any of the
+   * targets look like URLs. URLs are invalid input. */
+  for (i = 0; i < targets->nelts; i++)
+    {
+      const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+      if (svn_path_is_url(target))
+        return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                 _("'%s' is not a local path"), target);
+    }
+
   err = svn_client_revert2(targets, opt_state->depth,
                            opt_state->changelists, ctx, scratch_pool);
-
   if (err
       && (err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH)
       && (! SVN_DEPTH_IS_RECURSIVE(opt_state->depth)))

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/schema/info.rnc
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/schema/info.rnc?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/schema/info.rnc (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/schema/info.rnc Thu Dec  2 20:55:08 2010
@@ -53,6 +53,7 @@ uuid = element uuid { uuid.type }
 ## Info in the working copy entry.
 wc-info =
   element wc-info {
+    wcroot-abspath?,
     schedule?,
     changelist?,
     copy-from-url?,
@@ -63,6 +64,8 @@ wc-info =
     checksum?
   }
 
+wcroot-abspath = element wcroot-abspath { string }
+
 schedule =
   element schedule { "normal" | "add" | "delete" | "replace" | "none" }
 

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/status-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/status-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/status-cmd.c Thu Dec  2 20:55:08 2010
@@ -171,14 +171,7 @@ print_status(void *baton,
              apr_pool_t *pool)
 {
   struct status_baton *sb = baton;
-
-  svn_revnum_t revision;
-  svn_revnum_t changed_rev;
-  apr_time_t changed_date;
-  const char *changed_author;
-  const char *local_abspath;
-
-  local_abspath = status->local_abspath;
+  const char *local_abspath = status->local_abspath;
 
   /* ### The revision information with associates are based on what
    * ### _read_info() returns. The svn_wc_status_func4_t callback is
@@ -194,16 +187,13 @@ print_status(void *baton,
                  = svn_client_status_dup(status, sb->cl_pool);
 
       /* Retrieve some data from the original version of the replaced node */
-      SVN_ERR(svn_wc__node_get_working_rev_info(&revision, &changed_rev,
-                                                &changed_date,
-                                                &changed_author,
+      SVN_ERR(svn_wc__node_get_working_rev_info(&tweaked_status->revision,
+                                                &tweaked_status->changed_rev,
+                                                &tweaked_status->changed_date,
+                                                &tweaked_status->changed_author,
                                                 sb->ctx->wc_ctx,
                                                 local_abspath, sb->cl_pool,
                                                 pool));
-      tweaked_status->revision = revision;
-      tweaked_status->changed_rev = changed_rev;
-      tweaked_status->changed_date = changed_date;
-      tweaked_status->changed_author = changed_author;
 
       status = tweaked_status;
     }
@@ -259,6 +249,16 @@ svn_cl__status(apr_getopt_t *os,
   /* Add "." if user passed 0 arguments */
   svn_opt_push_implicit_dot_target(targets, scratch_pool);
 
+  /* URLs are invalid input. */
+  for (i = 0; i < targets->nelts; i++)
+    {
+      const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+      if (svn_path_is_url(target))
+        return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                 _("'%s' is not a local path"), target);
+    }
+
   /* We want our -u statuses to be against HEAD. */
   rev.kind = svn_opt_revision_head;
 

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/status.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/status.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/status.c Thu Dec  2 20:55:08 2010
@@ -163,6 +163,7 @@ print_status(const char *path,
           svn_wc_conflict_description_t *old_tree_conflict;
           SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict, ctx->wc_ctx,
                                             local_abspath, pool, pool));
+          SVN_ERR_ASSERT(tree_conflict != NULL);
           old_tree_conflict = svn_wc__cd2_to_cd(tree_conflict, pool);
 
           tree_status_code = 'C';

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/switch-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/switch-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/switch-cmd.c Thu Dec  2 20:55:08 2010
@@ -41,6 +41,7 @@
 
 static svn_error_t *
 rewrite_urls(const apr_array_header_t *targets,
+             svn_boolean_t ignore_externals,
              svn_client_ctx_t *ctx,
              apr_pool_t *pool)
 {
@@ -65,7 +66,8 @@ rewrite_urls(const apr_array_header_t *t
 
   if (targets->nelts == 2)
     {
-      SVN_ERR(svn_client_relocate2("", from, to, ctx, pool));
+      SVN_ERR(svn_client_relocate2("", from, to, ignore_externals,
+                                   ctx, pool));
     }
   else
     {
@@ -75,7 +77,8 @@ rewrite_urls(const apr_array_header_t *t
         {
           const char *target = APR_ARRAY_IDX(targets, i, const char *);
           svn_pool_clear(subpool);
-          SVN_ERR(svn_client_relocate2(target, from, to, ctx, subpool));
+          SVN_ERR(svn_client_relocate2(target, from, to,
+                                       ignore_externals, ctx, subpool));
         }
     }
 
@@ -98,6 +101,7 @@ svn_cl__switch(apr_getopt_t *os,
   svn_opt_revision_t peg_revision;
   svn_depth_t depth;
   svn_boolean_t depth_is_sticky;
+  struct svn_cl__check_externals_failed_notify_baton nwb;
 
   /* This command should discover (or derive) exactly two cmdline
      arguments: a local path to update ("target"), and a new url to
@@ -108,7 +112,8 @@ svn_cl__switch(apr_getopt_t *os,
 
   /* handle only-rewrite case specially */
   if (opt_state->relocate)
-    return rewrite_urls(targets, ctx, scratch_pool);
+    return rewrite_urls(targets, opt_state->ignore_externals,
+                        ctx, scratch_pool);
 
   if (targets->nelts < 1)
     return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
@@ -139,6 +144,12 @@ svn_cl__switch(apr_getopt_t *os,
       (SVN_ERR_BAD_URL, NULL,
        _("'%s' does not appear to be a URL"), switch_url);
 
+  /* Target path cannot be URL */
+  if (svn_path_is_url(target))
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("'%s' is not a local path"),
+                             target);
+
   /* Canonicalize the URL. */
   switch_url = svn_uri_canonicalize(switch_url, scratch_pool);
 
@@ -154,6 +165,12 @@ svn_cl__switch(apr_getopt_t *os,
       depth_is_sticky = FALSE;
     }
 
+  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;
+
   /* Do the 'switch' update. */
   SVN_ERR(svn_client_switch2(NULL, target, switch_url, &peg_revision,
                              &(opt_state->start_revision), depth,
@@ -161,7 +178,12 @@ svn_cl__switch(apr_getopt_t *os,
                              opt_state->force, ctx, scratch_pool));
 
   if (! opt_state->quiet)
-    SVN_ERR(svn_cl__print_conflict_stats(ctx->notify_baton2, scratch_pool));
+    SVN_ERR(svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool));
+
+  if (nwb.had_externals_error)
+    return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
+                            _("Failure occurred processing one or more "
+                              "externals definitions"));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/gpg-agent-password-store/subversion/svn/unlock-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/svn/unlock-cmd.c?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/svn/unlock-cmd.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/svn/unlock-cmd.c Thu Dec  2 20:55:08 2010
@@ -27,6 +27,7 @@
 
 /*** Includes. ***/
 
+#include "svn_path.h"
 #include "svn_pools.h"
 #include "svn_client.h"
 #include "svn_error_codes.h"
@@ -48,6 +49,8 @@ svn_cl__unlock(apr_getopt_t *os,
   svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
   svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
   apr_array_header_t *targets;
+  svn_boolean_t wc_present = FALSE, url_present = FALSE;
+  int i;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -59,6 +62,23 @@ svn_cl__unlock(apr_getopt_t *os,
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, scratch_pool));
 
+  /* Check to see if at least one of our paths is a working copy
+   * path or a repository url. */
+  for (i = 0; i < targets->nelts; ++i)
+    {
+      const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+      if (! svn_path_is_url(target))
+        wc_present = TRUE;
+      else
+        url_present = TRUE;
+    }
+
+  if (url_present && wc_present)
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("Cannot mix repository and working copy "
+                               "targets"));
+
   return svn_error_return(
     svn_client_unlock(targets, opt_state->force, ctx, scratch_pool));
 }