[RFC] Incremental svn_delta_path_driver

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[RFC] Incremental svn_delta_path_driver

Julian Foad-5
Does the attached patch look reasonable? It provides an incremental version of the existing svn_delta_path_driver2() function, in which the caller can provide one path at a time instead of all at once at the start.

We have a few (5 ~ 10) uses of svn_delta_path_driver2() in our codebase and I think a few more places already where an incremental path driver could be used if it existed, in addition to me now wanting to use it in "unshelve" as I mentioned the other day. I will try doing that, and, if/when working usefully, will commit it, along with any changes suggested here.

It already works as a factored-out body of svn_delta_path_driver2(): tests pass with this patch applied.

In svn_delta_path_driver2() there is some special handling of the root path, which we probably want to include in the incremental driver too; I just haven't got around to studying and deciding on that part yet.

--
- Julian

delta-path-driver-incr-1.patch (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [RFC] Incremental svn_delta_path_driver

Julian Foad-5
Julian Foad wrote on 2019-01-16:
> Does the attached patch look reasonable? It provides an incremental
> version of the existing svn_delta_path_driver2() function, in which the
> caller can provide one path at a time instead of all at once at the
> start.

It's now committed and debugged:

* svn_delta_path_driver_start
* svn_delta_path_driver_step -- drives the editor to a new path
* svn_delta_path_driver_finish

And the all-at-once path driver is slightly upgraded: the new version svn_delta_path_driver3() passes the 'editor' and 'edit_baton' to the callback, which makes most implementations a bit simpler.

> We have a few (5 ~ 10) uses of svn_delta_path_driver2() in our codebase
> and I think a few more places already where an incremental path driver
> could be used if it existed, in addition to me now wanting to use it in
> "unshelve"

Only used in "unshelve", so far, and I might soon replace that with something else for Shelving v3, but I'm sure it will be useful anyway.

--
- Julian