Protecting files from svn commit

Hey, imagine a simple webapp with log4j.properties that is versioned. I cannot add it to svn:ignore because it is a required file. If I create custom changes for development, and I don’t want to comment on them, I have to make sure that I don’t make mistakes. For one file, it is easy to process, with 3 or more files it becomes creepy.

Is there a way to temporarily disable these files from svn commit? So what makes it easier? I work with svn and subclipse .

+6
version-control svn svnignore subclipse
source share
3 answers

A typical way to handle such situations is to:

  • Make a copy of the file with a name indicating that it is a template
  • Pin template to your repository
  • Ignore source file

This way you will have a new copy, and during deployment you can copy the file from the template to the real file.

Thus, you do not risk making bad changes to this file and, at least for another version control system, you do not risk someone checking the file and forgetting the lock.

There is no way in Subversion to indicate that the file is only-commit-first-time, but when you added it to your repository, you told Subversion to track changes in that file. If you don’t make sure manually (or write a tool or change your tools) to never make changes to this file, Subversion will not help you.

+10
source share

My solution to this problem was to create a new (kind of virtual) user on our svn server and add it to all projects, Locker will call him. Therefore, I set the lock, as a Locker user, in configuration files that should not be changed in the code base.

Et voilà! Files are no longer mistaken, but if the production system needs to be updated with configuration files, locking can be forced for any team member or files can be updated and locked by those who are aware of Lockers credentials!

Perhaps this is not a solution for everyone, some company rules may prohibit the use of proxy users.

+7
source share

The way I do this is, for example, files named log4j.properties.server, and then I set my deployment script to copy .server files instead of the usual ones.

+1
source share

All Articles