Author: rhuijben
Date: Tue Jul 19 16:12:57 2011
New Revision: 1148424

URL: http://svn.apache.org/viewvc?rev=1148424&view=rev
Log:
Resolve issue 3963, 'svn update -r{R>HEAD}' hangs client over ra_svn.

* subversion/libsvn_ra_svn/editorp.c
  (svn_ra_svn_drive_editor2): Handle a failure command as an editor command.
    This handles the case where an editor can't be created in a way that
    doesn't cause us to send a failure back while the other side doesn't
    expect that.

* subversion/tests/cmdline/update_tests.py
  (update_to_HEAD_plus_1): New test.
  (test_list): Add update_to_HEAD_plus_1.

Modified:
    subversion/trunk/subversion/libsvn_ra_svn/editorp.c
    subversion/trunk/subversion/tests/cmdline/update_tests.py

Modified: subversion/trunk/subversion/libsvn_ra_svn/editorp.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/editorp.c?rev=1148424&r1=1148423&r2=1148424&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/editorp.c Tue Jul 19 16:12:57 2011
@@ -914,6 +914,17 @@ svn_error_t *svn_ra_svn_drive_editor2(sv
         }
       if (ra_svn_edit_cmds[i].cmd)
         err = (*ra_svn_edit_cmds[i].handler)(conn, subpool, params, &state);
+      else if (strcmp(cmd, "failure") == 0)
+        {
+          /* While not really an editor command this can occur when
+             reporter->finish_report() fails before the first editor command */
+          if (aborted)
+            *aborted = TRUE;
+          err = svn_ra_svn__handle_failure_status(params, pool);
+          return svn_error_compose_create(
+                            err,
+                            editor->abort_edit(edit_baton, subpool));
+        }
       else
         {
           err = svn_error_createf(SVN_ERR_RA_SVN_UNKNOWN_CMD, NULL,

Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=1148424&r1=1148423&r2=1148424&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/update_tests.py Tue Jul 19 
16:12:57 2011
@@ -5392,6 +5392,17 @@ def skip_access_denied(sbox):
 
   f.close()
 
+def update_to_HEAD_plus_1(sbox):
+  "updating to HEAD+1 should fail"
+
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        None, None, None,
+                                        ".*No such revision",
+                                        None, None,
+                                        None, None, None, wc_dir, '-r', '2')
 
 
 #######################################################################
@@ -5459,6 +5470,7 @@ test_list = [ None,
               update_nonexistent_child_of_copy,
               revive_children_of_copy,
               skip_access_denied,
+              update_to_HEAD_plus_1,
              ]
 
 if __name__ == '__main__':


Reply via email to