subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1846561 - in /subversion/branches/1.11.x: ./ STATUS subversion/libsvn_client/revisions.c subversion/tests/cmdline/basic_tests.py
Date Wed, 14 Nov 2018 04:00:14 GMT
Author: svn-role
Date: Wed Nov 14 04:00:14 2018
New Revision: 1846561

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

 * r1844987
   Raise an error if someone tries to use -rPREV on a working copy at r0.
   Justification:
     Fixes #4532, which is an assertion abort.
   Votes:
     +1: brane, rhuijben, julianfoad

Modified:
    subversion/branches/1.11.x/   (props changed)
    subversion/branches/1.11.x/STATUS
    subversion/branches/1.11.x/subversion/libsvn_client/revisions.c
    subversion/branches/1.11.x/subversion/tests/cmdline/basic_tests.py

Propchange: subversion/branches/1.11.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 14 04:00:14 2018
@@ -100,4 +100,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1840990-1840991,1840995,1840997,1841059,1841079,1841091,1841098,1841136,1841180,1841272,1841481,1841524-1841525,1841567,1841600-1841602,1841606,1841719,1841725,1841731,1841736,1841742-1841743,1841753-1841754,1841822,1841850,1841867,1842090,1842222-1842223,1842334,1842814,1842827,1842829,1842877,1843888,1844882,1845204,1845261,1845408,1845555-1845556,1845559,1845577,1846403,1846406
+/subversion/trunk:1840990-1840991,1840995,1840997,1841059,1841079,1841091,1841098,1841136,1841180,1841272,1841481,1841524-1841525,1841567,1841600-1841602,1841606,1841719,1841725,1841731,1841736,1841742-1841743,1841753-1841754,1841822,1841850,1841867,1842090,1842222-1842223,1842334,1842814,1842827,1842829,1842877,1843888,1844882,1844987,1845204,1845261,1845408,1845555-1845556,1845559,1845577,1846403,1846406

Modified: subversion/branches/1.11.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.11.x/STATUS?rev=1846561&r1=1846560&r2=1846561&view=diff
==============================================================================
--- subversion/branches/1.11.x/STATUS (original)
+++ subversion/branches/1.11.x/STATUS Wed Nov 14 04:00:14 2018
@@ -27,10 +27,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1844987
-   Raise an error if someone tries to use -rPREV on a working copy at r0.
-   Justification:
-     Fixes #4532, which is an assertion abort.
-   Votes:
-     +1: brane, rhuijben, julianfoad

Modified: subversion/branches/1.11.x/subversion/libsvn_client/revisions.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.11.x/subversion/libsvn_client/revisions.c?rev=1846561&r1=1846560&r2=1846561&view=diff
==============================================================================
--- subversion/branches/1.11.x/subversion/libsvn_client/revisions.c (original)
+++ subversion/branches/1.11.x/subversion/libsvn_client/revisions.c Wed Nov 14 04:00:14 2018
@@ -146,7 +146,14 @@ svn_client__get_revision_number(svn_revn
                                                           scratch_pool));
 
         if (revision->kind == svn_opt_revision_previous)
-          (*revnum)--;
+          {
+            if (*revnum == 0)
+              return svn_error_createf(
+                  SVN_ERR_CLIENT_BAD_REVISION, NULL,
+                  _("Path '%s' has no previous revision"),
+                  svn_dirent_local_style(local_abspath, scratch_pool));
+            --(*revnum);
+          }
       }
       break;
 

Modified: subversion/branches/1.11.x/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.11.x/subversion/tests/cmdline/basic_tests.py?rev=1846561&r1=1846560&r2=1846561&view=diff
==============================================================================
--- subversion/branches/1.11.x/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/1.11.x/subversion/tests/cmdline/basic_tests.py Wed Nov 14 04:00:14
2018
@@ -3050,6 +3050,15 @@ def peg_rev_on_non_existent_wc_path(sbox
                                      'cat', '-r2', sbox.ospath('mu3') + '@3')
 
 
+@Issue(4532)
+def diff_previous_revision_of_r0(sbox):
+  """diff -rPREV on WC at revision 0"""
+
+  sbox.build(empty=True)
+  svntest.actions.run_and_verify_svn(None, 'svn: E195002: ',
+                                     'diff', '-rPREV', sbox.ospath(''))
+
+
 # With 'svn mkdir --parents' the target directory may already exist on disk.
 # In that case it was wrongly performing a recursive 'add' on its contents.
 def mkdir_parents_target_exists_on_disk(sbox):
@@ -3302,6 +3311,7 @@ test_list = [ None,
               rm_missing_with_case_clashing_ondisk_item,
               delete_conflicts_one_of_many,
               peg_rev_on_non_existent_wc_path,
+              diff_previous_revision_of_r0,
               mkdir_parents_target_exists_on_disk,
               plaintext_password_storage_disabled,
               filtered_ls,



Mime
View raw message