开发者

Is it possible to Merge trunk and branch without pulling the source using Tortoise SVN?

I have recent source in branch containing some features. I want to merge them to the trunk source.

1) I cannot pull the source locally. Because, I have to merge nearly for 30+ sources in different different locations.

2) I cannot delete the trunk source location and move the branch sources using the Copy To option.

So, I just 开发者_如何转开发want to merge sources by providing the Source and Target locations alone without pulling the source locally. Or Is there any automated way available?

I saw lot of post in SO related to this. None of them address, the context what I'm looking for.


I don't think this is possible, but that's a good thing. Do you really want a mindless, automated merge of all these sources (finished with a commit)? The point of merging in a local copy is so you can sanity check it all, and resolve all the conflicts you'll get if you have changes in the same place in multiple branches....


As pointed out in this tortoise svn article

... merging always takes place within a working copy.

You might use svn merge --accept theirs-full URL1 URL2 WCPATH in order to resolve all conflicts with the version from a given URL.

Sources deleted with svn delete will still be part of the history.


No, what you're asking is not possible. Merging takes place in your working copy. There are several reasons why this it is a good idea to keep it this way:

  • Conflicts may appear and must be dealt with.
  • Users usually build and test before committing new code, and should do so after merging as well.
  • If the merge fails or if you do something stupid, you haven't messed up anything until you actually commit.

If you have to merge 30+ sources, you're best choice is to automate things using the command line client. This is how I would do it (in bash, you'll have to translate it to .bat or whatever you're comfortable with):

REPOS= \
    http://... \
    http://...

for f in REPO; do
    svn co REPO/target      
    svn merge REPO/source target
    svn commit -m "Merged target into source" target
    rm -r target
done

Tips:

  • Use svn help <command> to see how to invoke each of the svn commands.
  • Use svn merge --dry-run without svn commit first, to make sure you can do the merge without any conflicts (svn commit will fail unless you resolve the conflicts first).
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜