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

proposed editor interface change

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2001-04-19 18:30:44 CEST

Problem to Solve
----------------

We'd like the command-line client to respect multiple "targets".
Specifically, the command:

  svn commit dir1 dir2 dir3

should produce an *atomic* commit, and the command

  svn update dir1 dir2 dir3

should update the target dirs in *that* specific order.

Original Solution
-----------------

An editor allows only one call to replace_root(), thus our
editor-drivers must somehow drive a "meta" tree delta that encompasses
all the targets.

(1) The commit-editor-driver (svn_wc_crawl_local_mods) will call
    replace_root() on the "common parent" of dir1, dir2, dir3. It
    will call replace_dir() repeatedly until it finds one of the
    target dirs, then search for local mods. Then it will pop back up
    the tree, call replace_dir() some more, until it finds another
    target dir. Repeat until all target dirs have been found and
    reported.

(2) The update-editor-driver (svn_repos_dir_delta) will follow very
    much the same logic...

  ** But wait: it needs to report the targets in a *specific* order,
  as requested by the user. (This isn't necessary for commits, since
  the commits are atomic.) It's very, very tricky to write a variant
  of algorithm (1) which reports changes in a specific order --
  especially while trying to guarantee depth-first opening and closing
  of directories!

Options
-------

A. Find the tricky algorithm and implement.

B. Punt till post-1.0; just have the command-line client open a new
    network session for each target dir. (So 'svn up 1 2 3' becomes
    *exactly* the same as 'svn up 1; svn up 2; svn up 3'). Lots of
    network turnaround, ick ick.

C. Change the editor interface.

Ben, Mike, and Karl are pushing for option C. We'd like to make the
editor allow multiple calls to replace_root(). Specifically, the
editor driver would do this:

    get_editor()

    replace_root(dir1)
       ...
    close_dir(dir1)

    replace_root(dir2)
       ...
    close_dir(dir2)

    replace_root(dir3)
       ...
    close_dir(dir3)

    close_edit()

We all know that this has been discussed before, but we can't remember
the objections, or if any still apply. Here's what we *do* know:

 * it would make life *very* easy for the commit-driver and
   update-driver to work with multiple targets. No fancy tree
   searching needed.

 * this is a relatively small change. All of our existing editors
   don't seem to have any assumptions about replace_root() being
   called once. We forsee only a few tweaks needed.

Comments? Let's hear them!
Received on Sat Oct 21 14:36:29 2006

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.