Search code examples
svnversion-controlmergedelete-filerevisions

SVN merge trunk into branch deleting files


I am trying to do something seemingly simple, yet having problems.

Basically, I have an svn repo, it has a trunk and a branch which was created from revision 122.

I added a file (src/utils/foo.py) to the branch, committed it as revision 128, all good.

However, there have been several commits (namely (123,124,125,126,127) in to the trunk that I'd like in my branch. So I do something like:

$ svn merge -r122:127 ^/projects/my_project/trunk/src/utils .
--- Merging r123 through r127 into '.':
D    foo.py

Whoops! It deleted my file! What am I doing wrong so that this doesn't happen?


Solution

  • It may have more to do with the folder that owns the file, than the file itself. I believe most SCM tools treat folders like files in that they get versioned as well. You might need to go up one level to make sure that the "utils" folder gets merged over also.

    Edit:

    Just to explain a bit more, it is the folder "utils" that records that the file "foo.py" is a child of it, so even if foo.py exists in trunk, without merging the updated utils folder it may not display.