Q: SVN How to Merge Branch Twice Our organization is in the process of cleaning up and re-organizing our codebase. We're looking at restructuring our SVN (Subversion) repo to align with our staging and production process.
We have a small team of developers (3 people) that are making changes in the same code files - bug fixes and features. Once the changes are made, they need to be deployed to our staging environment for testing by the product owners. Once those changes are approved in staging, they need to be deployed to production. The problem I've run into with most of the standard feature / staging / production models is that it assumes testing will be done on the feature branches. Since we have varying timelines for testing and only a single testing server, our staging environment will have multiple features being tested at any time. And once one feature is approved it should move to production by itself - not waiting for all the current features to be tested and moved together.
Repo Diagram
The idea I've come up with is to run staging as a permanently separate branch from the production trunk (#2 on the diagram). We branch our features off the staging branch (#4) and merge them back to staging to get them deployed to the staging environment for testing (#8). Once approved, though, we would need to merge that same feature branch to the trunk (#9) - and I'm not sure how to do that or if it's possible.
How can I merge a feature branch to the staging branch and then later merge that same feature branch (by itself) to the trunk?
UPDATE: Thanks to sdanil for the wonderful suggestion. I think this is the right track, but I am getting an error.
I tried this with a simple test. I created a new repo and in the trunk put a text file with "added in trunk" on line 1. I branched that to a staging branch and modified the text file with "added in staging" on line 2. I committed that and then branched staging to feature1. I modified the file in feature1 with "Added Feature 1" on line 3 and checked that in. The merge from Feature1 to staging went exactly as expected. The merge from Feature1 to trunk had conflicts that make no sense. It's acting like line 2 is already present in the trunk, and wants to duplicate lines 1-3 as lines 3-5.
Conflict Screen Shot.

A: When you merge a feature branch to the staging branch, the feature branch remains unchanged. The changes are committed to the staging branch, including svn:mergeinfo property that tracks what is merged to the staging. But for the feature branch itself it is a completely read-only operation.
So nothing should stop you from merging the feature branch to the trunk too.
Have you tried that? Do you experience any errors?
