开发者

How to merge working copy into Base revision in subversion

EDIT my issue had nothing to do with SVN itself (see my answer below)

I'm using Tortoise SVN. I have a file that several developers are working on, including me.

I updated before I started working on the file, but another developer made changes to the file and committed. I updated my local (which, if I understand right, makes my local Working Base copy of the file match the Head revision in the repo). When I do a diff, TortoiseMerge shows me the changes made by the other developer in the Working Base copy, and my changes in the Working Copy.

What I want to do is have my changes and the other dev's changes merged. I understand that if we edited the same line I may get a conflict and am happy to merge manually at that开发者_如何学Go point. But I would like to be able to have svn do the automatic merging of both sets of changes without either set getting clobbered.

Last time this happened I just committed, expecting it to merge on the way in, but my changes clobbered the other dev's. Suggestions? Settings? Lack of understanding svn on my part (entirely possible)?


If both of you are using same branch, you can merge other developer's change (say revision 99)

svn merge -r 98:99 dir/filename


Subversion doesn't merge when you commit. It merges when you update.

If the other developer has made changes to the same file as you have, when you'll try to commit, Subversion will refuse and tell you to update first. You will then update, and subversion will try to merge the other dev's changes into your working copy. If there is a conflict, it will tell you. Else, your working copy will simply contain both sets of changes. You will then commit the file, and both sets of changes will thus be stored in the repo.


Sorry for the bogus question.

I figured out what it was. I'm using Eclipse and I must have saved over the top instead of refreshing from disk before committing. So my local working copy was being updated correctly, I was just clobbering it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜