1

I am using Doxygen to build documentation from comments in C++ source checked out from a Subversion repo. As part of the build Doxygen is used to build the output file \html\index.html.

I wish to check in a default \html\index.html explaining how to build documentation. Once checked-in I want modifications to this file to be ignored by any commits.

Is there some way to do this using SVN properties so that commits will ignore \html\index.html if it appears modified?

Thanks in advance,

-Ed

albert
  • 8,285
  • 3
  • 19
  • 32
Ed of the Mountain
  • 5,219
  • 4
  • 46
  • 54

2 Answers2

2

I don't think there is any built-in mechanism to tell commit to ignore certain files. As mentioned in SVN: Is there a way to mark a file as "do not commit"? you can use the "ignore-on-commit" changelist if you're using TortoiseSVN, but this does not prevent OTHER people from committing changes unless all of THEM use that changelist also.

One possible solution to your problem though, would be to svn lock that file on the server (without a working copy!) and just never unlock it. This would prevent other people from committing any changes to that file unless they steal the lock.

Obviously if you need to make changes to your template/instructions file you'd then need to steal the lock or break the lock on the server first, and then lock the file again when you're done.

Community
  • 1
  • 1
Ben
  • 8,725
  • 1
  • 30
  • 48
2

You can use a pre-commit hook to mark the file as not committable. People can change the file, but if they try to commit their changes, the commit will be rejected. This is more automatic than using a change list which must not only be done on a user-by-user basis, but also means that you have to do this for every working directory. Somewhere along the line, someone is going to accidentally make a change.

I just happen to have such a pre-commit hook. It is in Perl which is usually available by default on Unix/Linux/Mac, and is freely available for Windows. You simply setup a control file to prevent changes;

[file You do not have the ability to modify this index.html file.]
file = **/html/index.html
access = read-only
users = @ALL

[file Allow yourself to edit this file]
file = **/html/index.html
access = read-write
users = ed

You can also use add-only that will let people create this file, but never edit it. This way, people can create new projects, add this file in, but not edit it.

David W.
  • 105,218
  • 39
  • 216
  • 337