You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ja...@apache.org on 2018/07/02 02:27:29 UTC

svn commit: r1834810 - in /subversion/trunk/subversion: svn/shelf-cmd.c tests/cmdline/shelf_tests.py

Author: jamessan
Date: Mon Jul  2 02:27:29 2018
New Revision: 1834810

URL: http://svn.apache.org/viewvc?rev=1834810&view=rev
Log:
Fix use of implicit path when calling shelf-{list,log,drop} from a wc-subdir

* subversion/svn/shelf-cmd.c:
  (svn_cl__shelf_list, svn_cl__shelf_drop, svn_cl__shelf_log): Convert targets
   to absolute paths

* subversion/tests/cmdline/shelf_tests.py:
  (shelve_unshelve_verify): Add an assertion for "svn shelves"

Modified:
    subversion/trunk/subversion/svn/shelf-cmd.c
    subversion/trunk/subversion/tests/cmdline/shelf_tests.py

Modified: subversion/trunk/subversion/svn/shelf-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/shelf-cmd.c?rev=1834810&r1=1834809&r2=1834810&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/shelf-cmd.c (original)
+++ subversion/trunk/subversion/svn/shelf-cmd.c Mon Jul  2 02:27:29 2018
@@ -935,10 +935,14 @@ svn_cl__shelf_list(apr_getopt_t *os,
 
   for (i = 0; i < targets->nelts; ++i)
     {
+      const char *local_abspath;
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
 
       svn_pool_clear(iterpool);
-      SVN_ERR(shelves_list(target,
+
+      SVN_ERR(svn_dirent_get_absolute(&local_abspath, target, iterpool));
+
+      SVN_ERR(shelves_list(local_abspath,
                            opt_state->quiet,
                            ctx, iterpool));
     }
@@ -1105,10 +1109,13 @@ svn_cl__shelf_drop(apr_getopt_t *os,
 
   for (i = 0; i < targets->nelts; ++i)
     {
+      const char *local_abspath;
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
 
       svn_pool_clear(iterpool);
-      SVN_ERR(shelf_drop(name, target,
+
+      SVN_ERR(svn_dirent_get_absolute(&local_abspath, target, iterpool));
+      SVN_ERR(shelf_drop(name, local_abspath,
                          opt_state->dry_run, opt_state->quiet,
                          ctx, iterpool));
     }
@@ -1140,11 +1147,13 @@ svn_cl__shelf_log(apr_getopt_t *os,
 
   for (i = 0; i < targets->nelts; ++i)
     {
+      const char *local_abspath;
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
 
       svn_pool_clear(iterpool);
-      SVN_ERR(shelf_log(name, target,
-                        ctx, pool));
+
+      SVN_ERR(svn_dirent_get_absolute(&local_abspath, target, iterpool));
+      SVN_ERR(shelf_log(name, local_abspath, ctx, iterpool));
     }
 
   svn_pool_destroy(iterpool);

Modified: subversion/trunk/subversion/tests/cmdline/shelf_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/shelf_tests.py?rev=1834810&r1=1834809&r2=1834810&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/shelf_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/shelf_tests.py Mon Jul  2 02:27:29 2018
@@ -115,6 +115,13 @@ def shelve_unshelve_verify(sbox, modifie
                                      'shelve', 'foo')
   check_wc_state(wc_dir, virginal_state)
 
+  # List; ensure the shelf is listed
+  expected_output = svntest.verify.RegexListOutput(
+    ['foo\s*version \d+.*',
+     ' '
+    ])
+  svntest.actions.run_and_verify_svn(expected_output, [], 'shelves')
+
   # Unshelve; check the original modifications are here again
   svntest.actions.run_and_verify_svn(None, [],
                                      'unshelve', 'foo')