You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/05/26 21:52:04 UTC
svn commit: r1486457 -
/subversion/trunk/tools/server-side/svnpubsub/commit-hook.py
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])
Re: svn commit: r1486457 - /subversion/trunk/tools/server-side/svnpubsub/commit-hook.py
Posted by Ben Reser <be...@reser.org>.
On Sun, May 26, 2013 at 1:12 PM, Branko Čibej <br...@wandisco.com> wrote:
> It would probably be a good idea to backport this to 1.8.x, ecause
> currently the svnpubsub's commit-hook.py does not work with a 1.8 server.
>
> Opinions?
+1
Re: svn commit: r1486457 - /subversion/trunk/tools/server-side/svnpubsub/commit-hook.py
Posted by Branko Čibej <br...@wandisco.com>.
On 26.05.2013 21:52, brane@apache.org wrote:
> 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.
It would probably be a good idea to backport this to 1.8.x, ecause
currently the svnpubsub's commit-hook.py does not work with a 1.8 server.
Opinions?
-- Brane
--
Branko Čibej
Director of Subversion | WANdisco | www.wandisco.com