Branch merging: Difference between revisions

From Regattadata
m (Protected "Branch merging": Developer page (‎[edit=autoconfirmed] (indefinite) ‎[move=autoconfirmed] (indefinite)))
No edit summary
Line 1: Line 1:
Once you're sure that the code is ready to be folded into the trunk, you need to merge the branch and the trunk.  In order to do this, you need to know what revision the branch started, and what revision the branch is at now.  To find this out, run:
Once you're sure that the code is ready to be folded into the trunk, you need to merge the branch and the trunk.  In order to do this, you need to know what revision the branch started, and what revision the branch is at now.  To find this out, run:


  svn log https://sdsdev.smus.ca/svn/branches/sds/development/(branch_name) | less
  svn log https://secure.gavintech.com/svn/branches/rds/development/(branch_name) | less


Then look for the log entry for the start of the branch (something like "Make a new devel branch for bug 1081, online applications").  That's the '''start revision'''.  The top entry (the latest commit to your branch) is the '''end revision'''.
Then look for the log entry for the start of the branch (something like "Make a new devel branch for bug 34, div layout").  That's the '''start revision'''.  The top entry (the latest commit to your branch) is the '''end revision'''.


Make a new staging branch with the latest trunk code:
Make a new staging branch with the latest trunk code:


  svn cp https://sdsdev.smus.ca/svn/trunk/sds https://sdsdev.smus.ca/svn/branches/sds/staging/(branch_name)
  svn cp https://secure.gavintech.com/svn/trunk/sds https://secure.gavintech.com/svn/branches/rds/staging/(branch_name)


Remember this revision number, as you'll need it as (staging-rev) later.
Remember this revision number, as you'll need it as (staging-rev) later.
Line 13: Line 13:
Switch to the staging branch:
Switch to the staging branch:


  svn switch https://sdsdev.smus.ca/svn/branches/sds/staging/(branch_name)
  svn switch https://secure.gavintech.com/svn/branches/rds/staging/(branch_name)


Then, merge the code from the development branch onto the staging branch:
Then, merge the code from the development branch onto the staging branch:


  svn merge -r start-rev:end-rev https://sdsdev.smus.ca/svn/branches/sds/development/(branch_name)
  svn merge -r start-rev:end-rev https://secure.gavintech.com/svn/branches/rds/development/(branch_name)


This will take all of the changes made in the branch, bundle them up, and apply them to the staging branch.  There may be a couple of conflicts if development happened for a long time, as someone may have modified the trunk at exactly the same line as the branch.  Solve these conflicts (look for the files with the '''C''' beside them while the merge happens), and run:
This will take all of the changes made in the branch, bundle them up, and apply them to the staging branch.  There may be a couple of conflicts if development happened for a long time, as someone may have modified the trunk at exactly the same line as the branch.  Solve these conflicts (look for the files with the '''C''' beside them while the merge happens), and run:
Line 43: Line 43:
Switch to the trunk now:
Switch to the trunk now:


  svn switch https://sdsdev.smus.ca/svn/trunk/sds
  svn switch https://secure.gavintech.com/svn/trunk/rds


Merge the staging branch onto the trunk:
Merge the staging branch onto the trunk:


  svn merge -r (staging-rev):(commit-rev) https://sdsdev.smus.ca/svn/branches/sds/staging/(branch_name)
  svn merge -r (staging-rev):(commit-rev) https://secure.gavintech.com/svn/branches/rds/staging/(branch_name)


Finally, commit it with the same message as used when committing the staging branch: "merged revision '''start-rev''' to '''end-rev''' from branch 1081-online-applications to add online application functionality".
Finally, commit it with the same message as used when committing the staging branch: "merged revision '''start-rev''' to '''end-rev''' from branch 34-div-layout to add <div> layout functionality".


  svn commit
  svn commit

Revision as of 22:17, 20 July 2012

Once you're sure that the code is ready to be folded into the trunk, you need to merge the branch and the trunk. In order to do this, you need to know what revision the branch started, and what revision the branch is at now. To find this out, run:

svn log https://secure.gavintech.com/svn/branches/rds/development/(branch_name) | less

Then look for the log entry for the start of the branch (something like "Make a new devel branch for bug 34, div layout"). That's the start revision. The top entry (the latest commit to your branch) is the end revision.

Make a new staging branch with the latest trunk code:

svn cp https://secure.gavintech.com/svn/trunk/sds https://secure.gavintech.com/svn/branches/rds/staging/(branch_name)

Remember this revision number, as you'll need it as (staging-rev) later.

Switch to the staging branch:

svn switch https://secure.gavintech.com/svn/branches/rds/staging/(branch_name)

Then, merge the code from the development branch onto the staging branch:

svn merge -r start-rev:end-rev https://secure.gavintech.com/svn/branches/rds/development/(branch_name)

This will take all of the changes made in the branch, bundle them up, and apply them to the staging branch. There may be a couple of conflicts if development happened for a long time, as someone may have modified the trunk at exactly the same line as the branch. Solve these conflicts (look for the files with the C beside them while the merge happens), and run:

svn resolved /path/to/file

to mark the file as no longer conflicted.

At this point you probably want to run some smoketests and make sure that the functionality still works as it's supposed to.

Once that's done, you want to svn commit, with a log message that says something like: "merged revision start-rev to end-rev from branch 1081-online-applications to add online application functionality".

svn commit

Now, you need to resolve migration numbering. SVN move the migrations to new numbers that have not yet been used.

svn mv migrations/xxxx-migration migrations/yyyy-migration

SVN commit if you moved any migrations:

svn commit

Remember this revision number (commit-rev), as you'll need it shortly.

Switch to the trunk now:

svn switch https://secure.gavintech.com/svn/trunk/rds

Merge the staging branch onto the trunk:

svn merge -r (staging-rev):(commit-rev) https://secure.gavintech.com/svn/branches/rds/staging/(branch_name)

Finally, commit it with the same message as used when committing the staging branch: "merged revision start-rev to end-rev from branch 34-div-layout to add

layout functionality".
svn commit