I've got the same problem with the post-commit as with the pre-commit: The
script runs on the server, but the working directory is on the client.
Since "svn propset" doesn't take an URL (only a path to the working version
of the file), I would need to create a working directory, checkout the file
myself, create the property, then commit the transaction.
It appears that none of my options look too good:
1). Write a wrapper script for the "svn add" that will create the
svn:keywords property. This means creating a script that works with all the
various client and passing it around to all the client machines. It also
means that users of programs like TortoiseSVN will have to pull up a command
shell to run my script.
2). Actually create a working directory, do a "svn checkout", svn propset",
and "svn commit" on the server. It is possible in theory, but the
implementation would be clumsy and add quite a bit of time for the commit
transaction. I could run this as a post-commit script, but this script would
certainly take a lot of time to run and a lot of processing power.
3). Reject the commit and tell the user how to create the property
For now, the best choice is #3.
From: Robert Mohr [mailto:firstname.lastname@example.org]
Sent: Thursday, March 31, 2005 12:47 PM
Subject: Re: Setting up the Configuration File
Use the post-commit hook in roughly the same capacity as your current
pre-commit, and call 'svn propset svn:keywords Id
file://localhost$path' when keywords are not set. Then call 'svn
commit -m "Automatically setting svn:keywords to 'Id'."'
This results in an extra revision whenever a file without svn:keywords
set is committed, but I don't see how else to do this.
Received on Thu Mar 31 23:54:25 2005