Author: brane
Date: Sun May 26 19:52:04 2013
New Revision: 1486457
URL: http://svn.apache.org/r1486457
Log:
In 1.8, post-commit hooks get a third argument (the transaction name).
Update the example svnpubsub post-commit handler to accept and ignore it.
* tools/server-side/svnpubsub/commit-hook.py (at top level):
Move script configuration constants to the top of the file.
Accept, and ignore, a fourth command-line argument.
Modified:
subversion/trunk/tools/server-side/svnpubsub/commit-hook.py
Modified: subversion/trunk/tools/server-side/svnpubsub/commit-hook.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnpubsub/commit-hook.py?rev=1486457&r1=1486456&r2=1486457&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnpubsub/commit-hook.py (original)
+++ subversion/trunk/tools/server-side/svnpubsub/commit-hook.py Sun May 26
19:52:04 2013
@@ -19,6 +19,9 @@
SVNLOOK="/usr/local/svn-install/current/bin/svnlook"
#SVNLOOK="/usr/local/bin/svnlook"
+HOST="127.0.0.1"
+PORT=2069
+
import sys
import subprocess
try:
@@ -28,9 +31,6 @@ except ImportError:
import urllib2
-HOST="127.0.0.1"
-PORT=2069
-
def svncmd(cmd):
return subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
@@ -86,8 +86,8 @@ def main(repo, revision):
do_put(body)
if __name__ == "__main__":
- if len(sys.argv) != 3:
- print "invalid args"
+ if len(sys.argv) not in (3, 4):
+ sys.stderr.write("invalid args\n")
sys.exit(0)
- main(sys.argv[1], sys.argv[2])
+ main(*sys.argv[1:3])