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

Unshelving through the new WC editor API

From: Julian Foad <julianfoad_at_apache.org>
Date: Mon, 14 Jan 2019 16:58:03 +0000

I'm starting to re-implement "unshelve" using the new WC editor API. Here's what "unshelve" looks like now:

for each node-change found by shelf_status_walk(shelf-storage):
  if it's "delete": call svn_wc_delete4(path,...)
  if it's "modify": wc_file_merge(path,...)
  etc.

What I'll want to do now is drive a WC-mods-editor with the changes found:

for each node-change found in shelf-storage:
  drive wc_editor so as to "walk" from last visited path to this path
  switch (mod-kind):
    case "delete": call wc_editor->delete(...)
    case "modify": call wc_editor->apply_textdelta(...)
    etc.

I could write that code manually but it's a re-usable pattern. We already have a walker that takes a static list of paths to visit:
  svn_delta_path_driver2(editor, ... paths, ... callback)

We should have a similar walker that takes the paths to visit one at a time, performing one "step" for each one. That would make writing this code easier.

I'll augment svn_delta_path_driver2() to support one-step-at-a-time walking.

-- 
- Julian
Received on 2019-01-14 17:58:11 CET

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.