They are different in Subversion because the first operation retains the
history of the moved file, whereas the second adds a new file with no
history.
So in the first case, if there's been four years of development on the
moved file, with comments relating bug-fixes to other records (e.g. bug
id's) or giving explanations as to why a particular code change
happened, developers can still read all of this by running "svn log" on
the moved file.
In 3 months time, you don't have to manually remember that this file was
copied and where from, as Subversion will log the move.
History also helps merging determine what should and should not be
merged when you update information between branches.
This is often important (it certainly is for the project I currently
work on)
In the second case, it's a brand new file as far as Subversion is
concerned. If you're just setting up a new component of a project, or
for some other reason are unconcerned about Subversion's history of the
file, then this operation may be for you.
See the Subversion book for why history is important, e.g. Ch 3
"Examining History"
Cheers,
Rob Swarbrick
-----Original Message-----
From: Gavin Lambert [mailto:gavinl@compacsort.com]
Sent: 04 November 2005 05:47
To: users@subversion.tigris.org
Subject: Replacing files with move
Say I've got two versioned files, "file" and "file2". If I then execute
the following:
svn rm file
svn mv file2 file
svn commit
... I get an error stating that I have to commit the delete first. I
don't want to commit the delete first, as it would put the repository in
an unsafe state.
By contrast, if the replacement file isn't already versioned (so now we
have "file" in SVN and "file2" not in SVN):
svn rm file
mv file2 file
svn add file
svn commit
... and this all works fine, and it correctly recognises that the new
"file" is a replacement of the old "file" and not a modification to it.
This seems inconsistent to me. Shouldn't the first one work just like
the second?
---------------------------------------------------------------------
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
Received on Fri Nov 4 09:06:43 2005