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.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486457 13f79535-47bb-0310-9956-ffa450edef68
Add support for unversioned metadata change notifications
(i.e., for now, revprop changes) to SvnPubSub.

* tools/server-side/svnpubsub/svnpubsub/server.py:
   Add a second set of URLs that clients can subscribe to and hooks can post to.
   (Notification): New; base class for notification objects.
   (Commit): Change to subclass of Notification.
   (Metadata): New; another subclass of Notification.
   (Client.__init__): Accept another parameter 'kind' that define which
    notifications (commits or metadata) this client object is interested in.
   (Client.interested_in): Check notification types, too.
   (SvnPubSub.__notification_uri_map): Maps URL paths to notification types.
   (SvnPubSub.__init__): Remember the notification class for this instance.
   (SvnPubSub.render_GET): Check notification kind and pass it on to Clients.
   (SvnPubSub.notifyAll, SvnPubSub.renderPut):
    Parametrize implementation based on notification kind.
   (svnpubsub_server): Register two endpoints, for commits and notifications.

* tools/server-side/svnpubsub/revprop-change-hook.py: New hook script.
   Based on commit-hook.py but generates revprop change notifications.

* tools/server-side/svnpubsub/svnpubsub/client.py
  (Client.__init__): Accept optional metadata_callback.
  (Notification): New; base class for notification objects.
  (Commit): Make subclass of Notification.
  (Metadata): New; subclass of Notification.
  (JSONRecordHandler.__init__): Accept metadata_callback (can be None).
  (JSONRecordHandler.feed): Fix bug in unexpected version exception text.
   Emit metadata events if a handler is available.
  (MultiClient.__init__): Accept optional metadata_callback.
  (MultiCLient._add_channel): Optionally pass metadata_callback to Client.

* tools/server-side/svnpubsub/watcher.py (_metadata): New callback handler.
  (main): Pass _metadata handler to MultiClient constructor.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486463 13f79535-47bb-0310-9956-ffa450edef68
* tools/server-side/svnpubsub/commit-hook.py (svncmd):
   Do not pass command through the shell to avoid shell command injection.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486466 13f79535-47bb-0310-9956-ffa450edef68
* tools/server-side/svnpubsub/revprop-change-hook.py (svncmd):
   Do not pass command through the shell to avoid shell command injection.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486467 13f79535-47bb-0310-9956-ffa450edef68
* tools/server-side/svnpubsub/svnpubsub/server.py
  (Metadata.render_log): Fix lookup of revprop name in notification.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486499 13f79535-47bb-0310-9956-ffa450edef68
In SvnPubSub, extract wrapper for subprocess.check_output into a common utility
module. And make problems in the server hooks more visible by exiting with an
error if the hook fails to run.

[in tools/server-side/svnpubsub]
* svnpubsub/util.py: New module.
  (check_output): Wrapper for subprocess.check_output to make it available
   on versions of Python older than 2.7.

* svnwcsub.py (check_output): Removed. Imported from svnpubsub.util instead.
  (svn_info): Updated call to check_output.

* commit-hook.py: Do 'import svnpubsub.util' and do not 'import subprocess'.
  (svnlook): Renamed from svncmd; calls svnpubsub.util.check_output and
   expects the command to be a list, not a string. All callers updated.
  (svnlook_uuid): Renamed from svncmd_uuid. All callers updated.
  (svnlook_info): Renamed from svncmd_info. All callers updated.
  (svnlook_changed): Renamed from svncmd_changed. All callers updated.
  At top level: Exit with an error code if the number of arguments is wrong.

* revprop-change-hook.py: Same changes as in commit-hook.py, except that the
   renamed functions are: svnlook (from svncmd), svnlook_uuid (from svncmd_uuid)
   and svnlook_revprop (from svncmd_revprop).


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486500 13f79535-47bb-0310-9956-ffa450edef68
svnpubsub: be more careful when shelling out.

[in tools/server-side/svnpubsub]
* commit-hook.py
  (svnlook_uuid, svnlook_info, svnlook_changed):
* revprop-change-hook.py
  (svnlook_uuid, svnlook_revprop):
    Add an "--" end-of-arguments terminator, to escape REPOS_DIR and PROPNAME.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486513 13f79535-47bb-0310-9956-ffa450edef68
svnpubsub: make some commented-out examples more robust.

[in tools/server-side/svnpubsub]
* server.py
  (example comments): Escape arguments containing * and align the rest.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486514 13f79535-47bb-0310-9956-ffa450edef68
* CHANGES: remove duplicate "revprop packing" item;
  move fsfs caching items all into once place

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486572 13f79535-47bb-0310-9956-ffa450edef68
* tools/server-side/svnpubsub/revprop-change-hook.py (main):
   Exit with an error code if the action parameter is not valid.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486597 13f79535-47bb-0310-9956-ffa450edef68
* notes/dump-load-format.txt
  Fix two typos and a block-quote style inconsistency.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486714 13f79535-47bb-0310-9956-ffa450edef68
svnpubsub: fix MIME type declaration.

text/plain is wrong due to embedded NULs.

[in tools/server-side/svnpubsub]
* svnpubsub/server.py
  (SvnPubSub.render_GET): Use application/octet-stream.  Leave a comment about
    exploring better options.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486775 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_ra_serf/util.c
  (svn_ra_serf__context_run_wait):
    Note a possible problem with some apr_status_t arithmetics.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486798 13f79535-47bb-0310-9956-ffa450edef68
Revert r1486775, as it was misdirected.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486806 13f79535-47bb-0310-9956-ffa450edef68
Revert unintentional part of r1486806.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486807 13f79535-47bb-0310-9956-ffa450edef68
svnpubsub: fix MIME type declaration.  Reincarnation of r1486775.

application/json is wrong: it is not appropriate for a sequence of
NUL-terminated JSON objects.

[in tools/server-side/svnpubsub]
* svnpubsub/server.py
  (Client.write_start): Use application/octet-stream.  Leave a comment about
    exploring better options.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486809 13f79535-47bb-0310-9956-ffa450edef68
Optimize config file parser a bit.

* subversion/libsvn_subr/config_file.c
  (svn_config__parse_file): Use unbufferd I/O since config file parser 
   uses own buffering.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486897 13f79535-47bb-0310-9956-ffa450edef68
Improve svn patch performance significantly.

* subversion/libsvn_diff/parse-diff.c
  (svn_diff_open_patch_file): Open patch file with APR_BUFFERED flag.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486915 13f79535-47bb-0310-9956-ffa450edef68
* subversion/bindings/swig/ruby/test/windows_util.rb
  (SvnTestUtil.Windows.Svnserve.setup_svnserve): If a path in the PATH
   environment variable doesn't exist, then in addition to ignoring the
   ENOENT error when we try to change the cwd to the non-existent path, jump
   to the next iteration of the loop.  Previously we rescued the error, but
   continued with the loop, looking for binaries in the prior valid cwd.

Found by: danielsh


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1486931 13f79535-47bb-0310-9956-ffa450edef68
Followup to r1479563, fix typos in documentation.

* subversion/bindings/swig/perl/native/Core.pm
  (svn_opt_revision_t): s/$VN/$SVN/


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1487083 13f79535-47bb-0310-9956-ffa450edef68