[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: ra_svn problem with abort_report

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-10-12 17:28:30 CEST

Philip Martin <philip@codematters.co.uk> writes:

> Was my original idea correct? Is svn_repos_finish_report responsible
> for deleting the transactions if an error occurs driving the update
> editor?

This also solves the dangling txns problem, and it works over all RA
layers. From the comment I changed it appears that the original
behaviour was intentional, so is my change correct?

 
Index: subversion/libsvn_repos/reporter.c
===================================================================
--- subversion/libsvn_repos/reporter.c (revision 7386)
+++ subversion/libsvn_repos/reporter.c (working copy)
@@ -446,6 +446,7 @@
   svn_fs_root_t *root1, *root2;
   svn_repos_report_baton_t *rbaton = report_baton;
   const char *tgt_path;
+ svn_error_t *err1, *err2 = SVN_NO_ERROR, *err3 = SVN_NO_ERROR;
 
   /* If nothing was described, then we have an error */
   if (! SVN_IS_VALID_REVNUM (rbaton->txn_base_rev))
@@ -481,26 +482,37 @@
                                    NULL);
 
   /* Drive the update-editor. */
- SVN_ERR (svn_repos_dir_delta (root1,
- rbaton->base_path,
- rbaton->target,
- root2,
- tgt_path,
- rbaton->update_editor,
- rbaton->update_edit_baton,
- rbaton->text_deltas,
- rbaton->recurse,
- TRUE,
- rbaton->ignore_ancestry,
- rbaton->pool));
+ err1 = svn_repos_dir_delta (root1,
+ rbaton->base_path,
+ rbaton->target,
+ root2,
+ tgt_path,
+ rbaton->update_editor,
+ rbaton->update_edit_baton,
+ rbaton->text_deltas,
+ rbaton->recurse,
+ TRUE,
+ rbaton->ignore_ancestry,
+ rbaton->pool);
   
- /* Still here? Great! Throw out the transactions. */
+ /* Throw out the transactions. */
   if (rbaton->txn)
- SVN_ERR (svn_fs_abort_txn (rbaton->txn));
+ err2 = svn_fs_abort_txn (rbaton->txn);
   if (rbaton->txn2)
- SVN_ERR (svn_fs_abort_txn (rbaton->txn2));
-
- return SVN_NO_ERROR;
+ err3 = svn_fs_abort_txn (rbaton->txn2);
+
+ if (err1)
+ {
+ svn_error_clear (err3);
+ svn_error_clear (err2);
+ return err1;
+ }
+ if (err2)
+ {
+ svn_error_clear (err3);
+ return err2;
+ }
+ return err3;
 }
 
 

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Oct 12 17:29:15 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.