Modified: subversion/branches/ev2-export/tools/server-side/svnpubsub/rc.d/svnwcsub.debian URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/svnpubsub/rc.d/svnwcsub.debian?rev=1400556&r1=1400555&r2=1400556&view=diff ============================================================================== --- subversion/branches/ev2-export/tools/server-side/svnpubsub/rc.d/svnwcsub.debian (original) +++ subversion/branches/ev2-export/tools/server-side/svnpubsub/rc.d/svnwcsub.debian Sun Oct 21 02:00:31 2012 @@ -16,7 +16,7 @@ svnwcsub_user=${svnwcsub_user-"svnwc"} svnwcsub_group=${svnwcsub_group-"svnwc"} svnwcsub_pidfile=${svnwcsub_pidfile-"/var/run/svnwcsub.pid"} svnwcsub_config=${svnwcsub_config-"/etc/svnwcsub.conf"} -svnwcsub_logfile=${svnwcsub_logfile-"/var/bwlog/svnwcsub/svnwcsub.log"} +svnwcsub_logfile=${svnwcsub_logfile-"/var/log/svnwcsub/svnwcsub.log"} pidfile="${svnwcsub_pidfile}" SVNWCSUB_CMD="/opt/svnpubsub/svnwcsub.py \ @@ -24,6 +24,7 @@ SVNWCSUB_CMD="/opt/svnpubsub/svnwcsub.py --logfile=${svnwcsub_logfile} \ --pidfile=${pidfile} \ --uid=${svnwcsub_user} --gid=${svnwcsub_group} \ + --umask=002 \ ${svnwcsub_config} " RETVAL=0
Modified: subversion/branches/ev2-export/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris?rev=1400556&r1=1400555&r2=1400556&view=diff ============================================================================== --- subversion/branches/ev2-export/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris (original) +++ subversion/branches/ev2-export/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris Sun Oct 21 02:00:31 2012 @@ -14,8 +14,8 @@ SVNWCSUB_CMD="/usr/local/svnpubsub/svnwc --daemon \ --logfile=${svnwcsub_logfile} \ --pidfile=${pidfile} \ - --umask=002 \ --uid=${svnwcsub_user} --gid=${svnwcsub_group} \ + --umask=002 \ ${svnwcsub_config}" RETVAL=0 Modified: subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/client.py URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/client.py?rev=1400556&r1=1400555&r2=1400556&view=diff ============================================================================== --- subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/client.py (original) +++ subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/client.py Sun Oct 21 02:00:31 2012 @@ -137,13 +137,13 @@ class XMLStreamHandler(xml.sax.handler.C elif self.chars and self.rev: value = self.chars.strip() if name == 'path': - self.rev.dirs_changed.append(value) + self.rev.dirs_changed.append(value.decode('unicode_escape')) elif name == 'author': - self.rev.author = value + self.rev.author = value.decode('unicode_escape') elif name == 'date': - self.rev.date = value + self.rev.date = value.decode('unicode_escape') elif name == 'log': - self.rev.log = value + self.rev.log = value.decode('unicode_escape') # Toss out any accumulated characters for this element. self.chars = '' Modified: subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/server.py URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/server.py?rev=1400556&r1=1400555&r2=1400556&view=diff ============================================================================== --- subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/server.py (original) +++ subversion/branches/ev2-export/tools/server-side/svnpubsub/svnpubsub/server.py Sun Oct 21 02:00:31 2012 @@ -73,12 +73,15 @@ import time class Revision: def __init__(self, r): + # Don't escape the values; json handles binary values fine. + # ET will happily emit literal control characters (eg, NUL), + # thus creating invalid XML, so the XML code paths do escaping. self.rev = r.get('revision') self.repos = r.get('repos') - self.dirs_changed = [x.encode('unicode_escape') for x in r.get('dirs_changed')] - self.author = r.get('author').encode('unicode_escape') - self.log = r.get('log').encode('unicode_escape') - self.date = r.get('date').encode('unicode_escape') + self.dirs_changed = [x for x in r.get('dirs_changed')] + self.author = r.get('author') + self.log = r.get('log') + self.date = r.get('date') def render_commit(self, format): if format == "json": @@ -90,13 +93,13 @@ class Revision: 'date': self.date}}) +"," elif format == "xml": c = ET.Element('commit', {'repository': self.repos, 'revision': "%d" % (self.rev)}) - ET.SubElement(c, 'author').text = self.author - ET.SubElement(c, 'date').text = self.date - ET.SubElement(c, 'log').text = self.log + ET.SubElement(c, 'author').text = self.author.encode('unicode_escape') + ET.SubElement(c, 'date').text = self.date.encode('unicode_escape') + ET.SubElement(c, 'log').text = self.log.encode('unicode_escape') d = ET.SubElement(c, 'dirs_changed') for p in self.dirs_changed: x = ET.SubElement(d, 'path') - x.text = p + x.text = p.encode('unicode_escape') str = ET.tostring(c, 'UTF-8') + "\n" return str[39:] else: @@ -112,7 +115,7 @@ class Revision: d = ET.SubElement(c, 'dirs_changed') for p in self.dirs_changed: x = ET.SubElement(d, 'path') - x.text = p + x.text = p.encode('unicode_escape') str = ET.tostring(c, 'UTF-8') + "\n" return str[39:] else: Modified: subversion/branches/ev2-export/tools/server-side/svnpubsub/svnwcsub.py URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/svnpubsub/svnwcsub.py?rev=1400556&r1=1400555&r2=1400556&view=diff ============================================================================== --- subversion/branches/ev2-export/tools/server-side/svnpubsub/svnwcsub.py (original) +++ subversion/branches/ev2-export/tools/server-side/svnpubsub/svnwcsub.py Sun Oct 21 02:00:31 2012 @@ -1,4 +1,5 @@ #!/usr/bin/env python +# encoding: UTF-8 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -29,6 +30,7 @@ # See svnwcsub.conf for more information on its contents. # +import errno import subprocess import threading import sys @@ -71,6 +73,22 @@ def svn_info(svnbin, env, path): info[line[:idx]] = line[idx+1:].strip() return info +try: + import glob + glob.iglob + def is_emptydir(path): + # ### If the directory contains only dotfile children, this will readdir() + # ### the entire directory. But os.readdir() is not exposed to us... + for x in glob.iglob('%s/*' % path): + return False + for x in glob.iglob('%s/.*' % path): + return False + return True +except (ImportError, AttributeError): + # Python â¤2.4 + def is_emptydir(path): + # This will read the entire directory list to memory. + return not os.listdir(path) class WorkingCopy(object): def __init__(self, bdec, path, url): @@ -106,7 +124,7 @@ class WorkingCopy(object): def _get_match(self, svnbin, env): ### quick little hack to auto-checkout missing working copies - if not os.path.isdir(self.path): + if not os.path.isdir(self.path) or is_emptydir(self.path): logging.info("autopopulate %s from %s" % (self.path, self.url)) subprocess.check_call([svnbin, 'co', '-q', '--non-interactive', @@ -131,7 +149,8 @@ class BigDoEverythingClasss(object): self.svnbin = config.get_value('svnbin') self.env = config.get_env() self.tracking = config.get_track() - self.worker = BackgroundWorker(self.svnbin, self.env) + self.hook = config.get_value('hook') + self.worker = BackgroundWorker(self.svnbin, self.env, self.hook) self.watch = [ ] self.hostports = [ ] @@ -150,7 +169,7 @@ class BigDoEverythingClasss(object): # Add it to our watchers, and trigger an svn update. logging.info("Watching WC at %s <-> %s" % (wc.path, wc.url)) self.watch.append(wc) - self.worker.add_work(OP_UPDATE, wc) + self.worker.add_work(OP_BOOT, wc) def _normalize_path(self, path): if path[0] != '/': @@ -182,11 +201,12 @@ class BigDoEverythingClasss(object): # Start logging warnings if the work backlog reaches this many items BACKLOG_TOO_HIGH = 20 +OP_BOOT = 'boot' OP_UPDATE = 'update' OP_CLEANUP = 'cleanup' class BackgroundWorker(threading.Thread): - def __init__(self, svnbin, env): + def __init__(self, svnbin, env, hook): threading.Thread.__init__(self) # The main thread/process should not wait for this thread to exit. @@ -195,20 +215,28 @@ class BackgroundWorker(threading.Thread) self.svnbin = svnbin self.env = env + self.hook = hook self.q = Queue.Queue() self.has_started = False def run(self): while True: - if self.q.qsize() > BACKLOG_TOO_HIGH: - logging.warn('worker backlog is at %d', self.q.qsize()) - # This will block until something arrives operation, wc = self.q.get() + + # Warn if the queue is too long. + # (Note: the other thread might have added entries to self.q + # after the .get() and before the .qsize().) + qsize = self.q.qsize()+1 + if operation != OP_BOOT and qsize > BACKLOG_TOO_HIGH: + logging.warn('worker backlog is at %d', qsize) + try: if operation == OP_UPDATE: self._update(wc) + elif operation == OP_BOOT: + self._update(wc, boot=True) elif operation == OP_CLEANUP: self._cleanup(wc) else: @@ -228,7 +256,7 @@ class BackgroundWorker(threading.Thread) self.q.put((operation, wc)) - def _update(self, wc): + def _update(self, wc, boot=False): "Update the specified working copy." # For giggles, let's clean up the working copy in case something @@ -253,6 +281,15 @@ class BackgroundWorker(threading.Thread) info = svn_info(self.svnbin, self.env, wc.path) logging.info("updated: %s now at r%s", wc.path, info['Revision']) + ## Run the hook + if self.hook: + hook_mode = ['post-update', 'boot'][boot] + logging.info('running hook: %s at revision %s due to %s', + wc.path, info['Revision'], hook_mode) + args = [self.hook, hook_mode, + wc.path, info['Revision'], wc.url] + subprocess.check_call(args, env=self.env) + def _cleanup(self, wc): "Run a cleanup on the specified working copy." Modified: subversion/branches/ev2-export/win-tests.py URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/win-tests.py?rev=1400556&r1=1400555&r2=1400556&view=diff ============================================================================== --- subversion/branches/ev2-export/win-tests.py (original) +++ subversion/branches/ev2-export/win-tests.py Sun Oct 21 02:00:31 2012 @@ -78,10 +78,10 @@ def _usage_exit(): print(" will be used, if not specified") print(" --httpd-daemon : Run Apache httpd as daemon") print(" --httpd-service : Run Apache httpd as Windows service (default)") - print(" --http-library : dav library to use, neon (default) or serf") print(" --http-short-circuit : Use SVNPathAuthz short_circuit on HTTP server") print(" --disable-http-v2 : Do not advertise support for HTTPv2 on server") print(" --disable-bulk-updates : Disable bulk updates on HTTP server") + print(" --ssl-cert : Path to SSL server certificate to trust.") print(" --javahl : Run the javahl tests instead of the normal tests") print(" --list : print test doc strings only") print(" --milestone-filter=RE : RE is a regular expression pattern that (when") @@ -127,12 +127,13 @@ opts, args = my_getopt(sys.argv[1:], 'hr ['release', 'debug', 'verbose', 'quiet', 'cleanup', 'test=', 'url=', 'svnserve-args=', 'fs-type=', 'asp.net-hack', 'httpd-dir=', 'httpd-port=', 'httpd-daemon', - 'httpd-server', 'http-library=', 'http-short-circuit', + 'httpd-server', 'http-short-circuit', 'disable-http-v2', 'disable-bulk-updates', 'help', 'fsfs-packing', 'fsfs-sharding=', 'javahl', 'list', 'enable-sasl', 'bin=', 'parallel', 'config-file=', 'server-minor-version=', 'log-level=', - 'log-to-stdout', 'mode-filter=', 'milestone-filter=']) + 'log-to-stdout', 'mode-filter=', 'milestone-filter=', + 'ssl-cert=']) if len(args) > 1: print('Warning: non-option arguments after the first one will be ignored') @@ -147,7 +148,6 @@ svnserve_args = None run_httpd = None httpd_port = None httpd_service = None -http_library = 'serf' http_short_circuit = False advertise_httpv2 = True http_bulk_updates = True @@ -165,6 +165,7 @@ log_to_stdout = None mode_filter=None tests_to_run = [] log_level = None +ssl_cert = None for opt, val in opts: if opt in ('-h', '--help'): @@ -199,8 +200,6 @@ for opt, val in opts: httpd_service = 0 elif opt == '--httpd-service': httpd_service = 1 - elif opt == '--http-library': - http_library = val elif opt == '--http-short-circuit': http_short_circuit = True elif opt == '--disable-http-v2': @@ -234,6 +233,8 @@ for opt, val in opts: log_to_stdout = 1 elif opt == '--log-level': log_level = val + elif opt == '--ssl-cert': + ssl_cert = val # Calculate the source and test directory names abs_srcdir = os.path.abspath("") @@ -740,13 +741,13 @@ if not test_javahl: th = run_tests.TestHarness(abs_srcdir, abs_builddir, log_file, fail_log_file, - base_url, fs_type, http_library, + base_url, fs_type, 'serf', server_minor_version, not quiet, cleanup, enable_sasl, parallel, config_file, fsfs_sharding, fsfs_packing, list_tests, svn_bin, mode_filter, milestone_filter, - set_log_level=log_level) + set_log_level=log_level, ssl_cert=ssl_cert) old_cwd = os.getcwd() try: os.chdir(abs_builddir)
