Butler, Frances H (FHB) wrote:
> I read with interest Jacques' post of a pre-commit hook. (Text of his
> original script is included below.) It came at a great time. I have
> a need for just such a script, but my installation is using a svn
> repository on a Windows 2003 Server.
> I would like to modify this script according. I realize I need to
> change the path to Python and the "SVNLOOK" statement to point to the
> directory where our installation of Subversion lies.
You would most likely need to link the the exact location of the python
binary and the svnlook binary. For example if your svnlook binary is
located in the C:\Program Files\Subversion\bin\ folder, you would need
to use C:\Program Files\Subversion\bin\svnlook.exe for the file it needs
to execute. Also you are going to need the exact location of the python
> Thus, I think I have something like the following. Note my changes in
> I have not yet tested this, and I might need to check my path
> variable, right?
> Jacques, if you or anyone else on the users forum have suggestions for
> me, I would greatly appreciate it.
> Subversion pre-commit hook which currently checks that the commit
> a commit message to avoid commiting empty changesets which tortoisesvn
> to have a habbit of committing.
> Based on
> and hooks/pre-commit.tmpl
> Hacked together by Jacques Marneweck <email@example.com>
> import sys, os, string
> SVNLOOK='C:\Program Files\Subversion\bin'
> def main(repos, txn):
> log_cmd = '%s log -t "%s" "%s"' % (SVNLOOK, txn, repos)
> log_msg = os.popen(log_cmd, 'r').readline().rstrip('\n')
> if len(log_msg) < 10:
> sys.stderr.write ("Please enter a commit message which details
> what has changed during this commit.\n")
> if __name__ == '__main__':
> if len(sys.argv) < 3:
> sys.stderr.write("Usage: %s REPOS TXN\n" % (sys.argv))
> main(sys.argv, sys.argv)
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Tue May 31 19:27:01 2005