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

Re: Why --force with mv?

From: Jack O'Quin <joq_at_io.com>
Date: 2004-12-21 06:23:00 CET

Ben Collins-Sussman <sussman@collab.net> writes:

> On Dec 20, 2004, at 6:49 PM, Anthony Shipman wrote:
>> Does this mean that 'svn mv' destroys data or that it's not smart
>> enough to realise that the 'svn cp' part has saved it?
>
> I don't understand the question.
>
> If you run 'svn rm file --force', and the file has local edits, then
> yes, the file is gone forever. The local edits have been destroyed,
> because you used --force.
>
> If you run 'svn cp file file2' before running the 'svn rm --force',
> then the local edits aren't really destroyed, because they still live
> on in file2.
>
> When I say that 'svn mv' == 'svn cp; svn rm', I literally mean it. Go
> look at the code for svn_client_move(). It *really* is exactly the
> same as if you had typed the copy and delete commands instead.
> There's no concept of "move" anywhere in the code. 'svn mv' is purely
> a shortcut, a convenience for users.

I think he's suggesting that since the user has made a copy the
modified working file, nothing really gets lost. So, the `rm' part of
the `mv' operation could probably just assume the --force option in
that case. Conceptually, `svn mv' == `svn cp && svn rm --force'.
Since the copy must succeed before doing the remove, that should be
safe enough (AFAICT).

-- 
  joq
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Dec 21 06:24:17 2004

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.