Is it possible to set SVN properties with propset without committing?

525 Views Asked by At

Good Day,

Our team controls an SVN repository and is in charge of automating some of our sql deployments. We have a need to include the SVN revision number in the files that are checked out. At the moment I am able to add the line $Id$ somewhere in the file and run the command

svn propset svn:keywords "Id" filename.sql

After performing a commit, the $Id$ field is expanded and the revision information is replaced as expected.

What we are looking for is a way to run this propset command without having to commit and have the revision number changed. We have many developers using this repo and we do not want to have to request them to run this command themselves for each file. Is there a way to add this property globally or locally without committing? Is there perhaps another method we could use to obtain similar results?

Any advice is appreciated!

Thank you

1

There are 1 best solutions below

2
On

Each developer will not have to set the properties on existing files; they are versioned just like the files and their contents, so you only need add them to each file once and they will be updated appropriately on every checkout & update.

You can install a pre-commit hook to check for the existence of properties on new file adds and reject the commit if it's lacking the required properties.

As of Subversion 1.8, you can use repository-dicatated configuration to configure default property settings so that your developers don't have to do it themselves. This uses the svn:auto-props property.