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

Fwd: svn commit: r1331652 - /subversion/trunk/subversion/libsvn_delta/compat.c

From: Greg Stein <gstein_at_gmail.com>
Date: Fri, 27 Apr 2012 21:59:00 -0400

Hyrum,

I think you're going to like this one :-) ... all of the build() and
operation stuff is now gone. Rather than path elements and
intermediate batons manually, I switched the code to rely on the
path_driver. It also shares the change_node structure with the Ev1/Ev2
shim.

In essence, struct change_node records all possible changes to a
single node. Both shims just accumulate those, and at replay time
"does the right thing". Shoot... you could serialize a sequence of
those structures, send them over the wire, and replay them to perform
an edit. Not that we're gonna do that any time soon, but the semantics
are there.

Anyhow... I haven't deleted the old code yet. I want to use some of
that for reference to track down these two new test failures. Then I'm
gonna take a huge axe to compat.c to trim it back. Woot!

Cheers,
-g

---------- Forwarded message ----------
From: <gstein_at_apache.org>
Date: Fri, Apr 27, 2012 at 21:50
Subject: svn commit: r1331652 -
/subversion/trunk/subversion/libsvn_delta/compat.c
To: commits_at_subversion.apache.org

Author: gstein
Date: Sat Apr 28 01:50:35 2012
New Revision: 1331652

URL: http://svn.apache.org/viewvc?rev=1331652&view=rev
Log:
For the Ev2 shims:

Revamp the Ev2/Ev1 shims by using struct change_node rather than the
funky "operation" records and the build() function. Each Ev2 callback
simply inserts a new change_node structure with some values in
it. Later, we use the path_driver to apply these change_node
structures to all modified paths.

This obsoletes huge chunks of code; to be removed in a future revision.

Test failures: log 38, merge 105.

* subversion/libsvn_delta/compat.c:
 (process_actions): remove an incorrect assertion
 (struct editor_baton): add a CHANGES hash
 (insert_change): new helper function, similar to locate_change()
 (add_directory_cb, add_file_cb, add_absent_cb, delete_cb): add code
   blocks for setting up change records
 (add_symlink_cb): #if this whole thing out, and add SVN__NOT_IMPLEMENTED()
 (alter_directory_cb, alter_file_cb): set up change records, noting
   that the record could have been created by an earlier copy/move.
 (copy_cb): set up change records. use the FETCH_KIND_FUNC callback
   to fetch kind information about the source (so we know what Ev1
  function to invoke for the destination)
 (move_cb): set up a change record for the source/deletion side, and
   the destination/copy side. use the FETCH_KIND_FUNC callback.
 (drive_ev1_props): helpful utility function to drive a series of
   single property changes (adds, modifies, deletes) to the Ev1
   editor. this helper also manages the special "unlock" mechanism
 (apply_change): apply all changes described in a change_node
   structure to a specified node
 (drive_changes): if any changes have been made (eg. start_edit_func
   was called an the root baton opened), then prepare a list of paths
   for the path_driver, and then run the sucker to make all the
   necessary edits. we have some special sneakiness to ensure the
   path_driver doesn't call open_root() a second time.
 (complete_cb, abort_cb): use drive_changes() rather than drive_root()
 (start_edit_func): leave a note about early-open of the root
 (do_unlock): record UNLOCK in the change_node. this will be handled
   by drive_ev1_props() later.
 (svn_delta__editor_from_delta): create the new CHANGES hash

[snip]
Received on 2012-04-28 03:59:35 CEST

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.