You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/09/17 12:07:49 UTC
svn commit: r1703550 -
/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
Author: julianfoad
Date: Thu Sep 17 10:07:48 2015
New Revision: 1703550
URL: http://svn.apache.org/r1703550
Log:
On the 'move-tracking-2' branch: Fix some crashes in 'svnmover commit'.
* subversion/svnmover/svnmover.c
(wc_commit): Don't modify the passed-in revprops hash, especially not
leaving local scratch-pool data in it.
(do_commit): Always check out a new WC, as we have closed the editor
and so won't be able to close it again.
(execute): Always refresh the local copy of the WC editor pointer after
calling do_commit.
Modified:
subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c?rev=1703550&r1=1703549&r2=1703550&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Thu Sep 17 10:07:48 2015
@@ -480,6 +480,9 @@ wc_commit(svn_revnum_t *new_rev_p,
/* If no log msg provided, use the list of commands */
if (! svn_hash_gets(revprops, SVN_PROP_REVISION_LOG) && wc->list_of_commands)
{
+ /* Avoid modifying the passed-in revprops hash */
+ revprops = apr_hash_copy(scratch_pool, revprops);
+
svn_hash_sets(revprops, SVN_PROP_REVISION_LOG,
svn_string_create(wc->list_of_commands, scratch_pool));
}
@@ -2709,12 +2712,11 @@ do_commit(svn_revnum_t *new_rev_p,
/* Commit */
SVN_ERR(wc_commit(&new_rev, wc, revprops, scratch_pool));
- /* Check out a new WC if a commit was performed */
- if (SVN_IS_VALID_REVNUM(new_rev))
- {
- SVN_ERR(wc_checkout(wc, new_rev, wc->working->branch_id,
- scratch_pool));
- }
+ /* Check out a new WC.
+ (Instead, we could perhaps just get a new WC editor.) */
+ SVN_ERR(wc_checkout(wc, SVN_IS_VALID_REVNUM(new_rev) ? new_rev
+ : wc->base->revision,
+ wc->working->branch_id, scratch_pool));
if (new_rev_p)
*new_rev_p = new_rev;
@@ -3336,11 +3338,8 @@ execute(svnmover_wc_t *wc,
svn_revnum_t new_rev;
SVN_ERR(do_commit(&new_rev, wc, revprops, iterpool));
- if (SVN_IS_VALID_REVNUM(new_rev))
- {
- editor = wc->editor;
- }
- else
+ editor = wc->editor;
+ if (! SVN_IS_VALID_REVNUM(new_rev))
{
notify_v("There are no changes to commit.");
}