You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ar...@apache.org on 2010/08/07 14:31:50 UTC

svn commit: r983222 - /subversion/trunk/subversion/svnrdump/load_editor.c

Author: artagnon
Date: Sat Aug  7 12:31:50 2010
New Revision: 983222

URL: http://svn.apache.org/viewvc?rev=983222&view=rev
Log:
svnrdump: Fix a bug in the load_editor; it was unable to handle
revisions without node information previously.

* subversion/svnrdump/load_editor.c
  (close_revision): Add a new if-branch; if the commit_editor doesn't
  exist, create one, open_root and close_edit on it to indicate that
  we've finished processing the revision. While at it, also fix
  indentation.

Modified:
    subversion/trunk/subversion/svnrdump/load_editor.c

Modified: subversion/trunk/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.c?rev=983222&r1=983221&r2=983222&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/load_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/load_editor.c Sat Aug  7 12:31:50 2010
@@ -434,26 +434,43 @@ close_revision(void *baton)
   struct revision_baton *rb;
   const svn_delta_editor_t *commit_editor;
   void *commit_edit_baton;
+  void *child_baton;
   rb = baton;
 
   commit_editor = rb->pb->commit_editor;
   commit_edit_baton = rb->pb->commit_edit_baton;
 
-  /* r0 doesn't have a corresponding commit_editor; we fake it */
+  /* Fake revision 0 */
   if (rb->rev == 0)
     SVN_ERR(svn_cmdline_printf(rb->pool, "* Loaded revision 0\n"));
-  else {
-    /* Close all pending open directories, and then close the edit
-       session itself */
-    while (rb->db && rb->db->parent)
-      {
-        LDR_DBG(("Closing dir %p\n", rb->db->baton));
-        SVN_ERR(commit_editor->close_directory(rb->db->baton, rb->pool));
-        rb->db = rb->db->parent;
-      }
-    LDR_DBG(("Closing edit on %p\n", commit_edit_baton));
-    SVN_ERR(commit_editor->close_edit(commit_edit_baton, rb->pool));
-  }
+  else if (commit_editor)
+    {
+      /* Close all pending open directories, and then close the edit
+         session itself */
+      while (rb->db && rb->db->parent)
+        {
+          LDR_DBG(("Closing dir %p\n", rb->db->baton));
+          SVN_ERR(commit_editor->close_directory(rb->db->baton, rb->pool));
+          rb->db = rb->db->parent;
+        }
+      LDR_DBG(("Closing edit on %p\n", commit_edit_baton));
+      SVN_ERR(commit_editor->close_edit(commit_edit_baton, rb->pool));
+    }
+  else
+    {
+      /* Legitimate revision with no node information */
+      SVN_ERR(svn_ra_get_commit_editor3(rb->pb->session, &commit_editor,
+                                        &commit_edit_baton, rb->revprop_table,
+                                        commit_callback, NULL, NULL, FALSE,
+                                        rb->pool));
+
+      SVN_ERR(commit_editor->open_root(commit_edit_baton, rb->rev - 1,
+                                       rb->pool, &child_baton));
+
+      LDR_DBG(("Opened root %p\n", child_baton));
+      LDR_DBG(("Closing edit on %p\n", commit_edit_baton));
+      SVN_ERR(commit_editor->close_edit(commit_edit_baton, rb->pool));
+    }
 
   /* svn_fs_commit_txn rewrites the datestamp/ author property-
      rewrite it by hand after closing the commit_editor. */



Re: svn commit: r983222 - /subversion/trunk/subversion/svnrdump/load_editor.c

Posted by Branko Čibej <br...@xbc.nu>.
On 07.08.2010 16:32, Ramkumar Ramachandra wrote:
> Hi Daniel,
>
> Daniel Shahaf writes:
>   
>> artagnon@apache.org wrote on Sat, Aug 07, 2010 at 12:31:50 -0000:
>>     
>>> Author: artagnon
>>> Date: Sat Aug  7 12:31:50 2010
>>> New Revision: 983222
>>>
>>> URL: http://svn.apache.org/viewvc?rev=983222&view=rev
>>> Log:
>>> svnrdump: Fix a bug in the load_editor; it was unable to handle
>>> revisions without node information previously.
>>>
>>> * subversion/svnrdump/load_editor.c
>>>   (close_revision): Add a new if-branch; if the commit_editor doesn't
>>>   exist, create one, open_root and close_edit on it to indicate that
>>>   we've finished processing the revision. While at it, also fix indentation.
>>>       
>>                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> I take it you haven't seen my previous commit review yet?
>>     
> The trade-off is the creation of many trivial commits :)
>   

We do have a long-standing preference to not mix functional and
stylistic changes in the same commit. It's even documented in Hacking.

-- Brane

Re: svn commit: r983222 - /subversion/trunk/subversion/svnrdump/load_editor.c

Posted by Ramkumar Ramachandra <ar...@gmail.com>.
Hi Daniel,

Daniel Shahaf writes:
> artagnon@apache.org wrote on Sat, Aug 07, 2010 at 12:31:50 -0000:
> > Author: artagnon
> > Date: Sat Aug  7 12:31:50 2010
> > New Revision: 983222
> > 
> > URL: http://svn.apache.org/viewvc?rev=983222&view=rev
> > Log:
> > svnrdump: Fix a bug in the load_editor; it was unable to handle
> > revisions without node information previously.
> > 
> > * subversion/svnrdump/load_editor.c
> >   (close_revision): Add a new if-branch; if the commit_editor doesn't
> >   exist, create one, open_root and close_edit on it to indicate that
> >   we've finished processing the revision. While at it, also fix indentation.
>                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> I take it you haven't seen my previous commit review yet?

The trade-off is the creation of many trivial commits :)

-- Ram

Re: svn commit: r983222 - /subversion/trunk/subversion/svnrdump/load_editor.c

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
artagnon@apache.org wrote on Sat, Aug 07, 2010 at 12:31:50 -0000:
> Author: artagnon
> Date: Sat Aug  7 12:31:50 2010
> New Revision: 983222
> 
> URL: http://svn.apache.org/viewvc?rev=983222&view=rev
> Log:
> svnrdump: Fix a bug in the load_editor; it was unable to handle
> revisions without node information previously.
> 
> * subversion/svnrdump/load_editor.c
>   (close_revision): Add a new if-branch; if the commit_editor doesn't
>   exist, create one, open_root and close_edit on it to indicate that
>   we've finished processing the revision. While at it, also fix indentation.
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I take it you haven't seen my previous commit review yet?

> 
> Modified:
>     subversion/trunk/subversion/svnrdump/load_editor.c
> 
> Modified: subversion/trunk/subversion/svnrdump/load_editor.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.c?rev=983222&r1=983221&r2=983222&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svnrdump/load_editor.c (original)
> +++ subversion/trunk/subversion/svnrdump/load_editor.c Sat Aug  7 12:31:50 2010
> @@ -434,26 +434,43 @@ close_revision(void *baton)
> -  else {
> -    /* Close all pending open directories, and then close the edit
> -       session itself */
> -    while (rb->db && rb->db->parent)
> -      {
> -        LDR_DBG(("Closing dir %p\n", rb->db->baton));
> -        SVN_ERR(commit_editor->close_directory(rb->db->baton, rb->pool));
> -        rb->db = rb->db->parent;
> -      }
> -    LDR_DBG(("Closing edit on %p\n", commit_edit_baton));
> -    SVN_ERR(commit_editor->close_edit(commit_edit_baton, rb->pool));
> -  }
> +  else if (commit_editor)
> +    {
> +      /* Close all pending open directories, and then close the edit
> +         session itself */
> +      while (rb->db && rb->db->parent)
> +        {
> +          LDR_DBG(("Closing dir %p\n", rb->db->baton));
> +          SVN_ERR(commit_editor->close_directory(rb->db->baton, rb->pool));
> +          rb->db = rb->db->parent;
> +        }
> +      LDR_DBG(("Closing edit on %p\n", commit_edit_baton));
> +      SVN_ERR(commit_editor->close_edit(commit_edit_baton, rb->pool));
> +    }