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

Re: copy-planz.txt

From: <cmpilato_at_collab.net>
Date: 2001-11-19 16:13:47 CET

Greg Stein <gstein@lyra.org> writes:

> I think a move to a URL should be illegal.

Fine.

> A copy from a URL to a working copy seems okay (but only under the semantics
> of the next option). But a move doesn't.

Fine. This and the above case both seemed like twisted operations
nobody would seriously want to perform anyway.

> > * Case IV - SRC is repository URL, DST is repository URL:
> >
> > This is a freaky special commit drive, where we operate purely on
> > our ability to split paths up into components, and then "crawl"
> > those trees based purely on the layout of those path components.
> > Actually, for copies this is pretty much a four-line commit:
> >
> > e->replace_root (dst)
> > e->add_(file/dir) (dst_basename, copyfrom=src)
> > e->close_dir
> > e->close_edit
> >
> > The part that requires all the path component attention is if this
> > is a move, because we have make sure to anchor the edit at the
> > longest common ancestor of SRC and DST so we can delete SRC as part
> > of the same transaction as our addition of DST.
>
> As mentioned in the other note, I don't think you even do a "crawl" or
> "drive" for this, but you simply call those editor functions manually on the
> editors. Very straight-forward.

For a copy, yes, it is just this simple. For a move, this is not the
case. As an example:

   `svn move http://server/repo/experimental/my_work http://server/repo/trunk`

We'll assume that trunk exists, so we are creating a new directory in
trunk called my_work.

The proper editor commands for this operation are:

   e->replace_root (http://server/repo)
     e->replace_dir (trunk)
       e->add_dir (my_work, copyfrom=http://server/repo/experimental/my_work)
       e->close_dir ()
     e->close_dir ()
     e->replace_dir (experimental)
       e->delete_entry (my_work)
     e->close_dir ()
   e->close_dir ()
   e->close_edit ()

Were this just a copy, we would have only done:

   e->replace_root (http://server/repo/trunk)
     e->add_dir (my_work, copyfrom=http://server/repo/experimental/my_work)
     e->close_dir ()
   e->close_dir ()
   e->close_edit ()

Note the different anchor points, different drive depths, etc. Sure,
I don't have to "crawl" in the sense that I'm digging around through
dirents and such, but editor semantics need to be obeyed regardless,
and that will require a programmatic approach to move operations in
the repository. Not that the above is difficult to figure out at all,
just extra code. If we disallow moves in cases II and III, then we've
knocked out all the areas of concern that I had for this work in
progress.

---------------------------------------------------------------------
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.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.