You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/09/12 22:23:30 UTC

svn commit: r996383 - in /subversion/trunk/subversion: svn/conflict-callbacks.c tests/cmdline/resolve_tests.py

Author: danielsh
Date: Sun Sep 12 20:23:30 2010
New Revision: 996383

URL: http://svn.apache.org/viewvc?rev=996383&view=rev
Log:
'svn --accept': add shorthands.

* subversion/tests/cmdline/resolve_tests.py
  (automatic_conflict_resolution):  Adjust a test to cover the shorthand.

* subversion/svn/conflict-callbacks.c
  (svn_cl__accept_from_word): Recognize the abbreviations from...
  (svn_cl__conflict_handler): ...the interactive prompt, and add cross-references.

Modified:
    subversion/trunk/subversion/svn/conflict-callbacks.c
    subversion/trunk/subversion/tests/cmdline/resolve_tests.py

Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=996383&r1=996382&r2=996383&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Sun Sep 12 20:23:30 2010
@@ -59,23 +59,33 @@ svn_cl__conflict_baton_make(svn_cl__acce
 svn_cl__accept_t
 svn_cl__accept_from_word(const char *word)
 {
-  if (strcmp(word, SVN_CL__ACCEPT_POSTPONE) == 0)
+  /* Shorthand options are consistent with  svn_cl__conflict_handler(). */
+  if (strcmp(word, SVN_CL__ACCEPT_POSTPONE) == 0
+      || strcmp(word, "p") == 0)
     return svn_cl__accept_postpone;
   if (strcmp(word, SVN_CL__ACCEPT_BASE) == 0)
+    /* ### shorthand? */
     return svn_cl__accept_base;
   if (strcmp(word, SVN_CL__ACCEPT_WORKING) == 0)
+    /* ### shorthand? */
     return svn_cl__accept_working;
-  if (strcmp(word, SVN_CL__ACCEPT_MINE_CONFLICT) == 0)
+  if (strcmp(word, SVN_CL__ACCEPT_MINE_CONFLICT) == 0
+      || strcmp(word, "mc") == 0)
     return svn_cl__accept_mine_conflict;
-  if (strcmp(word, SVN_CL__ACCEPT_THEIRS_CONFLICT) == 0)
+  if (strcmp(word, SVN_CL__ACCEPT_THEIRS_CONFLICT) == 0
+      || strcmp(word, "tc") == 0)
     return svn_cl__accept_theirs_conflict;
-  if (strcmp(word, SVN_CL__ACCEPT_MINE_FULL) == 0)
+  if (strcmp(word, SVN_CL__ACCEPT_MINE_FULL) == 0
+      || strcmp(word, "mf") == 0)
     return svn_cl__accept_mine_full;
-  if (strcmp(word, SVN_CL__ACCEPT_THEIRS_FULL) == 0)
+  if (strcmp(word, SVN_CL__ACCEPT_THEIRS_FULL) == 0
+      || strcmp(word, "tf") == 0)
     return svn_cl__accept_theirs_full;
-  if (strcmp(word, SVN_CL__ACCEPT_EDIT) == 0)
+  if (strcmp(word, SVN_CL__ACCEPT_EDIT) == 0
+      || strcmp(word, "e") == 0)
     return svn_cl__accept_edit;
-  if (strcmp(word, SVN_CL__ACCEPT_LAUNCH) == 0)
+  if (strcmp(word, SVN_CL__ACCEPT_LAUNCH) == 0
+      || strcmp(word, "l") == 0)
     return svn_cl__accept_launch;
   /* word is an invalid action. */
   return svn_cl__accept_invalid;
@@ -493,6 +503,7 @@ svn_cl__conflict_handler(svn_wc_conflict
 
           if (strcmp(answer, "s") == 0)
             {
+              /* These are used in svn_cl__accept_from_word(). */
               SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
               _("\n"
                 "  (e)  edit             - change merged file in an editor\n"

Modified: subversion/trunk/subversion/tests/cmdline/resolve_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/resolve_tests.py?rev=996383&r1=996382&r2=996383&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/resolve_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/resolve_tests.py Sun Sep 12 20:23:30 2010
@@ -95,7 +95,7 @@ def automatic_conflict_resolution(sbox):
   # Test 'svn resolve -R --accept theirs-full'
   do_text_conflicting_merge()
   svntest.actions.run_and_verify_resolve([psi_COPY_path],
-                                         '-R', '--accept', 'theirs-full',
+                                         '-R', '--accept', 'tf',
                                          A_COPY_path)
   wc_disk.tweak('A_COPY/D/H/psi', contents="New content")
   svntest.actions.verify_disk(wc_dir, wc_disk)



Re: svn commit: r996383 - in /subversion/trunk/subversion: svn/conflict-callbacks.c tests/cmdline/resolve_tests.py

Posted by Stefan Sperling <st...@elego.de>.
On Sun, Sep 12, 2010 at 08:23:30PM -0000, danielsh@apache.org wrote:
> Author: danielsh
> Date: Sun Sep 12 20:23:30 2010
> New Revision: 996383
> 
> URL: http://svn.apache.org/viewvc?rev=996383&view=rev
> Log:
> 'svn --accept': add shorthands.
> 
> * subversion/tests/cmdline/resolve_tests.py
>   (automatic_conflict_resolution):  Adjust a test to cover the shorthand.
> 
> * subversion/svn/conflict-callbacks.c
>   (svn_cl__accept_from_word): Recognize the abbreviations from...
>   (svn_cl__conflict_handler): ...the interactive prompt, and add cross-references.
> 
> Modified:
>     subversion/trunk/subversion/svn/conflict-callbacks.c
>     subversion/trunk/subversion/tests/cmdline/resolve_tests.py
> 
> Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=996383&r1=996382&r2=996383&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
> +++ subversion/trunk/subversion/svn/conflict-callbacks.c Sun Sep 12 20:23:30 2010
> @@ -59,23 +59,33 @@ svn_cl__conflict_baton_make(svn_cl__acce
>  svn_cl__accept_t
>  svn_cl__accept_from_word(const char *word)
>  {
> -  if (strcmp(word, SVN_CL__ACCEPT_POSTPONE) == 0)
> +  /* Shorthand options are consistent with  svn_cl__conflict_handler(). */
> +  if (strcmp(word, SVN_CL__ACCEPT_POSTPONE) == 0
> +      || strcmp(word, "p") == 0)

Even though these strings are really short, could we add file-local macros
for them since we now require them to be consistent across two places?