You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ramoj Paruchuri <ra...@gmail.com> on 2004/10/12 21:37:52 UTC

svn rm

$svn rm <file>

Problem: if the file is not on the database it removes the local copy
too. Is there anyway to get back that file?

If a file is not in the repository -- it should say that it didnt find
it or atleast should rm the local file.

Thanks,

--Ramoj

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

Re: svn rm

Posted by Michael W Thelen <th...@cs.utah.edu>.
Dave Neary wrote:
> I was guessing that perhaps svn add followed by svn rm (without a ci) 
> would cause the problem, but I just tested.
> 
> $ touch test
> $ svn add test
> A         test
> 
> $ svn rm test
> svn: Use --force to override this restriction
> svn: 'test' has local modifications
> 
> $ svn revert test
> Reverted 'test'
> 
> $ ls
> test
> $
> 
> However, if I svn rm --force test at step 2, not only does test get 
> removed from versioning, it also gets removed from my sandbox. In this 
> particular case (where there has never been a copy of the file 
> committed), perhaps svn rm (even with --force) should not delete the 
> local copy. That said, you should use svn revert to roll-back an add 
> (this is a difference with cvs, where to roll back a cvs add, you did a 
> cvs rm).

In this scenario, I think the "has local modifications" message, coupled 
with the need to use the --force flag, should be plenty of warning that 
the file is really going to go away.  I don't think Subversion needs to 
provide any further protection.  The philosophy is to never lose local 
changes without the user explicitly authorizing it, and in this case I 
think using the --force flag is the authorization.  It generally means 
"I know what I'm doing, stop protecting me and just do it".

-- 
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams

Re: svn rm

Posted by Michael W Thelen <th...@cs.utah.edu>.
Dave Neary wrote:
> I was guessing that perhaps svn add followed by svn rm (without a ci) 
> would cause the problem, but I just tested.
> 
> $ touch test
> $ svn add test
> A         test
> 
> $ svn rm test
> svn: Use --force to override this restriction
> svn: 'test' has local modifications
> 
> $ svn revert test
> Reverted 'test'
> 
> $ ls
> test
> $
> 
> However, if I svn rm --force test at step 2, not only does test get 
> removed from versioning, it also gets removed from my sandbox. In this 
> particular case (where there has never been a copy of the file 
> committed), perhaps svn rm (even with --force) should not delete the 
> local copy. That said, you should use svn revert to roll-back an add 
> (this is a difference with cvs, where to roll back a cvs add, you did a 
> cvs rm).

In this scenario, I think the "has local modifications" message, coupled 
with the need to use the --force flag, should be plenty of warning that 
the file is really going to go away.  I don't think Subversion needs to 
provide any further protection.  The philosophy is to never lose local 
changes without the user explicitly authorizing it, and in this case I 
think using the --force flag is the authorization.  It generally means 
"I know what I'm doing, stop protecting me and just do it".

-- 
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams

Re: svn rm

Posted by Dave Neary <da...@phenix.fr>.
Hi Ben,

Ben Collins-Sussman wrote:
> On Oct 12, 2004, at 5:37 PM, Ramoj Paruchuri wrote:
>> $svn rm <file>
>>
>> Problem: if the file is not on the database it removes the local copy
>> too. Is there anyway to get back that file?
> 
> What are you talking about?  'svn' will never destroy unversioned files.

I was guessing that perhaps svn add followed by svn rm (without a ci) 
would cause the problem, but I just tested.

$ touch test
$ svn add test
A         test

$ svn rm test
svn: Use --force to override this restriction
svn: 'test' has local modifications

$ svn revert test
Reverted 'test'

$ ls
test
$

However, if I svn rm --force test at step 2, not only does test get 
removed from versioning, it also gets removed from my sandbox. In this 
particular case (where there has never been a copy of the file 
committed), perhaps svn rm (even with --force) should not delete the 
local copy. That said, you should use svn revert to roll-back an add 
(this is a difference with cvs, where to roll back a cvs add, you did a 
cvs rm).

Cheers,
Dave.

-- 
David Neary
Phenix Engineering
110 ave Jean Jaures, 69007 Lyon

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

Re: svn rm

Posted by Dave Neary <da...@phenix.fr>.
Hi Ben,

Ben Collins-Sussman wrote:
> On Oct 12, 2004, at 5:37 PM, Ramoj Paruchuri wrote:
>> $svn rm <file>
>>
>> Problem: if the file is not on the database it removes the local copy
>> too. Is there anyway to get back that file?
> 
> What are you talking about?  'svn' will never destroy unversioned files.

I was guessing that perhaps svn add followed by svn rm (without a ci) 
would cause the problem, but I just tested.

$ touch test
$ svn add test
A         test

$ svn rm test
svn: Use --force to override this restriction
svn: 'test' has local modifications

$ svn revert test
Reverted 'test'

$ ls
test
$

However, if I svn rm --force test at step 2, not only does test get 
removed from versioning, it also gets removed from my sandbox. In this 
particular case (where there has never been a copy of the file 
committed), perhaps svn rm (even with --force) should not delete the 
local copy. That said, you should use svn revert to roll-back an add 
(this is a difference with cvs, where to roll back a cvs add, you did a 
cvs rm).

Cheers,
Dave.

-- 
David Neary
Phenix Engineering
110 ave Jean Jaures, 69007 Lyon

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

Re: svn rm

Posted by Ramoj Paruchuri <ra...@gmail.com>.
If I remember correctly --

$svn add <file>

$svn rm <file>
should fail as its not been into DB yet. now, 

$svn rm --force <file> 
should remove the lock (perhaps tag or whatever...) it has on the file
and make it a free file.

I was rm'ing some files yesterday (with --force option) and
accidentally got one of my local files which has not been added. In
either case I think it is safe that svn rm --force should only act on
the files in the repository and not on the local files.

--Ramoj
PS: Thanks guys!


On Wed, 13 Oct 2004 09:15:54 -0400, Ben Collins-Sussman
<su...@collab.net> wrote:
> Please reply to the list, not me personally.
> 
> 
> On Oct 12, 2004, at 9:42 PM, Ramoj Paruchuri wrote:
> 
> > Yeah I think I was using a --force option. But in either case why is
> > svn deleting files that are local and not in the repository.
> 
> Because you're passing the --force option.  'svn rm' won't destroy
> unversioned data, unless you pass that option.  "--force" means
> "destroy the file no matter what."
> 
> 


-- 
Ramoj Paruchuri
Mobile:+1(512)789-2019

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

Re: svn rm

Posted by Ben Collins-Sussman <su...@collab.net>.
Please reply to the list, not me personally.


On Oct 12, 2004, at 9:42 PM, Ramoj Paruchuri wrote:

> Yeah I think I was using a --force option. But in either case why is
> svn deleting files that are local and not in the repository.

Because you're passing the --force option.  'svn rm' won't destroy 
unversioned data, unless you pass that option.  "--force" means 
"destroy the file no matter what."


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

Re: svn rm

Posted by Ben Collins-Sussman <su...@collab.net>.
On Oct 12, 2004, at 5:37 PM, Ramoj Paruchuri wrote:

> $svn rm <file>
>
> Problem: if the file is not on the database it removes the local copy
> too. Is there anyway to get back that file?
>

What are you talking about?  'svn' will never destroy unversioned files.

For example, I have an unversioned file 'ktrace.out' in my working copy:

$ svn st
?      ktrace.out

$ svn rm ktrace.out
subversion/clients/cmdline/delete-cmd.c:48: (apr_err=200005)
svn: Use --force to override this restriction
subversion/libsvn_client/delete.c:65: (apr_err=200005)
svn: 'ktrace.out' is not under version control

$ svn st
?      ktrace.out


Show us an example of what you're worried about.


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

Re: svn rm

Posted by Ben Collins-Sussman <su...@collab.net>.
On Oct 12, 2004, at 5:37 PM, Ramoj Paruchuri wrote:

> $svn rm <file>
>
> Problem: if the file is not on the database it removes the local copy
> too. Is there anyway to get back that file?
>

What are you talking about?  'svn' will never destroy unversioned files.

For example, I have an unversioned file 'ktrace.out' in my working copy:

$ svn st
?      ktrace.out

$ svn rm ktrace.out
subversion/clients/cmdline/delete-cmd.c:48: (apr_err=200005)
svn: Use --force to override this restriction
subversion/libsvn_client/delete.c:65: (apr_err=200005)
svn: 'ktrace.out' is not under version control

$ svn st
?      ktrace.out


Show us an example of what you're worried about.


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