开发者

Tools that automate merging of text files?

I have trouble where, for some reason, SVN would only merge the newly generated template code to implemented code (thus overwriting whatever I had done), but not the oth开发者_运维问答er way around.

For example,

1) I generate a file called SomeFile.java. I commit this to trunk. I also branch this to feat1/SomeFile.java

2) I work off of the feat1/SomeFile.java (the branch). Once everything is okay, I simply commit to feat1 branch, and reintegrate to the trunk.

3) Now I need to re-generate the code again (with some changes). What I did before was I committed this to the trunk, then I tried to merge from feat1 branch to trunk. BUT for some reason SVN would not merge the files at all.

Am I doing something wrong?


I think reintegrate is not what you want.

Try a normal merge. In your trunk:

svn merge [url]/feat1


I often do automatic merges. What i do is very low tech. I generate a patch file of the differences then apply them later.

I use a variation of patch tools for windows. I have noticed that windiff, tortoisesvn and just about any diffing tool can apply patch files using command line options.

(probably should close this question as a duplicate of superuser.com post)


I would recommend reading the chapter on Branching and Merging in the SVN book.

From the steps you described it seems to me you are merging multiple times from a branch to the trunk, which might not be a good idea or (as in your case) might not work at all.

Before you reintegrate the branch into the trunk, you should merge from the trunk to the branch. This will ensure that the only difference between the trunk and the branch is the changes you made in the branch. Then you reintegrate the changes from the branch into the trunk. Trunk and branch should now be at the same revision level.

In step 3 it sounds like you make changes to the trunk, commit these changes and then merge from the branch to the trunk again. The changes from the branch have already been merged in step 2 so SVN will not merge again.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜