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

Re: Rename in Subversion

From: Andy Levy <andy.levy_at_gmail.com>
Date: 2007-12-20 14:18:39 CET

On Dec 20, 2007 7:52 AM, John Peacock <john.peacock@havurah-software.org> wrote:
> Srilakshmanan, Lakshman wrote:
> > When I did a rename of a file and committed it, I found the original
> > file was still available.
>
> Then you did something wrong.
>
> > Further investigation revealed that a rename is treated as two
> > operation, first operation deletes the file while the second operation
> > copies a new file from the original file. Even though it's two
> > operations, the object id remains the same hence considered as "true
> > rename".
>
> That is correct, but the Subversion client (or TortoiseSVN in this case) treats
> it as an atomic operation. The fact that two things are performed in sequence
> is an implementation detail only; at some point, Subversion will support true
> renames. In the commandline client, 'svn rename oldname newname' will in fact
> physically rename the file in the working copy (so the oldname will no longer
> appear), while in the background actually schedule a delete plus an add with
> history.
>
> > The issue is that when you rename a file and commit the renamed file, the ***
> > original file *** delete operation is not performed and therefore that file
> > is still available and appears to be under a ** different ** object ID. How
> > do I know ? a log of the original file does not traverse the tree.
>
> Here's where you lost me. If you are using TortoiseSVN, you right click on the
> file and _from the TortoiseSVN submenu_ choose Rename (or Move, I don't have it
> in front of me). You do NOT use the normal Windows "Rename" command.
>
> I'm pretty confident this is driver error, but because of the vagueness of your
> description, I can't figure out what you actually did

I think what he did was this:

Rename the file using TSVN->Rename (or svn rename)
Right-click the file (with the new name, of course)
Commit

What he *should have* done was right-click the directory and commit
*that*, with only the filenames involved in the rename checked. As it
is, he only committed the Add of the new file (with history), and not
the Delete of the old file.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Dec 20 14:32:21 2007

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

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