tags:

views:

24

answers:

3

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 of 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.

A: 

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.

zellus
Hmm, I don't see how that helps; it works on entire changesets, and I am interested in marking a particular file as do-not-touch.
Jason S
"Instead of 'id.txt', a file called 'id.txt.template' is versioned" -- I do that kind of thing all this time using svn:ignore. That's not the situation in this case; the files in question are not autogenerated.
Jason S
+1  A: 

I think you'd have to exclude it each time, which would be a pain, unless you wanted to use something like SVNMerge.py.

warandpeace
+2  A: 

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.

gbjbaanb
+1: interesting idea of externals. does it have a down side?
Jason S
With externals you either need to specify the wanted revision of the referenced path, or make sure that the referenced path has a stable API. When you don't supply a revision number, svn will check out the HEAD of the referenced path, even when you check out an old revision of your project.
Rudi
also you can forget to check out with the 'get externals' option and so won't get the updated file. Not necessarily a problem if the file never changes :)
gbjbaanb