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

Re: Q about the delta editor interface

From: Greg Stein <gstein_at_gmail.com>
Date: Mon, 16 Feb 2009 11:29:36 +0100

On Mon, Feb 16, 2009 at 10:55, Stephen Butler <sbutler_at_elego.de> wrote:
> Quoting Philipp Marek <philipp.marek_at_emerion.com>:
>
>> On Montag, 16. Februar 2009, Stephen Butler wrote:
>>>
>>> did you try calling open_directory(dir-a,...) after
>>> add_directory(dir-a,...)?
>>
>> No, I didn't .... aren't these exclusive?
>
> The two functions are independent, but not exclusive.

What? Of course they are.

You do:
  open_directory(&baton, ...)
  do_child_stuff(baton)
  close_directory(baton)

or:
  add_directory(&baton, ...)
  do_child_stuff(baton)
  close_directory(baton)

(arguments not exact; just for illustrative reasons)

You use one or the other. They are *not* used together. Each returns a
baton to use for child operations, and that baton should eventually be
passed to close_directory.

> add_directory() simply creates a directory. Before adding children
> or setting properties, call open_directory().

No. add_directory() creates and opens the directory. You do not call
open_directory() *unless* you first call close_directory() on the
baton returned by the open_directory.

>> What should I do with the baton acquired from add_directory()?
>
> Pass it as the child_baton to open_directory(same_path,...), as the

What?! child_baton is an OUT parameter. You can't pass it to open_directory().

> dir_baton to change_dir_prop(), and as the parent_baton to functions
> involving the dir's children.
>
> (Disclaimer: I've written a fair bit of delta-editor consumer code,
> but not driver code.)

Well... we're talking about how the driver calls these things.

>> Wouldn't the duplicate close_directory() (on two batons) make problems?

Yes, it would. Don't do that.

Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1169886
Received on 2009-02-16 11:29:51 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.