Author: svn-role
Date: Fri Jan  5 04:00:20 2018
New Revision: 1820252

URL: http://svn.apache.org/viewvc?rev=1820252&view=rev
Log:
Merge r1819804 from trunk:

 * r1819804
   Fix 'shelve' when the current working directory is not the WC root.
   Justification:
     Makes shelve follow typical UI of svn commands
   Votes:
     +1: jamessan, stefan2, brane

Modified:
    subversion/branches/1.10.x/   (props changed)
    subversion/branches/1.10.x/STATUS
    subversion/branches/1.10.x/subversion/libsvn_client/shelve.c
    subversion/branches/1.10.x/subversion/tests/cmdline/shelve_tests.py

Propchange: subversion/branches/1.10.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan  5 04:00:20 2018
@@ -99,4 +99,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1817837,1817856,1818578,1818584,1818651,1818662,1818727,1818801,1818803,1818807,1818868,1818871,1819036-1819037,1819043,1819049,1819052,1819093,1819162,1819444,1819556-1819557,1819603,1819911
+/subversion/trunk:1817837,1817856,1818578,1818584,1818651,1818662,1818727,1818801,1818803,1818807,1818868,1818871,1819036-1819037,1819043,1819049,1819052,1819093,1819162,1819444,1819556-1819557,1819603,1819804,1819911

Modified: subversion/branches/1.10.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/STATUS?rev=1820252&r1=1820251&r2=1820252&view=diff
==============================================================================
--- subversion/branches/1.10.x/STATUS (original)
+++ subversion/branches/1.10.x/STATUS Fri Jan  5 04:00:20 2018
@@ -28,10 +28,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1819804
-   Fix 'shelve' when the current working directory is not the WC root.
-   Justification:
-     Makes shelve follow typical UI of svn commands
-   Votes:
-     +1: jamessan, stefan2, brane

Modified: subversion/branches/1.10.x/subversion/libsvn_client/shelve.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/subversion/libsvn_client/shelve.c?rev=1820252&r1=1820251&r2=1820252&view=diff
==============================================================================
--- subversion/branches/1.10.x/subversion/libsvn_client/shelve.c (original)
+++ subversion/branches/1.10.x/subversion/libsvn_client/shelve.c Fri Jan  5 
04:00:20 2018
@@ -128,6 +128,7 @@ svn_client_shelf_write_patch(const char
       if (svn_path_is_url(path))
         return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
                                  _("'%s' is not a local path"), path);
+      SVN_ERR(svn_dirent_get_absolute(&path, path, scratch_pool));
 
       SVN_ERR(svn_client_diff_peg6(
                      NULL /*options*/,
@@ -135,7 +136,7 @@ svn_client_shelf_write_patch(const char
                      &peg_revision,
                      &start_revision,
                      &end_revision,
-                     NULL,
+                     wc_root_abspath,
                      depth,
                      TRUE /*notice_ancestry*/,
                      FALSE /*no_diff_added*/,

Modified: subversion/branches/1.10.x/subversion/tests/cmdline/shelve_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/subversion/tests/cmdline/shelve_tests.py?rev=1820252&r1=1820251&r2=1820252&view=diff
==============================================================================
--- subversion/branches/1.10.x/subversion/tests/cmdline/shelve_tests.py 
(original)
+++ subversion/branches/1.10.x/subversion/tests/cmdline/shelve_tests.py Fri Jan 
 5 04:00:20 2018
@@ -44,21 +44,16 @@ Item = wc.StateItem
 
 #----------------------------------------------------------------------
 
-def shelve_unshelve(sbox, modifier):
-  "Round-trip: shelve and unshelve"
+def shelve_unshelve_verify(sbox):
+  """Round-trip: shelve; verify all changes are reverted;
+     unshelve; verify all changes are restored.
+  """
 
-  sbox.build()
-  was_cwd = os.getcwd()
-  os.chdir(sbox.wc_dir)
-  sbox.wc_dir = ''
-  wc_dir = ''
-
-  # Make some changes to the working copy
-  modifier(sbox)
+  wc_dir = sbox.wc_dir
 
   # Save the modified state
   _, output, _ = svntest.main.run_svn(None, 'status', '-v', '-u', '-q',
-                                      sbox.wc_dir)
+                                      wc_dir)
   modified_state = svntest.wc.State.from_status(output, wc_dir)
 
   # Shelve; check there are no longer any modifications
@@ -72,6 +67,23 @@ def shelve_unshelve(sbox, modifier):
                                      'unshelve', 'foo')
   svntest.actions.run_and_verify_status(wc_dir, modified_state)
 
+#----------------------------------------------------------------------
+
+def shelve_unshelve(sbox, modifier):
+  """Round-trip: build 'sbox'; apply changes by calling 'modifier(sbox)';
+     shelve and unshelve; verify changes are fully reverted and restored.
+  """
+
+  sbox.build()
+  was_cwd = os.getcwd()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
+
+  # Make some changes to the working copy
+  modifier(sbox)
+
+  shelve_unshelve_verify(sbox)
+
   os.chdir(was_cwd)
 
 ######################################################################
@@ -126,6 +138,23 @@ def shelve_deletes(sbox):
 
 #----------------------------------------------------------------------
 
+def shelve_from_inner_path(sbox):
+  "shelve from inner path"
+
+  def modifier(sbox):
+    sbox.simple_append('A/mu', 'appended mu text')
+
+  sbox.build()
+  was_cwd = os.getcwd()
+  os.chdir(sbox.ospath('A'))
+  sbox.wc_dir = '..'
+
+  modifier(sbox)
+  shelve_unshelve_verify(sbox)
+
+  os.chdir(was_cwd)
+
+#----------------------------------------------------------------------
 
 ########################################################################
 # Run the tests
@@ -136,6 +165,7 @@ test_list = [ None,
               shelve_prop_changes,
               shelve_adds,
               shelve_deletes,
+              shelve_from_inner_path,
              ]
 
 if __name__ == '__main__':


Reply via email to