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

Re: RA existence check?

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2001-11-21 23:59:13 CET

"Bill Tutt" <rassilon@lyra.org> writes:

> You want to be careful when you use this kind of check, esp. from a
> ra_dav POV. You're usually much better off documenting, and checking
> against a remote non-existence error than having an additional round
> trip just to give a prettier error message.

But in Mike's case, I'm not sure there's anything we can do.

I mean, suppose the user types:

   % svn cp A/mu http://foo/bar/baz

We've decided that this command causes an immediate commit of local
file 'mu' to the repository. That means that the commit-editor needs
to be driven in a specific way.

But how do we drive the editor?

  - If baz is a directory, then we want to

          open_dir(bar)
          open_dir(baz)
          add_file(mu)
          apply_txdelta(contents of mu)

  - If baz does not exist, then we want to

          open_dir(bar)
          add_file(baz)
          apply_txdelta(contents of mu)

  - If baz is already a file, then we either want to overwrite it, or
    possibly return an error.

          open_dir(bar)
          open_file(baz)
          appl_txdelta(contents of mu)

So really, I don't know how we can avoid doing an extra network 'stat'
of baz on the server; the answer completely determines how we should
drive the editor.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:49 2006

This is an archived mail posted to the Subversion Dev mailing list.