10

I have a branch in SVN that I want to keep up to date with changes from the trunk. What I would like to do is have a script or something that runs nightly that does this merge and then commits the new version of the branch if there are no merge conflicts but if there are merge conflicts somehow indicate so. I found this post that is somewhat helpful although it doesn't do everything.

I have been unable to find a way to determine whether there are merge conflicts and this is mostly what I'm looking for. Adding building the code and then committing on success will be easy enough in the script but without having a way to check for merge conflicts this won't be successful.

Thanks for any help you guys can provide!

2 Answers 2

10

I had your same exact problem, though I didn't try to automate merge because there were not many branches and I did it manually.

Anyway, the best option looks like using scripts. The script linked in your post doesn't do only the last required action: commit

I often use Linux so, if I was you, I would have used a shell script like the following:

cd /path/to/branch
svn update #just to be sure...
svn merge --non-interactive svn://path/to/trunk
svn commit -m "Automated commit"

A similar command could be used with SVN for windows in a batch script

2
  • That might be a possible solution because the commit should fail if there are conflicts. After thinking about this...if I try to compile prior to committing it should fail if there are merge conflicts. I can then generate a failure message from Cruise Control. Thanks for the help!
    – BryceH
    Commented Dec 28, 2010 at 15:43
  • Actually, you cannot commit if there are unresolved merge conflicts, so the commit will fail, definitely. Still, you might try to use the return value of svn merge or check for conflicts via another command that I don't know, Anyway, I forgot to add the --non-interactive flag to merge, because it would prompt you on what to do in case of conflicts. Commented Dec 28, 2010 at 23:55
0

Have a look at MergeFairy. It will continuously merge and email you on conflicts with instructions on how to resume.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.