Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Automatic merge SVN branch

Table of Contents

Method 1

Yes , it is possible , and there is an open source project that does it!

check out https://github.com/liveperson/Auto-Merger

we are constantly working with it and it saves so much time and helps avoiding all those missed merges bugs.

Method 2

Run these commands at the root of a working copy of tests-passed whenever you have determined that a new trunk revision has passed the tests:

svn update
svn merge http://example.com/svn/myproject/trunk -r 0:<somerev>
svn commit -m "merged trunk revisions up to <somerev> into tests-passed"

Whenever you use the merge command, SVN will record the merges in the svn:mergeinfo property. So the above command should automatically determine which revisions in the range 0: are eligible for merging, excluding any merges that have already been done.

Like you said in a comment, conflicts are not expected. But sometimes I’ve seen unexpected conflicts occur anyway when merging a range of SVN revisions containing renames. To get rid of these conflicts, you can use the –accept theirs-full option with the merge command to always accept the trunk state.

Method 3

  • If you merge from trunk to branch (in branch’s WC) order of parameters in mergeinfo is incorrect (reversed): shortened correct form have to be svn mergeinfo –show-revs eligible trunk (first parameter is SOURCE of merge, second – TARGET /default “.”/, i.e your WC)
  • If you use Subversion, which has already support for mergeinfo, you can skip detecting range of “have to be merged” revisions – Subversion do it automagically on merge
  • If you want in case of conflict always prefer changes from trunk, you can add it to merge command. As final result, your periodical sync-merge process will be single command inside WC of branch
svn merge <URL-OF-TRUNK> --accept "theirs-conflict"
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x