svn rm --keep-local silently deletes unversioned files

View: New views
2 Messages — Rating Filter:   Alert me  

svn rm --keep-local silently deletes unversioned files

by Hrvoje Nikšić-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In svn 1.5.4 svn rm deletes unversioned files even when --keep-local
is specified.  This is undocumented and leads to nasty surprises—for
example, a user may type `svn rm --keep-local *' in a directory to
unversion all files, retaining them for his own use.  What happens
instead is that versioned files are unversioned, and unversioned files
are deleted without question.

If this is the intended behavior, it should be clearly documented.
The current documentation claims:

Items specified by PATH are scheduled for deletion upon the next
commit. Files (and directories that have not been committed) are
immediately removed from the working copy unless the --keep-local
option is given. The command will not remove any unversioned or
modified items; use the --force option to override this behavior.

# in a working copy
$ touch foo
$ svn st foo
?      foo
$ svn rm --keep-local foo
$ ls foo
ls: cannot access foo: No such file or directory

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2414340

To unsubscribe from this discussion, e-mail: [users-unsubscribe@...].

Re: svn rm --keep-local silently deletes unversioned files

by Daniel Shahaf-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hrvoje Nikšić wrote on Wed, 4 Nov 2009 at 10:10 +0100:
> In svn 1.5.4 svn rm deletes unversioned files even when --keep-local
> is specified. [...]
>
> If this is the intended behavior, it should be clearly documented.

It's not intended.

> # in a working copy
> $ touch foo
> $ svn st foo
> ?      foo
> $ svn rm --keep-local foo
> $ ls foo
> ls: cannot access foo: No such file or directory
>

I can't reproduce this with trunk:

[[[
% svn --version -q
1.7.0-dev-r40229

% echo > iota2

% svn rm --keep-local iota2

% svn add iota2
A         iota2

%
]]]

Thanks for the report.

Daniel

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2414396

To unsubscribe from this discussion, e-mail: [users-unsubscribe@...].