4

I have a configuration file in my project which needs to be in the repository (so new developers get it when they checkout the project). Each developer might change some values in the file locally - these changes should not be committed and I don't want them showing in the synchronization menu (I'm using eclipse and subversive if it matters).

Note that I can't just set the svn:ignore property since it only works on files that aren't under version control - but I do want to keep a base version of the file in the repository. How can I avoid the file showing in synchronization without deleting it from repository?

EDIT: A better description - what I actually need is to be able to set a "read-only" property on the config file, so it can't be changed in the repository as long as the property is on. Do you know anything like this?

Thanks

Alex
  • 953
  • 13
  • 31

5 Answers5

3

I do this by having a base version of the file checked-in as foo.base, and svn lock this so that it's read-only on checkout. Then have each developer copy this file to their own personal foo file, which is ignored by svn-ignore.

xorsyst
  • 6,152
  • 5
  • 32
  • 53
2

You can't ignore files which are already under version control. The only way to ignore such files is first delete those files do a commit and after that change the svn:ignore property and do a second commit. If you like to have a kind of Base-Version use a template which has a different name.

khmarbaise
  • 81,692
  • 23
  • 160
  • 199
  • Can you give the exact reference for that nice comment ? – khmarbaise Mar 19 '12 at 09:58
  • That means as i expected that you say that i only need a single commit for that instead of two which is correct. Never the less you can't ignore an already commited file. – khmarbaise Mar 19 '12 at 10:14
  • Quote for you, if you can't see difference "The *secret is to make sure it's on the ignore list* **before** *you commit the delete*. If you do it **in that order**, the delete won't propagate to others' working copies." – Lazy Badger Mar 19 '12 at 10:21
  • Based on the OP questions it was already under version control. In other word in the repository. So the only thing which you can say is to save a single commit. Really nice. – khmarbaise Mar 19 '12 at 10:54
1
  • You can version template under different name

OR

Community
  • 1
  • 1
Lazy Badger
  • 87,730
  • 7
  • 72
  • 97
  • propedit - you mean set it to ignore? And it will still be in ignore mode after committing it? Either I didn't really understand this or something doesn't sound right – Alex Mar 19 '12 at 10:07
0

once u check out, u can lock it, and once it is locked, others will not be able to commit(make changes to svn) that file. see image below enter image description here

shams.haq
  • 650
  • 1
  • 6
  • 18
  • We actually have locks now, but I still get it in synchronization window every time until I (probably accidentally) forget to do "Remove from view" and it will get committed as part of some unrelated changeset – Alex Mar 19 '12 at 10:05
0

My solution is that a compile time script creates a copy from the original template file if it does not exist. This copy can be put on the ignore list. I feel that locking a file for this purpose abuses the locking feature (it was not created for this).

MrTJ
  • 12,760
  • 4
  • 35
  • 61