Re: [AD] Subversion

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Elias Pschernig wrote:
I'm thinking of the situation where the 4.2.0 branch has a file called
src/something.c but in the new_api_branch it's been moved to
src/module/something.c.  I would like if changes to one could be merged
into the other, even though they no longer have the same path.

Yes, I think it will work. E.g. if the rename in the new branch is in
revision 100, then you change something in revision 105. Now if you
merge back with -r 99:105 into the old branch, it will rename the file.
If you merge back with -r 100:105, it only will merge back the changes
inside the file, not the rename.

I would like to mention that Subversion does not (yet) support *true* renames. This means that "svn rename A B" is in fact just a shortcut for "svn copy A B; svn delete A". This preserves history, and most of the time works OK, but there are subtle side effects, and not all svn commands are rename-aware.

Here is an example, that I got from some subversion doc, although I don't remember which:

 * revision 100: branch is created from trunk
 * revision 101: trunk/a.txt is edited
 * revision 102: branch/a.txt is renamed to branch/b.txt

If you try to merge revision 101 from "trunk" to "branch", svn will complain that branch/a.txt does not exist. This works if you explicitely merge from "trunk/a.txt" to "branch/b.txt", but this isn't exactly convenient if there are more than 1 file modified in revision 101.

If you try to merge revision 102 from branch to trunk, then trunk/a.txt will be replaced by branch/b.txt, undoing the modifications from revision 101 ! This is because revision 102 contains a copy and a delete rather than a rename.

The result is that renames and merges don't mix too well... But even with that, Subversion is still *much* better than CVS :-) You just need to be aware of this limitation.

There are a few issues open in Subversion's issue tracker with more details, and discussions on the implementation of true renames.

--
Julien Cugnière




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/