> -----Original Message-----
> From: news [mailto:email@example.com]On Behalf Of Duncan Booth
> Sent: Tuesday, 13 November 2007 9:30 PM
> To: firstname.lastname@example.org
> Subject: Re: SVN Copy when directory exists
> John Peacock <email@example.com> wrote:
> > No, actually that is exactly how it works under *nix (at
> least, don't
> > have Windows handy to check).
> Windows behaves pretty much as Daniel expected SVN to behave:
> COPY sourcedir target
> If target exists copies all files in sourcedir into target. If target
> does not exist you get an error message. (Whereas
> XCOPY sourcedir target
> copies all files in sourcedir into target. If target does not
> exist it
> is created first.
> Both approaches have advantages and disadvantages, but they
> are mutually
> inconsistent. SVN has chosen to be self-consistent across platforms
> while not being consistent with the copy command on individual
> Note that while Unix 'cp' accepts multiple source paths for a single
> destination, Windows COPY/XCOPY only have a single source
> path which may
> include wildcard characters. This would make the windows behaviour
> almost impossible to implement successfully on Unix where the shell
> expands wildcards.
> >> E.g.
> >> > svn copy trunk branches/branch_name
> >> A branches\branch_name
> >> > svn copy trunk branches/directory_exists
> >> A branches\directory_exists\trunk
> > What did you expect this to do? Did you expect that it
> would replace
> > the contents of the previous branch? If so, the sequence is simply
> > $ svn delete branches/directory_exists
> > $ svn copy trunk branches/directory_exists
> > and you are good to go.
> An alternative, albeit longer sequence to make a branch exactly match
> the trunk is:
> svn switch wc branchurl/directory_exists
> svn merge branchurl/directory_exists trunkurl wc
> svn commit -m 'Brought branch in line with trunk' wc
> svn switch wc trunkurl
> which has the advantage of keeping the branch history intact.
> It is a pity though that there is no single command to create
> a branch
> or tag, and either fail if it already exists or (with
> --force) overwrite
> it but keeping the history.
The problem came about as we were trying to create a branch at branches/1.0/devel, which would be a copy of trunk. We tried to do it in one step, but of course the 1.0 directory did not exist. As an aside, I seem to remember some talk, maybe on the -dev list, about a create-parent switch, but I think that might be in 1.5.
I guess an error would have been useful, but it was more my mistake that caused the confusion in the first place.
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Wed Nov 14 00:00:33 2007