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/11/17 16:51:59 UTC

svn commit: r1714814 - /subversion/trunk/tools/dev/svnmover/svnmover.c

Author: julianfoad
Date: Tue Nov 17 15:51:59 2015
New Revision: 1714814

URL: http://svn.apache.org/viewvc?rev=1714814&view=rev
Log:
In 'svnmover', don't do so much work towards preparing a commit when
there are no changes to commit.

* tools/dev/svnmover/svnmover.c
  (wc_commit): Return early when there are no changes to commit.

Modified:
    subversion/trunk/tools/dev/svnmover/svnmover.c

Modified: subversion/trunk/tools/dev/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/svnmover/svnmover.c?rev=1714814&r1=1714813&r2=1714814&view=diff
==============================================================================
--- subversion/trunk/tools/dev/svnmover/svnmover.c (original)
+++ subversion/trunk/tools/dev/svnmover/svnmover.c Tue Nov 17 15:51:59 2015
@@ -685,6 +685,16 @@ wc_commit(svn_revnum_t *new_rev_p,
   const char *edit_root_branch_id;
   svn_branch__state_t *edit_root_branch;
 
+  SVN_ERR(txn_is_changed(wc->working->branch->txn, &change_detected,
+                         scratch_pool));
+  if (! change_detected)
+    {
+      wc->list_of_commands = NULL;
+      if (new_rev_p)
+        *new_rev_p = SVN_INVALID_REVNUM;
+      return SVN_NO_ERROR;
+    }
+
   /* If no log msg provided, use the list of commands */
   if (! svn_hash_gets(revprops, SVN_PROP_REVISION_LOG) && wc->list_of_commands)
     {
@@ -745,27 +755,17 @@ wc_commit(svn_revnum_t *new_rev_p,
                  wc->base->branch,
                  wc->working->branch,
                  scratch_pool));
-  SVN_ERR(txn_is_changed(commit_txn, &change_detected,
-                         scratch_pool));
-  if (change_detected)
-    {
-      ccbb.edit_txn = commit_txn;
-      ccbb.wc_base_branch_id = wc->base->branch->bid;
-      ccbb.wc_commit_branch_id = edit_root_branch_id;
 
-      SVN_ERR(svn_branch__txn_complete(commit_txn, scratch_pool));
-      SVN_ERR(display_diff_of_commit(&ccbb, scratch_pool));
-
-      wc->head_revision = ccbb.revision;
-      if (new_rev_p)
-        *new_rev_p = ccbb.revision;
-    }
-  else
-    {
-      SVN_ERR(svn_branch__txn_abort(commit_txn, scratch_pool));
-      if (new_rev_p)
-        *new_rev_p = SVN_INVALID_REVNUM;
-    }
+  ccbb.edit_txn = commit_txn;
+  ccbb.wc_base_branch_id = wc->base->branch->bid;
+  ccbb.wc_commit_branch_id = edit_root_branch_id;
+
+  SVN_ERR(svn_branch__txn_complete(commit_txn, scratch_pool));
+  SVN_ERR(display_diff_of_commit(&ccbb, scratch_pool));
+
+  wc->head_revision = ccbb.revision;
+  if (new_rev_p)
+    *new_rev_p = ccbb.revision;
 
   wc->list_of_commands = NULL;