tags:

views:

38

answers:

2

Hi there!

I'm currently using SVN for versioning my software projects. On an ongoing project, I have the trunk, for client common features and specifications and branches, for client specific ones.

Is there any way to mark some files / folders that shouldn't be merge into branches each time I perform such operation?

Thanks in advance for the help, Best regards!

+1  A: 

I don't immediately see a solution, but it would be easy enough to script something up. What I give you is not bug tested.

First you would make a list of directories that you would want exclueded. Called ~/.svn-merge-excludes

#regexes to exclude
./helpfiles/
./deploy_scripts/
./models/customer_integration

Then you would write another script to revert those directories in the branch after you merge the turnk into them.

#/usr/bin/bash
# I am assuming that you made the excludes based on the root directory 
# so that relative paths will work
for dir in $(cat ~/.svn-merge-excludes) ; do
    svn revert -R $dir
done

That should work. The big thing here is the '-R' option in the revert acting recursively on the directory. Therefore your workflow will look something like.

# cd path/to/branch
# svn merge -r123:245 svn://svnserver.com/svn/trunk
# revert_excludes_from_branch.sh

Then you would handle the conflicts and then commit. If you are using windows then a batch file would work too, you could just type out the revert commands in series.

flaxeater
+1  A: 

There is an option that you merge virtually meaning that the merge does not alter the files in the target but mark it in the merge tracking props. This way the changes will never occour in the files to be merged, ever!

The feature is called record-only in the command line version.

From link text

The --record-only option works with -r and does exactly what you think it does: it marks a revision as merged (or unmerged, if using the "-" revision number negation syntax), without actually changing anything besides the mergeinfo. For example, this would be useful when someone has hand-edited a file in such a way as to effectively incorporate a change that was already made somewhere else. Rather than have the original change be ported over in the next synchronization merge, thus risking textual conflicts wherever the two versions trivially differ, you can just record the change as already merged. (See the merge-tracking requirements, and Blocking Changes in the Subversion book, for more details.)

schoetbi