Index: subversion/bindings/swig/core.i
===================================================================
--- subversion/bindings/swig/core.i	(revision 8177)
+++ subversion/bindings/swig/core.i	(working copy)
@@ -18,6 +18,12 @@
 
 %module core
 
+#ifdef SWIGPERL
+    /* We want the error code enums wrapped so we must include error_codes.h
+       before anything else does. */
+    %include svn_error_codes.h
+#endif
+
 %include typemaps.i
 
 %{
@@ -40,9 +46,9 @@
    char * member may leak memory."
 */
 %immutable svn_log_changed_path_t::copyfrom_path;
-%immutable svn_dirent::last_author;
-%immutable svn_error::message;
-%immutable svn_error::file;
+%immutable svn_dirent_t::last_author;
+%immutable svn_error_t::message;
+%immutable svn_error_t::file;
 
 %include svn_types.h
 
@@ -224,9 +230,9 @@
     SPAGAIN ;
 
     if (count != 1)
-        croak("Big trouble\n") ;
+        croak("Wrong number of returns from fileno") ;
 
-    if (fd = POPi < 0)
+    if ((fd = POPi) < 0)
         croak("not an accessible filehandle");
 
     $1 = fdopen (fd, "r+");
@@ -325,6 +331,7 @@
 
 #ifdef SWIGPERL
 %include svn_diff.h
+%include svn_error.h
 #endif
 
 %{
Index: subversion/bindings/swig/svn_types.i
===================================================================
--- subversion/bindings/swig/svn_types.i	(revision 8177)
+++ subversion/bindings/swig/svn_types.i	(working copy)
@@ -93,15 +93,19 @@
 
 %typemap(perl5,out) svn_error_t * {
     if ($1) {
-	char buf[128], *p;
-	SV *err = sv_newmortal();
-	p = svn_strerror($1->apr_err, buf, 128);
-	sv_setpv (err, p);
-	while ($1) {
-	    sv_catpvf (err, ": %s", $1->message);
-	    $1 = $1->child;
-	}
-	croak (SvPV_nolen(err));
+        SV *exception_handler = perl_get_sv ("SVN::Error::handler", FALSE);
+
+        if (SvOK(exception_handler)) {
+            SV *callback_result;
+
+            svn_swig_pl_callback_thunk (CALL_SV, exception_handler,
+                                        &callback_result, "S", $1,
+                                        $1_descriptor);
+        } else {
+            $result = sv_newmortal();
+            SWIG_MakePtr ($result, (void *)$1, $1_descriptor ,0);
+            argvi++;
+        }
     }
 }
 
@@ -220,6 +224,17 @@
         SWIG_croak("Expecting a string");
     }
 }
+
+/* ---------------------------------------------------------------------------------
+   Handle retrieving the error message from svn_strerror
+*/
+
+%typemap(perl5,in,numinputs=0) (char *buf, apr_size_t bufsize) ( char temp[128] ) {
+    memset (temp,0,128); /* paranoia */
+    $1 = temp;
+    $2 = 128;
+}
+
 /* -----------------------------------------------------------------------
    Define a generic arginit mapping for pools.
 */
Index: subversion/bindings/swig/swigutil_pl.c
===================================================================
--- subversion/bindings/swig/swigutil_pl.c	(revision 8177)
+++ subversion/bindings/swig/swigutil_pl.c	(working copy)
@@ -108,19 +108,24 @@
     apr_array_header_t *temp;
     AV* array;
 
-    if (!(source && SvROK(source) && SvTYPE(SvRV(source)) == SVt_PVAV)) {
-	/* raise exception here */
-	return NULL;
-    }
-    array = (AV *)SvRV (source);
-    targlen = av_len (array) + 1;
-    temp = apr_array_make (pool, targlen, sizeof(const char *));
-    temp->nelts = targlen;
+    if (SvROK(source) && SvTYPE(SvRV(source)) == SVt_PVAV) {
+        array = (AV *)SvRV (source);
+        targlen = av_len (array) + 1;
+        temp = apr_array_make (pool, targlen, sizeof(const char *));
+        temp->nelts = targlen;
 
-    while (targlen--) {
-	/* more error handling here */
-	SV **item = av_fetch (array, targlen, 0);
-        APR_ARRAY_IDX(temp, targlen, const char *) = cv (*item, ctx, pool);
+        while (targlen--) {
+            /* more error handling here */
+            SV **item = av_fetch (array, targlen, 0);
+            APR_ARRAY_IDX(temp, targlen, const char *) = cv (*item, ctx, pool);
+        }
+    } else if (SvOK(source)) {
+        targlen = 1;
+        temp = apr_array_make (pool, targlen, sizeof(const char *));
+        temp->nelts = targlen;
+        APR_ARRAY_IDX(temp, 0, const char *) = cv (source, ctx, pool);
+    } else {
+        croak("Must pass a single value or an array reference");
     }
 
     return temp;
@@ -231,10 +236,12 @@
     return convert_array (array, (element_converter_t)convert_int, NULL);
 }
 
-typedef enum perl_func_invoker {
-    CALL_METHOD,
-    CALL_SV
-} perl_func_invoker_t;
+SV *svn_swig_pl_convert_array(const apr_array_header_t *array,
+                              swig_type_info *tinfo)
+{
+    return convert_array (array, (element_converter_t)convert_to_swig_type,
+                          tinfo);		          
+}
 
 /* put the va_arg in stack and invoke caller_func with func.
    fmt:
@@ -246,7 +253,7 @@
    put returned value in result if result is not NULL
 */
 
-static svn_error_t *perl_callback_thunk (perl_func_invoker_t caller_func,
+svn_error_t *svn_swig_pl_callback_thunk (perl_func_invoker_t caller_func,
 					 void *func,
 					 SV **result,
 					 const char *fmt, ...)
@@ -254,7 +261,10 @@
     const char *fp = fmt;
     va_list ap;
     int count;
+    I32 call_flags;
 
+    call_flags = result ? G_SCALAR : (G_VOID & G_DISCARD);
+
     dSP ;
     ENTER ;
     SAVETMPS ;
@@ -298,10 +308,10 @@
     PUTBACK;
     switch (caller_func) {
     case CALL_SV:
-	count = call_sv (func, G_SCALAR);
+	count = call_sv (func, call_flags );
 	break;
     case CALL_METHOD:
-	count = call_method (func, G_SCALAR);
+	count = call_method (func, call_flags );
 	break;
     default:
 	croak ("unkonwn calling type");
@@ -309,8 +319,9 @@
     }
     SPAGAIN ;
 
-    if (count != 1)
-	croak("Big trouble\n") ;
+    if (((call_flags & G_SCALAR) && count != 1) ||
+	((call_flags & G_VOID) && count != 0))
+	    croak ("Wrong number of returns");
 
     if (result) {
 	*result = POPs;
@@ -384,9 +395,9 @@
 {
     item_baton *ib = edit_baton;
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"set_target_revision", NULL,
-				  "Oi", ib->editor, target_revision));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"set_target_revision", NULL,
+				         "Oi", ib->editor, target_revision));
 
     return SVN_NO_ERROR;
 }
@@ -400,10 +411,10 @@
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
     SV *result;
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"open_root", &result,
-				  "OiS", ib->editor, base_revision,
-				  dir_pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"open_root", &result,
+				         "OiS", ib->editor, base_revision,
+				         dir_pool, poolinfo));
 
     *root_baton = make_baton(dir_pool, ib->editor, result);
     return SVN_NO_ERROR;
@@ -417,10 +428,10 @@
     item_baton *ib = parent_baton;
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"delete_entry", NULL,
-				  "OsiOS", ib->editor, path, revision,
-				  ib->baton, pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"delete_entry", NULL,
+				         "OsiOS", ib->editor, path, revision,
+				         ib->baton, pool, poolinfo));
     return SVN_NO_ERROR;
 }
 
@@ -435,11 +446,11 @@
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
     SV *result;
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"add_directory", &result,
-				  "OsOsiS", ib->editor, path, ib->baton,
-				  copyfrom_path, copyfrom_revision, 
-				  dir_pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"add_directory", &result,
+				         "OsOsiS", ib->editor, path, ib->baton,
+				         copyfrom_path, copyfrom_revision, 
+				         dir_pool, poolinfo));
     *child_baton = make_baton(dir_pool, ib->editor, result);
     return SVN_NO_ERROR;
 }
@@ -454,10 +465,10 @@
     SV *result;
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"open_directory", &result,
-				  "OsOiS", ib->editor, path, ib->baton,
-				  base_revision, dir_pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"open_directory", &result,
+				         "OsOiS", ib->editor, path, ib->baton,
+				         base_revision, dir_pool, poolinfo));
 
     *child_baton = make_baton(dir_pool, ib->editor, result);
 
@@ -472,11 +483,11 @@
     item_baton *ib = dir_baton;
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"change_dir_prop", NULL,
-				  "OOssS", ib->editor, ib->baton, name,
-				  value ? value->data : NULL,
-				  pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"change_dir_prop", NULL,
+				         "OOssS", ib->editor, ib->baton, name,
+				         value ? value->data : NULL,
+				         pool, poolinfo));
 
     return SVN_NO_ERROR;
 }
@@ -494,10 +505,10 @@
     item_baton *ib = parent_baton;
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"absent_directory", NULL,
-				  "OsOS", ib->editor, path, ib->baton,
-				  pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+	   			         (void *)"absent_directory", NULL,
+				         "OsOS", ib->editor, path, ib->baton,
+				         pool, poolinfo));
 
     return SVN_NO_ERROR;
 }
@@ -513,11 +524,11 @@
     SV *result;
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"add_file", &result,
-				  "OsOsiS", ib->editor, path, ib->baton,
-				  copyfrom_path, copyfrom_revision,
-				  file_pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"add_file", &result,
+				         "OsOsiS", ib->editor, path, ib->baton,
+				         copyfrom_path, copyfrom_revision,
+				         file_pool, poolinfo));
 
     *file_baton = make_baton(file_pool, ib->editor, result);
     return SVN_NO_ERROR;
@@ -533,10 +544,10 @@
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
     SV *result;
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"open_file", &result,
-				  "OsOiS", ib->editor, path, ib->baton,
-				  base_revision, file_pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"open_file", &result,
+				         "OsOiS", ib->editor, path, ib->baton,
+				         base_revision, file_pool, poolinfo));
 
     *file_baton = make_baton(file_pool, ib->editor, result);
     return SVN_NO_ERROR;
@@ -548,14 +559,14 @@
     SV *handler = baton;
 
     if (window == NULL) {
-	SVN_ERR (perl_callback_thunk (CALL_SV,
-				      handler, NULL, "O",
-				      &PL_sv_undef));
+	SVN_ERR (svn_swig_pl_callback_thunk (CALL_SV,
+				             handler, NULL, "O",
+				             &PL_sv_undef));
     }
     else {
 	swig_type_info *tinfo = SWIG_TypeQuery("svn_txdelta_window_t *");
-	SVN_ERR (perl_callback_thunk (CALL_SV,
-				      handler, NULL, "S", window, tinfo));
+	SVN_ERR (svn_swig_pl_callback_thunk (CALL_SV, handler,
+				             NULL, "S", window, tinfo));
     }
 
     return SVN_NO_ERROR;
@@ -572,10 +583,10 @@
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
     SV *result;
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"apply_textdelta", &result,
-				  "OOsS", ib->editor, ib->baton, base_checksum,
-				  pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"apply_textdelta", &result,
+				         "OOsS", ib->editor, ib->baton,
+					 base_checksum, pool, poolinfo));
     if (SvOK(result)) {
 	if (SvROK(result) && SvTYPE(SvRV(result)) == SVt_PVAV) {
 	    swig_type_info *handler_info = SWIG_TypeQuery("svn_txdelta_window_handler_t"), *void_info = SWIG_TypeQuery("void *");
@@ -583,11 +594,11 @@
 
 	    if (SWIG_ConvertPtr(*av_fetch (array, 0, 0),
 				(void **)handler, handler_info,0) < 0) {
-		croak("FOO!");
+		croak("Unable to convert from SWIG Type");
 	    }
 	    if (SWIG_ConvertPtr(*av_fetch (array, 1, 0),
 				h_baton, void_info,0) < 0) {
-		croak("FOO!");
+		croak("Unable to convert from SWIG Type ");
 	    }
 	}
 	else {
@@ -611,11 +622,11 @@
     item_baton *ib = file_baton;
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"change_file_prop", NULL,
-				  "OOssS", ib->editor, ib->baton, name,
-				  value ? value->data : NULL,
-				  pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"change_file_prop", NULL,
+				         "OOssS", ib->editor, ib->baton, name,
+				         value ? value->data : NULL,
+				         pool, poolinfo));
   
     return SVN_NO_ERROR;
 }
@@ -627,10 +638,10 @@
     item_baton *ib = file_baton;
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"close_file", NULL, "OOsS",
-				  ib->editor, ib->baton, text_checksum,
-				  pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"close_file", NULL, "OOsS",
+				         ib->editor, ib->baton, text_checksum,
+				         pool, poolinfo));
 
     SvREFCNT_dec(ib->editor);
     SvREFCNT_dec(ib->baton);
@@ -649,10 +660,10 @@
     item_baton *ib = parent_baton;
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
-    SVN_ERR (perl_callback_thunk (CALL_METHOD,
-				  (void *)"absent_file", NULL,
-				  "OsOS", ib->editor, path, ib->baton,
-				  pool, poolinfo));
+    SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+				         (void *)"absent_file", NULL,
+				         "OsOS", ib->editor, path, ib->baton,
+				         pool, poolinfo));
 
     return SVN_NO_ERROR;
 }
@@ -705,19 +716,19 @@
 					    const char *msg,
 					    apr_pool_t *pool)
 {
-    SV *receiver = baton, *result;
+    SV *receiver = baton;
     swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
     swig_type_info *tinfo = SWIG_TypeQuery("svn_log_changed_path_t *");
 
     if (!SvOK(receiver))
 	return SVN_NO_ERROR;
 
-    perl_callback_thunk (CALL_SV,
-			 receiver, &result,
-			 "OisssS", (changed_paths) ?
-			 svn_swig_pl_convert_hash(changed_paths, tinfo)
-			 : &PL_sv_undef,
-			 rev, author, date, msg, pool, poolinfo);
+    svn_swig_pl_callback_thunk (CALL_SV,
+			        receiver, NULL,
+			        "OisssS", (changed_paths) ?
+			        svn_swig_pl_convert_hash(changed_paths, tinfo)
+			        : &PL_sv_undef,
+			        rev, author, date, msg, pool, poolinfo);
 
     return SVN_NO_ERROR;
 }
@@ -733,9 +744,9 @@
     if (!SvOK(func))
 	return SVN_NO_ERROR;
 
-    perl_callback_thunk (CALL_SV,
-			 func, NULL,
-			 "siS", path, revision, pool, poolinfo);
+    svn_swig_pl_callback_thunk (CALL_SV,
+			        func, NULL,
+			        "siS", path, revision, pool, poolinfo);
 
     return SVN_NO_ERROR;
 }
@@ -753,11 +764,12 @@
     if (!SvOK(func))
 	return SVN_NO_ERROR;
 
-    perl_callback_thunk (CALL_SV,
-			 func, &result,
-			 "SsS", root, rootinfo, path, pool, poolinfo);
+    svn_swig_pl_callback_thunk (CALL_SV,
+			        func, &result,
+			        "SsS", root, rootinfo, path, pool, poolinfo);
 
     *allowed = SvIV (result);
+    SvREFCNT_dec (result);
 
     return SVN_NO_ERROR;
 }
@@ -770,8 +782,8 @@
     if (!SvOK((SV *)baton))
 	return SVN_NO_ERROR;
 
-    perl_callback_thunk (CALL_SV, baton, NULL,
-			 "iss", new_revision, date, author);
+    svn_swig_pl_callback_thunk (CALL_SV, baton, NULL,
+			        "iss", new_revision, date, author);
 
     return SVN_NO_ERROR;
 }
@@ -785,11 +797,11 @@
     SV *result;
     swig_type_info *tinfo = SWIG_TypeQuery("apr_file_t *");
 
-    perl_callback_thunk (CALL_METHOD, (void *)"open_tmp_file",
-			 &result, "O", callback_baton);
+    svn_swig_pl_callback_thunk (CALL_METHOD, (void *)"open_tmp_file",
+			        &result, "O", callback_baton);
 
     if (SWIG_ConvertPtr(result, (void *)fp, tinfo,0) < 0) {
-	croak("ouch");
+	croak("Unable to convert from SWIG Type");
     }
 
     return SVN_NO_ERROR;
@@ -804,8 +816,9 @@
     SV *result;
     swig_type_info *tinfo = SWIG_TypeQuery("apr_pool_t *");
 
-    perl_callback_thunk (CALL_METHOD, (void *)"get_wc_prop",
-			 &result, "OssS", baton, relpath, name, pool, tinfo);
+    svn_swig_pl_callback_thunk (CALL_METHOD, (void *)"get_wc_prop",
+			        &result, "OssS", baton, relpath, name,
+			       	pool, tinfo);
 
     /* this is svn_string_t * typemap in */
     if (!SvOK (result) || result == &PL_sv_undef) {
@@ -815,9 +828,11 @@
 	*value = svn_string_create (SvPV_nolen (result), pool);
     }
     else {
+	SvREFCNT_dec(result);
 	croak("not a string");
     }
 
+    SvREFCNT_dec(result);
     return SVN_NO_ERROR;
 }
 
@@ -840,7 +855,7 @@
     auth_baton = *hv_fetch((HV *)SvRV(perl_callbacks), "auth", 4, 0);
 
     if (SWIG_ConvertPtr(auth_baton, (void **)&(*cb)->auth_baton, tinfo,0) < 0) {
-	croak("ouch");
+	croak("Unable to convert from SWIG Type");
     }
     *c_baton = perl_callbacks;
     SvREFCNT_inc(perl_callbacks);
@@ -855,7 +870,6 @@
                                              svn_boolean_t may_save,
                                              apr_pool_t *pool)
 {
-    SV *result;
     swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
     swig_type_info *credinfo = SWIG_TypeQuery ("svn_auth_cred_simple_t *");
 
@@ -865,10 +879,10 @@
     if (!*cred) {
         croak ("Could not allocate memory for cred structure");
     }
-    perl_callback_thunk (CALL_SV,
-                         baton, &result,
-                         "SssiS", *cred, credinfo,
-                         realm, username, may_save, pool, poolinfo);
+    svn_swig_pl_callback_thunk (CALL_SV,
+                                baton, NULL,
+                                "SssiS", *cred, credinfo,
+                                realm, username, may_save, pool, poolinfo);
 
     return SVN_NO_ERROR;
 }
@@ -879,7 +893,6 @@
                                                svn_boolean_t may_save,
                                                apr_pool_t *pool)
 {
-    SV *result;
     swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
     swig_type_info *credinfo = SWIG_TypeQuery ("svn_auth_cred_username_t *");
 
@@ -889,10 +902,10 @@
     if (!*cred) {
         croak ("Could not allocate memory for cred structure");
     }
-    perl_callback_thunk (CALL_SV,
-                         baton, &result,
-                         "SsiS", *cred, credinfo,
-                         realm, may_save, pool, poolinfo);
+    svn_swig_pl_callback_thunk (CALL_SV,
+                                baton, NULL,
+                                "SsiS", *cred, credinfo,
+                                realm, may_save, pool, poolinfo);
 
     return SVN_NO_ERROR;
 }
@@ -906,7 +919,6 @@
                               svn_boolean_t may_save,
                               apr_pool_t *pool)
 {
-    SV *result;
     swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
     swig_type_info *credinfo = SWIG_TypeQuery (
                                  "svn_auth_cred_ssl_server_trust_t *");
@@ -919,12 +931,12 @@
     if (!*cred) {
         croak ("Could not allocate memory for cred structure");
     }
-    perl_callback_thunk (CALL_SV,
-                         baton, &result,
-                         "SsiSiS", *cred, credinfo,
-                         realm, failures, 
-                         cert_info, cert_info_info,
-                         may_save, pool, poolinfo);
+    svn_swig_pl_callback_thunk (CALL_SV,
+                                baton, NULL,
+                                "SsiSiS", *cred, credinfo,
+                                realm, failures, 
+                                cert_info, cert_info_info,
+                                may_save, pool, poolinfo);
 
     /* Allow the perl callback to indicate failure by setting all vars to 0 
      * or by simply doing nothing.  While still allowing them to indicate
@@ -945,7 +957,6 @@
                 svn_boolean_t may_save,
                 apr_pool_t *pool)
 {
-    SV *result;
     swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
     swig_type_info *credinfo = SWIG_TypeQuery (
                                  "svn_auth_cred_ssl_client_cert_t *");
@@ -956,10 +967,10 @@
     if (!*cred) {
         croak ("Could not allocate memory for cred structure");
     }
-    perl_callback_thunk (CALL_SV,
-                         baton, &result,
-                         "SsiS", *cred, credinfo,
-                         realm, may_save, pool, poolinfo);
+    svn_swig_pl_callback_thunk (CALL_SV,
+                                baton, NULL,
+                                "SsiS", *cred, credinfo,
+                                realm, may_save, pool, poolinfo);
 
     return SVN_NO_ERROR;
 }
@@ -971,7 +982,6 @@
                                      svn_boolean_t may_save,
                                      apr_pool_t *pool)
 {
-    SV *result;
     swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
     swig_type_info *credinfo = SWIG_TypeQuery (
                                  "svn_auth_cred_ssl_client_cert_pw_t *");
@@ -982,14 +992,170 @@
     if (!*cred) {
         croak ("Could not allocate memory for cred structure");
     }
-    perl_callback_thunk (CALL_SV,
-                         baton, &result,
-                         "SsiS", *cred, credinfo,
-                         realm, may_save, pool, poolinfo);
+    svn_swig_pl_callback_thunk (CALL_SV,
+                                baton, NULL,
+                                "SsiS", *cred, credinfo,
+                                realm, may_save, pool, poolinfo);
 
     return SVN_NO_ERROR;
 }
 
+/* Thunked version of svn_wc_notify_func_t callback type */
+void svn_swig_pl_notify_func(void * baton,
+		             const char *path,
+			     svn_wc_notify_action_t action,
+			     svn_node_kind_t kind,
+			     const char *mime_type,
+			     svn_wc_notify_state_t content_state,
+			     svn_wc_notify_state_t prop_state,
+			     svn_revnum_t revision)
+{
+    if (!SvOK((SV *)baton)) {
+        return; 
+    }
+
+    svn_swig_pl_callback_thunk (CALL_SV,
+		                baton, NULL,
+				"siisiii", path, action, kind, mime_type,
+				content_state, prop_state, revision);
+    
+}
+
+/* Thunked version of svn_client_get_commit_log_t callback type. */
+svn_error_t *svn_swig_pl_get_commit_log_func(const char **log_msg,
+                                             const char **tmp_file,
+                                             apr_array_header_t *commit_items,
+                                             void *baton,
+                                             apr_pool_t *pool)
+{
+    SV *result;
+    svn_error_t *ret_val = SVN_NO_ERROR;
+    SV *log_msg_sv;
+    SV *tmp_file_sv;
+    SV *commit_items_sv;
+    swig_type_info *commit_itemsinfo = SWIG_TypeQuery 
+	                                ("svn_client_commit_item_t *");
+    swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
+
+    if (!SvOK((SV *)baton)) {
+        *log_msg = apr_pstrdup (pool, "");
+	*tmp_file = NULL;
+        return SVN_NO_ERROR;
+    }
+    
+    log_msg_sv = newRV_noinc (sv_newmortal ());
+    tmp_file_sv = newRV_noinc (sv_newmortal ());
+    commit_items_sv = svn_swig_pl_convert_array (commit_items, 
+			                         commit_itemsinfo);
+
+    svn_swig_pl_callback_thunk (CALL_SV,
+	                        baton, &result,
+				"OOOS", log_msg_sv, tmp_file_sv,
+				commit_items_sv, pool, poolinfo);
+
+    if (!SvOK(SvRV(log_msg_sv))) {
+        /* client returned undef to us */
+        *log_msg = NULL;
+    } else if (SvPOK(SvRV(log_msg_sv))) {
+	/* client returned string so get the string and then duplicate
+	 * it using pool memory */
+        *log_msg = apr_pstrdup(pool, SvPV_nolen(SvRV(log_msg_sv)));
+    } else {
+        croak("Invalid value in log_msg reference, must be undef or a string");
+    }
+
+    if (!SvOK(SvRV(tmp_file_sv))) {
+	*tmp_file = NULL;
+    } else if (SvPOK(SvRV(tmp_file_sv))) {
+	*tmp_file = apr_pstrdup(pool, SvPV_nolen(SvRV(tmp_file_sv)));
+    } else {
+        croak("Invalid value in tmp_file reference, must be undef or a string");    
+    }
+
+    if (sv_derived_from (result, "_p_svn_error_t")) {
+        swig_type_info *errorinfo = SWIG_TypeQuery("svn_error_t *");
+	if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
+            SvREFCNT_dec(result);
+	    croak("Unable to convert from SWIG Type");
+        }
+    }
+
+    SvREFCNT_dec(result);
+    return ret_val;
+}
+
+/* Thunked version of svn_wc_cancel_func_t callback type. */
+svn_error_t *svn_swig_pl_cancel_func(void *cancel_baton) {
+    SV *result;
+    svn_error_t *ret_val;
+
+    if (!SvOK((SV *)cancel_baton)) {
+        return SVN_NO_ERROR;
+    }
+    svn_swig_pl_callback_thunk(CALL_SV, cancel_baton, &result, "");
+
+    if (sv_derived_from(result,"_p_svn_error_t")) { 
+        swig_type_info *errorinfo = SWIG_TypeQuery("svn_error_t *");
+	if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
+	    SvREFCNT_dec(result);
+	    croak("Unable to convert from SWIG Type");
+	}
+    } else if (SvIOK(result) && SvIV(result)) {
+        ret_val = svn_error_create(SVN_ERR_CANCELLED, NULL,"By cancel callback");
+    } else if (SvTRUE(result) && SvPOK(result)) {
+        ret_val = svn_error_create(SVN_ERR_CANCELLED, NULL, SvPV_nolen(result));
+    } else {
+        ret_val = SVN_NO_ERROR;
+    }
+    SvREFCNT_dec(result);
+    return ret_val;
+}
+
+/* Thunked version of svn_wc_status_func_t callback type. */
+void svn_swig_pl_status_func(void *baton,
+                             const char *path,
+                             svn_wc_status_t *status)
+{
+  swig_type_info *statusinfo = SWIG_TypeQuery ("svn_wc_status_t *");
+
+  if (!SvOK ((SV *)baton)) {
+    return;
+  }
+   
+  svn_swig_pl_callback_thunk (CALL_SV, baton, NULL, "sS",
+                              path, status, statusinfo); 
+
+}
+
+/* Thunked version of svn_client_blame_receiver_t callback type. */
+svn_error_t *svn_swig_pl_blame_func (void *baton,
+		                     apr_off_t line_no,
+				     svn_revnum_t revision,
+				     const char *author,
+				     const char *date,
+				     const char *line,
+				     apr_pool_t *pool)
+{
+    SV *result;
+    svn_error_t *ret_val = SVN_NO_ERROR;
+    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
+    
+    svn_swig_pl_callback_thunk (CALL_SV, baton, &result, "iisssS",
+		                line_no, revision, author, date, line,
+				pool, poolinfo);
+
+    if (sv_derived_from (result, "_p_svn_error_t")) {
+        swig_type_info *errorinfo = SWIG_TypeQuery("svn_error_t *");
+	if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
+            SvREFCNT_dec(result);
+	    croak("Unable to convert from SWIG Type");
+        }
+    }
+    
+    SvREFCNT_dec(result);
+    return ret_val;
+}
+
 /* default pool support */
 apr_pool_t *current_pool;
 
@@ -1009,8 +1175,8 @@
     }
 
     if (!current_pool)
-	perl_callback_thunk (CALL_METHOD, (void *)"new_default",
-			     &obj, "s", "SVN::Pool");
+	svn_swig_pl_callback_thunk (CALL_METHOD, (void *)"new_default",
+			            &obj, "s", "SVN::Pool");
     pool = current_pool;
 
     return pool;
@@ -1033,10 +1199,11 @@
     if ((mg = SvTIED_mg((SV*)io->io, PERL_MAGIC_tiedscalar))) {
 	SV *ret;
 	SV *buf = sv_newmortal();
-	perl_callback_thunk (CALL_METHOD, (void *)"READ", &ret, "OOi",
-			     SvTIED_obj((SV*)io->io, mg),
-			     buf, *len);
+	svn_swig_pl_callback_thunk (CALL_METHOD, (void *)"READ", &ret, "OOi",
+			            SvTIED_obj((SV*)io->io, mg),
+			            buf, *len);
 	*len = SvIV (ret);
+	SvREFCNT_dec (ret);
 	memmove (buffer, SvPV_nolen(buf), *len);
     }
     else
@@ -1054,9 +1221,10 @@
     if ((mg = SvTIED_mg((SV*)io->io, PERL_MAGIC_tiedscalar))) {
 	SV *ret, *pv;
         pv = sv_2mortal (newSVpvn (data, *len));
-	perl_callback_thunk (CALL_METHOD, (void *)"WRITE", &ret, "OOi",
-			     SvTIED_obj((SV*)io->io, mg), pv, *len);
+	svn_swig_pl_callback_thunk (CALL_METHOD, (void *)"WRITE", &ret, "OOi",
+			            SvTIED_obj((SV*)io->io, mg), pv, *len);
 	*len = SvIV (ret);
+	SvREFCNT_dec (ret);
     }
     else
 	*len = PerlIO_write (IoIFP (io->io), data, *len);
@@ -1069,8 +1237,8 @@
     MAGIC *mg;
 
     if ((mg = SvTIED_mg((SV*)io->io, PERL_MAGIC_tiedscalar))) {
-	perl_callback_thunk (CALL_METHOD, (void *)"CLOSE", NULL, "O",
-			     SvTIED_obj((SV*)io->io, mg));
+	svn_swig_pl_callback_thunk (CALL_METHOD, (void *)"CLOSE", NULL, "O",
+			            SvTIED_obj((SV*)io->io, mg));
     }
     else {
 	PerlIO_close (IoIFP (io->io));
@@ -1099,8 +1267,8 @@
 
     if (obj && sv_isobject(obj)) {
         if (sv_derived_from (obj, "SVN::Stream"))
-	    perl_callback_thunk (CALL_METHOD, (void *)"svn_stream",
-			         &obj, "O", obj);
+	    svn_swig_pl_callback_thunk (CALL_METHOD, (void *)"svn_stream",
+			                &obj, "O", obj);
 	else if (!sv_derived_from(obj, "_p_svn_stream_t"))
             simple_type = 0;
 
@@ -1136,8 +1304,8 @@
     swig_type_info *tinfo = SWIG_TypeQuery("svn_stream_t *");
     SV *ret;
 
-    perl_callback_thunk (CALL_METHOD, (void *)"new", &ret, "sS",
-			 "SVN::Stream", stream, tinfo);
+    svn_swig_pl_callback_thunk (CALL_METHOD, (void *)"new", &ret, "sS",
+			        "SVN::Stream", stream, tinfo);
 
     return sv_2mortal (ret);
 }
Index: subversion/bindings/swig/svn_string.i
===================================================================
--- subversion/bindings/swig/svn_string.i	(revision 8177)
+++ subversion/bindings/swig/svn_string.i	(working copy)
@@ -74,13 +74,31 @@
 }
 
 %typemap(perl5,in) svn_stringbuf_t * {
-    /* ### FIXME-perl */
+    apr_size_t len;
+    char *buf;
+
+    if (!SvOK($input)) {
+        $1 = NULL;
+    } else if (SvPOK($input)) {
+        buf = SvPV($input, len);
+        /* Another case of ugly pool handling, this should use the current
+           default pool, or make a new one if it doesn't exist yet */
+        $1 = svn_stringbuf_ncreate(buf,len,
+                                   svn_swig_pl_make_pool ((SV *)NULL));
+    } else {
+        croak("Not a string");
+    }
 }
+
 %typemap(python,out) svn_stringbuf_t * {
     $result = PyString_FromStringAndSize($1->data, $1->len);
 }
+
 %typemap(perl5,out) svn_stringbuf_t * {
-    /* ### FIXME-perl */
+    SV *sv = sv_newmortal();
+    sv_setpvn(sv,$1->data,$1->len);
+    $result = sv;
+    argvi++;
 }
 
 /* svn_stringbuf_t ** is always an output parameter */
Index: subversion/bindings/swig/swigutil_pl.h
===================================================================
--- subversion/bindings/swig/swigutil_pl.h	(revision 8177)
+++ subversion/bindings/swig/swigutil_pl.h	(working copy)
@@ -70,6 +70,16 @@
 extern apr_pool_t *current_pool;
 apr_pool_t *svn_swig_pl_make_pool (SV *obj);
 
+typedef enum perl_func_invoker {
+    CALL_METHOD,
+    CALL_SV
+} perl_func_invoker_t;
+
+svn_error_t *svn_swig_pl_callback_thunk (perl_func_invoker_t caller_func,
+		                         void *func,
+					 SV **result,
+					 const char *fmt, ...);
+
 SV *svn_swig_pl_prophash_to_hash (apr_hash_t *hash);
 SV *svn_swig_pl_convert_hash (apr_hash_t *hash, swig_type_info *tinfo);
 
@@ -89,6 +99,8 @@
 
 SV *svn_swig_pl_array_to_list(const apr_array_header_t *array);
 SV *svn_swig_pl_ints_to_list(const apr_array_header_t *array);
+SV *svn_swig_pl_convert_array(const apr_array_header_t *array,
+                              swig_type_info *tinfo);
 
 /* thunked log receiver function.  */
 svn_error_t * svn_swig_pl_thunk_log_receiver(void *py_receiver,
@@ -171,6 +183,41 @@
                                 const svn_string_t **value,
                                 apr_pool_t *pool);
 
+/* Thunked version of svn_wc_notify_func_t callback type */
+void svn_swig_pl_notify_func(void * baton,
+                             const char *path,
+		             svn_wc_notify_action_t action,
+			     svn_node_kind_t kind,
+			     const char *mime_type,
+			     svn_wc_notify_state_t content_state,
+			     svn_wc_notify_state_t prop_state,
+			     svn_revnum_t revision);
+
+
+/* Thunked version of svn_client_get_commit_log_t callback type. */
+svn_error_t *svn_swig_pl_get_commit_log_func(const char **log_msg,
+                                             const char **tmp_file,
+                                             apr_array_header_t *commit_items,
+                                             void *baton,
+                                             apr_pool_t *pool);
+
+/* Thunked version of svn_wc_cancel_func_t callback type. */
+svn_error_t *svn_swig_pl_cancel_func(void *cancel_baton);
+
+/* Thunked version of svn_wc_status_func_t callback type. */
+void svn_swig_pl_status_func(void *baton,
+                             const char *path,
+                             svn_wc_status_t *status);
+/* Thunked version of svn_client_blame_receiver_t callback type. */
+svn_error_t *svn_swig_pl_blame_func (void *baton,
+                                     apr_off_t line_no,
+                                     svn_revnum_t revision,
+                                     const char *author,
+                                     const char *date,
+                                     const char *line,
+                                     apr_pool_t *pool);
+
+
 /* helper for making the editor */
 void svn_delta_make_editor(svn_delta_editor_t **editor,
                            void **edit_baton,
Index: subversion/bindings/swig/svn_client.i
===================================================================
--- subversion/bindings/swig/svn_client.i	(revision 8177)
+++ subversion/bindings/swig/svn_client.i	(working copy)
@@ -27,14 +27,17 @@
 /* -----------------------------------------------------------------------
    don't wrap the following items
 */
-%ignore svn_client_proplist_item_t;
+#ifndef SWIGPERL
+    %ignore svn_client_proplist_item_t;
+#endif
 
 /* -----------------------------------------------------------------------
    these types (as 'type **') will always be an OUT param
 */
 %apply SWIGTYPE **OUTPARAM {
   svn_client_commit_info_t **,
-  svn_auth_provider_object_t **
+  svn_auth_provider_object_t **,
+  svn_client_ctx_t **
 };
 
 /* -----------------------------------------------------------------------
@@ -87,6 +90,22 @@
     $result = t_output_helper($result, list);
 }
 
+%typemap(perl5,in,numinputs=0) apr_array_header_t ** (apr_array_header_t *temp)
+{
+    $1 = &temp;
+}
+
+%typemap(perl5,argout) apr_array_header_t ** {
+    $result = svn_swig_pl_convert_array(*$1,SWIG_TypeQuery(
+                                              "svn_client_proplist_item_t *"));
+    argvi++;
+}
+
+%typemap(perl5,out) apr_hash_t *prop_hash {
+    $result = svn_swig_pl_prophash_to_hash($1);
+    argvi++;
+}
+
 /* -----------------------------------------------------------------------
    handle svn_wc_notify_func_t/baton pairs
 */
@@ -96,9 +115,6 @@
   $1 = svn_swig_py_notify_func;
   $2 = $input; /* our function is the baton. */
 }
-%typemap(perl5,argout) apr_hash_t **statushash {
-    /* ### FIXME-perl */
-}
 
 %typemap(java,in) (svn_wc_notify_func_t notify_func, void *notify_baton) {
 
@@ -114,10 +130,6 @@
     return $jnicall;
   }
 
-%typemap(perl5,in) (svn_wc_notify_func_t notify_func, void *notify_baton) {
-    /* ### FIXME-perl */
-}
-
 /* -----------------------------------------------------------------------
    handle svn_wc_notify_func_t/baton pairs
 */
@@ -127,6 +139,11 @@
   $2 = $input; /* our function is the baton. */
 }
 
+%typemap(perl5,in) (svn_wc_status_func_t status_func, void *status_baton) {
+  $1 = svn_swig_pl_status_func;
+  $2 = $input; /* our function is the baton. */
+}
+
 /* -----------------------------------------------------------------------
    handle svn_client_get_commit_log_t/baton pairs
 */
@@ -153,11 +170,6 @@
     return $jnicall;
   }
 
-%typemap(perl5,in) (svn_client_get_commit_log_t log_msg_func, 
-                     void *log_msg_baton) {
-    /* ### FIXME-perl */
-}
-
 /* -----------------------------------------------------------------------
    handle svn_client_prompt_t/baton pairs
 */
@@ -199,6 +211,15 @@
   }
 
 /* -----------------------------------------------------------------------
+   handle svn_client_blame_receiver_t/baton pairs
+*/
+
+%typemap(perl5,in) (svn_client_blame_receiver_t receiver, void *receiver_baton) {
+  $1 = svn_swig_pl_blame_func;
+  $2 = $input; /* our function is the baton. */
+}
+
+/* -----------------------------------------------------------------------
    handle the "statushash" OUTPUT param for svn_client_status()
 */
 %typemap(python,in,numinputs=0) apr_hash_t **statushash = apr_hash_t **OUTPUT;
@@ -208,10 +229,6 @@
         svn_swig_py_convert_hash(*$1, SWIGTYPE_p_svn_wc_status_t));
 }
 
-%typemap(perl5,argout) apr_hash_t **statushash {
-    /* ### FIXME-perl */
-}
-
 /* -----------------------------------------------------------------------
    handle the prompt_baton
 */
@@ -275,20 +292,35 @@
     $2 = (void *) _global_callback;
 }
 
-/* For all the prompt functions create a reference for the baton
- * (which in this case is an SV pointing to the prompt callback)
- * and make that a second return from the prompt function.  The
- * auth_open_helper can then split these values up so they
- * can be stored and the callback can stay valid until the 
- * auth_baton is freed. */
-%typemap(perl5, argout) void *prompt_baton (SV * _global_callback) {
-  $result = sv_2mortal (newRV_inc (_global_callback));
-  argvi++;
+/* -----------------------------------------------------------------------
+ * For all the various functions that set a callback baton create a reference
+ * for the baton (which in this case is an SV pointing to the callback)
+ * and make that a return from the function.  The perl side should
+ * then store the return in the object the baton is attached to.
+ * If the function already returns a value then this value is follows that
+ * function.  In the case of the prompt functions auth_open_helper in Core.pm
+ * is used to split up these values.
+*/
+%typemap(perl5, argout) void *CALLBACK_BATON (SV * _global_callback) {
+  /* callback baton */
+  $result = sv_2mortal (newRV_inc (_global_callback)); argvi++; }
+
+%typemap(perl5, in) void *CALLBACK_BATON (SV * _global_callback) {
+  _global_callback = $input;
+  $1 = (void *) _global_callback;
 }
 
-/* ----------------------------------------------------------------------- */
+#ifdef SWIGPERL
+%apply void *CALLBACK_BATON {
+  void *prompt_baton,
+  void *notify_baton,
+  void *log_msg_baton,
+  void *cancel_baton
+}
+#endif
 
-/* Convert perl hashes back into apr_hash_t * for setting the config
+/* ----------------------------------------------------------------------- 
+ * Convert perl hashes back into apr_hash_t * for setting the config
  * member of the svn_client_ctx_t.   This is an ugly hack, it will
  * always allocate the new apr_hash_t out of the global current_pool
  * It would be better to make apr_hash_t's into magic variables in
@@ -305,6 +337,70 @@
   argvi++;
 }
 
+/* -----------------------------------------------------------------------
+ * override default typemap for svn_client_commit_info_t for perl.  Some calls
+ * never allocate and fill the commit_info struct.  This lets us return
+ * undef for them.  Otherwise the object we pass back can cause crashes */
+%typemap(perl5, in, numinputs=0) svn_client_commit_info_t ** 
+                                 ( svn_client_commit_info_t * temp ) {
+    temp = NULL;
+    $1 = &temp;
+}
+
+%typemap(perl5, argout) svn_client_commit_info_t ** {
+    if ($1 == NULL) {
+        $result = &PL_sv_undef;
+        argvi++;
+    }  else {
+        $result = sv_newmortal();
+        SWIG_MakePtr($result, (void *)*$1,
+                     $*1_descriptor, 0);
+        argvi++;
+    }
+}
+
+/* -----------------------------------------------------------------------
+ * wcprop_changes member of svn_client_commit_info needs to be
+ * converted back and forth from an array */
+
+%typemap(perl5, out) apr_array_header_t *wcprop_changes {
+    $result = svn_swig_pl_convert_array($1,SWIG_TypeQuery("svn_prop_t *"));
+    argvi++;
+}
+
+/* -----------------------------------------------------------------------
+ * wrap svn_client_create_context */
+
+%typemap(perl5,in,numinputs=0) svn_client_ctx_t ** (svn_client_ctx_t *temp) {
+    $1 = &temp;
+}
+
+%typemap(perl5,argout) svn_client_ctx_t ** {
+  (*$1)->notify_func = svn_swig_pl_notify_func;
+  (*$1)->notify_baton = (void *) &PL_sv_undef;
+  (*$1)->log_msg_func = svn_swig_pl_get_commit_log_func;
+  (*$1)->log_msg_baton = (void *) &PL_sv_undef;
+  (*$1)->cancel_func = svn_swig_pl_cancel_func;
+  (*$1)->cancel_baton = (void *) &PL_sv_undef;
+  $result = sv_newmortal();
+  SWIG_MakePtr($result, (void *)*$1,
+               $*1_descriptor, 0);
+  argvi++;
+}  
+
+
+/* -----------------------------------------------------------------------
+ * Handle output types for svn_client_url_from_path, svn_client_uuid_from_url
+ * and svn_client_uuid_from_path */
+
+%apply const char **OUTPUT {
+    const char **url,
+    const char **uuid
+};
+
+
+
+
 /* ----------------------------------------------------------------------- */
 
 %typemap(java, in) svn_stream_t *out %{
Index: subversion/bindings/swig/perl/t/4pool.t
===================================================================
--- subversion/bindings/swig/perl/t/4pool.t	(revision 8177)
+++ subversion/bindings/swig/perl/t/4pool.t	(working copy)
@@ -1,7 +1,14 @@
 #!/usr/bin/perl
 use strict;
-use Test::More qw(no_plan);
+use Test::More tests => 6;
+use File::Path q(rmtree);
+use File::Temp qw(tempdir);
 
+# shut up about variables that are only used once.
+# these come from constants and variables used
+# by the bindings but not elsewhere in perl space.
+no warnings 'once'; 
+
 require SVN::Core;
 require SVN::Repos;
 require SVN::Fs;
@@ -23,7 +30,7 @@
 	$$SVN::_Core::current_pool, $text);
 }
 
-my $repospath = "/tmp/svn-$$";
+my $repospath = tempdir('svn-perl-test-XXXXXX', TMPDIR => 1);
 
 my $repos;
 
@@ -59,3 +66,8 @@
 
 
 is_pool_default ($pool, 'default pool from c calls destroyed');
+
+END {
+diag('cleanup');
+rmtree($repospath);
+}
Index: subversion/bindings/swig/perl/t/3client.t
===================================================================
--- subversion/bindings/swig/perl/t/3client.t	(revision 8177)
+++ subversion/bindings/swig/perl/t/3client.t	(working copy)
@@ -1,30 +1,348 @@
 #!/usr/bin/perl -w
 
-use Test::More qw(no_plan);
+use Test::More tests => 112;
 use strict;
 
-require SVN::Core;
-require SVN::Repos;
-require SVN::Client;
+# shut up about variables that are only used once.
+# these come from constants and variables used
+# by the bindings but not elsewhere in perl space.
+no warnings 'once'; 
 
-my $repospath = "/tmp/svn-$$";
-my $reposurl = "file://$repospath";
-my $wcpath = "/tmp/svn-wc-$$";
+use_ok('SVN::Core');
+use_ok('SVN::Repos');
+use_ok('SVN::Client');
+use_ok('SVN::Wc'); # needed for status
+use File::Spec::Functions;
+use File::Temp qw(tempdir);
+use File::Path qw(rmtree);
 
+# do not use cleanup because it will fail, some files we
+# will not have write perms to.
+my $testpath = tempdir('svn-perl-test-XXXXXX', TMPDIR => 1);
+
+my $repospath = catdir($testpath,'repo');
+my $reposurl = "file:///$repospath";
+my $wcpath = catdir($testpath,'wc');
+my $importpath = catdir($testpath,'import');
+
+# track current rev ourselves to test against
+my $current_rev = 0;
+
+# We want to trap errors ourself
+$SVN::Error::handler = undef;
+
+# Get username we are running as
+my $username = getpwuid($>);
+
 # This is ugly to create the test repo with SVN::Repos, but
 # it seems to be the most reliable way.
 ok(SVN::Repos::create("$repospath", undef, undef, undef, undef),
    "create repository at $repospath");
 
-my $ctx = SVN::Client->new;
+my ($ctx) = SVN::Client->new;
 isa_ok($ctx,'SVN::Client','Client Object');
 
-my $ci_dir1 = $ctx->mkdir(["$reposurl/dir1"]);
+my $uuid_from_url = $ctx->uuid_from_url($reposurl);
+ok($uuid_from_url);
+
+# test non method invocation passing a SVN::Client
+ok(SVN::Client::uuid_from_url($reposurl,$ctx));
+
+# test non method invocation passing a _p_svn_client_ctx_t
+ok(SVN::Client::uuid_from_url($reposurl,$ctx->{'ctx'}));
+
+             
+my ($ci_dir1) = $ctx->mkdir(["$reposurl/dir1"]);
 isa_ok($ci_dir1,'_p_svn_client_commit_info_t');
-is($ci_dir1->revision,1,'commit info revision equals 1');
+$current_rev++;
+is($ci_dir1->revision,$current_rev,"commit info revision equals $current_rev");
 
+
+
+my ($rpgval,$rpgrev) = $ctx->revprop_get('svn:author',$reposurl,$current_rev);
+is($rpgval,$username);
+is($rpgrev,$current_rev);
+
+SKIP: {
+    skip 'Difficult to test on Win32', 3 if $^O eq 'MSWin32';
+
+    ok(rename("$repospath/hooks/pre-revprop-change.tmpl",
+              "$repospath/hooks/pre-revprop-change"));
+    ok(chmod(0700,"$repospath/hooks/pre-revprop-change"));
+
+    my ($rps_rev) = $ctx->revprop_set('svn:log','mkdir dir1',
+                                      $reposurl, $current_rev, 0);
+    is($rps_rev,$current_rev);
+}
+
+my ($rph, $rplrev) = $ctx->revprop_list($reposurl,$current_rev);
+isa_ok($rph,'HASH');
+is($rplrev,$current_rev);
+is($rph->{'svn:author'},$username);
+if ($^O eq 'MSWin32') {
+    # we skip the log change test on win32 so we have to test
+    # for a different var here
+    is($rph->{'svn:log'},'Make dir1');
+} else {
+    is($rph->{'svn:log'},'mkdir dir1');
+}
+ok($rph->{'svn:date'});
+
+is($ctx->checkout($reposurl,$wcpath,'HEAD',1),1);
+
+is(SVN::Client::url_from_path($wcpath),$reposurl);
+
+ok(open NEW, ">$wcpath/dir1/new");
+ok(print NEW 'addtest');
+ok(close NEW);
+
+# no return means success
+is($ctx->add("$wcpath/dir1/new",0),undef);
+
+# test the log_msg callback
+$ctx->log_msg( 
+    sub 
+    {
+        my ($log_msg,$tmp_file,$commit_items,$pool) = @_;
+        isa_ok($log_msg,'SCALAR');
+        isa_ok($tmp_file,'SCALAR');
+        isa_ok($commit_items,'ARRAY');
+        isa_ok($pool,'_p_apr_pool_t');
+        my $commit_item = shift @$commit_items;
+        isa_ok($commit_item,'_p_svn_client_commit_item_t');
+        is($commit_item->path(),"$wcpath/dir1/new");
+        is($commit_item->kind(),$SVN::Node::file);
+        is($commit_item->url(),"$reposurl/dir1/new");
+        # revision is 0 because the commit has not happened yet
+        # and this is not a copy
+        is($commit_item->revision(),0);
+        is($commit_item->copyfrom_url(),undef);
+        is($commit_item->state_flags(),$SVN::Client::COMMIT_ITEM_ADD |
+                                       $SVN::Client::COMMIT_ITEM_TEXT_MODS);
+        my $wcprop_changes = $commit_item->wcprop_changes();
+        isa_ok($wcprop_changes,'ARRAY');
+        is(scalar(@$wcprop_changes),0);
+        $$log_msg = 'Add new';
+        return 0;
+    } );
+
+
+my ($ci_commit1) = $ctx->commit($wcpath,0);
+isa_ok($ci_commit1,'_p_svn_client_commit_info_t');
+$current_rev++;
+is($ci_commit1->revision,$current_rev,
+   "commit info revision equals $current_rev");
+
+# get rid of log_msg callback
+is($ctx->log_msg(undef),undef);
+
+# test getting the log
+is($ctx->log("$reposurl/dir1/new",$current_rev,$current_rev,1,0,
+             sub 
+             {
+                 my ($changed_paths,$revision,
+                     $author,$date,$message,$pool) = @_;
+                 isa_ok($changed_paths,'HASH');
+                 isa_ok($changed_paths->{'/dir1/new'},
+                        '_p_svn_log_changed_path_t');
+                 is($changed_paths->{'/dir1/new'}->action(),'A');
+                 is($changed_paths->{'/dir1/new'}->copyfrom_path(),undef);
+                 is($changed_paths->{'/dir1/new'}->copyfrom_rev(),$SVN::Core::INVALID_REVNUM);
+                 is($revision,$current_rev);
+                 is($author,$username);
+                 ok($date);
+                 is($message,'Add new');
+                 isa_ok($pool,'_p_apr_pool_t');
+             }),
+   undef);
+
+is($ctx->update($wcpath,'HEAD',1),$current_rev);
+
+# no return so we should get undef as the result
+# we will get a _p_svn_error_t if there is an error. 
+is($ctx->propset('perl-test','test-val',"$wcpath/dir1",0),undef);
+
+my ($ph) = $ctx->propget('perl-test',"$wcpath/dir1",undef,0);
+isa_ok($ph,'HASH');
+is($ph->{"$wcpath/dir1"},'test-val','perl-test property has the correct value');
+
+# No revnum for the working copy so we should get INVALID_REVNUM
+is($ctx->status($wcpath, undef, sub { 
+                                      my ($path,$wc_status) = @_;
+                                      is($path,"$wcpath/dir1");
+                                      isa_ok($wc_status,'_p_svn_wc_status_t');
+                                      is($wc_status->prop_status(),
+                                         $SVN::Wc::status_modified);
+                                      # TODO test the rest of the members
+                                    },
+                1, 0, 0, 0),
+   $SVN::Core::INVALID_REVNUM);
+
+my ($ci_commit2) = $ctx->commit($wcpath,0);
+isa_ok($ci_commit2,'_p_svn_client_commit_info_t');
+$current_rev++;
+is($ci_commit2->revision(),$current_rev,
+   "commit info revision equals $current_rev");
+
+my $dir1_rev = $current_rev;
+
+
+my($pl) = $ctx->proplist($reposurl,$current_rev,1);
+isa_ok($pl,'ARRAY');
+isa_ok($pl->[0], '_p_svn_client_proplist_item_t');
+is($pl->[0]->node_name(),"$reposurl/dir1");
+my $plh = $pl->[0]->prop_hash();
+isa_ok($plh,'HASH');
+is_deeply($plh, {'perl-test' => 'test-val'}, 'test prop list prop_hash values');
+
+# add a dir to test update
+my ($ci_dir2) = $ctx->mkdir(["$reposurl/dir2"]);
+isa_ok($ci_dir2,'_p_svn_client_commit_info_t');
+$current_rev++;
+is($ci_dir2->revision(),$current_rev,
+   "commit info revision equals $current_rev");
+
+# Use explicit revnum to test that instead of just HEAD.
+is($ctx->update($wcpath,$current_rev,$current_rev),$current_rev);
+
+# commit action against a repo returns undef
+is($ctx->delete(["$wcpath/dir2"],0),undef);
+
+# no return means success
+is($ctx->revert($wcpath,1),undef);
+
+my ($ci_copy) = $ctx->copy("$reposurl/dir1",2,"$reposurl/dir3");
+isa_ok($ci_copy,'_p_svn_client_commit_info_t');
+$current_rev++;
+is($ci_copy->revision,$current_rev,
+   "commit info revision equals $current_rev");
+
+ok(mkdir $importpath);
+ok(open FOO, ">$importpath/foo");
+ok(print FOO 'foobar');
+ok(close FOO);
+
+my ($ci_import) = $ctx->import($importpath,$reposurl,0);
+isa_ok($ci_import,'_p_svn_client_commit_info_t');
+$current_rev++;
+is($ci_import->revision,$current_rev,
+   "commit info revision equals $current_rev");
+
+is($ctx->blame("$reposurl/foo",'HEAD','HEAD', sub {
+                                              my ($line_no,$rev,$author,$date,
+                                                  $line,$pool) = @_;
+                                              is($line_no,0);
+                                              is($rev,$current_rev);
+                                              is($author,$username);
+                                              ok($date);
+                                              is($line,'foobar');
+                                              isa_ok($pool,'_p_apr_pool_t');
+                                            }),
+   undef);
+
+ok(open CAT, "+>$testpath/cattest");
+is($ctx->cat(\*CAT, "$reposurl/foo", 'HEAD'),undef);
+ok(seek CAT,0,0);
+is(readline *CAT,'foobar');
+ok(close CAT);
+
+my ($dirents) = $ctx->ls($reposurl,'HEAD', 1);
+isa_ok($dirents, 'HASH');
+isa_ok($dirents->{'dir1'},'_p_svn_dirent_t');
+is($dirents->{'dir1'}->kind(),$SVN::Core::node_dir);
+is($dirents->{'dir1'}->size(),0);
+is($dirents->{'dir1'}->has_props(),1);
+is($dirents->{'dir1'}->created_rev(),$dir1_rev);
+ok($dirents->{'dir1'}->time());
+#diag(scalar(localtime($dirents->{'dir1'}->time() / 1000000)));
+is($dirents->{'dir1'}->last_author(),$username);
+
+# test removing a property
+is($ctx->propset('perl-test', undef, "$wcpath/dir1", 0),undef);
+
+my ($ph2) = $ctx->propget('perl-test', "$wcpath/dir1", 'WORKING', 0);
+isa_ok($ph2,'HASH');
+is(scalar(keys %$ph2),0);
+
+SKIP: {
+    # This is ugly.  It is included here as an aide to understand how
+    # to test this and because it makes my life easier as I only have
+    # one command to run to test it.  If you want to use this you need
+    # to change the usernames, passwords, and paths to the client cert.
+    # It assumes that there is a repo running on localhost port 443 at
+    # via SSL.  The repo cert should trip a client trust issue.  The 
+    # client cert should be encrypted and require a pass to use it.
+    # Finally uncomment the skip line below.
+
+    # Before shipping make sure the following line is uncommented. 
+    skip 'Impossible to test without external effort to setup https', 7;
+ 
+    sub simple_prompt {
+        my $cred = shift;
+        my $realm = shift;
+        my $username_passed = shift;
+        my $may_save = shift; 
+        my $pool = shift;
+ 
+        ok(1,'simple_prompt called'); 
+        $cred->username('breser');
+        $cred->password('foo');
+    }
+
+    sub ssl_server_trust_prompt {
+        my $cred = shift;
+        my $realm = shift;
+        my $failures = shift;
+        my $cert_info = shift;
+        my $may_save = shift;
+        my $pool = shift;
+  
+        ok(1,'ssl_server_trust_prompt called');
+        $cred->may_save(0);
+        $cred->accepted_failures($failures);
+    }
+
+    sub ssl_client_cert_prompt {
+        my $cred = shift;
+        my $realm = shift;
+        my $may_save = shift;
+        my $pool = shift;
+
+        ok(1,'ssl_client_cert_prompt called');
+        $cred->cert_file('/home/breser/client-pass.p12');
+    }
+
+    sub ssl_client_cert_pw_prompt {
+        my $cred = shift;
+        my $may_save = shift;
+        my $pool = shift;
+    
+        ok(1,'ssl_client_cert_pw_prompt called');
+        $cred->password('test');
+    } 
+
+    my $oldauthbaton = $ctx->auth();
+
+    isa_ok($ctx->auth(SVN::Client::get_simple_prompt_provider(
+                                sub { simple_prompt(@_,'x') },2),
+               SVN::Client::get_ssl_server_trust_prompt_provider(
+                                \&ssl_server_trust_prompt),
+               SVN::Client::get_ssl_client_cert_prompt_provider(
+                                \&ssl_client_cert_prompt,2),
+               SVN::Client::get_ssl_client_cert_pw_prompt_provider(
+                                \&ssl_client_cert_pw_prompt,2)
+              ),'_p_svn_auth_baton_t');
+     
+    # if this doesn't work we will get an svn_error_t so by 
+    # getting a hash we know it worked. 
+    my ($dirents) = $ctx->ls('https://localhost/svn/test','HEAD',1);
+    isa_ok($dirents,'HASH');
+
+    # return the auth baton to its original setting
+    isa_ok($ctx->auth($oldauthbaton),'_p_svn_auth_baton_t');
+}
+
 END {
-diag "cleanup";
-`rm -rf $repospath`;
-#`rm -rf $wcpath`;
+diag('cleanup');
+rmtree($testpath);
 }
Index: subversion/bindings/swig/perl/t/1repos.t
===================================================================
--- subversion/bindings/swig/perl/t/1repos.t	(revision 8177)
+++ subversion/bindings/swig/perl/t/1repos.t	(working copy)
@@ -1,14 +1,17 @@
 #!/usr/bin/perl -w
 
-use Test::More qw(no_plan);
+use Test::More tests => 5;
+use File::Temp qw(tempdir);
+use File::Path qw(rmtree);
 use strict;
 
 require SVN::Core;
 require SVN::Repos;
 require SVN::Fs;
 require SVN::Delta;
+use File::Path;
 
-my $repospath = "/tmp/svn-$$";
+my $repospath = tempdir('svn-perl-test-XXXXXX', TMPDIR => 1);
 
 my $repos;
 
@@ -77,5 +80,5 @@
 diag "cleanup";
 print `svn cat file://$repospath/trunk/filea`;
 print `svn log -v file://$repospath`;
-`rm -rf $repospath`;
+rmtree($repospath);
 }
Index: subversion/bindings/swig/perl/t/2fs.t
===================================================================
--- subversion/bindings/swig/perl/t/2fs.t	(revision 8177)
+++ subversion/bindings/swig/perl/t/2fs.t	(working copy)
@@ -1,13 +1,16 @@
 #!/usr/bin/perl -w
 
-use Test::More qw(no_plan);
+use Test::More tests => 10;
 use strict;
+no warnings 'once'; # shut up about variables that are only used once.
 
 require SVN::Core;
 require SVN::Repos;
 require SVN::Fs;
+use File::Path qw(rmtree);
+use File::Temp qw(tempdir);
 
-my $repospath = "/tmp/svn-$$";
+my $repospath = tempdir('svn-perl-test-XXXXXX', TMPDIR => 1);
 
 my $repos;
 
@@ -55,5 +58,5 @@
 
 END {
 diag "cleanup";
-`rm -rf $repospath`;
+rmtree($repospath);
 }
Index: subversion/bindings/swig/perl/t/0use.t
===================================================================
--- subversion/bindings/swig/perl/t/0use.t	(revision 8177)
+++ subversion/bindings/swig/perl/t/0use.t	(working copy)
@@ -2,12 +2,10 @@
 
 use Test::More tests => 7;
 use strict;
-BEGIN {
-require_ok 'SVN::Core';
-require_ok 'SVN::Repos';
-require_ok 'SVN::Fs';
-require_ok 'SVN::Delta';
-require_ok 'SVN::Ra';
-require_ok 'SVN::Wc';
-require_ok 'SVN::Client';
-}
+use_ok 'SVN::Core';
+use_ok 'SVN::Repos';
+use_ok 'SVN::Fs';
+use_ok 'SVN::Delta';
+use_ok 'SVN::Ra';
+use_ok 'SVN::Wc';
+use_ok 'SVN::Client';
Index: subversion/bindings/swig/perl/Core.pm
===================================================================
--- subversion/bindings/swig/perl/Core.pm	(revision 8177)
+++ subversion/bindings/swig/perl/Core.pm	(working copy)
@@ -9,7 +9,7 @@
 
 =head1 SYNOPSIS
 
-    require SVN::Core; # does apr_initialize and cleanup for you
+    use SVN::Core; # does apr_initialize and cleanup for you
 
     # create a root pool and set it as default pool for later use
     my $pool = SVN::Pool->new_default;
@@ -73,6 +73,8 @@
 These callback arrays should be stored in the object
 the auth_baton is attached to.
 
+=back
+
 =cut
 
 sub auth_open_helper {
@@ -90,6 +92,10 @@
     return ($auth_baton,\@auth_callbacks);
 }
 
+# import the INVALID and IGNORED constants
+our $INVALID_REVNUM = $SVN::_Core::SVN_IGNORED_REVNUM_VALUE;
+our $IGNORED_REVNUM = $SVN::_Core::SVN_IGNORED_REVNUM_VALUE;
+
 package _p_svn_stream_t;
 use SVN::Base qw(Core svn_stream_);
 
@@ -99,8 +105,6 @@
 
 =head1 OTHER OBJECTS
 
-=over 4
-
 =head2 svn_stream_t - SVN::Stream
 
 You can use native perl io handles (including io globs) as
@@ -108,7 +112,7 @@
 translated into perl io handles, so you could access them with regular
 print, read, etc.
 
-Note that some functions takes a stream to read or write, while it
+Note that some functions take a stream to read or write, while it
 does not close it but still hold the reference to the handle. In this case
 the handle won't be destroyed properly. You should always use correct
 default pool before calling such functions.
@@ -286,27 +290,23 @@
 package SVN::Pool;
 use SVN::Base qw/Core svn_pool_/;
 
-=back
-
-=over 4
-
 =head2 svn_pool_t - SVN::Pool
 
-The perl bindings significantly simplify the usage of pools, without
-making them not manually adjustable.
+The perl bindings significantly simplify the usage of pools, while 
+still being manually adjustable.
 
 Functions requiring pool as the last argument (which are, almost all
-of the subversion functions), the pool is optionally. the default pool
+of the subversion functions), the pool is optionally. The default pool
 is used if it is omitted. If default pool is not set, a new root pool
 will be created and set as default automatically when the first
 function requiring a default pool is called.
 
 For callback functions providing pool to your subroutine, you could
-also use $pool->default to make it the default pool in the scope.
+also use $pool-E<gt>default to make it the default pool in the scope.
 
 =head3 Methods
 
-=over
+=over 4
 
 =item new ([$parent])
 
@@ -328,7 +328,7 @@
 
 =item destroy
 
-Destroy the pool. if the pool is the default pool, restore the
+Destroy the pool. If the pool is the default pool, restore the
 previous default pool as default. This is normally called
 automatically when the SVN::Pool object is no longer used and
 destroyed by the perl garbage collector.
@@ -409,11 +409,274 @@
     }
 }
 
+package _p_svn_error_t;
+use SVN::Base qw(Core svn_error_t_);
+
+sub strerror {
+	return SVN::Error::strerror($_[$[]->apr_err());
+}
+
+sub handle_error {
+	return SVN::Error::handle_error(@_);
+}
+
+sub expanded_message {
+	return SVN::Error::expanded_message(@_);
+}
+
+sub handle_warning {
+	# need to swap parameter order.
+	return SVN::Error::handle_warning($_[$[+1],$_[$[]);
+}
+
+foreach my $function (qw(compose clear quick_wrap)) {
+    my $real_function = \&{"SVN::_Core::svn_error_$function"};
+    *{"_p_svn_error_t::$function"} = sub {
+			  return $real_function->(@_);
+		}
+}
+
+package SVN::Error;
+use SVN::Base qw(Core svn_error_);
+use SVN::Base qw(Core SVN_ERR_);
+use Carp;
+our @CARP_NOT = qw(SVN::Base SVN::Client SVN::Core SVN::Delta
+                   SVN::Delta::Editor SVN::Error SVN::Fs SVN::Node
+									 SVN::Pool SVN::Ra SVN::Ra::Callbacks SVN::Ra::Reporter
+									 SVN::Repos SVN::Stream SVN::TxDelta SVN::Wc);
+
+=head2 svn_error_t - SVN::Error
+
+By default the perl bindings handle exceptions for you.  The default handler
+automatically croaks with an appropriate error message.  This is likely
+sufficient for simple scripts, but more complex usage may demand handling of
+errors.  
+
+You can override the default exception handler by changing the
+$SVN::Error::handler variable.  This variable holds a reference to a perl sub
+that should be called whenever an error is returned by a svn function.  This
+sub will be passed a svn_error_t object.   Its return value is ignored.
+
+If you set the $SVN::Error::handler to undef then each call will return an
+svn_error_t object as its first return in the case of an error, followed by the
+normal return values.  If there is no error then a svn_error_t will not be
+returned and only the normal return values will be returned.  When using this
+mode you should be careful only to call functions in array context.  For
+example: my ($ci) = $ctx-E<gt>mkdir('http://svn/foo');  In this case $ci will
+be an svn_error_t object if an error occurs and a svn_client_commit_info object
+otherwise.  If you leave the parenthesis off around $ci (scalar context) it
+will be the commit_info object, which in the case of an error will be undef.
+
+If you plan on using this exception handling, understanding the exception
+handling system the C API uses is helpful.  You can find information on it in
+the HACKING file and the API documentation.  Looking at the implementation of
+SVN::Error::croak_on_error and SVN::Error::expanded_message may be helpful as
+well.
+
+=over 4
+
+=item $svn_error_t-E<gt>apr_err()
+
+APR error value, possibly SVN_ custom error.
+
+=item $svn_error_t-E<gt>message()
+
+Details from producer of error.
+
+=item $svn_error_t-E<gt>child()
+
+svn_error_t object of the error that's wrapped.
+
+=item $svn_error_t-E<gt>pool()
+
+The pool holding this error and any child errors it wraps.
+
+=item $svn_error_t-E<gt>file()
+
+Source file where the error originated.
+
+=item $svn_error_t-E<gt>line()
+
+Source line where the error originated.
+
+=item SVN::Error::strerror($apr_status_t)
+
+Returns the english description of the status code.
+
+=item $svn_error_t-E<gt>strerror()
+
+Returns the english description of the apr_err status code set on the
+$svn_error_t.  This is short for:
+SVN::Error::strerror($svn_error_t-E<gt>apr_err());
+
+=item SVN::Error::create($apr_err, $child, $messsage);
+
+Returns a new svn_error_t object with the error status specified in $apr_err,
+the child as $child, and error message of $message.
+
+=item SVN::Error::quick_wrap($child, $new_msg); or $child-E<gt>quick_wrap($new_msg);
+
+A quick n' easy way to create a wrappered exception with your own message
+before throwing it up the stack.
+
+$child is the svn_error_t object you want to wrap and $new_msg is the new error
+string you want to set.
+
+=item SVN::Error::compose($chain, $new_error); or $chain-E<gt>compose($new_error);
+
+Add new_err to the end of $chain's chain of errors.
+
+The $new_err chain will be copied into $chain's pool and destroyed, so $new_err
+itself becomes invalid after this function.
+
+=item SVN::Error::clear($svn_error_t); or $svn_error_t-E<gt>clear();
+
+Free the memory used by $svn_error_t, as well as all ancestors and descendants
+of $svn_error_t.
+
+You must call this on every svn_error_t object you get or you will leak memory.
+
+=cut
+
+# Permit users to determine if they want automatic croaking or not.
+our $handler = \&croak_on_error;
+
+# Import functions that don't follow the normal naming scheme.
+foreach my $function (qw(handle_error handle_warning strerror)) {
+    my $real_function = \&{"SVN::_Core::svn_$function"};
+	  *{"SVN::Error::$function"} = sub {
+	      return $real_function->(@_);
+		}
+}
+
+=item SVN::Error::expanded_message($svn_error_t) or $svn_error_t-E<gt>expanded_message()
+
+Returns the error message by tracing through the svn_error_t object and its
+children and concatenating the error messages.  This is how the internal
+exception handlers get their error messages.
+
+=cut
+
+sub expanded_message {
+	  my $svn_error = shift;
+    unless (is_error($svn_error)) {
+	      return undef;
+		}
+
+		my $error_message = $svn_error->strerror();
+		while ($svn_error) {
+		    $error_message .= ': ' . $svn_error->message();
+				$svn_error = $svn_error->child();
+		}
+		return $error_message;
+}
+		
+		
+=item SVN::Error::is_error($value)
+
+Returns true if the value is an svn_error type return.  Returns false if the
+value is anything else or undefined.  This is useful for seeing if a call has
+returned an error.
+
+=cut
+
+sub is_error {
+		 return (ref($_[$[]) eq '_p_svn_error_t');
+}
+
+=item SVN::Error::croak_on_error 
+
+Default error handler.  It takes an svn_error_t and extracts the error messages
+from it and croaks with those messages.
+
+It can be used two ways.  The first is detailed above as setting it as the
+automatic exception handler via setting $SVN::Error::handler. 
+
+The 2nd is if you have $SVN::Error::handler set to undef as a wrapper for calls
+you want to croak on when there is an error but don't want to have to write an
+explicit error handler for example:
+
+my $result_rev=SVN::Error::croak_on_error($ctx-E<gt>checkout($url,$path,'HEAD',1));
+
+If there is no error then croak_on_error will return the arguments passed to it
+unchanged.
+
+=cut
+
+sub croak_on_error {
+		unless (is_error($_[$[])) {
+			return @_;
+		}
+    my $svn_error = shift;		
+    
+		my $error_message = $svn_error->expanded_message();
+		
+		$svn_error->clear();
+
+		croak($error_message);
+}
+
+=item SVN::Error::confess_on_error
+
+The same as croak_on_error except it will give a more detailed stack backtrace.
+Including showing internal calls within the implementations of the perl
+bindings.  This is useful if you're working on developing the bindings.
+
+=cut
+
+sub confess_on_error {
+		unless (is_error($_[$[])) {
+				return @_;
+		}
+    my $svn_error = shift;		
+    
+		my $error_message = $svn_error->expanded_message();
+		
+		$svn_error->clear();
+
+		confess($error_message);
+}
+
+=item SVN::Error::ignore_error
+
+This is useful for wrapping around calls which you wish to ignore any potential
+error.  It checks to see if the first parameter is an error and if it is it
+clears it.  It then returns all the other parameters.
+
+=back
+
+=cut
+
+sub ignore_error {
+    if (is_error($_[$[])) {
+		    my $svn_error = shift;
+				$svn_error->clear();
+		}
+
+		return @_;
+}
+
 package _p_svn_log_changed_path_t;
 use SVN::Base qw(Core svn_log_changed_path_t_);
 
 =head2 svn_log_changed_path_t
 
+=over 4
+
+=item $lcp-E<gt>action()
+
+'A'dd, 'D'elete, 'R'eplace, 'M'odify 
+
+=item $lcp-E<gt>copyfrom_path()
+
+Source path of copy (if any).
+
+=item $lcp-E<gt>copyfrom_rev()
+
+Source revision of copy (if any).
+
+=back
+
 =cut
 
 package SVN::Node;
@@ -421,6 +684,11 @@
 
 =head2 svn_node_kind_t - SVN::Node
 
+An enum of the following constants:
+
+$SVN::Node::none, $SVN::Node::file,
+$SVN::Node::dir, $SVN::Node::unknown.
+
 =cut
 
 package _p_svn_opt_revision_t;
@@ -436,13 +704,217 @@
 package _p_svn_config_t;
 use SVN::Base qw(Core svn_config_);
 
+=head2 svn_config_t
+
+Opaque object describing a set of configuration options.
+
+=cut
+
 package _p_svn_dirent_t;
 use SVN::Base qw(Core svn_dirent_t_);
 
-=head2 svn_config_t
+=head2 svn_dirent_t
 
+=over 4
+
+=item $dirent-E<gt>kind()
+
+Node kind.  One of these constants:
+$SVN::Node::none, $SVN::Node::file,
+$SVN::Node::dir, $SVN::Node::unknown.
+
+=item $dirent-E<gt>size()
+
+Length of file text, or 0 for directories.
+
+=item $dirent-E<gt>has_props()
+
+Does the node have props?
+
+=item $dirent-E<gt>created_rev()
+
+Last rev in which this node changed.
+
+=item $dirent-E<gt>time()
+
+Time of created_rev (mod-time).
+
+=item $dirent-E<gt>last_author()
+
+Author of created rev.
+
+=back
+
 =cut
 
+package _p_svn_auth_cred_simple_t;
+use SVN::Base qw(Core svn_auth_cred_simple_t_);
+
+=head2 svn_auth_cred_simple_t
+
+=over 4
+
+=item $simple-E<gt>username()
+
+Username.
+
+=item $simple-E<gt>password()
+
+Password.
+
+=item $simple-E<gt>may_save()
+
+Indicates if the credentials may be saved (to disk).
+
+=back
+
+=cut
+
+package _p_svn_auth_cred_username_t;
+use SVN::Base qw(Core svn_auth_cred_username_t_);
+
+=head2 svn_auth_cred_username_t
+
+=over 4
+
+=item $username-E<gt>username()
+
+Username.
+
+=item $username-E<gt>may_save()
+
+Indicates if the credentials may be saved (to disk).
+
+=back
+
+=cut
+
+package _p_svn_auth_cred_ssl_server_trust_t;
+use SVN::Base qw(Core svn_auth_cred_ssl_server_trust_t_);
+
+=head2 svn_auth_cred_ssl_server_trust_t
+
+=over 4
+
+=item $strust-E<gt>may_save()
+
+Indicates if the credentials may be saved (to disk).
+
+=item $strust-E<gt>accepted_failures()
+
+Bit mask of the accepted failures.
+
+=back
+
+=cut
+
+package _p_svn_auth_ssl_server_cert_info_t;
+use SVN::Base qw(Core svn_auth_ssl_server_cert_info_t_);
+
+=head2 svn_auth_ssl_server_cert_info_t
+
+=over 4
+
+=item $scert-E<gt>hostname()
+
+Primary CN.
+
+=item $scert-E<gt>fingerprint()
+
+ASCII fingerprint.
+
+=item $scert-E<gt>valid_from()
+
+ASCII date from which the certificate is valid.
+
+=item $scert-E<gt>valid_until()
+
+ASCII date until which the certificate is valid.
+
+=item $scert-E<gt>issuer_dname()
+
+DN of the certificate issuer.
+
+=item $scert-E<gt>ascii_cert()
+
+Base-64 encoded DER certificate representation.
+
+=back
+
+=cut
+
+package _p_svn_auth_cred_ssl_client_cert_t;
+use SVN::Base qw(Core svn_auth_cred_ssl_client_cert_t_);
+
+=head2 svn_auth_cred_ssl_client_cert_t
+
+=over 4
+
+=item $ccert-E<gt>cert_file()
+
+Full paths to the certificate file.
+
+=item $ccert-E<gt>may_save()
+
+Indicates if the credentials may be saved (to disk).
+
+=back
+
+=cut
+
+package _p_svn_auth_cred_ssl_client_cert_pw_t;
+use SVN::Base qw(Core svn_auth_cred_ssl_client_cert_pw_t_);
+
+=head2 svn_auth_cred_ssl_client_cert_pw_t
+
+=over 4
+
+=item $ccertpw-E<gt>password()
+
+Certificate password.
+
+=item $ccertpw-E<gt>may_save()
+
+Indicates if the credentials may be saved (to disk).
+
+=back
+
+=cut
+
+=head1 CONSTANTS
+
+=head2 SVN::Auth::SSL
+
+=over 4
+
+=item $SVN::Auth::SSL::NOTYETVALID
+
+Certificate is not yet valid.
+
+=item $SVN::Auth::SSL::EXPIRED
+
+Certificate has expired.
+
+=item $SVN::Auth::SSL::CNMISMATCH
+
+Certificate's CN (hostname) does not match the remote hostname. 
+
+=item $SVN::Auth::SSL::UNKNOWNCA
+
+Certificate authority is unknown (i.e. not trusted). 
+
+=item $SVN::Auth::SSL::OTHER
+
+Other failure. This can happen if neon has introduced a new failure bit that we
+do not handle yet.
+
+=back
+
+=cut
+
+package SVN::Auth::SSL;
+use SVN::Base qw(Core SVN_AUTH_SSL_);
+
 =head1 AUTHORS
 
 Chia-liang Kao E<lt>clkao@clkao.orgE<gt>
Index: subversion/bindings/swig/perl/Wc.pm
===================================================================
--- subversion/bindings/swig/perl/Wc.pm	(revision 8177)
+++ subversion/bindings/swig/perl/Wc.pm	(working copy)
@@ -1,13 +1,432 @@
 package SVN::Wc;
 use SVN::Base qw(Wc svn_wc_);
 
+=head1 NAME
+
+SVN::Wc - Subversion working copy functions
+
+=head1 SYNOPSIS
+
+Incomplete
+
+=head1 OBJECTS
+
+=cut 
+
 package _p_svn_wc_t;
 
+=head2 svn_wc_status_t
+
+=over 4
+
+=item $wcstat-E<gt>entry()
+
+A svn_wc_entry_t object for the item.  Can be undef if not under version
+control.
+
+=item $wcstat-E<gt>text_status()
+
+An integer representing the status of the item's text.  Can be one of the
+$SVN::Wc::Status::* constants.
+
+=item $wcstat-E<gt>prop_status()
+
+An integer representing the status of the item's properties.  Can be one of the
+$SVN::Wc::Status::* constants.
+
+=item $wcstat-E<gt>locked()
+
+A boolean telling if the item is locked.  A directory can be locked if a
+working copy update was interrupted.
+
+=item $wcstat-E<gt>copied()
+
+A boolean telling if the item was copied.  A file or directory can be copied if
+it's scheduled for addition-with-history (or part of a subtree that is
+scheduled as such).
+
+=item $wcstat-E<gt>switched()
+
+A boolean telling if the item was switched.  A file or directory can be
+switched if the switch command has been used.
+
+=item $wcstat-E<gt>repos_text_status()
+
+An integer representing the status of the item's text in the repository.  Can
+be one of the $SVN::Wc::Status::* constants.
+
+
+=item $wcstat-E<gt>repos_prop_status()
+
+An integer representing the status of the item's properties in the repository.
+Can be one of the $SVN::Wc::Status::* constants.
+
+=back
+
+=cut
+
+package _p_svn_wc_status_t;
+use SVN::Base qw(Wc svn_wc_status_t_);
+
+=head2 svn_wc_entry_t
+
+=over 4
+
+=item $wcent-E<gt>name()
+
+Entry's name.
+
+=item $wcent-E<gt>revision()
+
+Base revision.
+
+=item $wcent-E<gt>url()
+
+URL in repository.
+
+=item $wcent-E<gt>repos()
+
+Canonical repository URL.
+
+=item $wcent-E<gt>uuid()
+
+Repository uuid.
+
+=item $wcent-E<gt>kind()
+
+The kind of node.  One of the following constants:
+$SVN::Node::none, $SVN::Node::file,
+$SVN::Node::dir, $SVN::Node::unknown.
+
+=item $wcent-E<gt>schedule()
+
+Scheduling.  One of the SVN::Wc::Schedule::* constants.
+
+=item $wcent-E<gt>copied()
+
+In a copied state.
+
+=item $wcent-E<gt>deleted()
+
+Deleted, but parent rev lags behind.
+
+=item $wcent-E<gt>absent()
+
+Absent -- we know an entry of this name exists, but that's all (usually this
+happens because of authz restrictions) 
+
+=item $wcent-E<gt>incomplete()
+
+For THIS_DIR entry, implies whole entries file is incomplete.
+
+=item $wcent-E<gt>copyfrom_url()
+
+Copyfrom location.
+
+=item $wcent-E<gt>copyfrom_rev()
+
+Copyfrom revision.
+
+=item $wcent-E<gt>conflict_old()
+
+Old version of conflicted file.
+
+=item $wcent-E<gt>conflict_new()
+
+New version of conflicted file.
+
+=item $wcent-E<gt>conflict_wrk()
+
+Working version of conflicted file.
+
+=item $wcent-E<gt>prejfile()
+
+Property reject file.
+
+=item $wcent-E<gt>text_time()
+
+Last up-to-date time for text contents (0 means no information available).
+
+=item $wcent-E<gt>prop_time()
+
+Last up-to-date time for properties (0 means no information available).
+
+=item $wcent-E<gt>checksum()
+
+Base-64 encoded checksum for the untranslated text base file, can be undef for
+backwards compatability.
+
+=item $wcent-E<gt>cmt_rev()
+
+Last revision this was changed.
+
+=item $wcent-E<gt>cmt_date()
+
+Last date this was changed.
+
+=item $wcent-E<gt>cmt_author()
+
+Last commit author of this item.
+
+=back
+
+=cut
+
 package _p_svn_wc_entry_t;
 # still need to check if the function prototype allows it to be called
 # as method.
 use SVN::Base qw(Wc svn_wc_entry_t_);
 
+=head1 CONSTANTS
 
+=head2 SVN::Wc::Notify::Action
 
+=over 4
+
+=item $SVN::Wc::Notify::Action::add
+
+Adding a path to revision control.
+
+=item $SVN::Wc::Notify::Action::copy
+
+Copying a versioned path.
+
+=item $SVN::Wc::Notify::Action::delete
+
+Deleting a versioned path.
+
+=item $SVN::Wc::Notify::Action::restore
+
+Restoring a missing path from the pristine text-base.
+
+=item $SVN::Wc::Notify::Action::revert
+
+Reverting a modified path.
+
+=item $SVN::Wc::Notify::Action::failed_revert
+
+A revert operation has failed.
+
+=item $SVN::Wc::Notify::Action::resolved
+
+Resolving a conflict.
+
+=item $SVN::Wc::Notify::Action::skip
+
+Skipping a path.
+
+=item $SVN::Wc::Notify::Action::update_delete
+
+Got a delete in an update.
+
+=item $SVN::Wc::Notify::Action::update_add
+
+Got an add in an update.
+
+=item $SVN::Wc::Notify::Action::update_update
+
+Got any other action in an update.
+
+=item $SVN::Wc::Notify::Action::update_completed
+
+The last notification in an update (including updates of externals).
+
+=item $SVN::Wc::Notify::Action::update_external
+
+Updating an external module.
+
+=item $SVN::Wc::Notify::Action::status_completed
+
+The last notification in a status (including status on externals).
+
+=item $SVN::Wc::Notify::Action::status_external
+
+Running status on an external module.
+
+=item $SVN::Wc::Notify::Action::commit_modified
+
+Committing a modification.
+
+=item $SVN::Wc::Notify::Action::commit_added
+
+Committing an addition.
+
+=item $SVN::Wc::Notify::Action::commit_deleted
+
+Committing a deletion.
+
+=item $SVN::Wc::Notify::Action::commit_replaced
+
+Committing a replacement.
+
+=item $SVN::Wc::Notify::Action::commit_postfix_txdelta
+
+Transmitting post-fix text-delta data for a file.
+
+=item $SVN::Wc::Notify::Action::blame_revision
+
+Processed a single revision's blame.
+
+=back
+
+=cut
+
+# no reasonable prefix for these enums 
+# so we have to do them one by one to import.
+package SVN::Wc::Notify::Action;
+our $add = $SVN::Wc::notify_add;
+our $copy = $SVN::Wc::notify_copy;
+our $delete = $SVN::Wc::notify_delete;
+our $restore = $SVN::Wc::notify_restore;
+our $revert = $SVN::Wc::notify_revert;
+our $failed_revert = $SVN::Wc::notify_failed_revert;
+our $resolved = $SVN::Wc::notify_resolved;
+our $skip = $SVN::Wc::notify_skip;
+our $update_delete = $SVN::Wc::notify_update_delete;
+our $update_add = $SVN::Wc::notify_update_add;
+our $update_update = $SVN::Wc::notify_update_update;
+our $update_completed = $SVN::Wc::notify_update_completed;
+our $update_external = $SVN::Wc::notify_update_external;
+our $status_completed = $SVN::Wc::notify_status_completed;
+our $status_external = $SVN::Wc::notify_status_external;
+our $commit_modified = $SVN::Wc::notify_commit_modified;
+our $commit_added = $SVN::Wc::notify_commit_added;
+our $commit_deleted = $SVN::Wc::notify_commit_deleted;
+our $commit_replaced = $SVN::Wc::notify_commit_replaced;
+our $commit_postfix_txdelta = $SVN::Wc::notify_commit_postfix_txdelta;
+our $blame_revision = $SVN::Wc::notify_blame_revision;
+
+=head2 SVN::Wc::Notify::State
+
+=over 4
+
+=item $SVN::Wc::Notify::State::unknown
+
+Notifier doesn't know or isn't saying.
+
+=item $SVN::Wc::Notify::State::unchanged
+
+The state did not change.
+
+=item $SVN::Wc::Notify::State::missing
+
+The item wasn't present.
+
+=item $SVN::Wc::Notify::State::obstructed
+
+An unversioned item obstructed work.
+
+=item $SVN::Wc::Notify::State::changed
+
+Pristine state was modified.
+
+=item $SVN::Wc::Notify::State::merged
+
+Modified state had mods merged in.
+
+=item $SVN::Wc::Notify::State::conflicted
+
+Modified state got conflicting mods.
+
+=back
+
+=cut
+
+package SVN::Wc::Notify::State;
+use SVN::Base qw(Wc svn_wc_notify_state_);
+
+=head2 SVN::Wc::Schedule
+
+=over 4
+
+=item $SVN::Wc::Schedule::normal
+
+Nothing special here.
+
+=item $SVN::Wc::Schedule::add
+
+Slated for addition.
+
+=item $SVN::Wc::Schedule::delete
+
+Slated for deletion.
+
+=item $SVN::Wc::Schedule::replace
+
+Slated for replacement (delete + add)
+
+=back
+
+=cut
+
+package SVN::Wc::Schedule;
+use SVN::Base qw(Wc svn_wc_schedule_);
+
+=head2 SVN::Wc::Status
+
+=over 4
+
+=item $SVN::Wc::Status::none
+
+Does not exist.
+
+=item $SVN::Wc::Status::unversioned
+
+Is not a versioned node in this working copy.
+
+=item $SVN::Wc::Status::normal
+
+Exists, but uninteresting.
+
+=item $SVN::Wc::Status::added
+
+Is scheduled for addition.
+
+=item $SVN::Wc::Status::missing
+
+Under version control but missing.
+
+=item $SVN::Wc::Status::deleted
+
+Scheduled for deletion.
+
+=item $SVN::Wc::Status::replaced
+
+Was deleted and then re-added.
+
+=item $SVN::Wc::Status::modified
+
+Text or props have been modified.
+
+=item $SVN::Wc::Status::merged
+
+Local mods received repos mods.
+
+=item $SVN::Wc::Status::conflicted
+
+Local mods received conflicting mods.
+
+=item $SVN::Wc::Status::ignored
+
+A node marked as ignored.
+
+=item $SVN::Wc::Status::obstructed
+
+An unversioned resource is in the way of the versioned resource.
+
+=item $SVN::Wc::Status::external
+
+An unversioned path populated by an svn:external property.
+
+=item $SVN::Wc::Status::incomplete
+
+A directory doesn't contain a complete entries list.
+
+=back
+
+=cut
+
+package SVN::Wc::Status;
+use SVN::Base qw(Wc svn_wc_status_);
+
 1;
Index: subversion/bindings/swig/perl/Client.pm
===================================================================
--- subversion/bindings/swig/perl/Client.pm	(revision 8177)
+++ subversion/bindings/swig/perl/Client.pm	(working copy)
@@ -1,10 +1,13 @@
 use SVN::Core;
+use SVN::Wc;
 
 package SVN::Client;
 use SVN::Base(qw(Client svn_client_ checkout update switch add mkdir delete
                  commit status log blame diff merge cleanup relocate
                  revert resolved copy move revprop_set propset
-                 proplist revvprop_list export ls cat import)); 
+                 proplist revvprop_list export ls cat import propget
+                 uuid_from_url uuid_from_path url_from_path revprop_get
+                 revprop_list)); 
 
 =head1 NAME
 
@@ -64,13 +67,75 @@
 attribute methods do other things, especially when setting an attribute,
 besides simply manipulating the value in the hash.
 
+=head1 PARAMETER NOTES
+
+The client methods described below take a variety of parameters.  Many of
+them are similar.  Methods accepting parameters named below will follow
+the rules below or will be noted otherwise in the method description.
+
+=over 4
+
+=item $ctx
+
+An SVN::Client object that you get from the constructor.
+
+=item $url
+
+This is a URL to a subversion repository.  
+
+=item $path
+
+This is a path to a file or directory on the local file system.
+
+=item $paths
+
+This argument can either be a single path to a file or directory on the local
+file system, or it can be a reference to an array of files or directories on
+the local file system.
+
+=item $target
+
+This is a path to a file or directory in a working copy or a URL to a file or
+directory in a subversion repository.
+
+=item $targets
+
+This argument can either be a single $target (as defined above) or a reference
+to an array of them.
+
+=item $revision
+
+This specifies a revision in the subversion repository.  You can specify a
+revision in several ways.  The easiest and most obvious is to directly
+provide the revision number.  You may also use the strings (aka revision
+keywords) 'HEAD', 'BASE', 'COMMITTED', and 'PREV' which have the same
+meanings as in the command line client.  When referencing a working copy
+you can use the string 'WORKING" to reference the BASE plus any local
+modifications.  undef may be used to specify an unspecified revision.
+Finally you may pass a date by specifying the date inside curly braces
+'{}'.  The date formats accepted are the same as the command line client
+accepts.
+
+=item $recursive $nonrecusive.
+
+A boolean parameter that specifies if the action should follow directories.  It
+should only be 1 or 0.  $recursive means, 1 means to descend into directories,
+0 means not to.  $nonrecursive has the inverse meaning.
+
+=item $pool
+
+Pool is always an option parameter.  If you wish to pass a pool parameter it
+should be a SVN::Pool or an apr_pool_t object.
+
+=back
+
 =head1 METHODS
 
 The following methods are available:
 
 =over 4
 
-=item $ctx = SVN::Client->new( %options );
+=item $ctx = SVN::Client-E<gt>new( %options );
 
 This class method constructs a new C<SVN::Client> object and returns
 a reference to it.
@@ -81,13 +146,19 @@
 
     KEY                    DEFAULT
     ----------             ----------------------------------------
-    config                 Hash containing the config from the 
-                           default subversion config file location.
-
     auth                   auth_baton intiated to provide the
                            provider that read cached authentication
                            options from the subversion config only.
 
+    cancel                 undef
+                           
+    config                 Hash containing the config from the 
+                           default subversion config file location.
+
+    log_msg                undef
+
+    notify                 undef
+
     pool                   A new pool is created for the context.
 
 =cut
@@ -98,7 +169,7 @@
     my $self = bless {}, $class;
     my %args = @_;
 
-    $self->{'ctx'} = SVN::_Client::new_svn_client_ctx_t ();
+    $self->{'ctx'} = SVN::_Client::svn_client_create_context ();
 
     if (defined($args{'auth'}))
     {
@@ -134,15 +205,574 @@
     } else {
         $self->config(SVN::Core::config_get_config(undef));
     }
+
+    if (defined($args{'notify'}))
+    {
+        $self->notify($args{'notify'});
+    }
+
+    if (defined($args{'log_msg'}))
+    {
+        $self->log_msg($args{'log_msg'});
+    }
+
+    if (defined($args{'cancel'}))
+    {
+        $self->cancel($args{'cancel'});
+    }
+    
     return $self;
 }
 
-=item $ctx->cat(\*FILEHANDLE, path_or_url, revision, pool);
+=item $ctx-E<gt>add($path, $recursive, $pool);
 
-Outputs the content of the file identified by path_or_url and revision to the
-FILEHANDLE.  FILEHANLDE is a reference to a filehandle.  revision should be a
-number or 'HEAD'.  pool is an optional parameter.
+Schedule a working copy $path for addition to the repository.
 
+$path's parent must be under revision control already, but $path is not.
+If $recursive is set, then assuming $path is a directory, all of its
+contents will be scheduled for addition as well.
+
+Calls the notify callback for each added item.
+
+Important: this is a B<scheduling> operation.  No changes will happen
+to the repository until a commit occurs.  This scheduling can be
+removed with $ctx-E<gt>revert().
+
+No return.
+
+=item $ctx-E<gt>blame($target, $start, $end, \&receiver, $pool);
+
+Invoke \&receiver subroutine on each line-blame item associated with revision
+$end of $target, using $start as the default source of all blame.
+
+An Error will be raised if either $start or $end is undef.
+
+No return.
+
+The blame receiver subroutine receives the following arguments:
+$line_no, $revision, $author, $date, $line, $pool
+
+$line_no is the line number of the file (starting with 0).
+The line was last changed in revision number $revision
+by $author on $date and the contents were $line.
+
+The blame receiver subroutine can return an svn_error_t object
+to return an error.  All other returns will be ignored.
+You can create an svn_error_t object with SVN::Error::create().
+
+=item $ctx-E<gt>cat(\*FILEHANDLE, $target, $revision, $pool);
+
+Outputs the content of the file identified by $target and $revision to the
+FILEHANDLE.  FILEHANDLE is a reference to a filehandle. 
+
+If $target is not a local path, then if $revision is 'PREV' (or
+some other kind that requires a local path), an error be raised, because the 
+desired revision can not be determined.
+
+=item $ctx-E<gt>checkout($url, $path, $revision, $recursive, $pool);
+
+Checkout a working copy of $url at $revision using $path as the root directory
+of the newly checked out working copy.  
+
+$revision must be a number, 'HEAD', or a date.  If $revision does not
+meet these requirements the $SVN::Error::CLIENT_BAD_REVISION is raised.
+
+Returns the value of the revision actually checked out of the repository.
+
+=item $ctx-E<gt>cleanup($dir, $pool);
+
+Recursively cleanup a working copy directory, $dir, finishing any incomplete
+operations, removing lockfiles, etc.
+
+=item $ctx-E<gt>commit($targets, $nonrecursive, $pool);
+
+Commit files or directories referenced by target.  Will use the log_msg
+callback to obtain the log message for the commit.
+
+If $targets has no paths (zero elements), then does nothing and immediately
+returns without error.
+
+Calls the notify callback as the commit progresses with any of the following
+actions: $SVN::Wc::Notify::Action::commit_modified,
+$SVN::Wc::Notify::Action::commit_added,
+$SVN::Wc::Notify::Action::commit_deleted,
+$SVN::Wc::Notify::Action::commit_replaced,
+$SVN::Wc::Notify::Action::commit_postfix_txdelta.
+
+Use $nonrecursive to indicate that subdirectories of directory targets
+should be ignored.
+
+Returns a svn_client_commit_info_t object.  If the revision member of the commit
+info object is $SVN::Core::INVALID_REVNUM and no error was raised, then the
+commit was a no-op; nothing needed to be committed.
+
+=item $ctx-E<gt>copy($src_target, $src_revision, $dst_target, $pool);
+
+Copies $src_target to $dst_target.
+
+$src_target must be a file or directory under version control, or the URL
+of a versioned item in the repository.  If $src_target is a URL,
+$src_revision is used to choose the revision from which to copy the
+$src_target.  $dst_path must be a file or directory under version control,
+or a repoistory URL, existant or not.
+
+If $dst_target is a URL immediately attempt to commit the copy action
+to the repository.  The log_msg callback will be called to query for a commit
+log message. If the commit succeeds, return a svn_client_commit_info_t object.
+
+If $dst_target is not a URL, then this is just a variant of $ctx-E<gt>add(),
+where the $dst_path items are scheduled for addition as copies.  No changes
+will happen to the repository until a commit occurs.  This scheduling can be
+removed with $ctx-E<gt>revert().  undef will be returned in this case.
+
+Calls the notify callback for each item added at the new location, passing
+the new, relative path of the added item.
+
+=item $ctx-E<gt>delete($targets, $force, $pool);
+
+Delete items from a repository or working copy.
+
+If the paths in $targets are URLs, immediate attempt to commit a deletion of the
+URLs from the repository.  The log_msg callback will be called to query for
+a commit log message.  If the commit succeeds, return a svn_client_commit_info_t object.
+Every path must belong to the same repository.
+
+Else, schedule the working copy paths in $targets for removal from the
+repository.  Each path's parent must be under revision control.  This is
+just a B<scheduling> operation.  No changes will happen to the repository
+until a commit occurs.  This scheduling can be removed with $ctx-E<gt>revert().
+If a path is a file it is immediately removed from the working copy.  If
+the path is a directory it will remain in the working copy but all the files,
+and all unversioned items it contains will be removed.  If $force is not set
+then this operation will fail if any path contains locally modified and/or
+unversioned items.  If $force is set such items will be deleted.
+
+The notify callback is called for each item deleted with the path of
+the deleted item.
+
+Has no return.
+
+=item $ctx-E<gt>diff($diff_options, $target1, $revision1, $target2, $revision2, $recursive, $ignore_ancestry, $no_diff_deleted, $outfile, $errfile, $pool);
+
+Produces diff output which describes the delta between $target1 at
+$revision1 and $target2 at $revision2.  They both must represent the same
+node type (i.e. they most both be directories or files).  The revisions
+must not be undef.  
+
+Prints the output of the diff to the filename or filehandle passed as $outfile, and
+any errors to the filename or filehandle passed as $errfile.
+
+Use $ignore_ancestry to control whether or not items being diffed will be
+checked for relatedness first. Unrelated items are typically transmitted to the
+editor as a deletion of one thing and the addition of another, but if this flag
+is true, unrelated items will be diffed as if they were related.
+
+If $no_diff_deleted is true, then no diff output will be generated on deleted
+files.
+
+$diff_options is a reference to an array of additional arguments to pass to
+diff process invoked to compare files.  You'll usually just want to use [] to
+pass an empty array.
+
+Has no return.
+
+=item $ctx-E<gt>export($from, $to, $revision, $force, $pool);
+
+Export the contents of either a subversion repository or a subversion
+working copy into a 'clean' directory (meaning a directory with no
+administrative directories).
+
+$from is either the path to the working copy on disk, or a URL
+to the repository you wish to export.
+
+$to is the path to the directory where you wish to create the exported
+tree.
+
+$revision is the revision that should be exported, which is only used
+when exporting from a repository.  It may be undef otherwise.
+
+The notify callback will be called for the items exported.
+
+Returns the value of the revision actually exported or
+$SVN::Core::INVALID_REVNUM for local exports.
+
+=item $ctx-E<gt>import($path, $url, $nonrecursive, $pool);
+
+Import file or directory $path into repository directory $url at head.
+
+If some components of $url do not exist then create parent directories
+as necessary.
+
+If $path is a directory, the contents of that directory are imported
+directly into the directory identifed by $url.  Note that the the directory 
+$path itself is not imported; that is, the basename of $path is not part
+of the import.
+
+If $path is a file, then the dirname of $url is the directory receiving the
+import.  The basename of $url is the filename in the repository.  In this case
+if $url already exists, raise an error.
+
+The notify callback (if defined) will be called as the import progresses, with
+any of the following actions: $SVN::Wc::Notify::Action::commit_added,
+$SVN::Wc::Notify::Action::commit_postfix_txdelta.
+
+Use $nonrecursive to indicate that imported directories should not recurse
+into any subdirectories they may have.
+
+Uses the log_msg callback to determine the log message for the commit when
+one is needed.
+
+Returns a svn_client_commit_info_t object.  
+
+=item $ctx-E<gt>log($targets, $start, $end, $discover_changed_paths, $strict_node_history, \&log_receiver, $pool);
+
+Invoke the log_receiver subroutine on each log_message from $start to $end in
+turn, inclusive (but will never invoke receiver on a given log message more
+than once).
+
+$targets is a reference to an array containing all the paths or URLs for which the
+log messages are desired.  The log_receiver is only invoked on messages whose
+revisions involved a change to some path in $targets.
+
+If $discover_changed_paths is set, then the changed_paths argument to the
+log_receiver routine will be passed on each invocation.
+
+If $strict_node_history is set, copy history (if any exists) will not be
+traversed while harvesting revision logs for each target.
+
+If $start or $end is undef the arp_err code will be set to:
+$SVN::Error::CLIENT_BAD_REVISION.
+
+Special case for repositories at revision 0:
+
+If $start is 'HEAD' and $end is 1, then handle an emtpy (no revisions)
+repository specially: instead of erroring because requested revision 1
+when the highest revision is 0, just invoke $log_receiver on revision 0,
+passing undef to changed paths and empty strings for the author and date.
+This is because that particular combination of $start and $end usually indicates
+the common case of log invocation; the user wants to see all log messages from
+youngest to oldest, where the oldest commit is revision 1.  That works fine,
+except there are no commits in the repository, hence this special case.
+
+Calls the notify subroutine with a $SVN::Wc::Notify::Action::skip signal on any
+unversioned targets.
+
+The log_receiver takes the following arguments:
+$changed_paths, $revision, $author, $date, $message, $pool
+
+It is called once for each log $message from the $revision
+on $date by $author.  $author, $date or $message may be undef.
+
+If $changed_paths is defined it references a hash with the keys
+every path commited in $revision; the values are svn_log_changed_path_t
+objects.  
+
+=item $ctx-E<gt>ls($target, $revision, $recursive, $pool);
+
+Returns a hash of svn_dirent_t objects for $target at $revision.
+
+If $target is a directory, returns entries for all of
+the directories contents.  If $recursive is true, it will
+recurse subdirectories in $target.
+
+If $target is a file only return an entry for the file.
+
+If $target is non-existant, raises the $SVN::Error::FS_NOT_FOUND
+error.
+ 
+=item $ctx-E<gt>merge($src1, $rev1, $src2, $rev2, $target_wcpath, $recursive, $ignore_ancestry, $force, $dry_run, $pool);
+
+Merge changes from $src1/$rev1 to $src2/$rev2 into the working-copy path
+$target_wcpath.
+
+$src1 and $src2 are either URLs that refer to entries in the repository, or
+paths to entries in the working copy.
+
+By 'merging', we mean: apply file differences and schedule additions &
+deletions when appropriate.
+
+$src1 and $src2 must both represent the same node kind; that is, if $src1
+is a direcotry, $src2 must also be, and if $src1 is a file, $src2 must also be.
+
+If either $rev1 or $rev2 is undef raises the $SVN::Error::CLIENT_BAD_REVISION
+error.
+
+If $recursive is true (and the URLs are directories), apply changes recursively;
+otherwise, only apply changes in the current directory.
+
+Use $ignore_ancestry to control whether or not items being diffed will be
+checked for relatedness first.  Unrelated items are typically transmitted
+to the editor as a deletion of one thing and the addition of another, but
+if this flag is true, unrelated items will be diffed as if they were related.
+
+If $force is not set and the merge involves deleting locally modifed or
+unversioned items the operation will raise an error.  If $force is set such
+items will be deleted.
+
+Calls the notify callback once for each merged target, passing the targets
+local path.
+
+If $dry_run is true the merge is carried out, and the full notification
+feedback is provided, but the working copy is not modified.
+
+Has no return.
+
+=item $ctx-E<gt>mkdir($targets, $pool);
+
+Create a directory, either in a repository or a working copy.
+
+If $targets contains URLs immediately attempts to commit the creation of the
+directories in $targets in the repository.  Returns a svn_client_commit_info_t
+object.
+
+Else, create the directories on disk, and attempt to schedule them for addition.
+In this case returns undef.
+
+Calls the notify callback when the directory has been created (successfully)
+in the working copy, with the path of the new directory.  Note this is only
+called for items added to the working copy.
+
+=item $ctx-E<gt>move($src_path, $src_revision, $dst_path, $force, $pool);
+
+Move $src_path to $dst_path.
+
+$src_path must be a file or directory under version control, or the URL 
+of a versioned item in the repository.
+
+If $src_path is a repository URL:
+
+* $dst_path must also be a repository URL (existant or not).
+
+* $src_revision is used to choose the revision from which to copy the 
+$src_path.
+
+* The log_msg callback will be called for the commit log message.
+
+* The move operation will be immediately committed.  If the commit succeeds,
+returns a svn_client_commit_info_t object.
+
+If $src_path is a working copy path
+
+* $dst_path must also be a working copy path (existant or not).
+
+* $src_revision is ignored and may be undef.  The log_msg callback will
+not be called.
+
+* This is a sceduling operation.  No changes will happen to the repository
+until a commit occurs.  This scheduling can be removed with $ctx-E<gt>revert().
+If $src_path is a file it is removed from the working copy immediately.
+If $src_path is a directory it will remain in the working copy but all
+files, and unversioned items, it contains will be removed.
+
+* If $src_path contains locally modified and/or unversioned items and $force is
+not set, the copy will raise an error.  If $force is set such items will be
+removed.
+
+The notify callback will be called twice for each item moved, once to
+indicate the deletion of the moved node, and once to indicate the addition
+of the new location of the node.
+
+=item $ctx-E<gt>propget($propname, $target, $revision, $recursive, $pool);
+
+Returns a reference to a hash containing paths or URLs, prefixed by $target (a
+working copy or URL), of items of which the property $propname is set, and
+whose values represent the the property value for $propname at that path.
+
+=item $ctx-E<gt>proplist($target, $revision, $recursive, $pool);
+
+Returns a reference to an array of svn_client_proplist_item_t objects.
+
+For each item the node_name member of the proplist_item object contains
+the name relative to the same base as $target.
+
+If $revision is undef, then get properties from the working copy, if
+$target is a working copy, or from the repository head if $target is a URL.
+Else get the properties as of $revision. 
+
+If $recursive is false, or $target is a file, the returned array will only
+contain a single element.  Otherwise, it will contain one entry for each
+versioned entry below (and including) $target.
+
+If $target is not found, raises the $SVN::Error::ENTRY_NOT_FOUND error.
+
+=item $ctx-E<gt>propset($propname, $propval, $target, $recursive, $pool);
+
+Set $propname to $propval on $target (a working copy or URL path).
+
+If $recursive is true, then $propname will be set recursively on $target
+and all children.  If $recursive is false, and $target is a directory,
+$propname will be set on B<only> $target.
+
+A $propval of undef will delete the property.
+
+If $propname is an svn-controlled property (i.e. prefixed with svn:),
+then the caller is responsible for ensuring that $propval is UTF8-encoded
+and uses LF line-endings.
+
+=item $ctx-E<gt>relocate($dir, $from, $to, $recursive, $pool);
+
+Modify a working copy directory $dir, changing any repository URLs that
+begin with $from to begin with $to instead, recursing into subdirectories if
+$recursive is true.
+
+Has no return.
+
+=item $ctx-E<gt>resolved($path, $recursive, $pool);
+
+Removed the 'conflicted' state on a working copy path.
+
+This will not semantically resolve conflicts; it just allows $path to be
+committed in the future.  The implementation details are opaque.  If
+$recursive is set, recurse below $path, looking for conflicts to
+resolve.
+
+If $path is not in a state of conflict to begin with, do nothing.
+
+If $path's conflict state is removed  call the notify callback with the
+$path.
+
+=item $ctx-E<gt>revert($paths, $resursive, $pool); 
+
+Restore the pristine version of a working copy $paths, efficentively undoing
+any local mods.  
+
+For each path in $paths, if it is a directory and $recursive
+is true, this will be a recursive operation.
+
+=item $ctx-E<gt>revprop_get($propname, $url, $revision, $pool);
+
+Returns two values, the first of which is the value of $propname on revision
+$revision in the repository represented by $url.  The second value is the
+actual revision queried.
+
+Note that unlike its cousin $ctx-E<gt>propget(), this routine doesn't affect
+working copy at all; it's a pure network operation that queries an
+B<unversioned> property attached to a revision.  This can be used to query
+log messages, dates, authors, and the like.
+
+=item $ctx-E<gt>revprop_list($url, $revision, $pool);
+
+Returns two values, the first of which is a reference to a hash containing
+the properties attached to $revision in the repository represented by $url.
+The second value is the actual revision queried.
+
+Note that unlike its cousin $ctx-E<gt>proplist(), this routine doesn't read a
+working copy at all; it's a pure network operation that reads B<unversioned>
+properties attached to a revision.
+
+=item $ctx-E<gt>revprop_set($propname, $propval, $url, $revision, $force, $pool);
+
+Set $propname to $propval on revision $revision in the repository represented
+by $url.
+
+Returns the actual revision affected.  A $propval of undef will delete the
+property.
+
+If $force is true, allow newlines in the author property.
+
+If $propname is an svn-controlled property (i.e. prefixed with svn:), then
+the caller is responsible for ensuring that the value is UTF8-encoded and
+uses LF line-endings.
+
+Note that unlike its cousin $ctx-E<gt>propset(), this routine doesn't affect
+the working copy at all; it's a pure network operation that changes an
+B<unversioned> property attached to a revision.  This can be used to tweak
+log messages, dates, authors, and the like.  Be careful: it's a lossy
+operation.
+
+Also note that unless the administrator creates a pre-revprop-change hook
+in the repository, this feature will fail.
+
+=item $ctx-E<gt>status($path, $revision, \&status_func, $recursive, $get_all, $update, $no_ignore, $pool);
+
+Given $path to a working copy directory (or single file), call status_func with a set of
+svn_wc_status_t objects which describe the status of $path and its children.
+
+If $recursive is true, recurse fully, else do only immediate children.
+
+If $get_all is set, retrieve all entries; otherwise, retrieve only 'interesting'
+entries (local mods and/or out-of-date).
+
+If $update is set, contact the repository and augment the status objects with
+information about out-of-dateness (with respect to $revision).  Also, will
+return the value of the actual revision against with the working copy was compared.
+(The return will be undef if $update is not set).
+
+The function recurses into externals definitions ('svn:externals') after
+handling the main target, if any exist.  The function calls the notify callback
+with $SVN::Wc::Notify::Action::status_external action before handling each externals
+definition, and with $SVN::Wc::Notify::Action::status_completed after each.
+
+The status_func subroutine takes the following parameters:
+$path, $status
+
+$path is the pathname of the file or directory which status is being
+reported.  $status is a svn_wc_status_t object.
+
+The return of the status_func subroutine is ignored.
+
+=item $ctx-E<gt>switch($path, $url, $revision, $recursive, $pool);
+
+Switch working tree $path to $url at $revision.
+
+$revision must be a number, 'HEAD', or a date, otherwise it raises the 
+$SVN::Error::CLIENT_BAD_REVISION error.
+
+Calls the notify callback on paths affected by the switch.  Also invokes
+the callback for files that may be restored from the text-base because they
+were removed from the working copy.
+
+Summary of purpose: This is normally used to switch a working directory
+over to another line of development, such as a branch or a tag.  Switching
+an existing working directory is more efficient than checking out $url from
+scratch.
+
+Returns the value of the revision to which the working copy was actually
+switched. 
+
+=item $ctx-E<gt>update($path, $revision, $recursive, $pool)
+
+Update a working copy $path to $revision.
+
+$revision must be a revision number, 'HEAD', or a date or this method will
+raise the $SVN::Error::CLIENT_BAD_REVISION error. 
+
+Calls the notify callback for each item handled by the update, and
+also for files restored from the text-base.
+
+Returns the revision to which the working copy was actually updated.
+
+
+=item $ctx-E<gt>url_from_path($target, $pool); or SVN::Client::url_from_path($target, $pool);
+
+Returns the URL for $target.
+
+If $target is already a URL it returns $target.
+
+If $target is a versioned item, it returns $target's entry URL.
+
+If $target is unversioned (has no entry), returns undef.
+
+=item $ctx-E<gt>uuid_from_path($path, $adm_access, $pool);
+
+Return the repository uuid for working-copy $path, allocated in $pool.
+
+Use $adm_access to retrieve the uuid from $path's entry; if not present in the
+entry, then call $ctx-E<gt>uuid_from_uril() to retrieve, using the entry's URL.
+
+Note: The only reason this function falls back on $ctx-E<gt>uuid_from_url is for
+compatability purposes.  Old working copies may not have uuids in the entries
+files.
+
+Note: This method probably doesn't work right now without a lot of pain,
+because SVN::Wc is incomplete and it requires an adm_access object from it.
+
+=item $ctx-E<gt>uuid_from_url($url, $pool);
+
+Return repository uuid for url.
+
+=back
+
 =cut
 
 # import methods into our name space and wrap them in a closure
@@ -150,24 +780,45 @@
 foreach my $function (qw(checkout update switch add mkdir delete commit
                        status log blame diff merge cleanup relocate
                        revert resolved copy move revprop_set propset
-                       proplist revvprop_list export ls cat import))
+                       proplist revvprop_list export ls cat import
+                       propget uuid_from_url uuid_from_path
+                       url_from_path revprop_get revprop_list))
 {
 
     my $real_function = \&{"SVN::_Client::svn_client_$function"};
     *{"SVN::Client::$function"} = sub
     {
-        # Allows import to work while not breaking use SVN::Client.
-        if ($function eq 'import')
+        my ($self, $ctx);
+        my @args;
+    
+        # Don't shift the first param if it isn't a SVN::Client
+        # object.  This lets the old style interface still work.  
+        # And is useful for functions like url_from_path which
+        # don't take a ctx param, but might be called in method
+        # invocation style or as a normal function.
+        for (my $index = $[; $index <= $#_; $index++)
         {
-            if (ref($_[$[]) ne 'SVN::Client')
+            if (ref($_[$index]) eq 'SVN::Client')
             {
+                ($self) = splice(@_,$index,1);
+                $ctx = $self->{'ctx'};
+                last;
+            } elsif (ref($_[$index]) eq '_p_svn_client_ctx_t') {
+                $self = undef;
+                ($ctx) = splice(@_,$index,1);
+                last;
+            }
+        }
+        
+        if (!defined($ctx))
+        {
+            # Allows import to work while not breaking use SVN::Client.
+            if ($function eq 'import')
+            {
                 return;
             }
         }
 
-        my $self = shift;
-        my @args;
-
         if (ref($_[$#_]) eq '_p_apr_pool_t')
         {
             # if we got a pool pased to us we need to
@@ -175,17 +826,17 @@
             # so we push only the first arg to the next
             # to last arg.
             push @args, @_[$[ .. ($#_ - 1)];
-            unless ($function eq 'propset')
+            unless ($function =~ /^(?:propset|url_from_path)$/)
             {
-                # propset doesn't take a ctx argument
-                push @args, $self->{'ctx'};
+                # propset and url_from_path don't take a ctx argument
+                push @args, $ctx;
             }
             push @args, $_[$#_];
         } else {
             push @args, @_;
-            unless ($function eq 'propset')
+            unless ($function =~ /^(?:propset|url_from_path)$/)
             {
-                push @args,$self->{'ctx'};
+                push @args,$ctx;
             }
             if (defined($self->{'pool'}) && 
                 ref($self->{'pool'}) eq '_p_apr_pool_t')
@@ -203,11 +854,13 @@
 
 The following attribute methods are provided that allow you to set various
 configuration or retrieve it.  They all take value(s) to set the attribute and
-return the new value of the attribute or no paremeters which reuturns the
+return the new value of the attribute or no paremeters which returns the
 current value.
 
-=item $ctx->auth(SVN::Client::get_username_provider());
+=over 4
 
+=item $ctx-E<gt>auth(SVN::Client::get_username_provider());
+
 Provides access the auth_baton in the svn_client_ctx_t attached to the
 SVN::Client object.
 
@@ -247,8 +900,105 @@
     return $self->{'ctx'}->auth_baton();
 }
 
-=item $ctx->pool(new SVN::Pool);
+=item $ctx-E<gt>notify(\&notify);
 
+Sets the notify callback for the client context to a code reference that
+you pass.  It always returns the current codereference set.
+
+The subroutine pointed to by this reference will be called when a change
+is made to the working copy.  The return value of this function is ignored.
+It's only purpose is to notify you of the change.
+
+The subroutine will receive 6 parameters.  The first paramater will be the path
+of the changed file (absolute or relative to the cwd).  The second is an
+integer specifying the type of action taken.  See L<SVN::Wc> for a list of the
+possible actions values and what they mean.  The 3rd is an integer specifying
+the kind of node the path is, which can be: $SVN::Node::none, $SVN::Node::file,
+$SVN::Node::dir, $SVN::Node::unknown.  The fourth parameter is the mime-type of
+the file or undef if the mime-type is unknown, it will always be undef for
+directories.  The 5th parameter is the state of the file, again see L<SVN::Wc>
+for a list of the possible states.  The 6th and final paramter is the numeric
+revision number of the changed file.  The revision number will be -1 except
+when the action is $SVN::Wc::Notify::Action::update_completed.
+
+=cut 
+
+sub notify {
+    my $self = shift;
+    if (scalar(@_) == 1) {
+        $self->{'notify_callback'} = $self->{'ctx'}->notify_baton(shift);
+    }
+    return ${$self->{'notify_callback'}};
+}
+
+=item $ctx-E<gt>log_msg(\&log_msg)
+
+Sets the log_msg callback for the client context to a code reference that you
+pass.  It always returns the current codereference set.
+
+The subroutine pointed to by this coderef will be called to get the log
+message for any operation that will commit a revision to the repo.
+
+It receives 4 parameters.  The first parameter is a reference to a scalar
+value in which the callback should place the log_msg.  If you wish to cancel
+the commit you can set this scalar to undef.  The 2nd value is a path to a
+temporary file which might be holding that log message, or undef if no such
+field exists (though, if log_msg is undef, this value is undefined).  The 
+log message B<MUST> be a UTF8 string with LF line separators.  The 3rd parameter
+is a reference to an array of svn_client_commit_item_t objects, which may
+be fully or only partially filled-in, depending on the type of commit
+operation.  The 4th and last parameter will be a pool.
+
+If the function wishes to return an error it should return a svn_error_t
+object made with SVN::Error::create.  Any other return value will be
+interpreted as SVN_NO_ERROR.
+
+=cut
+
+sub log_msg {
+    my $self = shift;
+
+    if (scalar(@_) == 1) {
+        $self->{'log_msg_callback'} = $self->{'ctx'}->log_msg_baton(shift);
+    }
+    return ${$self->{'log_msg_callback'}};
+}
+
+=item $ctx-E<gt>cancel(\&cancel)
+
+Sets the log_msg callback for the client context to a code reference that you
+pass.  It always returns the current codereference set.
+
+The subroutine pointed to by this value will be called to see if the operation
+should be canceled.  If the operation should be canceled the function may
+return one of the following values:
+
+An svn_error_t object made with SVN::Error::create.
+
+Any true value, in which case the bindings will generate an svn_error_t object
+for you with the error code of SVN_ERR_CANCELLED and the string set to "By
+cancel callback".
+
+A string, in which case the bindings will generate an svn_error_t object for you
+with the error code of SVN_ERR_CANCELLED and the string set to the string you
+returned.
+
+Any other value will be interpreted as wanting to continue the operation.  Generally,
+it's best to return 0 to continue the operation.
+
+=cut
+
+sub cancel {
+    my $self = shift;
+
+    if (scalar(@_) == 1) {
+        $self->{'cancel_callback'} = $self->{'ctx'}->cancel_baton(shift);
+    }
+    return ${$self->{'cancel_callback'}};
+}
+
+=item $ctx-E<gt>pool(new SVN::Pool);
+
 Method that sets or gets the pool that is passed to method calls requiring a
 pool but that you didn't pass one.
 
@@ -268,9 +1018,8 @@
         return $self->{'pool'} = shift;
     }
 }
+=item $ctx-E<gt>config(SVN::Core::config_get_config(undef));
 
-=item $ctx->config(SVN::Core::config_get_config(undef));
-
 Method that allows access to the config member of the svn_client_ctx_t.
 Accepts a perl hash to set, which is what functions like
 SVN::Core:config_get_config() will return.
@@ -280,6 +1029,8 @@
 the future, this value will be tied to the actual hash used
 by the C API.
 
+=back
+
 =cut
 
 sub config
@@ -303,11 +1054,11 @@
 call a subroutine to allow you to prompt the user for the
 information.
 
-The functions that return the provider objects for prompt style providers
-take a reference to a perl subroutine to use for the callback.  The first
-parameter each of these subroutines receive is a credential object.  The
-subroutines return the response by setting members of that object.  Members
-may be set like so: $cred->username("breser");  These functions and credential
+The functions that return the svn_auth_provider_object_t for prompt style
+providers take a reference to a perl subroutine to use for the callback.  The
+first parameter each of these subroutines receive is a credential object.  The
+subroutines return the response by setting members of that object.  Members may
+be set like so: $cred-E<gt>username("breser");  These functions and credential
 objects always have a may_save member which specifies if the authentication
 data will be cached.
 
@@ -339,7 +1090,7 @@
 Returns a simple provider that prompts the user via a callback. Takes two or
 three parameters, the first is the callback subroutine, the 2nd is the number
 of retries to allow, the 3rd is optionally a pool.  The subroutine gets called
-with the following parameters.  A svn_auth_cred_simple object, a realm string,
+with the following parameters.  A svn_auth_cred_simple_t object, a realm string,
 a default username, may_save, and a pool.  The svn_auth_cred_simple has the
 following members: username, password, and may_save.
 
@@ -353,13 +1104,13 @@
 Returns a username provider that prompts the user via a callback. Takes two or
 three parameters, the first is the callback subroutine, the 2nd is the number
 of retries to allow, the 3rd is optionally a pool.  The subroutine gets called
-with the following parameters.  A svn_auth_cred_username object, a realm
+with the following parameters.  A svn_auth_cred_username_t object, a realm
 string, a default username, may_save, and a pool.  The svn_auth_cred_username
 has the following members: username and may_save.
 
 =item SVN::Client::get_ssl_server_trust_file_provider
 
-Returns a server trust provider that returns infromation from previously
+Returns a server trust provider that returns information from previously
 cached sessions.  Takes no parameters or optionally a pool parameter.
 
 =item SVN::Client::get_ssl_server_trust_prompt_provider
@@ -367,27 +1118,28 @@
 Returns a server trust  provider that prompts the user via a callback. Takes
 one or two parameters the callback subroutine and optionally a pool parameter.
 The subroutine gets called with the following parameters.  A
-svn_auth_cred_ssl_server_trust object, a realm string, an integer specifiying
-how the certificate failed authentication, a cert info object, may_save, and a
-pool.  The svn_auth_cred_ssl_server_trust object has the following members:
-may_save and accepted_failures.  The svn_ssl_cert_info object has the following
-members (and behaves just like cred objects though you can't modify it):
-hostname, fingerprint, valid_from, valid_until, issuer_dname, ascii_cert.
+svn_auth_cred_ssl_server_trust_t object, a realm string, an integer specifiying
+how the certificate failed authentication, a svn_auth_ssl_server_cert_info_t
+object, may_save, and a pool.  The svn_auth_cred_ssl_server_trust_t object has
+the following members: may_save and accepted_failures.  The
+svn_auth_ssl_server_cert_info_t object has the following members (and behaves
+just like cred objects though you can't modify it): hostname, fingerprint,
+valid_from, valid_until, issuer_dname, ascii_cert.
 
-The masks used for determaning the failures are in SVN::_Core and are named:
+The masks used for determining the failures are in SVN::Auth::SSL and are named:
 
-$SVN::_Core::SVN_AUTH_SSL_NOTYETVALID
-$SVN::_Core::SVN_AUTH_SSL_EXPIRED
-$SVN::_Core::SVN_AUTH_SSL_CNMISMATCH
-$SVN::_Core::SVN_AUTH_SSL_UNKNOWNCA
-$SVN::_Core::SVN_AUTH_SSL_OTHER
+$SVN::Auth::SSL::NOTYETVALID
+$SVN::Auth::SSL::EXPIRED
+$SVN::Auth::SSL::CNMISMATCH
+$SVN::Auth::SSL::UNKNOWNCA
+$SVN::Auth::SSL::OTHER
 
 You reply by setting the accepted_failures of the cred object with an integer 
 of the values for what you want to accept bitwise anded together.
 
 =item SVN::Client::get_ssl_cert_file_provider
 
-Returns a client certificate provider that returns infromation from previously
+Returns a client certificate provider that returns information from previously
 cached sessions.  Takes no parameters or optionally a pool parameter.
 
 =item SVN::Client::get_ssl_cert_prompt_provider
@@ -408,7 +1160,7 @@
 
 =item SVN::Client::get_ssl_cert_pw_prompt_provider
 
-Returns a client certificate passowrd provider that prompts the user via a
+Returns a client certificate password provider that prompts the user via a
 callback. Takes two or three parameters, the first is the callback subroutine,
 the 2nd is the number of retries to allow, the 3rd is optionally a pool
 parameter.  The subroutine gets called with the following parameters.  A
@@ -416,35 +1168,123 @@
 The svn_auth_cred_ssl_client_cert_pw has the following members: password and
 may_save.
 
+=back 
+
+=head1 OBJECTS
+
+These are some of the object types that are returned from the methods
+and functions.  Others are documented in L<SVN::Core> and L<SVN::Wc>.
+If an object is not documented it is more than likely opaque and 
+not something you can do anything with, except pass to other functions
+that require such objects.
+
 =cut
 
 package _p_svn_client_commit_info_t;
 use SVN::Base qw(Client svn_client_commit_info_t_);
 
+=head2 svn_client_commit_item_t
+
+=over 8
+
+=item $citem-E<gt>path()
+
+Absolute working-copy path of item.
+
+=item $citem-E<gt>kind()
+
+An integer representing the type of node it is (file/dir).
+Can be one of the following constants:
+$SVN::Node::none
+$SVN::Node::file
+$SVN::Node::dir
+$SVN::Node::unknown
+
+=item $citem-E<gt>url()
+
+Commit URL for this item.
+
+=item $citem-E<gt>revision()
+
+Revision (copyfrom_rev if state_flags has IS_COPY set).
+
+=item $citem-E<gt>copyform_url();
+
+CopyFrom URL
+
+=item $citem-E<gt>state_flags();
+
+One of several state flags:
+$SVN::Client::COMMIT_ITEM_ADD
+$SVN::Client::COMMIT_ITEM_DELETE
+$SVN::Client::COMMIT_ITEM_TEXT_MODS
+$SVN::Client::COMMIT_ITEM_PROP_MODS
+$SVN::Client::COMMIT_ITEM_IS_COPY
+
+=item $citem>wcprop_changes()
+
+A reference to an array of svn_prop_t objects represent changes
+to wc properties.
+
+=back
+
+=cut
+
 package _p_svn_client_commit_item_t;
 use SVN::Base qw(Client svn_client_commit_item_t_);
 
+=head2 svn_client_commit_info_t
+
+=over 4
+
+=item $cinfo-E<gt>revision()
+
+Just commited revision.
+
+=item $cinfo-E<gt>date()
+
+Server-Side date of the commit as a string.
+
+=item $cinfo-E<gt>author()
+
+Author of the commit.
+
+=back
+
+=cut
+
 package _p_svn_client_ctx_t;
 use SVN::Base qw(Client svn_client_ctx_t_);
 
 package _p_svn_client_proplist_item_t;
 use SVN::Base qw(Client svn_client_proplist_item_t_);
 
-=head1 TODO
+=head2 svn_client_proplist_item_t
 
-* Complete documentation 
+=over 8
 
-* Support for the notify callback.
+=item $proplist-E<gt>node_name()
 
-* Support for the log_msg callback.
+The name of the node on which these properties are set.
 
+=item $proplist-E<gt>prop_hash()
+
+A reference to a hash of property names and values.
+
+=back
+
+=head1 TODO
+
 * Better support for the config.
 
-* More unit tests.
+* Unit tests for cleanup, diff, export, merge, move, relocate, resolved 
+and switch.  This may reveal problems for using these methods as I haven't
+tested them yet that require deeper fixes.
 
 =head1 AUTHORS
 
 Chia-liang Kao E<lt>clkao@clkao.orgE<gt>
+
 Ben Reser E<lt>ben@reser.orgE<gt>
 
 =head1 COPYRIGHT
Index: subversion/bindings/swig/apr.i
===================================================================
--- subversion/bindings/swig/apr.i	(revision 8177)
+++ subversion/bindings/swig/apr.i	(working copy)
@@ -85,9 +85,6 @@
 	/* FIXME: What goes here? */
 }
 
-%typemap(perl5,argout) apr_time_t * {
-    /* ### FIXME-perl apr_time_t out */
-}
 /* -----------------------------------------------------------------------
    create some INOUT typemaps for apr_size_t
 */


