You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2013/01/14 04:05:59 UTC
svn commit: r1432791 - in /subversion/trunk/tools/server-side/svnpubsub:
svnwcsub.conf.example svnwcsub.py
Author: danielsh
Date: Mon Jan 14 03:05:59 2013
New Revision: 1432791
URL: http://svn.apache.org/viewvc?rev=1432791&view=rev
Log:
[in tools/server-side/svnpubsub]
Log stderr output when a child fails.
* svnwcsub.py
(check_call): Add some logging to the 'if failed' branch
Modified:
subversion/trunk/tools/server-side/svnpubsub/svnwcsub.conf.example
subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py
Modified: subversion/trunk/tools/server-side/svnpubsub/svnwcsub.conf.example
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnpubsub/svnwcsub.conf.example?rev=1432791&r1=1432790&r2=1432791&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnpubsub/svnwcsub.conf.example (original)
+++ subversion/trunk/tools/server-side/svnpubsub/svnwcsub.conf.example Mon Jan 14 03:05:59 2013
@@ -1,16 +1,10 @@
[DEFAULT]
-svnbin: /usr/local/bin/svn
-streams: http://svn.example.org:2069/commits/svn
-# hook: /usr/bin/true
-
-## The values below are used by ConfigParser's interpolation syntax.
-## See http://docs.python.org/library/configparser
-SOME_REPOS: svn://svn.example.org/repos/chaos
+svnbin: /usr/bin/svn
+streams: http://svn.apache.org:2069/commits/json
[env]
-HOME: /home/svn
+HOME: /home/danielsh
LANG: en_US.UTF-8
[track]
-/usr/local/foo/prod: %(SOME_REPOS)s/foo/production
-/usr/local/foo/dev: %(SOME_REPOS)s/foo/trunk
+/tmp/whimsy: https://svn.apache.org/repos/infra/infrastructure/trunk/projects/whimsy
Modified: subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py?rev=1432791&r1=1432790&r2=1432791&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py (original)
+++ subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py Mon Jan 14 03:05:59 2013
@@ -84,8 +84,18 @@ except AttributeError:
assert hasattr(subprocess, 'check_call')
def check_call(*args, **kwds):
- return subprocess.check_call(*args, **kwds)
-
+ """Wrapper around subprocess.check_call() that logs stderr upon failure."""
+ assert 'stderr' not in kwds
+ kwds.update(stderr=subprocess.PIPE)
+ pipe = subprocess.Popen(*args, **kwds)
+ output, errput = pipe.communicate()
+ if pipe.returncode:
+ cmd = args[0] if len(args) else kwds.get('args', '(no command)')
+ # TODO: log stdout too?
+ logging.error('Command failed: returncode=%d command=%r stderr=%r',
+ pipe.returncode, cmd, errput)
+ raise subprocess.CalledProcessError(pipe.returncode, args)
+ return pipe.returncode # is EXIT_OK
### note: this runs synchronously. within the current Twisted environment,
### it is called from ._get_match() which is run on a thread so it won't