A Good Way to Limit Merge Costs for the Affiliates Feature in SVN

Can anyone recommend workflow / use patterns that reduce merge cost / complexity when using Agile with SVN?

I know that use- git is the answer, but I'm trying to figure out how to solve my problems, wise where I am, before throwing a new tool into the mix, because I don't have cycles to handle the destruction at the moment.

Recently, we switched from an unstable trunk model with service and stabilization branches from the trunk to a stable trunk with function branches. We have a trunk with old service branches for support and new team branches with branch functions.

The team develops the functions and pushes them to the team branch, and then to the trunk. Sometimes functions are also combined between function branches. We encounter some problems with tree conflicts (especially when the set of changes moves both to the trunk and to another branch of the function).

When we need to move changes to supporting service branches or pull changes from them to the trunk, it is very difficult. Trunk and maintenance drifted quite a bit.

Mergers go our way, and I'm trying to determine if there is any kind of process problem when we shorten the SVN kernel and cause problems. I am looking for the best branch management strategy that reduces your efforts.

Can anyone recommend good articles, strategies or tools?

+4
source share
4 answers

I would recommend:

  • Keep branch functions in sync with the trunk. To make this a common task, it does not take time if you do it every couple of days. When you are ready to drop work in the trunk, make sure it gives a healthy dose of QA and uses the reintegrate merger. Reintegrate requests the svn: mergeinfo property in files and folders to ensure that changes synchronized from the trunk to your property branch are not synchronized backward ("circular" merges).

  • Make sure that you just lean back from the trunk, do not disconnect branches from other branches. We had cases where the COPY-TO property in the renamed file was not tracked when the file was merged. This can cause SVN to not delete everything correctly, and this problem is exacerbated if you have cascading branches.

  • In the past, we had serious problems with svn: mergeinfo: there were errors in the system when it was first introduced, and as a result, it put mergeinfo in almost every file and folder. This caused us more harm than good when merging, it was just confusing, so we decided to clear mergeinfo from each file and folder separately from the root folder of our repository. Then it acts as a good summary of industry activity. If you do this, you won’t get all the possibilities of moving / moving SVN tracking files, but we had so many problems that in the end it turned out that we needed to quickly resolve manually tree conflicts where necessary. Note: this policy is controversial. I do not recommend doing this if you really need it, but it worked for us.

  • Speaking of moving a folder / file, don't go crazy while restructuring your code base. Move files and folders only if it is really necessary, and if you ensure the transfer of changes to your team.

  • The same goes for renaming without renaming things without a good reason. File names in the repository are case sensitive, but Windows files are not case sensitive. Therefore, if you change the file from 'foo.txt' to 'Foo.txt' and then go back to 'foo.txt', during the merge, SVN will try to delete, add, and then add the file again. He thinks this is different, but the file system will complain and exit the merge. These are very unpleasant cases.

  • Following Sander Rijken's remarks: in addition to making sure that you do not have local changes, it is recommended that you regularly delete any unregistered files. If you have a file floating around which a merge attempt to write via SVN may get confused. We have several scenarios for Ruby rubies for such cases.

  • Pay attention to tree conflicts. They are easy to solve if you have merged into small doses. You just need to look at the history of the changes in the file on the code line you are merging with and reapply them manually to the destination. This is the worst case, but if you have the right person responsible for the merger, for example. leadership in this project with an understanding of the work, then they can be resolved relatively quickly.

  • Lastly, make sure you constantly update your SVN clients.

  • Oh yes, and having a good merge tool can make the whole process a lot less painful. I use Araxis, but I heard that the merge tool in SmartSVN is also good.

+3
source

A few things I can think of will help reduce potential conflicts:

  • Make sure your working copy is in the same revision by running svn up in the root of the working copy.
  • Make sure you do not have local changes.
  • Make sure there are no child switches (this happens when you switch the directory inside wc, not wc itself)
  • Make sure the working copy is verified with depth = infinity, i.e. without a sparse working copy.
0
source

Depending on how stand-alone specific functions are, you might consider creating modules for functions and including them (possibly binding a specific revision) using svn:externals . It depends on how code / design is suitable for this kind of modulation.

0
source

SVN was not specifically designed for a workflow with a branch function, which you can probably tell right now. If you're going to get close to this, try Git or another DVCS and everything will be much better for you. It is worth the investment switching.

0
source

All Articles