subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1432790 - in /subversion/trunk/tools/server-side/svnpubsub: svnwcsub.conf.example svnwcsub.py
Date Mon, 14 Jan 2013 02:49:21 GMT
Author: danielsh
Date: Mon Jan 14 02:49:20 2013
New Revision: 1432790

URL: http://svn.apache.org/viewvc?rev=1432790&view=rev
Log:
[in tools/server-side/svnpubsub]

Make the 'hook' config knob optional.

* svnwcsub.py
  (ReloadableConfig.get_optional_value): New instance method.
  (BigDoEverythingClasss.__init__): Use it for 'hook'.

* svnwcsub.conf.example
  (DEFAULT.hook): Comment it out.

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=1432790&r1=1432789&r2=1432790&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnpubsub/svnwcsub.conf.example (original)
+++ subversion/trunk/tools/server-side/svnpubsub/svnwcsub.conf.example Mon Jan 14 02:49:20
2013
@@ -1,7 +1,7 @@
 [DEFAULT]
 svnbin: /usr/local/bin/svn
 streams: http://svn.example.org:2069/commits/svn
-hook: /usr/bin/true
+# hook: /usr/bin/true
 
 ## The values below are used by ConfigParser's interpolation syntax.
 ## See http://docs.python.org/library/configparser

Modified: subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py?rev=1432790&r1=1432789&r2=1432790&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py (original)
+++ subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py Mon Jan 14 02:49:20 2013
@@ -178,7 +178,7 @@ class BigDoEverythingClasss(object):
         self.svnbin = config.get_value('svnbin')
         self.env = config.get_env()
         self.tracking = config.get_track()
-        self.hook = config.get_value('hook')
+        self.hook = config.get_optional_value('hook')
         self.streams = config.get_value('streams').split()
         self.worker = BackgroundWorker(self.svnbin, self.env, self.hook)
         self.watch = [ ]
@@ -354,6 +354,12 @@ class ReloadableConfig(ConfigParser.Safe
     def get_value(self, which):
         return self.get(ConfigParser.DEFAULTSECT, which)
 
+    def get_optional_value(self, which, default=None):
+        if self.has_option(ConfigParser.DEFAULTSECT, which):
+            return self.get(ConfigParser.DEFAULTSECT, which)
+        else:
+            return default
+
     def get_env(self):
         env = os.environ.copy()
         default_options = self.defaults().keys()



Mime
View raw message