Modified: subversion/branches/javahl-ra/tools/dev/benchmarks/suite1/run.bat
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dev/benchmarks/suite1/run.bat?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dev/benchmarks/suite1/run.bat (original)
+++ subversion/branches/javahl-ra/tools/dev/benchmarks/suite1/run.bat Sun Dec 
23 18:34:14 2012
@@ -1,105 +1,105 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements.  See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership.  The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License.  You may obtain a copy of the License at
-::
-::   http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied.  See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-
-ECHO.THIS SCRIPT IS CURRENTLY OUTDATED.
-GOTO :EOF
-
-SETLOCAL EnableDelayedExpansion
-
-:: Where are the svn binaries you want to benchmark?
-SET SVN_1_6=C:\path\to\1.6-svn\bin\svn
-SET SVN_trunk=C:\path\to\trunk-svn\bin\svn
-
-SET benchmark=%CD%\benchmark.py
-
-SET my_datetime=%date%-%time%
-SET my_datetime=%my_datetime: =_%
-SET my_datetime=%my_datetime:/=_%
-SET my_datetime=%my_datetime::=%
-SET my_datetime=%my_datetime:.=%
-SET my_datetime=%my_datetime:,=%
-SET parent=%my_datetime%
-SET inital_workdir=%CD%
-mkdir "%parent%"
-cd "%parent%"
-ECHO %CD%
-
-GOTO main
-
-:batch
-  SET levels=%1
-  SET spread=%2
-  SET N=%3
-  SET pre=%levels%x%spread%_
-  ECHO.
-  ECHO.---------------------------------------------------------------------
-  ECHO.
-  ECHO.Results for dir levels: %levels%  spread: %spread%
-  CALL "%benchmark%" --svn="%SVN_1_6%" run %pre%1.6 %levels% %spread% %N% > NUL
-  CALL "%benchmark%" --svn="%SVN_trunk%" run %pre%trunk %levels% %spread% %N% 
> NUL
-  CALL "%benchmark%" compare %pre%1.6 %pre%trunk
-  GOTO :EOF
-
-:main
-SET N=6
-SET al=5
-SET as=5
-SET bl=25
-SET bs=1
-SET cl=1
-SET cs=100
-
-::::DEBUG
-::SET N=1
-::SET al=1
-::SET as=1
-::SET bl=2
-::SET bs=1
-::SET cl=1
-::SET cs=2
-::::DEBUG
-
-SET started=%date%-%time%
-ECHO.Started at %started%
-ECHO.
-
-CALL :batch %al% %as% %N%
-CALL :batch %bl% %bs% %N%
-CALL :batch %cl% %cs% %N%
-
-ECHO.
-ECHO.=========================================================================
-ECHO.
-FOR %%F IN (*x*_1.6) DO SET all_1.6=!all_1.6! %%F
-CALL "%benchmark%" combine total_1.6 %all_1.6% > NUL
-FOR %%F IN (*x*_trunk) DO SET all_trunk=!all_trunk! %%F
-CALL "%benchmark%" combine total_trunk %all_trunk% > NUL
-
-ECHO.comparing averaged totals..."
-CALL "%benchmark%" compare total_1.6 total_trunk
-
-ECHO.
-ECHO.Had started at %started%,
-ECHO.       done at %date%-%time%
-ECHO %CD%
-
-cd "%inital_workdir%"
-IF EXIST %parent%\total_trunk rmdir /S /Q "%parent%"
-
-ENDLOCAL
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+::
+::   http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License.
+
+@ECHO OFF
+
+ECHO.THIS SCRIPT IS CURRENTLY OUTDATED.
+GOTO :EOF
+
+SETLOCAL EnableDelayedExpansion
+
+:: Where are the svn binaries you want to benchmark?
+SET SVN_1_6=C:\path\to\1.6-svn\bin\svn
+SET SVN_trunk=C:\path\to\trunk-svn\bin\svn
+
+SET benchmark=%CD%\benchmark.py
+
+SET my_datetime=%date%-%time%
+SET my_datetime=%my_datetime: =_%
+SET my_datetime=%my_datetime:/=_%
+SET my_datetime=%my_datetime::=%
+SET my_datetime=%my_datetime:.=%
+SET my_datetime=%my_datetime:,=%
+SET parent=%my_datetime%
+SET inital_workdir=%CD%
+mkdir "%parent%"
+cd "%parent%"
+ECHO %CD%
+
+GOTO main
+
+:batch
+  SET levels=%1
+  SET spread=%2
+  SET N=%3
+  SET pre=%levels%x%spread%_
+  ECHO.
+  ECHO.---------------------------------------------------------------------
+  ECHO.
+  ECHO.Results for dir levels: %levels%  spread: %spread%
+  CALL "%benchmark%" --svn="%SVN_1_6%" run %pre%1.6 %levels% %spread% %N% > NUL
+  CALL "%benchmark%" --svn="%SVN_trunk%" run %pre%trunk %levels% %spread% %N% 
> NUL
+  CALL "%benchmark%" compare %pre%1.6 %pre%trunk
+  GOTO :EOF
+
+:main
+SET N=6
+SET al=5
+SET as=5
+SET bl=25
+SET bs=1
+SET cl=1
+SET cs=100
+
+::::DEBUG
+::SET N=1
+::SET al=1
+::SET as=1
+::SET bl=2
+::SET bs=1
+::SET cl=1
+::SET cs=2
+::::DEBUG
+
+SET started=%date%-%time%
+ECHO.Started at %started%
+ECHO.
+
+CALL :batch %al% %as% %N%
+CALL :batch %bl% %bs% %N%
+CALL :batch %cl% %cs% %N%
+
+ECHO.
+ECHO.=========================================================================
+ECHO.
+FOR %%F IN (*x*_1.6) DO SET all_1.6=!all_1.6! %%F
+CALL "%benchmark%" combine total_1.6 %all_1.6% > NUL
+FOR %%F IN (*x*_trunk) DO SET all_trunk=!all_trunk! %%F
+CALL "%benchmark%" combine total_trunk %all_trunk% > NUL
+
+ECHO.comparing averaged totals..."
+CALL "%benchmark%" compare total_1.6 total_trunk
+
+ECHO.
+ECHO.Had started at %started%,
+ECHO.       done at %date%-%time%
+ECHO %CD%
+
+cd "%inital_workdir%"
+IF EXIST %parent%\total_trunk rmdir /S /Q "%parent%"
+
+ENDLOCAL

Propchange: subversion/branches/javahl-ra/tools/dev/benchmarks/suite1/run.bat
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: subversion/branches/javahl-ra/tools/dev/unix-build/Makefile.svn
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dev/unix-build/Makefile.svn?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/javahl-ra/tools/dev/unix-build/Makefile.svn Sun Dec 23 
18:34:14 2012
@@ -862,6 +862,8 @@ endif
                > $(CYRUS_SASL_SRCDIR)/lib/dlopen.c.patched
        mv $(CYRUS_SASL_SRCDIR)/lib/dlopen.c.patched \
                $(CYRUS_SASL_SRCDIR)/lib/dlopen.c
+       # Fix a weird autotools error about missing cmulocal dir
+       (cd $(CYRUS_SASL_SRCDIR)/saslauthd/ && ln -sf ../cmulocal)
        touch $@
 
 # configure cyrus-sasl
@@ -961,6 +963,12 @@ $(RUBY_OBJDIR)/.retrieved: $(DISTDIR)/$(
        tar -C $(SRCDIR) -zxf $(DISTDIR)/$(RUBY_DIST)
        touch $@
 
+ifeq ($(THREADING),yes)
+THREADSAFE_FLAG=--enable-pthread
+else
+THREADSAFE_FLAG=--disable-pthread
+endif
+
 # configure ruby
 $(RUBY_OBJDIR)/.configured: $(RUBY_OBJDIR)/.retrieved
        cd $(RUBY_OBJDIR) \
@@ -968,7 +976,7 @@ $(RUBY_OBJDIR)/.configured: $(RUBY_OBJDI
                $(RUBY_SRCDIR)/configure \
                --prefix=$(PREFIX)/ruby \
                --enable-shared \
-               --disable-pthread
+               $(THREADSAFE_FLAG)
        touch $@
 
 # compile ruby
@@ -1149,6 +1157,7 @@ MOD_DAV_SVN=modules/svn-$(WC)/mod_dav_sv
 MOD_AUTHZ_SVN=modules/svn-$(WC)/mod_authz_svn.so
 LIBMAGIC_FLAG=--with-libmagic=$(PREFIX)/libmagic
 NEON_FLAG=--with-neon="$(PREFIX)/neon"
+JAVAHL_CHECK_TARGET=check-javahl
 else ifeq ($(BRANCH_MAJOR),1.6)
 BDB_FLAG=db.h:$(PREFIX)/bdb/include:$(PREFIX)/bdb/lib:db-$(BDB_MAJOR_VER)
 SERF_FLAG=--with-serf="$(PREFIX)/serf"
@@ -1156,6 +1165,7 @@ MOD_DAV_SVN=modules/svn-$(WC)/mod_dav_sv
 MOD_AUTHZ_SVN=modules/svn-$(WC)/mod_authz_svn.so
 W_NO_SYSTEM_HEADERS=-Wno-system-headers
 NEON_FLAG=--with-neon="$(PREFIX)/neon"
+JAVAHL_CHECK_TARGET=check-javahl
 else ifeq ($(BRANCH_MAJOR),1.5)
 BDB_FLAG=$(PREFIX)/bdb
 SERF_FLAG=--with-serf="$(PREFIX)/serf-old"
@@ -1164,12 +1174,14 @@ MOD_AUTHZ_SVN=modules/mod_authz_svn.so
 DISABLE_NEON_VERSION_CHECK=--disable-neon-version-check
 W_NO_SYSTEM_HEADERS=-Wno-system-headers
 NEON_FLAG=--with-neon="$(PREFIX)/neon"
+JAVAHL_CHECK_TARGET=check-javahl
 else # 1.8
 BDB_FLAG=db.h:$(PREFIX)/bdb/include:$(PREFIX)/bdb/lib:db-$(BDB_MAJOR_VER)
 SERF_FLAG=--with-serf="$(PREFIX)/serf"
 MOD_DAV_SVN=modules/svn-$(WC)/mod_dav_svn.so
 MOD_AUTHZ_SVN=modules/svn-$(WC)/mod_authz_svn.so
 LIBMAGIC_FLAG=--with-libmagic=$(PREFIX)/libmagic
+JAVAHL_CHECK_TARGET=check-all-javahl
 endif
 
 ifeq ($(ENABLE_JAVA_BINDINGS),yes)
@@ -1350,10 +1362,17 @@ endif
 libpath:
        @echo export LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):$$LD_LIBRARY_PATH" \
                "PYTHONPATH=$(SVN_PREFIX)/lib/svn-python"
+#
+# OpenBSD requires an LD_PRELOAD hack to dlopen() libraries linked to
+# libpthread (e.g. libsvn_auth_gnome_keyring.so) into executables that
+# aren't linked to libpthread.
+ifeq ($(UNAME),OpenBSD)
+LIB_PTHREAD_HACK=LD_PRELOAD=libpthread.so
+endif
 
 .PHONY: start-svnserve stop-svnserve start-httpd stop-httpd
 
-HTTPD_CMD = env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
+HTTPD_CMD = env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) $(LIB_PTHREAD_HACK) \
                $(PREFIX)/httpd/bin/apachectl -f $(HTTPD_CHECK_CONF)
 HTTPD_START_CMD = $(HTTPD_CMD) -k start
 HTTPD_START_CMD_DEBUG = $(HTTPD_START_CMD) -X
@@ -1400,7 +1419,7 @@ define do_check
 -cd $(svn_builddir) && for fs in fsfs bdb; do \
     echo "Begin test: $(subst svn-check-,,$@) x $$fs"; \
     test -d "$(RAMDISK)/tmp" && export TMPDIR="$(RAMDISK)/tmp"; \
-    env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
+    env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) $(LIB_PTHREAD_HACK) \
         make check PARALLEL=$(PARALLEL) CLEANUP=$(CLEANUP) $1 FS_TYPE=$$fs; \
     for log in tests.log fails.log; do \
         test -f $$log && mv -f $$log $$log.$@-$$fs; \
@@ -1456,6 +1475,7 @@ svn-check-swig-pl:
        -if [ $(ENABLE_PERL_BINDINGS) = yes ]; then \
                (cd $(svn_builddir) && \
                        env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
+                       $(LIB_PTHREAD_HACK) \
                        make check-swig-pl 2>&1) | \
                                tee $(svn_builddir)/tests.log.bindings.pl; \
        fi
@@ -1473,6 +1493,7 @@ svn-check-swig-rb:
                env RUBYLIB=$(RUBYLIB) \
                LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
                PATH=$(SVN_PREFIX)/bin:$$PATH \
+               $(LIB_PTHREAD_HACK) \
                        make check-swig-rb 2>&1) | \
                        tee $(svn_builddir)/tests.log.bindings.rb
 
@@ -1480,7 +1501,7 @@ svn-check-javahl:
        -if [ $(ENABLE_JAVA_BINDINGS) = yes ]; then \
                (cd $(svn_builddir) && \
                        env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
-                       make check-all-javahl 2>&1) | \
+                       make $(JAVAHL_CHECK_TARGET) 2>&1) | \
                                tee $(svn_builddir)/tests.log.bindings.javahl; \
        fi
 

Modified: subversion/branches/javahl-ra/tools/dist/backport.pl
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dist/backport.pl?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dist/backport.pl (original)
+++ subversion/branches/javahl-ra/tools/dist/backport.pl Sun Dec 23 18:34:14 
2012
@@ -126,9 +126,9 @@ EOF
 reinteg_rev=\`$SVN info $STATUS | sed -ne 's/Last Changed Rev: //p'\`
 if $WET_RUN; then
   # Sleep to avoid out-of-order commit notifications
-  if [ -n "$YES" ]; then sleep 15; fi
+  if [ -n "\$YES" ]; then sleep 15; fi
   $SVNq rm $BRANCHES/$entry{branch} -m "Remove the '$entry{branch}' branch, 
reintegrated in r\$reinteg_rev."
-  if [ -n "$YES" ]; then sleep 1; fi
+  if [ -n "\$YES" ]; then sleep 1; fi
 else
   echo "Removing reintegrated '$entry{branch}' branch"
 fi
@@ -229,6 +229,10 @@ sub main {
   usage, exit 0 if @ARGV;
   usage, exit 1 unless -r $STATUS;
 
+  # Because we use the ':normal' command in Vim...
+  die "A vim with the +ex_extra feature is required"
+      if `${VIM} --version` !~ /[+]ex_extra/;
+
   @ARGV = $STATUS;
 
   # Skip most of the file

Modified: subversion/branches/javahl-ra/tools/dist/make-deps-tarball.sh
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dist/make-deps-tarball.sh?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dist/make-deps-tarball.sh (original)
+++ subversion/branches/javahl-ra/tools/dist/make-deps-tarball.sh Sun Dec 23 
18:34:14 2012
@@ -21,14 +21,12 @@
 #
 set -e
 
-# NOTE: Before bumping the default APR dependency the 1.6.x test suite
-# should be adjusted to cope with hash ordering changes from APR 1.4.6.
-APR=apr-1.4.5
+APR=apr-1.4.6
 APR_UTIL=apr-util-1.4.1
 NEON=neon-0.29.6
 SERF=serf-0.3.1
-ZLIB=zlib-1.2.6
-SQLITE_VERSION=3071100
+ZLIB=zlib-1.2.7
+SQLITE_VERSION=3071400
 SQLITE=sqlite-amalgamation-$SQLITE_VERSION
 
 HTTPD=httpd-2.2.22

Propchange: subversion/branches/javahl-ra/tools/dist/make-deps-tarball.sh
------------------------------------------------------------------------------
  Merged 
/subversion/branches/inheritable-props/tools/dist/make-deps-tarball.sh:r1305667-1395089
  Merged 
/subversion/branches/10Gb/tools/dist/make-deps-tarball.sh:r1388394,1388636,1388639,1388644,1388654,1388720,1388789,1388795,1388801,1388805,1388810,1388816,1389044,1389276,1389289,1389662,1389867,1390017,1390216,1390407
  Merged /subversion/trunk/tools/dist/make-deps-tarball.sh:r1329209-1398940

Modified: subversion/branches/javahl-ra/tools/dist/nightly.sh
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dist/nightly.sh?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dist/nightly.sh (original)
+++ subversion/branches/javahl-ra/tools/dist/nightly.sh Sun Dec 23 18:34:14 2012
@@ -55,10 +55,10 @@ head=`$svn info $repo/trunk | grep '^Rev
 # Get the latest versions of the rolling scripts
 for i in release.py dist.sh
 do 
-  $svn export -r $head $repo/trunk/tools/dist/$i@$head $dir/$i
+  $svn export --force -r $head $repo/trunk/tools/dist/$i@$head $dir/$i
 done
 # We also need ezt
-$svn export -r $head $repo/trunk/build/generator/ezt.py@$head $dir/ezt.py
+$svn export --force -r $head $repo/trunk/build/generator/ezt.py@$head 
$dir/ezt.py
 
 # Create the environment
 cd roll

Modified: subversion/branches/javahl-ra/tools/dist/release.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/dist/release.py?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/dist/release.py (original)
+++ subversion/branches/javahl-ra/tools/dist/release.py Sun Dec 23 18:34:14 2012
@@ -679,7 +679,7 @@ def write_downloads(args):
 #----------------------------------------------------------------------
 # Validate the signatures for a release
 
-key_start = '-----BEGIN PGP SIGNATURE-----\n'
+key_start = '-----BEGIN PGP SIGNATURE-----'
 fp_pattern = 
re.compile(r'^pub\s+(\w+\/\w+)[^\n]*\n\s+Key\sfingerprint\s=((\s+[0-9A-F]{4}){10})\nuid\s+([^<\(]+)\s')
 
 def check_sigs(args):

Propchange: subversion/branches/javahl-ra/tools/server-side/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Dec 23 18:34:14 2012
@@ -2,3 +2,4 @@
 svn-populate-node-origins-index
 svnauthz-validate
 svn-rep-sharing-stats
+fsfs-reorg

Modified: subversion/branches/javahl-ra/tools/server-side/svnauthz-validate.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/server-side/svnauthz-validate.c?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/server-side/svnauthz-validate.c 
(original)
+++ subversion/branches/javahl-ra/tools/server-side/svnauthz-validate.c Sun Dec 
23 18:34:14 2012
@@ -28,32 +28,56 @@
  *
  */
 
+#include "svn_cmdline.h"
+#include "svn_dirent_uri.h"
+#include "svn_opt.h"
 #include "svn_pools.h"
 #include "svn_repos.h"
-#include "svn_cmdline.h"
+#include "svn_utf.h"
+
+enum {
+  OPT_USERNAME = SVN_OPT_FIRST_LONGOPT_ID,
+  OPT_PATH,
+  OPT_REPOS
+};
+
+static int
+usage(const char *argv0)
+{
+  printf("Usage:  %s FILE [--username USER [--path FSPATH] [--repository 
REPOS_NAME]] FILE\n\n", argv0);
+  printf("Loads the authz file at FILE and validates its syntax.\n"
+         "Optionally prints the access available to USER for FSPATH in\n"
+         "repository with authz name REPOS_NAME.  If FSPATH is omitted, 
reports\n"
+         "whether USER has any access at all.\n"
+         "Returns:\n"
+         "    0   when syntax is OK.\n"
+         "    1   when syntax is invalid.\n"
+         "    2   operational error\n");
+  return 2;
+}
 
 int
 main(int argc, const char **argv)
 {
   apr_pool_t *pool;
   svn_error_t *err;
+  apr_status_t apr_err;
   svn_authz_t *authz;
-  const char *authz_file;
-
-  if (argc != 2 && argc != 4 && argc != 5)
+  apr_getopt_t *os;
+  const apr_getopt_option_t options[] =
     {
-      printf("Usage:  %s FILE [USER PATH [REPOS_NAME]]\n\n", argv[0]);
-      printf("Loads the authz file at FILE and validates its syntax.\n"
-             "Optionally reports the access available to USER for PATH in\n"
-             "repository REPOS_NAME.\n"
-             "Returns:\n"
-             "    0   when syntax is OK.\n"
-             "    1   when syntax is invalid.\n"
-             "    2   operational error\n");
-      return 2;
-    }
-
-  authz_file = argv[1];
+      {"username", OPT_USERNAME, 1, ("the authenticated username")},
+      {"path", OPT_PATH, 1, ("path within the repository")},
+      {"repository", OPT_REPOS, 1, ("repository authz name")},
+      {0,             0,  0,  0}
+    };
+  struct {
+    const char *authz_file;
+    const char *username;
+    const char *fspath;
+    const char *repos_name;
+  } opts;
+  opts.username = opts.fspath = opts.repos_name = NULL;
 
   /* Initialize the app.  Send all error messages to 'stderr'.  */
   if (svn_cmdline_init(argv[0], stderr) != EXIT_SUCCESS)
@@ -61,16 +85,69 @@ main(int argc, const char **argv)
 
   pool = svn_pool_create(NULL);
 
+  /* Repeat svn_cmdline__getopt_init() inline. */
+  apr_err = apr_getopt_init(&os, pool, argc, argv);
+  if (apr_err)
+    return svn_cmdline_handle_exit_error(
+             svn_error_wrap_apr(apr_err,
+                                ("Error initializing command line arguments")),
+             pool, "svn-rep-sharing-stats: ");
+
+  os->interleave = 1;
+  while (1)
+    {
+      int opt;
+      const char *arg;
+      apr_status_t status = apr_getopt_long(os, options, &opt, &arg);
+      if (APR_STATUS_IS_EOF(status))
+        break;
+      if (status != APR_SUCCESS)
+        {
+          return usage(argv[0]);
+        }
+      switch (opt)
+        {
+        case OPT_USERNAME:
+          /* ### TODO: UTF-8? */
+          opts.username = arg;
+          break;
+        case OPT_PATH:
+          /* ### TODO: UTF-8? */
+          opts.fspath = arg;
+          break;
+        case OPT_REPOS:
+          opts.repos_name = arg;
+          break;
+        default:
+          return usage(argv[0]);
+        }
+    }
+
+  /* Exactly 1 non-option argument, and no --repository/--path
+     unless --username.  */
+  if (os->ind + 1 != argc || (!opts.username && (opts.fspath || 
opts.repos_name)))
+    {
+      return usage(argv[0]);
+    }
+
+  /* Grab AUTHZ_FILE from argv. */
+  SVN_INT_ERR(svn_utf_cstring_to_utf8(&opts.authz_file, os->argv[os->ind],
+                                      pool));
+  opts.authz_file = svn_dirent_internal_style(opts.authz_file, pool);
+
   /* Read the access file and validate it. */
-  err = svn_repos_authz_read(&authz, authz_file, TRUE, pool);
+  err = svn_repos_authz_read(&authz, opts.authz_file, TRUE, pool);
 
-  if (!err && (argc == 4 || argc == 5))
+  /* Optionally, print the access a USER has to a given PATH in REPOS.
+     PATH and REPOS may be NULL. */
+  if (!err && opts.username)
     {
-      const char *user = argv[2], *path = argv[3];
-      const char *repos = argc == 5 ? argv[4] : "";
+      const char *user = opts.username;
+      const char *path = opts.fspath;
+      const char *repos = opts.repos_name;
       svn_boolean_t read_access, write_access;
 
-      if (path[0] != '/')
+      if (path && path[0] != '/')
         path = apr_pstrcat(pool, "/", path, NULL);
 
       err = svn_repos_authz_check_access(authz, repos, path, user,
@@ -81,12 +158,9 @@ main(int argc, const char **argv)
                                            svn_authz_read, &read_access,
                                            pool);
       if (!err)
-        printf("user '%s' has %s access to '%s'%s%s\n",
-               user,
-               write_access ? "rw" : read_access ? "r" : "no",
-               path,
-               repos[0] ? "in repository " : "",
-               repos);
+        printf("%s\n",
+               write_access ? "rw" : read_access ? "r" : "no"
+               );
     }
 
   svn_pool_destroy(pool);

Modified: subversion/branches/javahl-ra/tools/server-side/svnpubsub/README.txt
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/server-side/svnpubsub/README.txt?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/server-side/svnpubsub/README.txt 
(original)
+++ subversion/branches/javahl-ra/tools/server-side/svnpubsub/README.txt Sun 
Dec 23 18:34:14 2012
@@ -40,10 +40,3 @@ Installation instructions:
 
    (eg svnwcsub.py, svnpubsub/client.py,
        'curl -i http://${hostname}:2069/commits/json')
-
-
-Other notes:
-
-- svnwcsub.py will create a file called ".revision" in the root of the working
-  copy it updates.  That file will contain
-  `svn info ./ | sed -ne s/^Revision:.//p`.

Propchange: subversion/branches/javahl-ra/tools/server-side/svnpubsub/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/commit-hook.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/server-side/svnpubsub/commit-hook.py?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/server-side/svnpubsub/commit-hook.py 
(original)
+++ subversion/branches/javahl-ra/tools/server-side/svnpubsub/commit-hook.py 
Sun Dec 23 18:34:14 2012
@@ -46,7 +46,7 @@ def svncmd_info(repo, revision):
     #print data
     return {'author': data[0],
             'date': data[1],
-            'log': "".join(data[3:])}
+            'log': "\n".join(data[3:])}
 
 def svncmd_dirs(repo, revision):
     cmd = "%s dirs-changed  -r %s %s" % (SVNLOOK, revision, repo)
@@ -68,6 +68,7 @@ def do_put(body):
 
 
 def main(repo, revision):
+    revision = revision.lstrip('r')
     i = svncmd_info(repo, revision)
     data = {'revision': int(revision),
             'dirs_changed': [],

Modified: subversion/branches/javahl-ra/tools/server-side/svnpubsub/example.conf
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/server-side/svnpubsub/example.conf?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/server-side/svnpubsub/example.conf 
(original)
+++ subversion/branches/javahl-ra/tools/server-side/svnpubsub/example.conf Sun 
Dec 23 18:34:14 2012
@@ -3,6 +3,7 @@
 [DEFAULT]
 svnbin: /usr/local/bin/svn
 streams: http://svn.example.org:2069/commits/xml
+hook: /usr/bin/true
 
 ## The values below are used by ConfigParser's interpolation syntax.
 ## See http://docs.python.org/library/configparser

Modified: 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.debian
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.debian?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.debian 
(original)
+++ 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.debian 
Sun Dec 23 18:34:14 2012
@@ -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/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.freebsd
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.freebsd?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.freebsd 
(original)
+++ 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.freebsd 
Sun Dec 23 18:34:14 2012
@@ -33,6 +33,7 @@ command_args="--daemon \
               --logfile=${svnwcsub_logfile} \
               --pidfile=${pidfile} \
               --uid=${svnwcsub_user} --gid=${svnwcsub_group} \
-              --umask=002 ${svnwcsub_config}"
+              --umask=002 \
+             ${svnwcsub_config}"
 
 run_rc_command "$1"

Modified: 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris 
(original)
+++ 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris 
Sun Dec 23 18:34:14 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/javahl-ra/tools/server-side/svnpubsub/svnpubsub/client.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnpubsub/client.py?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnpubsub/client.py 
(original)
+++ 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnpubsub/client.py 
Sun Dec 23 18:34:14 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/javahl-ra/tools/server-side/svnpubsub/svnpubsub/server.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnpubsub/server.py?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnpubsub/server.py 
(original)
+++ 
subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnpubsub/server.py 
Sun Dec 23 18:34:14 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/javahl-ra/tools/server-side/svnpubsub/svnwcsub.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnwcsub.py?rev=1425508&r1=1425507&r2=1425508&view=diff
==============================================================================
--- subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnwcsub.py 
(original)
+++ subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnwcsub.py Sun 
Dec 23 18:34:14 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
@@ -72,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):
@@ -107,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',
@@ -132,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 = [ ]
@@ -151,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] != '/':
@@ -183,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.
@@ -196,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:
@@ -229,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
@@ -254,14 +281,14 @@ 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'])
 
-        ### update the .revision file
-        dotrevision = os.path.join(wc.path, '.revision') 
-        try:
-            os.unlink(dotrevision)
-        except IOError, e:
-            if e.errno != errno.ENOENT:
-                raise
-        open(dotrevision, 'w').write(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."


Reply via email to