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

Re: svn copy/remove issue

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2003-09-10 21:36:54 CEST

"Yanghui Bian" <ybi@vitesse.com> writes:

> svn copy turned out a very weird result: The removed file re-appared.

There's no bug here; you're just getting confused about directory
versioning.

> $ svn co http://p1033295/repos/svndata/repos_tmp/trunk/projects/
>
> $ cd projects/
>
> $ mkdir test1
>
> $ cd test1/
>
> $ touch t1.txt
>
> $ touch t2.txt
>
> $ cd ..
>
> $ svn add test1
>
> $ svn commit

Okay, so now revison N contains 'test1' with two files in it.

>
> $ cd test1/
>
> $ svn rm t2.txt
>
> $ svn commit
>

And now revision N+1 contains 'test1' with only a single file in it.

But notice: you never updated. So your working copy of 'test' is
still at revision N.

> $ cd ..
>
> # For I failed to use svn rename, so I try to work around it.
>
> # copy the working directory first then remove the original one.
>
> $ svn status
>
> $ svn cp test1 test2
>
> $ svn commit

'test2' is now a copy of 'test1' at revision *N*, not N+1. Because
that's what you copied.

>
> $ svn rm test1
>
> $ svn commit
>
> Log message unchanged or not specified
>
> a)bort, c)ontinue, e)dit
>
> c
>
> Deleting test1
>
> svn: Item is out-of-date.
> svn: Commit failed (details follow):

That's correct. One of our rules of directory versioning is that you
cannot delete an item (either file or dir) which is out-of-date. The
latest version of 'test1' is N+1, but you're trying to delete version
N from your working copy.

>
> $ cd ..
>
> $ mv projects/ ppp
>
> $ svn co http://p1033295/repos/svndata/repos_tmp/trunk/projects/
>
> A projects\test1
>
> A projects\test1\t1.txt
>
> A projects\test2
>
> A projects\test2\t1.txt
>
> A projects\test2\t2.txt
>
> Checked out revision 18.

Exactly what I would expect.
'test2' is a copy of 'test1' at revision N.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 10 21:37:48 2003

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.