You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Andrew Arnott <an...@gmail.com> on 2004/10/30 01:16:07 UTC

How to rename an added (not committed) file

Hey, I've run into this problem repeatedly, and I'm asking you
experienced SVN users how to overcome it.  I add a file, then realize
that the name doesn't fit very well.  I haven't committed my changes
yet.  But SVN makes it difficult to rename the file unless I commit
first, which seems like a waste: why commit something you know is
wrong?

Consider this console, done within a working copy: 

andrew@ynot:/tmp/wc> touch torename
andrew@ynot:/tmp/wc> svn add torename
A         torename
andrew@ynot:/tmp/wc> svn mv torename torename2
svn: Use --force to override this restriction
svn: Move will not be attempted unless forced
svn: 'torename' has local modifications
andrew@ynot:/tmp/wc> mv torename torename3
andrew@ynot:/tmp/wc> ls
another  somedir  some file  torename3
andrew@ynot:/tmp/wc> svn st
?      torename3
!      torename
andrew@ynot:/tmp/wc>

How to overcome this without commiting or reverting first?  Commit
saves a mistake, and revert erases the file, or maybe not---i'm not
sure on that point.

Any help would be greatly appreciated!

-- 
Andrew Arnott
Web Developer
Brigham Young University

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How to rename an added (not committed) file

Posted by Christian Lescuyer <cl...@goelette.net>.
Hi,

> Thanks everybody, for all those suggestions.  These solve my problem. 
> I think then in the TortoiseSVN environment (which is what I use
> typically), I just need to Revert or Delete before performing the
> rename, and I should be alright.

I seem to remember that Tortoise Delete will actually delete the file. I 
suggest copying it to the new name beforehand, then deleting.

Xtian


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: How to rename an added (not committed) file

Posted by Andrew Arnott <an...@gmail.com>.
Thanks everybody, for all those suggestions.  These solve my problem. 
I think then in the TortoiseSVN environment (which is what I use
typically), I just need to Revert or Delete before performing the
rename, and I should be alright.

On Sat, 30 Oct 2004 13:32:37 +0900, Hyuns Kim <sn...@gmail.com> wrote:
> You can use 'revert' command.
> 
> % svn add test.txt
> A test.txt
> 
> % mv test.txt test2.txt
> 
> % svn status
> ? test2.txt
> ! test.txt
> 
> % svn revert test.txt
> Reverted 'test.txt'
> 
> % svn add test2.txt
> A test2.txt
> 
> ;-)
> 
> On Fri, 29 Oct 2004 22:47:18 -0400, James FitzGibbon
> 
> 
> <jf...@primustel.ca> wrote:
> > On Oct 29, 2004, at 9:16 PM, Andrew Arnott wrote:
> >
> > > Hey, I've run into this problem repeatedly, and I'm asking you
> > > experienced SVN users how to overcome it.  I add a file, then realize
> > > that the name doesn't fit very well.  I haven't committed my changes
> > > yet.  But SVN makes it difficult to rename the file unless I commit
> > > first, which seems like a waste: why commit something you know is
> > > wrong?
> >
> > I use this sequence:
> >
> > [expn:james] ~/perl (5) % svn add foo
> > A         foo
> > [expn:james] ~/perl (6) % mv foo bar
> > [expn:james] ~/perl (8) % svn del foo
> > D         foo
> > [expn:james] ~/perl (9) % svn add bar
> > A         bar
> > [expn:james] ~/perl (10) % svn stat
> > A      bar
> > [expn:james] ~/perl (11) %
> >
> > Because the pending add is cancelled out before the commit, the
> > existence
> > of foo is never reflected in the repo.
> >
> > Regards.
> >
> > --
> > j.
> >
> > ----------------------------------------------------------------------------
> > This electronic message contains information from Primus Telecommunications
> > Canada Inc. ("PRIMUS") , which may be legally privileged and confidential.
> > The information is intended to be for the use of the individual(s) or entity
> > named above. If you are not the intended recipient, be aware that any
> > disclosure, copying, distribution or use of the contents of this information
> > is prohibited. If you have received this electronic message in error, please
> > notify us by telephone or e-mail (to the number or address above)
> > immediately. Any views, opinions or advice expressed in this electronic
> > message are not necessarily the views, opinions or advice of PRIMUS.
> > It is the responsibility of the recipient to ensure that
> > any attachments are virus free and PRIMUS bears no responsibility
> > for any loss or damage arising in any way from the use
> > thereof.The term "PRIMUS" includes its affiliates.
> > ----------------------------------------------------------------------------
> > Pour la version en français de ce message, veuillez voir
> > http://www.primustel.ca/fr/legal/cs.htm
> > ----------------------------------------------------------------------------
> >
> >
> >
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> >
> >
> 


-- 
Andrew Arnott
Web Developer
Brigham Young University

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: How to rename an added (not committed) file

Posted by Hyuns Kim <sn...@gmail.com>.
You can use 'revert' command.

% svn add test.txt
A test.txt

% mv test.txt test2.txt

% svn status
? test2.txt
! test.txt

% svn revert test.txt
Reverted 'test.txt'

% svn add test2.txt
A test2.txt

;-)

On Fri, 29 Oct 2004 22:47:18 -0400, James FitzGibbon
<jf...@primustel.ca> wrote:
> On Oct 29, 2004, at 9:16 PM, Andrew Arnott wrote:
> 
> > Hey, I've run into this problem repeatedly, and I'm asking you
> > experienced SVN users how to overcome it.  I add a file, then realize
> > that the name doesn't fit very well.  I haven't committed my changes
> > yet.  But SVN makes it difficult to rename the file unless I commit
> > first, which seems like a waste: why commit something you know is
> > wrong?
> 
> I use this sequence:
> 
> [expn:james] ~/perl (5) % svn add foo
> A         foo
> [expn:james] ~/perl (6) % mv foo bar
> [expn:james] ~/perl (8) % svn del foo
> D         foo
> [expn:james] ~/perl (9) % svn add bar
> A         bar
> [expn:james] ~/perl (10) % svn stat
> A      bar
> [expn:james] ~/perl (11) %
> 
> Because the pending add is cancelled out before the commit, the
> existence
> of foo is never reflected in the repo.
> 
> Regards.
> 
> --
> j.
> 
> ----------------------------------------------------------------------------
> This electronic message contains information from Primus Telecommunications
> Canada Inc. ("PRIMUS") , which may be legally privileged and confidential.
> The information is intended to be for the use of the individual(s) or entity
> named above. If you are not the intended recipient, be aware that any
> disclosure, copying, distribution or use of the contents of this information
> is prohibited. If you have received this electronic message in error, please
> notify us by telephone or e-mail (to the number or address above)
> immediately. Any views, opinions or advice expressed in this electronic
> message are not necessarily the views, opinions or advice of PRIMUS.
> It is the responsibility of the recipient to ensure that
> any attachments are virus free and PRIMUS bears no responsibility
> for any loss or damage arising in any way from the use
> thereof.The term "PRIMUS" includes its affiliates.
> ----------------------------------------------------------------------------
> Pour la version en français de ce message, veuillez voir
> http://www.primustel.ca/fr/legal/cs.htm
> ----------------------------------------------------------------------------
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: How to rename an added (not committed) file

Posted by James FitzGibbon <jf...@primustel.ca>.
On Oct 29, 2004, at 9:16 PM, Andrew Arnott wrote:

> Hey, I've run into this problem repeatedly, and I'm asking you
> experienced SVN users how to overcome it.  I add a file, then realize
> that the name doesn't fit very well.  I haven't committed my changes
> yet.  But SVN makes it difficult to rename the file unless I commit
> first, which seems like a waste: why commit something you know is
> wrong?

I use this sequence:

[expn:james] ~/perl (5) % svn add foo
A         foo
[expn:james] ~/perl (6) % mv foo bar
[expn:james] ~/perl (8) % svn del foo
D         foo
[expn:james] ~/perl (9) % svn add bar
A         bar
[expn:james] ~/perl (10) % svn stat
A      bar
[expn:james] ~/perl (11) %

Because the pending add is cancelled out before the commit, the 
existence
of foo is never reflected in the repo.

Regards.

-- 
j.




----------------------------------------------------------------------------
This electronic message contains information from Primus Telecommunications
Canada Inc. ("PRIMUS") , which may be legally privileged and confidential.
The information is intended to be for the use of the individual(s) or entity
named above. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents of this information
is prohibited. If you have received this electronic message in error, please
notify us by telephone or e-mail (to the number or address above)
immediately. Any views, opinions or advice expressed in this electronic
message are not necessarily the views, opinions or advice of PRIMUS.
It is the responsibility of the recipient to ensure that
any attachments are virus free and PRIMUS bears no responsibility
for any loss or damage arising in any way from the use
thereof.The term "PRIMUS" includes its affiliates.
----------------------------------------------------------------------------
Pour la version en fran�ais de ce message, veuillez voir
 http://www.primustel.ca/fr/legal/cs.htm
----------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org