Basic autoversioning: if the SVNAutoversioning directive is used, then
allow write requests (PUT, PROPPATCH, DELETE, MKCOL, COPY, MOVE) on a
public URI.  Each request creates a new revision with an
auto-generated log message.

This change mainly implements (previously-empty) provider routines
used by mod_dav's built-in autoversioning infrastructure.  (We're
following the plan that's been sitting in autoversioning-strategy.txt.)

Note that many WebDAV clients try to use the LOCK/UNLOCK methods,
which we don't yet support.  So while you may be able to drag-n-drop,
delete, and rename files in your DAV "share", you probably won't be
able to open files directly from the share.  For now, the workaround
is to drag a file from the share to the desktop, edit, then drag it
back.  So far, I've only been testing this feature with cadaver 0.20.5
and Nautilus 2.0 clients... seems to work correctly.  Others will have
to play with Win32, OS X, KDE, and Linux davfs.  Meanwhile, 'make
check' passes over ra_dav with SVNAutoversioning both absent and
present, so feel free to switch your mod_dav_svn subdir over to this
branch if you want to play.

* dav_svn.h 

  (dav_svn_create_working_resource):  new 'tweak_in_place' flag.
  (dav_svn_working_to_regular_resource):  declare.
  (dav_svn_create_version_resource):  declare.
  (dav_svn_get_autoversioning_flag):  declare.
  (struct dav_resource_private): new 'auto_checked_out' flag.
  (struct dav_svn_repos): new 'autoversioning' flag.
  (dav_svn_checkout):  declare [no longer a static func].
  (dav_svn_checkin):  declare [no longer a static func].

* mod_dav_svn.c: 

  (struct dav_svn_dir_conf):  add 'autoversioning' flag.
  (dav_svn_autoversioning_cmd): new setting function.
  (dav_svn_get_autoversioning_flag):  new accessor.
  (dav_svn_merge_dir_config): inherit autoversioning flag.
  (dav_svn_cmds): add SVNAutoversioning directive.

* liveprops.c 
  
  (dav_svn_props): add new DAV:auto-version liveprop.
  (dav_svn_insert_prop): always return 'DAV:checkout-checkin' as the
  value for this new liveprop, just to stay within deltaV spec.

* deadprops.c 

  (get_repos_propname): if autoversioning is turned on, then allow
  incoming props to exist in arbitrary namespaces (instead of the two
  svn-specific ones.)

  (save_value, get_value): remove old comments.

* version.c 

  (set_auto_log_message): new helper function.

  (dav_svn_auto_versionable): allow regular resources to be
  auto-versionable, and working resources too, as long as they were
  auto-checked-out to begin with.

  (dav_svn_checkout): for a regular resource, create an activity/txn,
  then convert the resource to a working resource in-place.

  (dav_svn_uncheckout): try to abort the txn, then change the working
  resource back to a regular resource in-place.

  (dav_svn_checkin): try to set an auto-generated log message, commit
  the txn, then change the working resource back to a regular resource
  in-place.  if caller asks, return the newly created version-resource.

  (dav_svn_vsn_control): this function is basically a no-op;  there's
  no need to put a resource under version control, because all svn
  resources are already so.

* repos.c 

  (dav_svn_get_resource): set repos->autoversioning flag by calling
  module conf accessor.

  (dav_svn_create_working_resource): new 'tweak_in_place' flag, and
  make input resource mutable.  New code to optionally change a
  regular resource directly into a working resource; no need to create
  a comb object in here anymore.

  (dav_svn_working_to_regular): new function. changes working resource
  in-place back into a regular resource.

  (dav_svn_create_version_resource): new function.  creates a new
  version resource from an appropriate version-resource uri.

  (dav_svn_remove_resource, dav_svn_create_collection,
  dav_svn_copy_resource): extend these three routines to operate on a
  regular resource too, provided autoversioning is active.  the
  regular resource is checked-out before the fs operation, then
  checked-in to commit.  This continues these routines' theme of
  ignoring the 'parent checkout' philosophy of mod_dav... to be
  addressed some other day.

  (dav_svn_get_parent_resource): allow this routine to construct a
  'private' parent resource for regular resources, not just working
  ones.  This is necessary for a DELETE on a regular resource, since
  mod_dav wants to get the parent.

  (dav_svn_move_resource): only allow this routine to run if
  autoversioning is active, and we're operating on two public URIs.
  like svn itself, make this routine call fs_copy and fs_delete in the
  same autoversioned txn.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/autoversion@844267 13f79535-47bb-0310-9956-ffa450edef68
6 files changed