All pastes #800003 Raw Edit

Stuff

public text v1 · immutable
#800003 ·published 2007-11-28 00:57 UTC
rendered paste body
The thing to notice is at the end, where it prints "Aborted", but then a grep of the C code shows
there is no such string anywhere!

[Okay, I admit it: now I'm just re-submitting in hopes of getting paste number 800000.  Looks like I missed, dang, but I did get 800001 and now 800002.]

$ svn diff
Index: subversion/include/svn_types.h
===================================================================
--- subversion/include/svn_types.h	(revision 28091)
+++ subversion/include/svn_types.h	(working copy)
@@ -238,14 +238,13 @@
   svn_depth_unknown    = -2,
 
   /* Exclude (i.e., don't descend into) directory D. */
-  /* ### In Subversion 1.5, svn_depth_exclude is *not* supported
-     ### anywhere in the client-side (libsvn_wc/libsvn_client/etc)
-     ### code; it is only supported as an argument to set_path
-     ### functions in the ra and repos reporters.  (This will enable
-     ### future versions of Subversion to run updates (etc) against
-     ### 1.5 servers with proper svn_depth_exclude behavior, once we
-     ### get a chance to implement client-side support for
-     ### svn_depth_exclude.)
+  /* NOTE: In Subversion 1.5, svn_depth_exclude is *not* supported
+     anywhere in the client-side (libsvn_wc/libsvn_client/etc) code;
+     it is only supported as an argument to set_path functions in the
+     ra and repos reporters.  (This will enable future versions of
+     Subversion to run updates, etc, against 1.5 servers with proper
+     svn_depth_exclude behavior, once we get a chance to implement
+     client-side support for svn_depth_exclude.)
   */
   svn_depth_exclude    = -1,
 
Index: subversion/tests/libsvn_repos/repos-test.c
===================================================================
--- subversion/tests/libsvn_repos/repos-test.c	(revision 28091)
+++ subversion/tests/libsvn_repos/repos-test.c	(working copy)
@@ -2003,6 +2003,7 @@
   svn_revnum_t youngest_rev;
   const svn_delta_editor_t *editor;
   void *edit_baton, *report_baton;
+  svn_error_t *err;
   
   *msg = "test reporter and svn_depth_exclude";
 
@@ -2126,6 +2127,45 @@
     svn_pool_clear(subpool);
   }
 
+  /* Expect an error on an illegal report for r1 to r2.  The illegal
+     sequence is that we exclude A/D, then set_path() below A/D. */
+  SVN_ERR(svn_fs_begin_txn(&txn, fs, 1, subpool));
+  SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
+  SVN_ERR(dir_delta_get_editor(&editor, &edit_baton, fs,
+                               txn_root, "", subpool));
+
+  SVN_ERR(svn_repos_begin_report2(&report_baton, 2, repos, "/", "", NULL,
+                                  TRUE, svn_depth_infinity, FALSE, FALSE,
+                                  editor, edit_baton, NULL, NULL, subpool));
+  SVN_ERR(svn_repos_set_path3(report_baton, "", 1,
+                              svn_depth_infinity,
+                              FALSE, NULL, subpool));
+  SVN_ERR(svn_repos_set_path3(report_baton, "iota", SVN_INVALID_REVNUM,
+                              svn_depth_exclude,
+                              FALSE, NULL, subpool));
+  SVN_ERR(svn_repos_set_path3(report_baton, "A/D", SVN_INVALID_REVNUM,
+                              svn_depth_exclude,
+                              FALSE, NULL, subpool));
+  /* This is the illegal call, since A/D was excluded above.  This
+     call itself will not error, but finish_report() will. */
+  SVN_ERR(svn_repos_set_path3(report_baton, "A/D/G/pi",
+                              SVN_INVALID_REVNUM,
+                              svn_depth_infinity,
+                              FALSE, NULL, subpool));
+  err = svn_repos_finish_report(report_baton, subpool);
+  if (! err)
+    {
+      return svn_error_createf
+        (SVN_ERR_TEST_FAILED, NULL,
+         "Illegal report of \"A/D/G/pi\" did not error as expected");
+    }
+  else if (err->apr_err != SVN_ERR_FS_NOT_FOUND)
+    {
+      return svn_error_createf
+        (SVN_ERR_TEST_FAILED, err,
+         "Illegal report of \"A/D/G/pi\" got wrong kind of error:");
+    }
+
   /* Clean up after ourselves. */
   svn_error_clear(svn_fs_abort_txn(txn, subpool));
 
$ subversion/tests/libsvn_repos/repos-test 11
PASS:  lt-repos-test 11: test reporter and svn_depth_exclude
Aborted
$ find . -name "*.[ch]" -print | xargs grep Aborted
$