subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1376157 [1/3] - in /subversion/branches/inheritable-props: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ contrib/client-side/emacs/ subversion/include/ subversion/libsvn_diff/ subversion/libsvn_fs/ subversion/libsv...
Date Wed, 22 Aug 2012 17:47:46 GMT
Author: pburba
Date: Wed Aug 22 17:47:44 2012
New Revision: 1376157

URL: http://svn.apache.org/viewvc?rev=1376157&view=rev
Log:
On the inheritable-props branch: Sync with ^/subversion/trunk through
r1376155.

Modified:
    subversion/branches/inheritable-props/   (props changed)
    subversion/branches/inheritable-props/Makefile.in
    subversion/branches/inheritable-props/build.conf
    subversion/branches/inheritable-props/build/ac-macros/apache.m4
    subversion/branches/inheritable-props/build/ac-macros/sqlite.m4
    subversion/branches/inheritable-props/build/generator/gen_base.py
    subversion/branches/inheritable-props/build/generator/gen_make.py
    subversion/branches/inheritable-props/build/generator/templates/makefile.ezt
    subversion/branches/inheritable-props/build/run_tests.py
    subversion/branches/inheritable-props/contrib/client-side/emacs/dsvn.el
    subversion/branches/inheritable-props/subversion/include/svn_dav.h
    subversion/branches/inheritable-props/subversion/include/svn_repos.h
    subversion/branches/inheritable-props/subversion/libsvn_diff/parse-diff.c
    subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.c
    subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.h
    subversion/branches/inheritable-props/subversion/libsvn_fs_base/fs.c
    subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.c
    subversion/branches/inheritable-props/subversion/libsvn_ra_serf/commit.c
    subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c
    subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/inheritable-props/subversion/libsvn_repos/fs-wrap.c
    subversion/branches/inheritable-props/subversion/libsvn_repos/hooks.c
    subversion/branches/inheritable-props/subversion/libsvn_repos/repos.c
    subversion/branches/inheritable-props/subversion/libsvn_repos/repos.h
    subversion/branches/inheritable-props/subversion/libsvn_subr/auth.c
    subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c
    subversion/branches/inheritable-props/subversion/mod_dav_svn/activity.c
    subversion/branches/inheritable-props/subversion/mod_dav_svn/dav_svn.h
    subversion/branches/inheritable-props/subversion/mod_dav_svn/posts/create_txn.c
    subversion/branches/inheritable-props/subversion/mod_dav_svn/repos.c
    subversion/branches/inheritable-props/subversion/mod_dav_svn/version.c
    subversion/branches/inheritable-props/subversion/po/zh_CN.po
    subversion/branches/inheritable-props/subversion/tests/cmdline/commit_tests.py
    subversion/branches/inheritable-props/subversion/tests/cmdline/svntest/actions.py

Propchange: subversion/branches/inheritable-props/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1373084-1376155

Modified: subversion/branches/inheritable-props/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/Makefile.in?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/Makefile.in (original)
+++ subversion/branches/inheritable-props/Makefile.in Wed Aug 22 17:47:44 2012
@@ -250,6 +250,7 @@ INSTALL_INCLUDE = $(INSTALL) -m 644
 INSTALL_MOD_SHARED = @APXS@ -i -S LIBEXECDIR="$(APACHE_LIBEXECDIR)" @MOD_ACTIVATION@
 INSTALL_DATA = $(INSTALL) -m 644
 INSTALL_LOCALE = $(INSTALL_DATA)
+INSTALL_APACHE_MODS = @INSTALL_APACHE_MODS@
 
 ### this isn't correct yet
 INSTALL_SWIG_PY = $(INSTALL_LIB)

Modified: subversion/branches/inheritable-props/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/build.conf?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/build.conf (original)
+++ subversion/branches/inheritable-props/build.conf Wed Aug 22 17:47:44 2012
@@ -327,6 +327,7 @@ msvc-export = svn_wc.h private\svn_wc_pr
 # Subversion plugin for Apache's mod_dav
 [mod_dav_svn]
 description = Subversion plug-in for the Apache DAV module
+when = INSTALL_APACHE_MODS
 type = apache-mod
 path = subversion/mod_dav_svn
 sources = *.c reports/*.c posts/*.c
@@ -337,6 +338,7 @@ msvc-libs = mod_dav.lib libhttpd.lib
 
 [mod_authz_svn]
 description = Subversion path-based authorization module for Apache
+when = INSTALL_APACHE_MODS
 type = apache-mod
 path = subversion/mod_authz_svn
 nonlibs = mod_dav_svn apr aprutil
@@ -346,6 +348,7 @@ msvc-libs = libhttpd.lib
 
 [mod_dontdothat]
 description = Apache Httpd module to block certain kinds of Apache Subversion requests
+when = INSTALL_APACHE_MODS
 type = apache-mod
 path = tools/server-side/mod_dontdothat
 nonlibs = mod_dav_svn apr aprutil

Modified: subversion/branches/inheritable-props/build/ac-macros/apache.m4
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/build/ac-macros/apache.m4?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/build/ac-macros/apache.m4 (original)
+++ subversion/branches/inheritable-props/build/ac-macros/apache.m4 Wed Aug 22 17:47:44 2012
@@ -128,6 +128,7 @@ AC_ARG_WITH(apache-libexecdir,
     APACHE_LIBEXECDIR="$withval"
 ])
 
+INSTALL_APACHE_MODS=false
 if test -n "$APXS" && test "$APXS" != "no"; then
     APXS_CC="`$APXS -q CC`"
     APACHE_INCLUDES="$APACHE_INCLUDES -I$APXS_INCLUDE"
@@ -140,6 +141,7 @@ if test -n "$APXS" && test "$APXS" != "n
 
     BUILD_APACHE_RULE=apache-mod
     INSTALL_APACHE_RULE=install-mods-shared
+    INSTALL_APACHE_MODS=true
 
     case $host in
       *-*-cygwin*)
@@ -157,6 +159,7 @@ AC_SUBST(APXS)
 AC_SUBST(APACHE_LDFLAGS)
 AC_SUBST(APACHE_INCLUDES)
 AC_SUBST(APACHE_LIBEXECDIR)
+AC_SUBST(INSTALL_APACHE_MODS)
 
 # there aren't any flags that interest us ...
 #if test -n "$APXS" && test "$APXS" != "no"; then

Modified: subversion/branches/inheritable-props/build/ac-macros/sqlite.m4
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/build/ac-macros/sqlite.m4?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/build/ac-macros/sqlite.m4 (original)
+++ subversion/branches/inheritable-props/build/ac-macros/sqlite.m4 Wed Aug 22 17:47:44 2012
@@ -189,10 +189,15 @@ AC_DEFUN(SVN_SQLITE_FILE_CONFIG,
 SQLITE_VERSION_OKAY
 #endif],
                  [AC_MSG_RESULT([amalgamation found and is okay])
+                  _SVN_SQLITE_DSO_LIBS
                   AC_DEFINE(SVN_SQLITE_INLINE, 1,
                   [Defined if svn should use the amalgamated version of sqlite])
                   SVN_SQLITE_INCLUDES="-I`dirname $sqlite_amalg`"
-                  SVN_SQLITE_LIBS="-ldl -lpthread"
+                  if test -n "$svn_sqlite_dso_ldflags"; then
+                    SVN_SQLITE_LIBS="$svn_sqlite_dso_ldflags -lpthread"
+                  else
+                    SVN_SQLITE_LIBS="-lpthread"
+                  fi
                   svn_lib_sqlite="yes"],
                  [AC_MSG_RESULT([unsupported amalgamation SQLite version])])
   fi
@@ -244,3 +249,50 @@ AC_DEFUN(SVN_DOWNLOAD_SQLITE,
   echo ""
   AC_MSG_ERROR([Subversion requires SQLite])
 ])
+
+dnl _SVN_SQLITE_DSO_LIBS() dnl Find additional libraries that the
+dnl sqlite amalgamation code should link in order to load
+dnl shared libraries.  Copied from build/libtool.m4
+AC_DEFUN(_SVN_SQLITE_DSO_LIBS,
+[
+  case $host_os in
+  beos* | mingw* | pw32* | cegcc* | cygwin*)
+    svn_sqlite_dso_ldflags=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+                [lt_cv_dlopen="dlopen" svn_sqlite_dso_ldflags="-ldl"],[
+    svn_sqlite_dso_ldflags=
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+          [svn_sqlite_dso_ldflags=],
+      [AC_CHECK_LIB([dld], [shl_load],
+            [svn_sqlite_dso_ldflags="-ldld"],
+        [AC_CHECK_FUNC([dlopen],
+              [svn_sqlite_dso_ldflags=],
+          [AC_CHECK_LIB([dl], [dlopen],
+                [svn_sqlite_dso_ldflags="-ldl"],
+            [AC_CHECK_LIB([svld], [dlopen],
+                  [svn_sqlite_dso_ldflags="-lsvld"],
+              [AC_CHECK_LIB([dld], [dld_link],
+                    [svn_sqlite_dso_ldflags="-ldld"])
+              ])
+            ])
+          ])
+        ])
+      ])
+    ;;
+  esac
+
+  AC_MSG_CHECKING([additional libraries for sqlite])
+  if test -n "$svn_sqlite_dso_ldflags"; then
+    AC_MSG_RESULT(${svn_sqlite_dso_ldflags})
+  else
+    AC_MSG_RESULT(none)
+  fi
+])

Modified: subversion/branches/inheritable-props/build/generator/gen_base.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/build/generator/gen_base.py?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/build/generator/gen_base.py (original)
+++ subversion/branches/inheritable-props/build/generator/gen_base.py Wed Aug 22 17:47:44 2012
@@ -300,15 +300,16 @@ for _dt in dep_types:
   globals()[_dt] = _dt
 
 class DependencyNode:
-  def __init__(self, filename):
+  def __init__(self, filename, when = None):
     self.filename = filename
+    self.when = when
 
   def __str__(self):
     return self.filename
 
 class ObjectFile(DependencyNode):
-  def __init__(self, filename, compile_cmd = None):
-    DependencyNode.__init__(self, filename)
+  def __init__(self, filename, compile_cmd = None, when = None):
+    DependencyNode.__init__(self, filename, when)
     self.compile_cmd = compile_cmd
     self.source_generated = 0
 
@@ -362,6 +363,7 @@ class Target(DependencyNode):
     self.name = name
     self.gen_obj = gen_obj
     self.desc = options.get('description')
+    self.when = options.get('when')
     self.path = options.get('path', '')
     self.add_deps = options.get('add-deps', '')
     self.add_install_deps = options.get('add-install-deps', '')
@@ -434,7 +436,7 @@ class TargetLinked(Target):
           else:
             raise GenError('ERROR: unknown file extension on ' + src)
 
-          ofile = ObjectFile(objname, self.compile_cmd)
+          ofile = ObjectFile(objname, self.compile_cmd, self.when)
 
           # object depends upon source
           self.gen_obj.graph.add(DT_OBJECT, ofile, SourceFile(src, reldir))
@@ -554,7 +556,7 @@ class TargetI18N(Target):
       else:
         raise GenError('ERROR: unknown file extension on ' + src)
 
-      ofile = ObjectFile(objname, self.compile_cmd)
+      ofile = ObjectFile(objname, self.compile_cmd, self.when)
 
       # object depends upon source
       self.gen_obj.graph.add(DT_OBJECT, ofile, SourceFile(src, reldir))
@@ -699,7 +701,8 @@ class TargetJavaHeaders(TargetJava):
       class_pkg_list = self.package.split('.')
       class_pkg = build_path_join(*class_pkg_list)
       class_file = ObjectFile(build_path_join(self.classes, class_pkg,
-                                              class_name + self.objext))
+                                              class_name + self.objext),
+                              self.when)
       class_file.source_generated = 1
       class_file.class_name = class_name
       hfile = HeaderFile(class_header, self.package + '.' + class_name,
@@ -759,7 +762,7 @@ class TargetJavaClasses(TargetJava):
       else:
         raise GenError('ERROR: unknown file extension on "' + src + '"')
 
-      ofile = ObjectFile(objname, self.compile_cmd)
+      ofile = ObjectFile(objname, self.compile_cmd, self.when)
       sfile = SourceFile(src, reldir)
       sfile.sourcepath = sourcepath
 
@@ -1126,6 +1129,10 @@ class IncludeDependencyInfo:
       #   of <>/"" convention.
     return hdrs
 
+class FileInfo:
+    def __init__(self, filename, when):
+        self.filename = filename
+        self.when = when
 
 def _sorted_files(graph, area):
   "Given a list of targets, sort them based on their dependencies."
@@ -1163,9 +1170,9 @@ def _sorted_files(graph, area):
           s = graph.get_sources(DT_LINK, t.name)
           for d in s:
             if d not in targets:
-              files.append(d.filename)
+              files.append(FileInfo(d.filename, d.when))
         else:
-          files.append(t.filename)
+          files.append(FileInfo(t.filename, t.when))
 
         # don't consider this target any more
         targets.remove(t)

Modified: subversion/branches/inheritable-props/build/generator/gen_make.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/build/generator/gen_make.py?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/build/generator/gen_make.py (original)
+++ subversion/branches/inheritable-props/build/generator/gen_make.py Wed Aug 22 17:47:44 2012
@@ -289,6 +289,7 @@ class Generator(gen_base.GeneratorBase):
                             add_deps=target_ob.add_deps,
                             objects=objects,
                             deps=deps,
+                            when=target_ob.when,
                             )
       data.target.append(ezt_target)
 
@@ -375,11 +376,11 @@ class Generator(gen_base.GeneratorBase):
 
       def apache_file_to_eztdata(file):
           # cd to dirname before install to work around libtool 1.4.2 bug.
-          dirname, fname = build_path_splitfile(file)
+          dirname, fname = build_path_splitfile(file.filename)
           base, ext = os.path.splitext(fname)
           name = base.replace('mod_', '')
-          return _eztdata(fullname=file, dirname=dirname,
-                          name=name, filename=fname)
+          return _eztdata(fullname=file.filename, dirname=dirname,
+                          name=name, filename=fname, when=file.when)
       if area == 'apache-mod':
         data.areas.append(ezt_area)
 
@@ -396,7 +397,8 @@ class Generator(gen_base.GeneratorBase):
 
         # ### TODO: This is a hack.  See discussion here:
         # ### http://mid.gmane.org/20120316191639.GA28451@daniel3.local
-        apache_files = [t.filename for t in inst_targets
+        apache_files = [gen_base.FileInfo(t.filename, t.when)
+                        for t in inst_targets
                         if isinstance(t, gen_base.TargetApacheMod)]
 
         files = [f for f in files if f not in apache_files]
@@ -404,9 +406,9 @@ class Generator(gen_base.GeneratorBase):
           ezt_area.apache_files.append(apache_file_to_eztdata(file))
         for file in files:
           # cd to dirname before install to work around libtool 1.4.2 bug.
-          dirname, fname = build_path_splitfile(file)
-          ezt_file = _eztdata(dirname=dirname, fullname=file,
-                              filename=fname)
+          dirname, fname = build_path_splitfile(file.filename)
+          ezt_file = _eztdata(dirname=dirname, fullname=file.filename,
+                              filename=fname, when=file.when)
           if area == 'locale':
             lang, objext = os.path.splitext(fname)
             installdir = '$(DESTDIR)$(%sdir)/%s/LC_MESSAGES' % (area_var, lang)
@@ -456,6 +458,7 @@ class Generator(gen_base.GeneratorBase):
 
     for objname, sources in obj_deps:
       dep = _eztdata(name=str(objname),
+                     when=objname.when,
                      deps=list(map(str, sources)),
                      cmd=objname.compile_cmd,
                      source=str(sources[0]))

Modified: subversion/branches/inheritable-props/build/generator/templates/makefile.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/build/generator/templates/makefile.ezt?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/build/generator/templates/makefile.ezt (original)
+++ subversion/branches/inheritable-props/build/generator/templates/makefile.ezt Wed Aug 22 17:47:44 2012
@@ -112,7 +112,7 @@ $([target.varname]_OBJECTS): $([target.v
 [else][target.varname]_DEPS = [target.add_deps][for target.objects] [target.objects][end][for target.deps] [target.deps][end]
 [target.varname]_OBJECTS =[for target.objnames] [target.objnames][end]
 [target.filename]: $([target.varname]_DEPS)
-	cd [target.path] && [target.link_cmd] $([target.varname]_LDFLAGS) -o [target.basename] [target.undefined_flag] $([target.varname]_OBJECTS)[for target.libs] [target.libs][end] $(LIBS)
+	[if-any target.when]if $([target.when]) ; then [else][end]cd [target.path] && [target.link_cmd] $([target.varname]_LDFLAGS) -o [target.basename] [target.undefined_flag] $([target.varname]_OBJECTS)[for target.libs] [target.libs][end] $(LIBS)[if-any target.when] ; else echo "fake" > [target.filename] ; fi[else][end]
 [end][end][end]
 
 ########################################
@@ -127,13 +127,13 @@ $([target.varname]_OBJECTS): $([target.v
 ########################################
 [for areas]
 [is areas.type "apache-mod"]install-mods-shared:[for areas.files] [areas.files.fullname][end][for areas.files]
-	cd [areas.files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.files.name] [areas.files.filename][end]
+	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]cd [areas.files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.files.name] [areas.files.filename][if-any areas.files.when] ; fi[else][end][end]
 [else]install-[areas.type]: [for areas.files][if-index areas.files first][else] [end][areas.files.fullname][end] [for areas.apache_files] [areas.apache_files.fullname][end]
 	$(MKDIR) $(DESTDIR)$([areas.varname]dir)[for areas.files][is areas.type "locale"]
 	$(MKDIR) [areas.files.installdir]
-	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] [areas.files.installdir]/$(PACKAGE_NAME)[areas.files.objext][else]
-	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] $(DESTDIR)[areas.files.install_fname][end][end][for areas.apache_files]
-	cd [areas.apache_files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.apache_files.name] [areas.apache_files.filename][end]
+	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] [areas.files.installdir]/$(PACKAGE_NAME)[areas.files.objext][if-any areas.files.when] ; fi[else][end][else]
+	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] $(DESTDIR)[areas.files.install_fname][if-any areas.files.when] ; fi[else][end][end][end][for areas.apache_files]
+	[if-any areas.apache_files.when]if $([areas.apache_files.when]) ; then [else][end]cd [areas.apache_files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.apache_files.name] [areas.apache_files.filename][if-any areas.apache_files.when] ; fi[else][end][end]
 [if-any areas.extra_install]	$(INSTALL_EXTRA_[areas.uppervar])
 [end][end][end]
 
@@ -156,5 +156,5 @@ install-include:[for includes] [includes
 ########################################
 [for deps]
 [deps.name]:[for deps.deps] [deps.deps][end][if-any deps.cmd]
-	[deps.cmd] [if-any deps.generated][else]$(canonicalized_srcdir)[end][deps.source][end]
+	[if-any deps.when]if $([deps.when]) ; then [else][end][deps.cmd] [if-any deps.generated][else]$(canonicalized_srcdir)[end][deps.source][end][if-any deps.when] ; else echo "fake" > [deps.name] ; fi[else][end]
 [end]

Modified: subversion/branches/inheritable-props/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/build/run_tests.py?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/build/run_tests.py (original)
+++ subversion/branches/inheritable-props/build/run_tests.py Wed Aug 22 17:47:44 2012
@@ -317,6 +317,12 @@ class TestHarness:
       print("WARNING: no failures, but '%s' exists from a previous run."
             % self.faillogfile)
 
+    # Summary.
+    if xpassed or failed_list:
+      print("SUMMARY: Some tests failed.\n")
+    else:
+      print("SUMMARY: All tests successful.\n")
+
     self._close_log()
     return failed
 

Modified: subversion/branches/inheritable-props/contrib/client-side/emacs/dsvn.el
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/contrib/client-side/emacs/dsvn.el?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/contrib/client-side/emacs/dsvn.el (original)
+++ subversion/branches/inheritable-props/contrib/client-side/emacs/dsvn.el Wed Aug 22 17:47:44 2012
@@ -360,21 +360,55 @@ Argument ARG are the command line argume
 		       (append svn-diff-args (split-string arg))
 		       'diff-mode))
 
+(defun svn-add-unversioned-files-p (files)
+  "Ask the user whether FILES should be added; return the answer."
+  (let ((buf (get-buffer-create "*svn-unversioned-files*")))
+    (with-current-buffer buf
+      (setq buffer-read-only nil)
+      (erase-buffer)
+      (insert (mapconcat (lambda (f) f) files "\n"))
+      (setq buffer-read-only t)
+      (goto-char (point-min))
+      (save-selected-window
+        (pop-to-buffer buf)
+        (shrink-window-if-larger-than-buffer)
+        (let* ((n (length files))
+               (add-them (y-or-n-p
+                          (if (= n 1)
+                              "Add this item first? "
+                            (format "Add these %d items first? " n)))))
+          (let ((win (get-buffer-window buf)))
+            (if win
+                (condition-case nil
+                    (delete-window win)
+                  (error nil))))
+          (bury-buffer buf)
+          add-them)))))
+
 (defun svn-commit ()
   "Commit changes to one or more files."
   (interactive)
   (save-some-buffers)
-  (let ((status-buf (current-buffer))
-        (commit-buf (get-buffer-create "*svn commit*"))
-        (window-conf (and svn-restore-windows (current-window-configuration)))
-        (listfun (lambda () (with-current-buffer log-edit-parent-buffer
-                              (svn-action-files)))))
-    (log-edit 'svn-confirm-commit t
-              (if (< emacs-major-version 23)
-                  listfun
-                (list (cons 'log-edit-listfun listfun)))
-              commit-buf)
-    (set (make-local-variable 'saved-window-configuration) window-conf)))
+  (let ((unversioned-files (svn-action-files
+                            (lambda (pos) (eq (svn-file-status pos) ?\?)))))
+    (if unversioned-files
+        (if (svn-add-unversioned-files-p unversioned-files)
+            (progn
+              (message "Adding unversioned items. Please re-commit when ready.")
+              (svn-run 'add unversioned-files "Adding files"))
+          (message "Files not added; nothing committed."))
+      (let ((status-buf (current-buffer))
+            (commit-buf (get-buffer-create "*svn commit*"))
+            (window-conf (and svn-restore-windows
+                              (current-window-configuration)))
+            (listfun (lambda () (with-current-buffer log-edit-parent-buffer
+                                  (svn-action-files)))))
+        (log-edit 'svn-confirm-commit t
+                  (if (< emacs-major-version 23)
+                      listfun
+                    (list (cons 'log-edit-listfun listfun)))
+                  commit-buf)
+        (set (make-local-variable 'saved-window-configuration) window-conf)))))
 
 (defun svn-confirm-commit ()
   "Commit changes with the current buffer as commit message."
@@ -1643,27 +1677,24 @@ Set it if MARK is non-NIL, and clear it 
   "Return a list of lists (FILE POS) to act on.
 Optional argument PRED is a predicate function that is called with POS as
 argument."
-  (let ((files ())
-        (pos (next-single-property-change (point-min) 'svn-file)))
-    (while pos
-      (when (and (get-text-property pos 'svn-mark)
-                 (or (not pred)
-                     (funcall pred pos)))
-        (setq files (cons (list (get-text-property pos 'svn-file)
-                                pos)
-                          files)))
-      (setq pos (next-single-property-change pos 'svn-file)))
-    (if (null files)
-        (let ((file (svn-getprop (point) 'file)))
-          (unless file
-            (error "No file on this line"))
-          (when (and pred
-                     (not (funcall pred (line-beginning-position))))
-            (error "Invalid file"))
-          (list (list file
-                      (save-excursion
-                        (beginning-of-line)
-                        (point)))))
+  (let ((positions ()))
+    (let ((pos (next-single-property-change (point-min) 'svn-file)))
+      (while pos
+        (when (get-text-property pos 'svn-mark)
+          (setq positions (cons pos positions)))
+        (setq pos (next-single-property-change pos 'svn-file))))
+    (when (null positions)
+      (unless (svn-getprop (point) 'file)
+        (error "No file on this line"))
+      (setq positions (list (line-beginning-position))))
+
+    (let ((files ()))
+      (mapc (lambda (pos)
+              (when (or (not pred) (funcall pred pos))
+                (setq files (cons (list (get-text-property pos 'svn-file)
+                                        pos)
+                                  files))))
+            (reverse positions))
       (reverse files))))
 
 (defun svn-action-files (&optional pred)

Modified: subversion/branches/inheritable-props/subversion/include/svn_dav.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/include/svn_dav.h?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/include/svn_dav.h (original)
+++ subversion/branches/inheritable-props/subversion/include/svn_dav.h Wed Aug 22 17:47:44 2012
@@ -177,6 +177,13 @@ extern "C" {
  * @since New in 1.7.  */
 #define SVN_DAV_VTXN_NAME_HEADER "SVN-VTxn-Name"
 
+/** This header is used in the OPTIONS response to identify named
+ * skel-based POST request types which the server is prepared to
+ * handle.  (HTTP protocol v2 only)
+ * @since New in 1.8.   */
+#define SVN_DAV_SUPPORTED_POSTS_HEADER "SVN-Supported-Posts"
+
+
 /**
  * @name Fulltext MD5 headers
  *

Modified: subversion/branches/inheritable-props/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/include/svn_repos.h?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/include/svn_repos.h (original)
+++ subversion/branches/inheritable-props/subversion/include/svn_repos.h Wed Aug 22 17:47:44 2012
@@ -715,6 +715,12 @@ const char *
 svn_repos_start_commit_hook(svn_repos_t *repos,
                             apr_pool_t *pool);
 
+/** Return the path to @a repos's init-commit hook, allocated in @a pool.
+ * @since New in 1.8 */
+const char *
+svn_repos_init_commit_hook(svn_repos_t *repos,
+                           apr_pool_t *pool);
+
 /** Return the path to @a repos's pre-commit hook, allocated in @a pool. */
 const char *
 svn_repos_pre_commit_hook(svn_repos_t *repos,

Modified: subversion/branches/inheritable-props/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_diff/parse-diff.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_diff/parse-diff.c Wed Aug 22 17:47:44 2012
@@ -1284,8 +1284,7 @@ svn_diff_parse_next_patch(svn_patch_t **
       /* Run the state machine. */
       for (i = 0; i < (sizeof(transitions) / sizeof(transitions[0])); i++)
         {
-          if (line->len > strlen(transitions[i].expected_input)
-              && starts_with(line->data, transitions[i].expected_input)
+          if (starts_with(line->data, transitions[i].expected_input)
               && state == transitions[i].required_state)
             {
               SVN_ERR(transitions[i].fn(&state, line->data, *patch,
@@ -1302,19 +1301,24 @@ svn_diff_parse_next_patch(svn_patch_t **
         }
       else if (state == state_git_tree_seen && line_after_tree_header_read)
         {
-          /* We have a valid diff header for a patch with only tree changes.
-           * Rewind to the start of the line just read, so subsequent calls
-           * to this function don't end up skipping the line -- it may
-           * contain a patch. */
-          SVN_ERR(svn_io_file_seek(patch_file->apr_file, APR_SET, &last_line,
-                                   scratch_pool));
-          break;
+          /* git patches can contain an index line after the file mode line */
+          if (!starts_with(line->data, "index "))
+          {
+            /* We have a valid diff header for a patch with only tree changes.
+             * Rewind to the start of the line just read, so subsequent calls
+             * to this function don't end up skipping the line -- it may
+             * contain a patch. */
+            SVN_ERR(svn_io_file_seek(patch_file->apr_file, APR_SET, &last_line,
+                    scratch_pool));
+            break;
+          }
         }
       else if (state == state_git_tree_seen)
         {
           line_after_tree_header_read = TRUE;
         }
-      else if (! valid_header_line && state != state_start)
+      else if (! valid_header_line && state != state_start
+               && !starts_with(line->data, "index "))
         {
           /* We've encountered an invalid diff header.
            *

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.c Wed Aug 22 17:47:44 2012
@@ -601,7 +601,8 @@ svn_fs_pack(const char *path,
 
   SVN_MUTEX__WITH_LOCK(common_pool_lock,
                        vtable->pack_fs(fs, path, notify_func, notify_baton,
-                                       cancel_func, cancel_baton, pool));
+                                       cancel_func, cancel_baton, pool,
+                                       common_pool));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.h?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.h Wed Aug 22 17:47:44 2012
@@ -107,7 +107,7 @@ typedef struct fs_library_vtable_t
   svn_error_t *(*pack_fs)(svn_fs_t *fs, const char *path,
                           svn_fs_pack_notify_t notify_func, void *notify_baton,
                           svn_cancel_func_t cancel_func, void *cancel_baton,
-                          apr_pool_t *pool);
+                          apr_pool_t *pool, apr_pool_t *common_pool);
 
   /* Provider-specific functions should go here, even if they could go
      in an object vtable, so that they are all kept together. */

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_base/fs.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_base/fs.c Wed Aug 22 17:47:44 2012
@@ -911,7 +911,8 @@ base_bdb_pack(svn_fs_t *fs,
               void *notify_baton,
               svn_cancel_func_t cancel,
               void *cancel_baton,
-              apr_pool_t *pool)
+              apr_pool_t *pool,
+              apr_pool_t *common_pool)
 {
   /* Packing is currently a no op for BDB. */
   return SVN_NO_ERROR;

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.c Wed Aug 22 17:47:44 2012
@@ -263,13 +263,14 @@ fs_pack(svn_fs_t *fs,
         void *notify_baton,
         svn_cancel_func_t cancel_func,
         void *cancel_baton,
-        apr_pool_t *pool)
+        apr_pool_t *pool,
+        apr_pool_t *common_pool)
 {
   SVN_ERR(svn_fs__check_fs(fs, FALSE));
   SVN_ERR(initialize_fs_struct(fs));
   SVN_ERR(svn_fs_fs__open(fs, path, pool));
   SVN_ERR(svn_fs_fs__initialize_caches(fs, pool));
-  SVN_ERR(fs_serialized_init(fs, pool, pool));
+  SVN_ERR(fs_serialized_init(fs, common_pool, pool));
   return svn_fs_fs__pack(fs, notify_func, notify_baton,
                          cancel_func, cancel_baton, pool);
 }

Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/commit.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/commit.c Wed Aug 22 17:47:44 2012
@@ -38,6 +38,7 @@
 #include "svn_private_config.h"
 #include "private/svn_dep_compat.h"
 #include "private/svn_fspath.h"
+#include "private/svn_skel.h"
 
 #include "ra_serf.h"
 #include "../libsvn_ra/ra_loader.h"
@@ -1108,7 +1109,26 @@ create_txn_post_body(serf_bucket_t **bod
                      serf_bucket_alloc_t *alloc,
                      apr_pool_t *pool)
 {
-  *body_bkt = SERF_BUCKET_SIMPLE_STRING("( create-txn )", alloc);
+  apr_hash_t *revprops = baton;
+  svn_skel_t *request_skel;
+  svn_stringbuf_t *skel_str;
+
+  request_skel = svn_skel__make_empty_list(pool);
+  if (revprops)
+    {
+      svn_skel_t *proplist_skel;
+
+      SVN_ERR(svn_skel__unparse_proplist(&proplist_skel, revprops, pool));
+      svn_skel__prepend(proplist_skel, request_skel);
+      svn_skel__prepend_str("create-txn-with-props", request_skel, pool);
+      skel_str = svn_skel__unparse(request_skel, pool);
+      *body_bkt = SERF_BUCKET_SIMPLE_STRING(skel_str->data, alloc);
+    }
+  else
+    {
+      *body_bkt = SERF_BUCKET_SIMPLE_STRING("( create-txn )", alloc);
+    }
+
   return SVN_NO_ERROR;
 }
 
@@ -1213,12 +1233,15 @@ open_root(void *edit_baton,
   proppatch_context_t *proppatch_ctx;
   dir_context_t *dir;
   apr_hash_index_t *hi;
-  const char *proppatch_target;
+  const char *proppatch_target = NULL;
 
   if (SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(ctx->session))
     {
       post_response_ctx_t *prc;
       const char *rel_path;
+      svn_boolean_t post_with_revprops =
+        apr_hash_get(ctx->session->supported_posts, "create-txn-with-props",
+                     APR_HASH_KEY_STRING) ? TRUE : FALSE;
 
       /* Create our activity URL now on the server. */
       handler = apr_pcalloc(ctx->pool, sizeof(*handler));
@@ -1226,7 +1249,8 @@ open_root(void *edit_baton,
       handler->method = "POST";
       handler->body_type = SVN_SKEL_MIME_TYPE;
       handler->body_delegate = create_txn_post_body;
-      handler->body_delegate_baton = NULL;
+      handler->body_delegate_baton =
+        post_with_revprops ? ctx->revprop_table : NULL;
       handler->header_delegate = setup_post_headers;
       handler->header_delegate_baton = NULL;
       handler->path = ctx->session->me_resource;
@@ -1288,7 +1312,9 @@ open_root(void *edit_baton,
       dir->removed_props = apr_hash_make(dir->pool);
       dir->url = apr_pstrdup(dir->pool, ctx->txn_root_url);
 
-      proppatch_target = ctx->txn_url;
+      /* If we included our revprops in the POST, we need not
+         PROPPATCH them. */
+      proppatch_target = post_with_revprops ? NULL : ctx->txn_url;
     }
   else
     {
@@ -1369,45 +1395,50 @@ open_root(void *edit_baton,
       proppatch_target = ctx->baseline_url;
     }
 
+  /* Unless this is NULL -- which means we don't need to PROPPATCH the
+     transaction with our revprops -- then, you know, PROPPATCH the
+     transaction with our revprops.  */
+  if (proppatch_target)
+    {
+      proppatch_ctx = apr_pcalloc(ctx->pool, sizeof(*proppatch_ctx));
+      proppatch_ctx->pool = dir_pool;
+      proppatch_ctx->commit = ctx;
+      proppatch_ctx->path = proppatch_target;
+      proppatch_ctx->changed_props = apr_hash_make(proppatch_ctx->pool);
+      proppatch_ctx->removed_props = apr_hash_make(proppatch_ctx->pool);
+      proppatch_ctx->base_revision = SVN_INVALID_REVNUM;
+
+      for (hi = apr_hash_first(ctx->pool, ctx->revprop_table); hi;
+           hi = apr_hash_next(hi))
+        {
+          const void *key;
+          void *val;
+          const char *name;
+          svn_string_t *value;
+          const char *ns;
+
+          apr_hash_this(hi, &key, NULL, &val);
+          name = key;
+          value = val;
 
-  /* PROPPATCH our revprops and pass them along.  */
-  proppatch_ctx = apr_pcalloc(ctx->pool, sizeof(*proppatch_ctx));
-  proppatch_ctx->pool = dir_pool;
-  proppatch_ctx->commit = ctx;
-  proppatch_ctx->path = proppatch_target;
-  proppatch_ctx->changed_props = apr_hash_make(proppatch_ctx->pool);
-  proppatch_ctx->removed_props = apr_hash_make(proppatch_ctx->pool);
-  proppatch_ctx->base_revision = SVN_INVALID_REVNUM;
-
-  for (hi = apr_hash_first(ctx->pool, ctx->revprop_table); hi;
-       hi = apr_hash_next(hi))
-    {
-      const void *key;
-      void *val;
-      const char *name;
-      svn_string_t *value;
-      const char *ns;
-
-      apr_hash_this(hi, &key, NULL, &val);
-      name = key;
-      value = val;
+          if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
+            {
+              ns = SVN_DAV_PROP_NS_SVN;
+              name += sizeof(SVN_PROP_PREFIX) - 1;
+            }
+          else
+            {
+              ns = SVN_DAV_PROP_NS_CUSTOM;
+            }
 
-      if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
-        {
-          ns = SVN_DAV_PROP_NS_SVN;
-          name += sizeof(SVN_PROP_PREFIX) - 1;
-        }
-      else
-        {
-          ns = SVN_DAV_PROP_NS_CUSTOM;
+          svn_ra_serf__set_prop(proppatch_ctx->changed_props,
+                                proppatch_ctx->path,
+                                ns, name, value, proppatch_ctx->pool);
         }
 
-      svn_ra_serf__set_prop(proppatch_ctx->changed_props, proppatch_ctx->path,
-                            ns, name, value, proppatch_ctx->pool);
+      SVN_ERR(proppatch_resource(proppatch_ctx, dir->commit, ctx->pool));
     }
 
-  SVN_ERR(proppatch_resource(proppatch_ctx, dir->commit, ctx->pool));
-
   *root_baton = dir;
 
   return SVN_NO_ERROR;

Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c Wed Aug 22 17:47:44 2012
@@ -210,6 +210,16 @@ capabilities_headers_iterator_callback(v
   /* SVN-specific headers -- if present, server supports HTTP protocol v2 */
   else if (strncmp(key, "SVN", 3) == 0)
     {
+      /* If we've not yet seen any information about supported POST
+         requests, we'll initialize the list/hash with "create-txn"
+         (which we know is supported by virtue of the server speaking
+         HTTPv2 at all. */
+      if (! session->supported_posts)
+        {
+          session->supported_posts = apr_hash_make(session->pool);
+          apr_hash_set(session->supported_posts, "create-txn", 10, (void *)1);
+        }
+
       if (svn_cstring_casecmp(key, SVN_DAV_ROOT_URI_HEADER) == 0)
         {
           session->repos_root = session->session_url;
@@ -263,6 +273,21 @@ capabilities_headers_iterator_callback(v
         {
           opt_ctx->youngest_rev = SVN_STR_TO_REV(val);
         }
+      else if (svn_cstring_casecmp(key, SVN_DAV_SUPPORTED_POSTS_HEADER) == 0)
+        {
+          /* May contain multiple values, separated by commas. */
+          int i;
+          apr_array_header_t *vals = svn_cstring_split(val, ",", TRUE,
+                                                       opt_ctx->pool);
+
+          for (i = 0; i < vals->nelts; i++)
+            {
+              const char *post_val = APR_ARRAY_IDX(vals, i, const char *);
+
+              apr_hash_set(session->supported_posts, post_val,
+                           APR_HASH_KEY_STRING, (void *)1);
+            }
+        }
     }
 
   return 0;

Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h Wed Aug 22 17:47:44 2012
@@ -209,6 +209,10 @@ struct svn_ra_serf__session_t {
   const char *vtxn_stub;        /* for accessing transactions (i.e. txnprops) */
   const char *vtxn_root_stub;   /* for accessing TXN/PATH pairs */
 
+  /* Hash mapping const char * server-supported POST types to
+     disinteresting-but-non-null values. */
+  apr_hash_t *supported_posts;
+
   /*** End HTTP v2 stuff ***/
 
   svn_ra_serf__blncache_t *blncache;

Modified: subversion/branches/inheritable-props/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_repos/fs-wrap.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_repos/fs-wrap.c Wed Aug 22 17:47:44 2012
@@ -84,9 +84,11 @@ svn_repos_fs_begin_txn_for_commit2(svn_f
                                    apr_hash_t *revprop_table,
                                    apr_pool_t *pool)
 {
-  svn_string_t *author = apr_hash_get(revprop_table, SVN_PROP_REVISION_AUTHOR,
-                                      APR_HASH_KEY_STRING);
   apr_array_header_t *revprops;
+  const char *txn_name;
+  svn_string_t *author = apr_hash_get(revprop_table,
+                                      SVN_PROP_REVISION_AUTHOR,
+                                      APR_HASH_KEY_STRING);
 
   /* Run start-commit hooks. */
   SVN_ERR(svn_repos__hooks_start_commit(repos, author ? author->data : NULL,
@@ -95,12 +97,15 @@ svn_repos_fs_begin_txn_for_commit2(svn_f
   /* Begin the transaction, ask for the fs to do on-the-fly lock checks. */
   SVN_ERR(svn_fs_begin_txn2(txn_p, repos->fs, rev,
                             SVN_FS_TXN_CHECK_LOCKS, pool));
+  SVN_ERR(svn_fs_txn_name(&txn_name, *txn_p, pool));
 
   /* We pass the revision properties to the filesystem by adding them
      as properties on the txn.  Later, when we commit the txn, these
      properties will be copied into the newly created revision. */
   revprops = svn_prop_hash_to_array(revprop_table, pool);
-  return svn_repos_fs_change_txn_props(*txn_p, revprops, pool);
+  SVN_ERR(svn_repos_fs_change_txn_props(*txn_p, revprops, pool));
+
+  return svn_error_trace(svn_repos__hooks_init_commit(repos, txn_name, pool));
 }
 
 

Modified: subversion/branches/inheritable-props/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_repos/hooks.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_repos/hooks.c Wed Aug 22 17:47:44 2012
@@ -124,6 +124,7 @@ check_hook_result(const char *name, cons
     {
       const char *action;
       if (strcmp(name, "start-commit") == 0
+          || strcmp(name, "init-commit") == 0
           || strcmp(name, "pre-commit") == 0)
         action = _("Commit");
       else if (strcmp(name, "pre-revprop-change") == 0)
@@ -397,6 +398,34 @@ svn_repos__hooks_start_commit(svn_repos_
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_repos__hooks_init_commit(svn_repos_t *repos,
+                             const char *txn_name,
+                             apr_pool_t *pool)
+{
+  const char *hook = svn_repos_init_commit_hook(repos, pool);
+  svn_boolean_t broken_link;
+
+  if ((hook = check_hook_cmd(hook, &broken_link, pool)) && broken_link)
+    {
+      return hook_symlink_error(hook);
+    }
+  else if (hook)
+    {
+      const char *args[4];
+
+      args[0] = hook;
+      args[1] = svn_dirent_local_style(svn_repos_path(repos, pool), pool);
+      args[2] = txn_name;
+      args[3] = NULL;
+
+      SVN_ERR(run_hook_cmd(NULL, SVN_REPOS__HOOK_INIT_COMMIT, hook, args,
+                           repos->hooks_env, NULL, pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* Set *HANDLE to an open filehandle for a temporary file (i.e.,
    automatically deleted when closed), into which the LOCK_TOKENS have
    been written out in the format described in the pre-commit hook

Modified: subversion/branches/inheritable-props/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_repos/repos.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_repos/repos.c Wed Aug 22 17:47:44 2012
@@ -111,6 +111,13 @@ svn_repos_start_commit_hook(svn_repos_t 
 
 
 const char *
+svn_repos_init_commit_hook(svn_repos_t *repos, apr_pool_t *pool)
+{
+  return svn_dirent_join(repos->hook_path, SVN_REPOS__HOOK_INIT_COMMIT, pool);
+}
+
+
+const char *
 svn_repos_pre_commit_hook(svn_repos_t *repos, apr_pool_t *pool)
 {
   return svn_dirent_join(repos->hook_path, SVN_REPOS__HOOK_PRE_COMMIT, pool);
@@ -375,6 +382,93 @@ PREWRITTEN_HOOKS_TEXT
     SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
   }  /* end start-commit hook */
 
+  /* Init-commit hook. */
+  {
+    this_path = apr_psprintf(pool, "%s%s",
+                             svn_repos_init_commit_hook(repos, pool),
+                             SVN_REPOS__HOOK_DESC_EXT);
+
+#define SCRIPT_NAME SVN_REPOS__HOOK_INIT_COMMIT
+
+    contents =
+"#!/bin/sh"                                                                  NL
+""                                                                           NL
+"# INIT-COMMIT HOOK"                                                         NL
+"#"                                                                          NL
+"# The init-commit hook is invoked immediate after a Subversion commit txn"  NL
+"# is created and initialized.  Subversion runs this hook by invoking a"     NL
+"# program (script, executable, binary, etc.) named '"SCRIPT_NAME"' (for"    NL
+"# which this file is a template), with the following ordered arguments:"    NL
+"#"                                                                          NL
+"#   [1] REPOS-PATH   (the path to this repository)"                         NL
+"#   [2] TXN-NAME     (the name of the commit txn just created)"             NL
+"#"                                                                          NL
+"# The default working directory for the invocation is undefined, so"        NL
+"# the program should set one explicitly if it cares."                       NL
+"#"                                                                          NL
+"# If the hook program exits with success, the commit txn remains active;"   NL
+"# but if it exits with failure (non-zero), the txn is aborted, no commit"   NL
+"# takes place, and STDERR is returned to the client.   The hook"            NL
+"# program can use the 'svnlook' utility to help it examine the txn."        NL
+"#"                                                                          NL
+"# On a Unix system, the normal procedure is to have '"SCRIPT_NAME"'"        NL
+"# invoke other programs to do the real work, though it may do the"          NL
+"# work itself too."                                                         NL
+"#"                                                                          NL
+"#   ***  NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT  ***"       NL
+"#   ***  FOR REVISION PROPERTIES (like svn:log or svn:author).   ***"       NL
+"#"                                                                          NL
+"#   This is why we recommend using the read-only 'svnlook' utility."        NL
+"#   In the future, Subversion may enforce the rule that pre-commit"         NL
+"#   hooks should not modify the versioned data in txns, or else come"       NL
+"#   up with a mechanism to make it safe to do so (by informing the"         NL
+"#   committing client of the changes).  However, right now neither"         NL
+"#   mechanism is implemented, so hook writers just have to be careful."     NL
+"#"                                                                          NL
+"# Note that '"SCRIPT_NAME"' must be executable by the user(s) who will"     NL
+"# invoke it (typically the user httpd runs as), and that user must"         NL
+"# have filesystem-level permission to access the repository."               NL
+"#"                                                                          NL
+"# On a Windows system, you should name the hook program"                    NL
+"# '"SCRIPT_NAME".bat' or '"SCRIPT_NAME".exe',"                              NL
+"# but the basic idea is the same."                                          NL
+"#"                                                                          NL
+"# WARNING: The degree of txn \"initialization\" may differ depending on"    NL
+"# how the commit process is being driven.  For example, some older"         NL
+"# Subversion clients (notably pre-1.7 clients committing over HTTP) will"   NL
+"# not have yet attached some metadata -- such as the commit log message --" NL
+"# to the txn by the time this hook runs.  Hook authors should therefore"    NL
+"# not assume that a txn which lacks a log message at this stage of the  "   NL
+"# commit will necessarily still lack a log message by the time the commit"  NL
+"# completes."                                                               NL
+"#"                                                                          NL
+HOOKS_ENVIRONMENT_TEXT
+"# "                                                                         NL
+"# Here is an example hook script, for a Unix /bin/sh interpreter."          NL
+PREWRITTEN_HOOKS_TEXT
+""                                                                           NL
+""                                                                           NL
+"REPOS=\"$1\""                                                               NL
+"TXN=\"$2\""                                                                 NL
+""                                                                           NL
+"# If a log message is present, make sure it mentions an issue tracker id."  NL
+"SVNLOOK=" SVN_BINDIR "/svnlook"                                             NL
+"if $SVNLOOK log -t \"$TXN\" \"$REPOS\" | \\"                                NL
+"   grep \"[a-zA-Z0-9]\" > /dev/null; then \\"                               NL
+"       $SVNLOOK log -t \"$TXN\" \"$REPOS\" | \\"                            NL
+"           grep -E \"issue [0-9]+\" > /dev/null || exit 1; fi"              NL
+""                                                                           NL
+"# All checks passed, so allow the commit to proceed."                       NL
+"exit 0"                                                                     NL;
+
+#undef SCRIPT_NAME
+    SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
+              _("Creating init-commit hook"));
+
+    SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
+  }  /* end init-commit hook */
+
+
   /* Pre-commit hook. */
   {
     this_path = apr_psprintf(pool, "%s%s",

Modified: subversion/branches/inheritable-props/subversion/libsvn_repos/repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_repos/repos.h?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_repos/repos.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_repos/repos.h Wed Aug 22 17:47:44 2012
@@ -70,6 +70,7 @@ extern "C" {
 
 /* In the repository hooks directory, look for these files. */
 #define SVN_REPOS__HOOK_START_COMMIT    "start-commit"
+#define SVN_REPOS__HOOK_INIT_COMMIT     "init-commit"
 #define SVN_REPOS__HOOK_PRE_COMMIT      "pre-commit"
 #define SVN_REPOS__HOOK_POST_COMMIT     "post-commit"
 #define SVN_REPOS__HOOK_READ_SENTINEL   "read-sentinels"
@@ -163,6 +164,15 @@ svn_repos__hooks_start_commit(svn_repos_
                               const apr_array_header_t *capabilities,
                               apr_pool_t *pool);
 
+/* Run the init-commit hook for REPOS.  Use POOL for any temporary
+   allocations.  If the hook fails, return SVN_ERR_REPOS_HOOK_FAILURE.
+
+   TXN_NAME is the name of the transaction that is being committed.  */
+svn_error_t *
+svn_repos__hooks_init_commit(svn_repos_t *repos,
+                             const char *txn_name,
+                             apr_pool_t *pool);
+
 /* Run the pre-commit hook for REPOS.  Use POOL for any temporary
    allocations.  If the hook fails, return SVN_ERR_REPOS_HOOK_FAILURE.
 

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/auth.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/auth.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/auth.c Wed Aug 22 17:47:44 2012
@@ -523,34 +523,29 @@ svn_auth_get_platform_specific_client_pr
   apr_array_header_t *password_stores;
   int i;
 
+#define SVN__MAYBE_ADD_PROVIDER(list, p) \
+  { if (p) APR_ARRAY_PUSH(list, svn_auth_provider_object_t *) = p; }
+
 #define SVN__DEFAULT_AUTH_PROVIDER_LIST \
          "gnome-keyring,kwallet,keychain,gpg-agent,windows-cryptoapi"
 
-  if (config)
-    {
-      svn_config_get
-        (config,
-         &password_stores_config_option,
-         SVN_CONFIG_SECTION_AUTH,
-         SVN_CONFIG_OPTION_PASSWORD_STORES,
-         SVN__DEFAULT_AUTH_PROVIDER_LIST);
-    }
-  else
-    {
-      password_stores_config_option = SVN__DEFAULT_AUTH_PROVIDER_LIST;
-    }
-
   *providers = apr_array_make(pool, 12, sizeof(svn_auth_provider_object_t *));
 
-  password_stores
-    = svn_cstring_split(password_stores_config_option, " ,", TRUE, pool);
+  /* Fetch the configured list of password stores, and split them into
+     an array. */
+  svn_config_get(config,
+                 &password_stores_config_option,
+                 SVN_CONFIG_SECTION_AUTH,
+                 SVN_CONFIG_OPTION_PASSWORD_STORES,
+                 SVN__DEFAULT_AUTH_PROVIDER_LIST);
+  password_stores = svn_cstring_split(password_stores_config_option,
+                                      " ,", TRUE, pool);
 
   for (i = 0; i < password_stores->nelts; i++)
     {
       const char *password_store = APR_ARRAY_IDX(password_stores, i,
                                                  const char *);
 
-
       /* GNOME Keyring */
       if (apr_strnatcmp(password_store, "gnome-keyring") == 0)
         {
@@ -558,104 +553,68 @@ svn_auth_get_platform_specific_client_pr
                                                           "gnome_keyring",
                                                           "simple",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
 
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "gnome_keyring",
                                                           "ssl_client_cert_pw",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
-
-          continue;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
         }
-
       /* GPG-AGENT */
-      if (apr_strnatcmp(password_store, "gpg-agent") == 0)
+      else if (apr_strnatcmp(password_store, "gpg-agent") == 0)
         {
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "gpg_agent",
                                                           "simple",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
-
-          continue;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
         }
-
       /* KWallet */
-      if (apr_strnatcmp(password_store, "kwallet") == 0)
+      else if (apr_strnatcmp(password_store, "kwallet") == 0)
         {
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "kwallet",
                                                           "simple",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
 
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "kwallet",
                                                           "ssl_client_cert_pw",
                                                           pool));
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
-
-          continue;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
         }
-
       /* Keychain */
-      if (apr_strnatcmp(password_store, "keychain") == 0)
+      else if (apr_strnatcmp(password_store, "keychain") == 0)
         {
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "keychain",
                                                           "simple",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
 
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "keychain",
                                                           "ssl_client_cert_pw",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
-
-          continue;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
         }
-
       /* Windows */
-      if (apr_strnatcmp(password_store, "windows-cryptoapi") == 0)
+      else if (apr_strnatcmp(password_store, "windows-cryptoapi") == 0)
         {
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "windows",
                                                           "simple",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
 
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "windows",
                                                           "ssl_client_cert_pw",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
-
-          continue;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
         }
-
-      return svn_error_createf(SVN_ERR_BAD_CONFIG_VALUE, NULL,
-                               _("Invalid config: unknown password store "
-                                 "'%s'"),
-                               password_store);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/sysinfo.c Wed Aug 22 17:47:44 2012
@@ -55,6 +55,7 @@
 
 #if HAVE_UNAME
 static const char* canonical_host_from_uname(apr_pool_t *pool);
+static const char* release_name_from_uname(apr_pool_t *pool);
 #endif
 
 #ifdef WIN32
@@ -71,10 +72,10 @@ static const char *macos_release_name(ap
 const char *
 svn_sysinfo__canonical_host(apr_pool_t *pool)
 {
-#if HAVE_UNAME
-  return canonical_host_from_uname(pool);
-#elif defined(WIN32)
+#ifdef WIN32
   return win32_canonical_host(pool);
+#elif HAVE_UNAME
+  return canonical_host_from_uname(pool);
 #else
   return "unknown-unknown-unknown";
 #endif
@@ -86,8 +87,10 @@ svn_sysinfo__release_name(apr_pool_t *po
 {
 #ifdef WIN32
   return win32_release_name(pool);
-#elif defined(SVN_HAVE_MACOS_PLIST)
+#elif SVN_HAVE_MACOS_PLIST
   return macos_release_name(pool);
+#elif HAVE_UNAME
+  return release_name_from_uname(pool);
 #else
   return NULL;
 #endif
@@ -144,16 +147,68 @@ canonical_host_from_uname(apr_pool_t *po
 
       if (0 == strcmp(sysname, "darwin"))
         vendor = "apple";
-
-      err = svn_utf_cstring_to_utf8(&tmp, info.release, pool);
-      if (err)
-        svn_error_clear(err);
+      if (0 == strcmp(sysname, "linux"))
+        sysver = "-gnu";
       else
-        sysver = tmp;
+        {
+          err = svn_utf_cstring_to_utf8(&tmp, info.release, pool);
+          if (err)
+            svn_error_clear(err);
+          else
+            {
+              apr_size_t n = strspn(tmp, ".0123456789");
+              if (n > 0)
+                {
+                  char *ver = apr_pstrdup(pool, tmp);
+                  ver[n] = 0;
+                  sysver = ver;
+                }
+              else
+                sysver = tmp;
+            }
+        }
     }
 
   return apr_psprintf(pool, "%s-%s-%s%s", machine, vendor, sysname, sysver);
 }
+
+/* Generate a release name from the uname(3) info, effectively
+   returning "`uname -s` `uname -r`". */
+static const char *
+release_name_from_uname(apr_pool_t *pool)
+{
+  struct utsname info;
+  if (0 <= uname(&info))
+    {
+      svn_error_t *err;
+      const char *sysname;
+      const char *sysver;
+
+      err = svn_utf_cstring_to_utf8(&sysname, info.sysname, pool);
+      if (err)
+        {
+          sysname = NULL;
+          svn_error_clear(err);
+        }
+
+
+      err = svn_utf_cstring_to_utf8(&sysver, info.release, pool);
+      if (err)
+        {
+          sysver = NULL;
+          svn_error_clear(err);
+        }
+
+      if (sysname || sysver)
+        {
+          return apr_psprintf(pool, "%s%s%s",
+                              (sysname ? sysname : ""),
+                              (sysver ? (sysname ? " " : "") : ""),
+                              (sysver ? sysver : ""));
+        }
+    }
+  return NULL;
+}
 #endif  /* HAVE_UNAME */
 
 
@@ -613,6 +668,9 @@ release_name_from_version(const char *os
   return NULL;
 }
 
+/* Construct the release name from information stored in the Mac OS X
+   "SystemVersion.plist" file (or ServerVersion.plist, for Mac Os
+   Server. */
 static const char *
 macos_release_name(apr_pool_t *pool)
 {

Modified: subversion/branches/inheritable-props/subversion/mod_dav_svn/activity.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/mod_dav_svn/activity.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/mod_dav_svn/activity.c (original)
+++ subversion/branches/inheritable-props/subversion/mod_dav_svn/activity.c Wed Aug 22 17:47:44 2012
@@ -240,16 +240,21 @@ dav_svn__store_activity(const dav_svn_re
 dav_error *
 dav_svn__create_txn(const dav_svn_repos *repos,
                     const char **ptxn_name,
+                    apr_hash_t *revprops,
                     apr_pool_t *pool)
 {
   svn_revnum_t rev;
   svn_fs_txn_t *txn;
   svn_error_t *serr;
-  apr_hash_t *revprop_table = apr_hash_make(pool);
+
+  if (! revprops)
+    {
+      revprops = apr_hash_make(pool);
+    }
 
   if (repos->username)
     {
-      apr_hash_set(revprop_table, SVN_PROP_REVISION_AUTHOR, APR_HASH_KEY_STRING,
+      apr_hash_set(revprops, SVN_PROP_REVISION_AUTHOR, APR_HASH_KEY_STRING,
                    svn_string_create(repos->username, pool));
     }
 
@@ -262,8 +267,7 @@ dav_svn__create_txn(const dav_svn_repos 
     }
 
   serr = svn_repos_fs_begin_txn_for_commit2(&txn, repos->repos, rev,
-                                            revprop_table,
-                                            repos->pool);
+                                            revprops, repos->pool);
   if (serr != NULL)
     {
       return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,

Modified: subversion/branches/inheritable-props/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/mod_dav_svn/dav_svn.h?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/inheritable-props/subversion/mod_dav_svn/dav_svn.h Wed Aug 22 17:47:44 2012
@@ -420,10 +420,17 @@ const char *dav_svn__get_vtxn_root_stub(
 /*** activity.c ***/
 
 /* Create a new transaction based on HEAD in REPOS, setting *PTXN_NAME
-   to the name of that transaction.  Use POOL for allocations. */
+   to the name of that transaction.  REVPROPS is an optional hash of
+   const char * property names and const svn_string_t * values which
+   will be set as transactions properties on the transaction this
+   function creates.  Use POOL for allocations.
+
+   NOTE:  This function will overwrite the svn:author property, if
+   any, found in REVPROPS.  */
 dav_error *
 dav_svn__create_txn(const dav_svn_repos *repos,
                     const char **ptxn_name,
+                    apr_hash_t *revprops,
                     apr_pool_t *pool);
 
 /* If it exists, abort the transaction named TXN_NAME from REPOS.  Use
@@ -675,20 +682,15 @@ dav_svn__get_inherited_props_report(cons
 
 /*** posts/ ***/
 
-/* The list of Subversion's custom POSTs. */
-/* ### TODO:  Populate this list and transmit its contents in the
-   ### OPTIONS response.
-static const char * dav_svn__posts_list[] = {
-  "create-txn",
-  NULL
-};
-*/
-
 /* The various POST handlers, defined in posts/, and used by repos.c.  */
 dav_error *
 dav_svn__post_create_txn(const dav_resource *resource,
                          svn_skel_t *request_skel,
                          ap_filter_t *output);
+dav_error *
+dav_svn__post_create_txn_with_props(const dav_resource *resource,
+                                    svn_skel_t *request_skel,
+                                    ap_filter_t *output);
 
 /*** authz.c ***/
 

Modified: subversion/branches/inheritable-props/subversion/mod_dav_svn/posts/create_txn.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/mod_dav_svn/posts/create_txn.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/mod_dav_svn/posts/create_txn.c (original)
+++ subversion/branches/inheritable-props/subversion/mod_dav_svn/posts/create_txn.c Wed Aug 22 17:47:44 2012
@@ -42,13 +42,64 @@ dav_svn__post_create_txn(const dav_resou
   request_rec *r = resource->info->r;
 
   /* Create a Subversion repository transaction based on HEAD. */
-  if ((derr = dav_svn__create_txn(resource->info->repos, &txn_name,
+  if ((derr = dav_svn__create_txn(resource->info->repos, &txn_name, NULL,
                                   resource->pool)))
     return derr;
 
   /* Build a "201 Created" response with header that tells the
      client our new transaction's name. */
-  vtxn_name =  apr_table_get(r->headers_in, SVN_DAV_VTXN_NAME_HEADER);
+  vtxn_name = apr_table_get(r->headers_in, SVN_DAV_VTXN_NAME_HEADER);
+  if (vtxn_name && vtxn_name[0])
+    {
+      /* If the client supplied a vtxn name then store a mapping from
+         the client name to the FS transaction name in the activity
+         database. */
+      if ((derr  = dav_svn__store_activity(resource->info->repos,
+                                           vtxn_name, txn_name)))
+        return derr;
+      apr_table_set(r->headers_out, SVN_DAV_VTXN_NAME_HEADER, vtxn_name);
+    }
+  else
+    apr_table_set(r->headers_out, SVN_DAV_TXN_NAME_HEADER, txn_name);
+
+  r->status = HTTP_CREATED;
+
+  return NULL;
+}
+
+
+/* Respond to a "create-txn-with-props" POST request.
+ *
+ * Syntax:  ( create-txn-with-props (PROPNAME PROPVAL [PROPNAME PROPVAL ...])
+ */
+dav_error *
+dav_svn__post_create_txn_with_props(const dav_resource *resource,
+                                    svn_skel_t *request_skel,
+                                    ap_filter_t *output)
+{
+  const char *txn_name;
+  const char *vtxn_name;
+  dav_error *derr;
+  svn_error_t *err;
+  request_rec *r = resource->info->r;
+  apr_hash_t *revprops;
+  svn_skel_t *proplist_skel = request_skel->children->next;
+
+  if ((err = svn_skel__parse_proplist(&revprops, proplist_skel,
+                                      resource->pool)))
+    {
+      return dav_svn__convert_err(err, HTTP_BAD_REQUEST,
+                                  "Malformatted request skel", resource->pool);
+    }
+  
+  /* Create a Subversion repository transaction based on HEAD. */
+  if ((derr = dav_svn__create_txn(resource->info->repos, &txn_name,
+                                  revprops, resource->pool)))
+    return derr;
+
+  /* Build a "201 Created" response with header that tells the
+     client our new transaction's name. */
+  vtxn_name = apr_table_get(r->headers_in, SVN_DAV_VTXN_NAME_HEADER);
   if (vtxn_name && vtxn_name[0])
     {
       /* If the client supplied a vtxn name then store a mapping from

Modified: subversion/branches/inheritable-props/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/mod_dav_svn/repos.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/inheritable-props/subversion/mod_dav_svn/repos.c Wed Aug 22 17:47:44 2012
@@ -4444,7 +4444,7 @@ handle_post_request(request_rec *r,
                     dav_resource *resource,
                     ap_filter_t *output)
 {
-  svn_skel_t *request_skel;
+  svn_skel_t *request_skel, *post_skel;
   int status;
   apr_pool_t *pool = resource->pool;
 
@@ -4461,16 +4461,23 @@ handle_post_request(request_rec *r,
     return dav_svn__new_error(pool, HTTP_BAD_REQUEST, 0,
                               "Unable to identify skel POST request flavor.");
 
-  if (svn_skel__matches_atom(request_skel->children, "create-txn"))
+  post_skel = request_skel->children;
+
+  /* NOTE: If you add POST handlers here, you'll want to advertise
+     that the server supports them, too.  See version.c:get_option(). */
+
+  if (svn_skel__matches_atom(post_skel, "create-txn"))
     {
       return dav_svn__post_create_txn(resource, request_skel, output);
     }
-  else
+  else if (svn_skel__matches_atom(post_skel, "create-txn-with-props"))
     {
-      return dav_svn__new_error(pool, HTTP_BAD_REQUEST, 0,
-                                "Unsupported skel POST request flavor.");
+      return dav_svn__post_create_txn_with_props(resource,
+                                                 request_skel, output);
     }
-  /* NOTREACHED */
+
+  return dav_svn__new_error(pool, HTTP_BAD_REQUEST, 0,
+                            "Unsupported skel POST request flavor.");
 }
 
 int dav_svn__method_post(request_rec *r)

Modified: subversion/branches/inheritable-props/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/mod_dav_svn/version.c?rev=1376157&r1=1376156&r2=1376157&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/inheritable-props/subversion/mod_dav_svn/version.c Wed Aug 22 17:47:44 2012
@@ -235,6 +235,16 @@ get_option(const dav_resource *resource,
      DeltaV-free!  If we're configured to advise this support, do so.  */
   if (resource->info->repos->v2_protocol)
     {
+      /* The list of Subversion's custom POSTs.  You'll want to keep
+         this in sync with the handling of these suckers in
+         handle_post_request().  */
+      static const char * posts_list[] = {
+        "create-txn",
+        "create-txn-with-props",
+        NULL
+      };
+      const char **this_post = posts_list;
+
       apr_table_set(r->headers_out, SVN_DAV_ROOT_URI_HEADER, repos_root_uri);
       apr_table_set(r->headers_out, SVN_DAV_ME_RESOURCE_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
@@ -257,6 +267,15 @@ get_option(const dav_resource *resource,
       apr_table_set(r->headers_out, SVN_DAV_VTXN_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
                                 dav_svn__get_vtxn_stub(r), (char *)NULL));
+
+      /* Report the supported POST types. */
+      while (*this_post)
+        {
+          apr_table_addn(r->headers_out, SVN_DAV_SUPPORTED_POSTS_HEADER,
+                         apr_pstrcat(resource->pool, *this_post,
+                                     (char *)NULL));
+          this_post++;
+        }
     }
 
   return NULL;
@@ -399,7 +418,7 @@ dav_svn__checkout(dav_resource *resource
           shared_activity = apr_pstrdup(resource->info->r->pool, uuid_buf);
 
           derr = dav_svn__create_txn(resource->info->repos, &shared_txn_name,
-                                     resource->info->r->pool);
+                                     NULL, resource->info->r->pool);
           if (derr) return derr;
 
           derr = dav_svn__store_activity(resource->info->repos,
@@ -1143,7 +1162,8 @@ make_activity(dav_resource *resource)
                                   SVN_DAV_ERROR_NAMESPACE,
                                   SVN_DAV_ERROR_TAG);
 
-  err = dav_svn__create_txn(resource->info->repos, &txn_name, resource->pool);
+  err = dav_svn__create_txn(resource->info->repos, &txn_name, 
+                            NULL, resource->pool);
   if (err != NULL)
     return err;
 



Mime
View raw message