Alireza Fattahi
Alireza Fattahi

Reputation: 45663

SVN merge trunk in different branches with switch

Consider a product with five customers. The product configuration files change product UI and some behavior changes for each customer.

The version is controlled by SVN.

The development is done on the trunk, when release is ready a branch is created for every customer and product is tagged, and the development will keep on trunk for next release.

We commit to branch if a serious bug happens or when we want to update a feature to a customer sooner.

Now consider we have developed a new feature.

  1. We commit the new feature to trunk.
  2. We do an SVN checkout from branchA.
  3. Merge the revision (which has the features in it) from trunk to branchA.
  4. Commit branchA.
  5. We switch workspace to path branchB
  6. Do the same merge here.
  7. Try to commit to branch and .... I get the error which says, already merged the branch please test it.

I can solve it by getting a fresh checkout for branchB I can merge again.

It seems that he problem is with switch command, but I don't know why !!

Any comments ?

Upvotes: 1

Views: 341

Answers (1)

bta
bta

Reputation: 45087

The error message "already merged the branch please test it" is not a standard Subversion error message. That sounds like something that your repository's administrator set up as part of a test done by a pre-commit hook script. You should talk to your administrator and find out what specific tests that script is doing, and what is causing it to return that particular error message. For all we know, this could be a bug in the hook script and not with your process.

Hook script aside, here is some general advice for investigating things from your end:

I recommend looking at this one step at a time. After the 'switch' in step 5, do a svn diff between your working copy and the repository URL for branch B. They should be completely identical at this point. If they aren't, then your 'switch' didn't work as expected (if you're using externals, you may need to do an 'update' after the 'switch'). A similar option would be to check out a fresh copy of branch B into a new folder, and then compare the fresh branch B with your switched working copy (comparing file contents, folder tree, and subversion metadata).

After the merge in step 6, run svn diff > after_merge.diff. Also run svn diff svn://your_repo_url/your_path -c revision_number > incoming_merge.diff. Compare these two files and make sure that they are identical. Any difference between them could indicate that the merge didn't complete successfully or that the branch is out of sync.

Upvotes: 1

Related Questions