svn: merging while maintaining variants between branches
Is there a way to tell SVN when it is merging, that one or more files are special and should not be merged?
I am dealing with a couple o开发者_Python百科f build trees which need different unique IDs to distinguish them, and every time we re-merge files, it is a pain to maintain those IDs.
You can exclude the files from the merge or you can merge the whole lot then revert the files before committing.
Possibly the best solution is to use externals - put the non-merge files elsewhere in your tree, and use the externals property to pull the specific file into your WC when you checkout. The files will not be part of the merge then.
I think you'd have to exclude it each time, which would be a pain, unless you wanted to use something like SVNMerge.py.
The section Blocking Changes gives an overview of the methods available to prevent given revision from merging.
EDIT: To my understanding subversion is all about revisions. In contrast to well known DVCS it does not track content or change sets. In order to close the gap between tracking a file in subversion, but not tracking deployment/working copy changes, the following approach might be feasible.
Instead of 'id.txt', a file called 'id.txt.template' is versioned. As part of the deployment process, 'id.txt' is generated, while being part of svn:ignore
.
精彩评论