You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/12/14 05:14:20 UTC
svn commit: r1421664 [1/4] - in /subversion/branches/in-repo-authz: ./
build/ build/ac-macros/ contrib/server-side/svncutter/
subversion/bindings/swig/ subversion/bindings/swig/python/tests/
subversion/bindings/swig/ruby/libsvn_swig_ruby/ subversion/in...
Author: breser
Date: Fri Dec 14 04:14:09 2012
New Revision: 1421664
URL: http://svn.apache.org/viewvc?rev=1421664&view=rev
Log:
Sync the 'in-repo-authz' branch with recent trunk changes.
(Merged /subversion/trunk:r1418751-r1421661.)
Added:
subversion/branches/in-repo-authz/subversion/bindings/swig/python/tests/checksum.py
- copied unchanged from r1421661, subversion/trunk/subversion/bindings/swig/python/tests/checksum.py
subversion/branches/in-repo-authz/subversion/libsvn_client/import.c
- copied unchanged from r1421661, subversion/trunk/subversion/libsvn_client/import.c
subversion/branches/in-repo-authz/subversion/libsvn_wc/token-map.h
- copied unchanged from r1421661, subversion/trunk/subversion/libsvn_wc/token-map.h
subversion/branches/in-repo-authz/subversion/tests/libsvn_ra/ (props changed)
- copied from r1421661, subversion/trunk/subversion/tests/libsvn_ra/
Modified:
subversion/branches/in-repo-authz/ (props changed)
subversion/branches/in-repo-authz/CHANGES
subversion/branches/in-repo-authz/Makefile.in
subversion/branches/in-repo-authz/build.conf
subversion/branches/in-repo-authz/build/ac-macros/svn-macros.m4
subversion/branches/in-repo-authz/build/ac-macros/swig.m4
subversion/branches/in-repo-authz/build/run_tests.py
subversion/branches/in-repo-authz/build/transform_sql.py
subversion/branches/in-repo-authz/configure.ac
subversion/branches/in-repo-authz/contrib/server-side/svncutter/svncutter
subversion/branches/in-repo-authz/get-deps.sh
subversion/branches/in-repo-authz/subversion/bindings/swig/core.i
subversion/branches/in-repo-authz/subversion/bindings/swig/python/tests/run_all.py
subversion/branches/in-repo-authz/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
subversion/branches/in-repo-authz/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
subversion/branches/in-repo-authz/subversion/include/private/svn_skel.h
subversion/branches/in-repo-authz/subversion/include/private/svn_sqlite.h
subversion/branches/in-repo-authz/subversion/include/svn_client.h
subversion/branches/in-repo-authz/subversion/include/svn_config.h
subversion/branches/in-repo-authz/subversion/include/svn_repos.h
subversion/branches/in-repo-authz/subversion/include/svn_wc.h
subversion/branches/in-repo-authz/subversion/libsvn_auth_kwallet/kwallet.cpp
subversion/branches/in-repo-authz/subversion/libsvn_client/add.c
subversion/branches/in-repo-authz/subversion/libsvn_client/commit.c
subversion/branches/in-repo-authz/subversion/libsvn_client/merge.c
subversion/branches/in-repo-authz/subversion/libsvn_fs/fs-loader.c
subversion/branches/in-repo-authz/subversion/libsvn_fs_base/dag.c
subversion/branches/in-repo-authz/subversion/libsvn_fs_base/dag.h
subversion/branches/in-repo-authz/subversion/libsvn_fs_fs/fs_fs.c
subversion/branches/in-repo-authz/subversion/libsvn_ra/compat.c
subversion/branches/in-repo-authz/subversion/libsvn_ra/ra_loader.c
subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/commit.c
subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/ra_serf.h
subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/replay.c
subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/serf.c
subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/update.c
subversion/branches/in-repo-authz/subversion/libsvn_ra_svn/cyrus_auth.c
subversion/branches/in-repo-authz/subversion/libsvn_subr/auth.c
subversion/branches/in-repo-authz/subversion/libsvn_subr/config_file.c
subversion/branches/in-repo-authz/subversion/libsvn_subr/skel.c
subversion/branches/in-repo-authz/subversion/libsvn_subr/sqlite.c
subversion/branches/in-repo-authz/subversion/libsvn_subr/sysinfo.c
subversion/branches/in-repo-authz/subversion/libsvn_wc/adm_ops.c
subversion/branches/in-repo-authz/subversion/libsvn_wc/conflicts.c
subversion/branches/in-repo-authz/subversion/libsvn_wc/conflicts.h
subversion/branches/in-repo-authz/subversion/libsvn_wc/deprecated.c
subversion/branches/in-repo-authz/subversion/libsvn_wc/merge.c
subversion/branches/in-repo-authz/subversion/libsvn_wc/props.c
subversion/branches/in-repo-authz/subversion/libsvn_wc/props.h
subversion/branches/in-repo-authz/subversion/libsvn_wc/upgrade.c
subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-metadata.sql
subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-queries.sql
subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c
subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h
subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h
subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c
subversion/branches/in-repo-authz/subversion/mod_dav_svn/mirror.c
subversion/branches/in-repo-authz/subversion/tests/README
subversion/branches/in-repo-authz/subversion/tests/cmdline/README
subversion/branches/in-repo-authz/subversion/tests/cmdline/davautocheck.sh
subversion/branches/in-repo-authz/subversion/tests/cmdline/prop_tests.py
subversion/branches/in-repo-authz/subversion/tests/cmdline/svnrdump_tests.py
subversion/branches/in-repo-authz/subversion/tests/cmdline/svnserveautocheck.sh
subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/op-depth-test.c
subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/wc-queries-test.c
subversion/branches/in-repo-authz/tools/dev/contribulyze.py
subversion/branches/in-repo-authz/tools/dist/ (props changed)
subversion/branches/in-repo-authz/tools/dist/release.py
Propchange: subversion/branches/in-repo-authz/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 14 04:14:09 2012
@@ -49,3 +49,5 @@ mkmf.log
zlib
sqlite-amalgamation
serf
+.git
+.gitignore
Propchange: subversion/branches/in-repo-authz/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1418751-1421661
Modified: subversion/branches/in-repo-authz/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/CHANGES?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/CHANGES (original)
+++ subversion/branches/in-repo-authz/CHANGES Fri Dec 14 04:14:09 2012
@@ -55,6 +55,37 @@ http://svn.apache.org/repos/asf/subversi
* star-imports in swig-py only import 'svn_*' symbols (r1303375)
+Version 1.7.8
+(17 Dec 2012, from /branches/1.7.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.7.8
+ User-visible changes
+ - Client- and server-side bugfixes:
+ * Fix typos in pt_BR, es and zh_TW translations (r1402417, r1402421)
+
+ - Client-side bugfixes:
+ * fix crash with --username option on Windows (r1396285)
+ * add missing attributes to "svn log -v --xml" output (r1398100)
+ * fix svn patch ignoring hunks after no trailing newline (r139917)
+ * fix hang with ra_serf during error processing (r1403583)
+ * ignore file externals with mergeinfo when merging (r1401915)
+ * fix "svnmucc cp" segfault with a missing last argument (issue #4079)
+ * fix conflict handling on symlinks (issue #4091)
+
+ - Server-side bugfixes:
+ * properly detect threading availability (r1398325)
+ * fix "svnadmin load --bypass-prop-validation" (r1237779)
+ * fix parsing of [groupsfoo] sections in authz file (issue #3531)
+ * add Vary: header to GET responses to improve cacheability (r1390653)
+ * fix fs_fs to cleanup after failed rep transmission (r1403964, et al)
+ * fix mod_dav_svn to complain about revisions > HEAD (r1403588)
+
+ Developer-visible changes:
+ - General:
+ * fix incorrect status returned by 1.6 API (r1403258)
+ * fix compilation with g++ 4.7 (r1345740)
+ * fix svn_uri_get_file_url_from_dirent on Windows (r1409146)
+
+
Version 1.7.7
(09 Oct 2012, from /branches/1.7.x)
http://svn.apache.org/repos/asf/subversion/tags/1.7.7
Modified: subversion/branches/in-repo-authz/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/Makefile.in?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/Makefile.in (original)
+++ subversion/branches/in-repo-authz/Makefile.in Fri Dec 14 04:14:09 2012
@@ -589,8 +589,9 @@ gcov-clean:
find . -name "*.gcda" -o -name "*.gcno" -print0 | xargs -0 rm -f
check-clean: gcov-clean
- rm -rf subversion/tests/cmdline/svn-test-work \
- subversion/tests/libsvn_fs/test-repo-* \
+ find subversion/tests/cmdline/svn-test-work -print0 \
+ -mindepth 1 -maxdepth 1 | xargs -0 rm -rf; \
+ rm -rf subversion/tests/libsvn_fs/test-repo-* \
subversion/tests/libsvn_fs_base/test-repo-* \
subversion/tests/libsvn_fs_fs/test-repo-* \
subversion/tests/libsvn_ra_local/test-repo-* \
Modified: subversion/branches/in-repo-authz/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/build.conf?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/build.conf (original)
+++ subversion/branches/in-repo-authz/build.conf Fri Dec 14 04:14:09 2012
@@ -970,6 +970,18 @@ install = test
libs = libsvn_test libsvn_diff libsvn_subr apriconv apr
# ----------------------------------------------------------------------------
+# Tests for libsvn_ra
+
+[ra-test]
+description = Test a few things in libsvn_ra
+type = exe
+path = subversion/tests/libsvn_ra
+sources = ra-test.c
+install = test
+libs = libsvn_test libsvn_ra libsvn_fs libsvn_delta libsvn_subr
+ apriconv apr
+
+# ----------------------------------------------------------------------------
# Tests for libsvn_ra_local
[ra-local-test]
@@ -1195,6 +1207,7 @@ libs = __ALL__
translate-test
random-test window-test
diff-diff3-test
+ ra-test
ra-local-test
svndiff-test vdelta-test
entries-dump atomic-ra-revprop-change wc-lock-tester wc-incomplete-tester
Modified: subversion/branches/in-repo-authz/build/ac-macros/svn-macros.m4
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/build/ac-macros/svn-macros.m4?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/build/ac-macros/svn-macros.m4 (original)
+++ subversion/branches/in-repo-authz/build/ac-macros/svn-macros.m4 Fri Dec 14 04:14:09 2012
@@ -172,6 +172,16 @@ AC_DEFUN(SVN_MAYBE_ADD_TO_CFLAGS,
fi
])
+dnl SVN_STRIP_FLAG(FLAG_VAR_NAME, FLAG)
+dnl
+dnl Remove FLAG from the variable FLAG_VAR_NAME, if it exists. This macro
+dnl is primarily used for removing unwanted compiler flags, but is really
+dnl just a general wrapper around `sed'.
+AC_DEFUN(SVN_STRIP_FLAG,
+[
+ $1=`echo "$$1" | $SED -e 's/$2//'`
+])
+
dnl SVN_REMOVE_STANDARD_LIB_DIRS(OPTIONS)
dnl
dnl Remove standard library search directories.
Modified: subversion/branches/in-repo-authz/build/ac-macros/swig.m4
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/build/ac-macros/swig.m4?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/build/ac-macros/swig.m4 (original)
+++ subversion/branches/in-repo-authz/build/ac-macros/swig.m4 Fri Dec 14 04:14:09 2012
@@ -120,9 +120,13 @@ AC_DEFUN(SVN_FIND_SWIG,
])
SWIG_PY_COMPILE="$ac_cv_python_compile $CFLAGS"
- dnl Swig-generated code results in a number of shadowed variables, so
- dnl ignore those warnings when compiling swig-py
- SWIG_PY_COMPILE=`echo "$SWIG_PY_COMPILE" | $SED -e 's/-Wshadow //'`
+ dnl Swig-generated code results in a number of shadowed variables and other
+ dnl warnings, so ignore them when compiling swig-py
+ SVN_STRIP_FLAG(SWIG_PY_COMPILE, [-Wall])
+ SVN_STRIP_FLAG(SWIG_PY_COMPILE, [-Wunused])
+ SVN_STRIP_FLAG(SWIG_PY_COMPILE, [-Wshadow])
+ SVN_STRIP_FLAG(SWIG_PY_COMPILE, [-Wmissing-prototypes])
+ SVN_STRIP_FLAG(SWIG_PY_COMPILE, [-Wmissing-declarations])
AC_CACHE_CHECK([for linking Python extensions], [ac_cv_python_link],[
ac_cv_python_link="`$PYTHON ${abs_srcdir}/build/get-py-info.py --link`"
@@ -214,6 +218,17 @@ AC_DEFUN(SVN_FIND_SWIG,
])
SWIG_RB_COMPILE="$svn_cv_ruby_compile"
+ dnl The swig bindings create a lot of spurious warnings with several of
+ dnl our standard compiler flags, so filter them out here
+ SVN_STRIP_FLAG(SWIG_RB_COMPILE, [-Wall])
+ SVN_STRIP_FLAG(SWIG_RB_COMPILE, [-Wunused])
+ SVN_STRIP_FLAG(SWIG_RB_COMPILE, [-Wshadow])
+ SVN_STRIP_FLAG(SWIG_RB_COMPILE, [-Wstrict-prototypes])
+ SVN_STRIP_FLAG(SWIG_RB_COMPILE, [-Wmissing-declarations])
+ SVN_STRIP_FLAG(SWIG_RB_COMPILE, [-Wmissing-prototypes])
+ SVN_STRIP_FLAG(SWIG_RB_COMPILE, [-Wredundant-decls])
+ SWIG_RB_COMPILE="$SWIG_RB_COMPILE -Wno-int-to-pointer-cast"
+
AC_CACHE_CHECK([how to link Ruby extensions], [svn_cv_ruby_link],[
svn_cv_ruby_link="`$RUBY -e 'ARGV.shift; print ARGV.join(%q( ))' \
$rbconfig_LDSHARED`"
Modified: subversion/branches/in-repo-authz/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/build/run_tests.py?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/build/run_tests.py (original)
+++ subversion/branches/in-repo-authz/build/run_tests.py Fri Dec 14 04:14:09 2012
@@ -354,7 +354,7 @@ class TestHarness:
if self.config_file is not None:
cmdline.append('--config-file=' + self.config_file)
else:
- print('Don\'t know what to do about ' + progbase)
+ print("Don't know what to do about " + progbase)
sys.exit(1)
if self.verbose is not None:
@@ -433,8 +433,8 @@ class TestHarness:
prog_mod = imp.load_module(progbase[:-3], open(prog, 'r'), prog,
('.py', 'U', imp.PY_SOURCE))
except:
- print('Don\'t know what to do about ' + progbase)
- raise
+ print("Don't know what to do about " + progbase)
+ sys.exit(1)
import svntest.main
Modified: subversion/branches/in-repo-authz/build/transform_sql.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/build/transform_sql.py?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/build/transform_sql.py (original)
+++ subversion/branches/in-repo-authz/build/transform_sql.py Fri Dec 14 04:14:09 2012
@@ -25,11 +25,19 @@
#
+import operator
import os
import re
import sys
+# operator.methodcaller doesn't exist in Python 2.5.
+if not hasattr(operator, 'methodcaller'):
+ def methodcaller(method, *args, **kwargs):
+ return lambda x: getattr(x, method)(*args, **kwargs)
+ operator.methodcaller = methodcaller
+ del methodcaller
+
DEFINE_END = ' ""\n\n'
@@ -89,10 +97,11 @@ class Processor(object):
self.output.write(' APR_STRINGIFY(%s) \\\n' % define)
- def __init__(self, dirpath, output, var_name):
+ def __init__(self, dirpath, output, var_name, token_map):
self.dirpath = dirpath
self.output = output
self.var_name = var_name
+ self.token_map = token_map
self.stmt_count = 0
self.var_printed = False
@@ -140,6 +149,11 @@ class Processor(object):
r" AND ((\1) < CASE (\2) WHEN '' THEN X'FFFF' ELSE (\2) || '0' END))",
line)
+ # Another preprocessing.
+ for symbol, string in self.token_map.iteritems():
+ # ### This doesn't sql-escape 'string'
+ line = re.sub(r'\b%s\b' % re.escape(symbol), "'%s'" % string, line)
+
if line.strip():
handled = False
@@ -172,10 +186,51 @@ class Processor(object):
self.var_printed = False
+class NonRewritableDict(dict):
+ """A dictionary that does not allow self[k]=v when k in self
+ (unless v is equal to the stored value).
+
+ (An entry would have to be explicitly deleted before a new value
+ may be entered.)
+ """
+
+ def __setitem__(self, key, val):
+ if self.__contains__(key) and self.__getitem__(key) != val:
+ raise Exception("Can't re-insert key %r with value %r "
+ "(already present with value %r)"
+ % (key, val, self.__getitem__(key)))
+ super(NonRewritableDict, self).__setitem__(key, val)
+
+def hotspots(fd):
+ hotspot = False
+ for line in fd:
+ # hotspot is TRUE within definitions of static const svn_token_map_t[].
+ hotspot ^= int(('svn_token_map_t', '\x7d;')[hotspot] in line)
+ if hotspot:
+ yield line
+
+def extract_token_map(filename):
+ try:
+ fd = open(filename)
+ except IOError:
+ return {}
+
+ pattern = re.compile(r'"(.*?)".*?(MAP_\w*)')
+ return \
+ NonRewritableDict(
+ map(operator.itemgetter(1,0),
+ map(operator.methodcaller('groups'),
+ filter(None,
+ map(pattern.search,
+ hotspots(fd))))))
+
def main(input_filepath, output):
filename = os.path.basename(input_filepath)
input = open(input_filepath, 'r').read()
+ token_map_filename = os.path.dirname(input_filepath) + '/token-map.h'
+ token_map = extract_token_map(token_map_filename)
+
var_name = re.sub('[-.]', '_', filename).upper()
output.write(
@@ -184,7 +239,7 @@ def main(input_filepath, output):
'\n'
% (filename,))
- proc = Processor(os.path.dirname(input_filepath), output, var_name)
+ proc = Processor(os.path.dirname(input_filepath), output, var_name, token_map)
proc.process_file(input)
### the STMT_%d naming precludes *multiple* transform_sql headers from
Modified: subversion/branches/in-repo-authz/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/configure.ac?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/configure.ac (original)
+++ subversion/branches/in-repo-authz/configure.ac Fri Dec 14 04:14:09 2012
@@ -99,18 +99,21 @@ SVN_LIB_APR($APR_VER_REGEXES)
if test `expr $apr_version : 2` -ne 0; then
dnl Bump the library so-version to 2 if using APR-2
dnl (Debian uses so-version 1 for APR-1-with-largefile)
- SVN_LT_SOVERSION="-version-info 2"
+ svn_lib_ver=2
dnl APR-2 provides APRUTIL
apu_config=$apr_config
AC_SUBST(SVN_APRUTIL_INCLUDES)
AC_SUBST(SVN_APRUTIL_CONFIG, ["$apu_config"])
AC_SUBST(SVN_APRUTIL_LIBS)
else
- SVN_LT_SOVERSION="-version-info 0"
+ svn_lib_ver=0
APU_VER_REGEXES=["0\.9\.[7-9] 0\.9\.1[0-9] 1\."]
SVN_LIB_APRUTIL($APU_VER_REGEXES)
fi
+SVN_LT_SOVERSION="-version-info $svn_lib_ver"
AC_SUBST(SVN_LT_SOVERSION)
+AC_DEFINE_UNQUOTED(SVN_SOVERSION, $svn_lib_ver,
+ [Subversion library major verson])
dnl Search for pkg-config
AC_PATH_PROG(PKG_CONFIG, pkg-config)
@@ -145,9 +148,8 @@ SVN_FIND_APACHE(20020903)
dnl Search for SQLite
SQLITE_MINIMUM_VER="3.7.12"
-SQLITE_RECOMMENDED_VER="3.7.12"
-SQLITE_RECOMMENDED_VER_URL="3071200"
-SQLITE_URL="http://www.sqlite.org/sqlite-amalgamation-${SQLITE_RECOMMENDED_VER_URL}.zip"
+SQLITE_RECOMMENDED_VER="3.7.15"
+SQLITE_URL="http://www.sqlite.org/sqlite-amalgamation-$(printf %u%02u%02u%02u $(echo ${SQLITE_RECOMMENDED_VER} | sed -e 's/\./ /g')).zip"
SVN_LIB_SQLITE(${SQLITE_MINIMUM_VER}, ${SQLITE_RECOMMENDED_VER},
${SQLITE_URL})
@@ -1382,12 +1384,12 @@ AC_SUBST(JAVAHL_COMPAT_TESTS_TARGET)
# Strip '-no-cpp-precomp' from CPPFLAGS for the clang compiler
### I think we get this flag from APR, so the fix probably belongs there
if test "$CC" = "clang"; then
- CPPFLAGS=`echo "$CPPFLAGS" | $SED -e 's/-no-cpp-precomp //'`
+ SVN_STRIP_FLAG(CPPFLAGS, [-no-cpp-precomp ])
fi
# Clang also doesn't (yet) support the '-ansi' flag
if test "$CC" = "clang"; then
- CFLAGS=`echo "$CFLAGS" | $SED -e 's/-ansi //'`
+ SVN_STRIP_FLAG(CFLAGS, [-ansi ])
fi
dnl Since this is used only on Unix-y systems, define the path separator as '/'
Modified: subversion/branches/in-repo-authz/contrib/server-side/svncutter/svncutter
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/contrib/server-side/svncutter/svncutter?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/contrib/server-side/svncutter/svncutter (original)
+++ subversion/branches/in-repo-authz/contrib/server-side/svncutter/svncutter Fri Dec 14 04:14:09 2012
@@ -30,6 +30,7 @@ Available subcommands:
log
setlog
skeleton
+ branchdel
"""
oneliners = {
@@ -40,7 +41,8 @@ oneliners = {
"proprename": "Renaming revision properties",
"log": "Extracting log entries",
"setlog": "Mutating log entries",
- "skeleton": "strip content, leave only headers",
+ "skeleton": "Strip content, leave only headers",
+ "branchdel": "Delete a specified branch",
}
helpdict = {
@@ -129,6 +131,11 @@ skeleton: usage: svncutter [-r SELECTION
Strip out all content. Does not produce a valid dumpfile, but may be useful
when you need to examine a particularly complex node structure.
""",
+ "branchdel": """\
+branchdelete: usage: svncutter [-r SELECTION ] branchdel BRANCHNAME
+
+Delete all operations on the specified branch.
+""",
}
import os, sys, calendar, time, getopt, re
@@ -246,6 +253,8 @@ class DumpfileSource(LineBufferedSource)
stash += "V %d%s" % (len(properties[key]), os.linesep)
stash += "%s%s" % (properties[key], os.linesep)
stash += self.flush()
+ while self.peek() == '\n':
+ stash += self.readline()
if self.baton:
self.baton.twirl()
return (revision, stash, properties)
@@ -280,10 +289,10 @@ class DumpfileSource(LineBufferedSource)
#print "I see contents line", repr(line)
if not line:
break
- content += line
if line.startswith("Node-path:") or line.startswith("Revision-number"):
self.push(line)
break
+ content += line
#print "READ NODE ENDS"
return (header, properties, content)
def read_until_next(self, prefix, revmap=None):
@@ -431,6 +440,50 @@ def reference_mapper(value, mutator, fla
value = value[:m.start(1)] + new + value[m.end(1):]
return value
+def report(source, selection, hook):
+ "Apply hook to a portion of the dump file defined by a revision selection."
+ emit = 0 in selection
+ stash = source.read_until_next("Revision-number:")
+ if emit:
+ sys.stdout.write(stash)
+ if not source.has_line_buffered():
+ return
+ while True:
+ nodecount = 0
+ (revision,stash,properties) = source.read_revision_header()
+ if revision in selection:
+ pass
+ elif revision == selection.upperbound()+1:
+ return
+ else:
+ source.read_until_next("Revision-number:")
+ continue
+ while True:
+ line = source.readline()
+ if not line:
+ return
+ elif line == '\n':
+ sys.stdout.write(line)
+ continue
+ elif line.startswith("Revision-number:"):
+ source.push(line)
+ if stash and nodecount == 0:
+ sys.stdout.write(stash)
+ break
+ elif line.startswith("Node-path:"):
+ nodecount += 1
+ source.push(line)
+ (header, properties, content) = source.read_node()
+ emit = hook(header, properties, content)
+ if emit and stash:
+ emit = stash + emit
+ stash = ""
+ sys.stdout.write(emit)
+ continue
+ else:
+ sys.stderr.write("svncutter: parse at %s doesn't look right (%s), aborting!\n" % (revision, repr(line)))
+ sys.exit(1)
+
# Generic machinery ends here, actual command implementations begin
def squash(source, timefuzz,
@@ -657,40 +710,16 @@ def setlog(source, logpatch, selection):
def skeletonize(source, selection):
"Skeletonize a portion of the dump file defined by a revision selection."
- emit = 0 in selection
- stash = source.read_until_next("Revision-number:")
- if emit:
- sys.stdout.write(stash)
- if not source.has_line_buffered():
- return
- while True:
- (revision,stash,properties) = source.read_revision_header()
- if revision in selection:
- sys.stdout.write(stash)
- emit = True
- elif revision == selection.upperbound()+1:
- return
+ report(source, selection, lambda h, p, c: h + p)
+
+def branchdel(source, selection, branchname):
+ "Strip out ops defined by a revision selection and a branch name."
+ def __branchdel(header, properties, content):
+ if re.search("Node-path: " + branchname, header):
+ return ""
else:
- source.read_until_next("Revision-number:")
- continue
- while True:
- line = source.readline()
- if not line:
- return
- elif line == '\n':
- sys.stdout.write(line)
- continue
- elif line.startswith("Revision-number:"):
- source.push(line)
- break
- elif line.startswith("Node-path:"):
- source.push(line)
- (header, properties, content) = source.read_node()
- sys.stdout.write(header + properties)
- continue
- else:
- sys.stderr.write("svncutter: parse at %s doesn't look right (%s), aborting!\n" % (revision, repr(line)))
- sys.exit(1)
+ return header + properties + content
+ report(source, selection, __branchdel)
if __name__ == '__main__':
try:
@@ -761,7 +790,9 @@ if __name__ == '__main__':
sys.stderr.write("svncutter: setlog requires a log entries file.\n")
setlog(DumpfileSource(sys.stdin, baton), logpatch, selection)
elif arguments[0] == "skeleton":
- skeletonize(DumpfileSource(sys.stdin, baton), selection)
+ skeletonize(DumpfileSource(sys.stdin, baton), selection)
+ elif arguments[0] == "branchdel":
+ branchdel(DumpfileSource(sys.stdin, baton), selection, arguments[1])
elif arguments[0] == "help":
if len(arguments) == 1:
sys.stdout.write(__doc__)
Modified: subversion/branches/in-repo-authz/get-deps.sh
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/get-deps.sh?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/get-deps.sh (original)
+++ subversion/branches/in-repo-authz/get-deps.sh Fri Dec 14 04:14:09 2012
@@ -24,13 +24,13 @@
#
APR=apr-1.4.6
-APR_UTIL=apr-util-1.4.1
-SERF=serf-1.0.1
+APR_UTIL=apr-util-1.5.1
+SERF=serf-1.1.1
ZLIB=zlib-1.2.7
-SQLITE_VERSION=3.7.12
-SQLITE=sqlite-amalgamation-$(printf %u%02u%02u%02u $(echo $SQLITE_VERSION | sed -e "s/\./ /g"))
+SQLITE_VERSION=3.7.15
+SQLITE=sqlite-amalgamation-$(printf %u%02u%02u%02u $(echo $SQLITE_VERSION | sed -e 's/\./ /g'))
-HTTPD=httpd-2.2.22
+HTTPD=httpd-2.4.3
APR_ICONV=apr-iconv-1.2.1
BASEDIR=`pwd`
@@ -115,7 +115,11 @@ get_deps() {
if [ $# -gt 0 ]; then
for target; do
- get_$target || usage
+ if [ "$target" -ne "deps" ]; then
+ get_$target || usage
+ else
+ usage
+ fi
done
else
get_apr
Modified: subversion/branches/in-repo-authz/subversion/bindings/swig/core.i
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/bindings/swig/core.i?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/bindings/swig/core.i (original)
+++ subversion/branches/in-repo-authz/subversion/bindings/swig/core.i Fri Dec 14 04:14:09 2012
@@ -786,6 +786,7 @@ svn_swig_pl_set_current_pool (apr_pool_t
%include svn_dirent_uri_h.swg
%include svn_mergeinfo_h.swg
%include svn_io_h.swg
+%include svn_checksum_h.swg
Modified: subversion/branches/in-repo-authz/subversion/bindings/swig/python/tests/run_all.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/bindings/swig/python/tests/run_all.py?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/bindings/swig/python/tests/run_all.py (original)
+++ subversion/branches/in-repo-authz/subversion/bindings/swig/python/tests/run_all.py Fri Dec 14 04:14:09 2012
@@ -19,8 +19,8 @@
#
#
import unittest, setup_path
-import mergeinfo, core, client, delta, pool, ra, wc, repository, auth, \
- trac.versioncontrol.tests
+import mergeinfo, core, client, delta, checksum, pool, ra, wc, repository, \
+ auth, trac.versioncontrol.tests
# Run all tests
@@ -28,6 +28,7 @@ def suite():
"""Run all tests"""
s = unittest.TestSuite()
s.addTest(core.suite())
+ s.addTest(checksum.suite())
s.addTest(mergeinfo.suite())
s.addTest(client.suite())
s.addTest(delta.suite())
Modified: subversion/branches/in-repo-authz/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c (original)
+++ subversion/branches/in-repo-authz/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c Fri Dec 14 04:14:09 2012
@@ -1219,7 +1219,7 @@ r2c_svn_string(VALUE value, void *ctx, a
}
void *
-svn_swig_rb_to_swig_type(VALUE value, void *ctx, apr_pool_t *pool)
+svn_swig_rb_to_swig_type(VALUE value, const void *ctx, apr_pool_t *pool)
{
void **result = NULL;
result = apr_palloc(pool, sizeof(void *));
Modified: subversion/branches/in-repo-authz/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h (original)
+++ subversion/branches/in-repo-authz/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h Fri Dec 14 04:14:09 2012
@@ -112,7 +112,7 @@ SVN_RB_SWIG_SWIGUTIL_EXPORT
void svn_swig_rb_handle_svn_error(svn_error_t *error);
SVN_RB_SWIG_SWIGUTIL_EXPORT
-void *svn_swig_rb_to_swig_type(VALUE value, void *ctx, apr_pool_t *pool);
+void *svn_swig_rb_to_swig_type(VALUE value, const void *ctx, apr_pool_t *pool);
SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_from_swig_type(void *value, void *ctx);
Modified: subversion/branches/in-repo-authz/subversion/include/private/svn_skel.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/private/svn_skel.h?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/private/svn_skel.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/private/svn_skel.h Fri Dec 14 04:14:09 2012
@@ -217,7 +217,7 @@ svn_skel__parse_prop(svn_string_t **prop
for all allocations. */
svn_error_t *
svn_skel__unparse_proplist(svn_skel_t **skel_p,
- apr_hash_t *proplist,
+ const apr_hash_t *proplist,
apr_pool_t *pool);
/* Unparse INHERITED_PROPS, a depth-first ordered array of
Modified: subversion/branches/in-repo-authz/subversion/include/private/svn_sqlite.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/private/svn_sqlite.h?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/private/svn_sqlite.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/private/svn_sqlite.h Fri Dec 14 04:14:09 2012
@@ -288,6 +288,15 @@ svn_sqlite__column_token(svn_sqlite__stm
int column,
const svn_token_map_t *map);
+/* Fetch the word at COLUMN, look it up in the MAP, and return its value.
+ Returns NULL_VAL if the column is null. MALFUNCTION is thrown if the
+ column contains an unknown word. */
+int
+svn_sqlite__column_token_null(svn_sqlite__stmt_t *stmt,
+ int column,
+ const svn_token_map_t *map,
+ int null_val);
+
/* Return the column as a hash of const char * => const svn_string_t *.
If the column is null, then NULL will be stored into *PROPS. The
results will be allocated in RESULT_POOL, and any temporary allocations
@@ -363,7 +372,10 @@ svn_sqlite__result_int64(svn_sqlite__con
svn_error_t *
svn_sqlite__finalize(svn_sqlite__stmt_t *stmt);
-/* Error-handling wrapper around sqlite3_reset. */
+/* Reset STMT by calling sqlite3_reset(), and also clear any bindings to it.
+
+ Note: svn_sqlite__get_statement() calls this function automatically if
+ the requested statement has been used and has not yet been reset. */
svn_error_t *
svn_sqlite__reset(svn_sqlite__stmt_t *stmt);
Modified: subversion/branches/in-repo-authz/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/svn_client.h?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/svn_client.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/svn_client.h Fri Dec 14 04:14:09 2012
@@ -4208,21 +4208,26 @@ svn_client_resolved(const char *path,
/** Perform automatic conflict resolution on a working copy @a path.
*
- * If @a depth is #svn_depth_empty, act only on @a path; if
- * #svn_depth_files, resolve @a path and its conflicted file
- * children (if any); if #svn_depth_immediates, resolve @a path and
- * all its immediate conflicted children (both files and directories,
- * if any); if #svn_depth_infinity, resolve @a path and every
- * conflicted file or directory anywhere beneath it.
- * Note that this operation will try to lock the parent directory of
- * @a path in order to be able to resolve tree-conflicts on @a path.
+ * If @a conflict_choice is
+ *
+ * - #svn_wc_conflict_choose_base:
+ * resolve the conflict with the old file contents
+ *
+ * - #svn_wc_conflict_choose_mine_full:
+ * use the original working contents
+ *
+ * - #svn_wc_conflict_choose_theirs_full:
+ * use the new contents
+ *
+ * - #svn_wc_conflict_choose_merged:
+ * don't change the contents at all, just remove the conflict
+ * status, which is the pre-1.5 behavior.
*
- * If @a conflict_choice is #svn_wc_conflict_choose_base, resolve the
- * conflict with the old file contents; if
- * #svn_wc_conflict_choose_mine_full, use the original working contents;
- * if #svn_wc_conflict_choose_theirs_full, the new contents; and if
- * #svn_wc_conflict_choose_merged, don't change the contents at all,
- * just remove the conflict status, which is the pre-1.5 behavior.
+ * - #svn_wc_conflict_choose_theirs_conflict
+ * ###...
+ *
+ * - #svn_wc_conflict_choose_mine_conflict
+ * ###...
*
* #svn_wc_conflict_choose_theirs_conflict and
* #svn_wc_conflict_choose_mine_conflict are not legal for binary
@@ -4232,6 +4237,16 @@ svn_client_resolved(const char *path,
* If @a path's conflict state is removed and @a ctx->notify_func2 is non-NULL,
* call @a ctx->notify_func2 with @a ctx->notify_baton2 and @a path.
*
+ * If @a depth is #svn_depth_empty, act only on @a path; if
+ * #svn_depth_files, resolve @a path and its conflicted file
+ * children (if any); if #svn_depth_immediates, resolve @a path and
+ * all its immediate conflicted children (both files and directories,
+ * if any); if #svn_depth_infinity, resolve @a path and every
+ * conflicted file or directory anywhere beneath it.
+ *
+ * Note that this operation will try to lock the parent directory of
+ * @a path in order to be able to resolve tree-conflicts on @a path.
+ *
* @since New in 1.5.
*/
svn_error_t *
Modified: subversion/branches/in-repo-authz/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/svn_config.h?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/svn_config.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/svn_config.h Fri Dec 14 04:14:09 2012
@@ -88,7 +88,9 @@ typedef struct svn_config_t svn_config_t
"store-ssl-client-cert-pp-plaintext"
#define SVN_CONFIG_OPTION_USERNAME "username"
/** @since New in 1.8. */
-#define SVN_CONFIG_OPTION_BULK_UPDATES "bulk-updates"
+#define SVN_CONFIG_OPTION_HTTP_BULK_UPDATES "http-bulk-updates"
+/** @since New in 1.8. */
+#define SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS "http-max-connections"
#define SVN_CONFIG_CATEGORY_CONFIG "config"
#define SVN_CONFIG_SECTION_AUTH "auth"
@@ -180,6 +182,7 @@ typedef struct svn_config_t svn_config_t
#define SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP TRUE
#define SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \
SVN_CONFIG_ASK
+#define SVN_CONFIG_DEFAULT_OPTION_HTTP_MAX_CONNECTIONS 4
/** Read configuration information from the standard sources and merge it
* into the hash @a *cfg_hash. If @a config_dir is not NULL it specifies a
Modified: subversion/branches/in-repo-authz/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/svn_repos.h?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/svn_repos.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/svn_repos.h Fri Dec 14 04:14:09 2012
@@ -1321,7 +1321,8 @@ svn_repos_replay(svn_fs_root_t *root,
*
* @a repos is a previously opened repository. @a repos_url is the
* decoded URL to the base of the repository, and is used to check
- * copyfrom paths. @a txn is a filesystem transaction object to use
+ * copyfrom paths. copyfrom paths passed to the editor must be full,
+ * URI-encoded, URLs. @a txn is a filesystem transaction object to use
* during the commit, or @c NULL to indicate that this function should
* create (and fully manage) a new transaction.
*
Modified: subversion/branches/in-repo-authz/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/svn_wc.h?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/svn_wc.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/svn_wc.h Fri Dec 14 04:14:09 2012
@@ -6891,8 +6891,9 @@ svn_wc_merge_props3(svn_wc_notify_state_
*
* This function has the @a base_merge parameter which (when TRUE) will
* apply @a propchanges to this node's pristine set of properties. This
- * functionality is not supported on newer APIs -- pristine information
- * should only be changed through an update editor drive.
+ * functionality is not supported since API version 1.7 and will give an
+ * error if requested (unless @a dry_run is TRUE). For details see
+ * 'notes/api-errata/1.7/wc006.txt'.
*
* Uses a svn_wc_conflict_resolver_func_t conflict resolver instead of a
* svn_wc_conflict_resolver_func2_t.
@@ -6901,7 +6902,7 @@ svn_wc_merge_props3(svn_wc_notify_state_
* #SVN_ERR_UNVERSIONED_RESOURCE, when svn_wc_merge_props3 would return either
* #SVN_ERR_WC_PATH_NOT_FOUND or #SVN_ERR_WC_PATH_UNEXPECTED_STATUS.
*
- * @since New in 1.5.
+ * @since New in 1.5. The base_merge option is not supported since 1.7.
* @deprecated Provided for backward compatibility with the 1.6 API.
*/
SVN_DEPRECATED
@@ -6922,6 +6923,7 @@ svn_wc_merge_props2(svn_wc_notify_state_
* Same as svn_wc_merge_props2(), but with a @a conflict_func (and
* baton) of NULL.
*
+ * @since New in 1.3. The base_merge option is not supported since 1.7.
* @deprecated Provided for backward compatibility with the 1.4 API.
*/
SVN_DEPRECATED
@@ -6943,7 +6945,9 @@ svn_wc_merge_props(svn_wc_notify_state_t
* correct for 'svn update', it's incorrect for 'svn merge', and can
* cause flawed behavior. (See issue #2035.)
*
+ * @since The base_merge option is not supported since 1.7.
* @deprecated Provided for backward compatibility with the 1.2 API.
+ * Replaced by svn_wc_merge_props().
*/
SVN_DEPRECATED
svn_error_t *
Modified: subversion/branches/in-repo-authz/subversion/libsvn_auth_kwallet/kwallet.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_auth_kwallet/kwallet.cpp?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_auth_kwallet/kwallet.cpp (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_auth_kwallet/kwallet.cpp Fri Dec 14 04:14:09 2012
@@ -253,7 +253,8 @@ kwallet_password_get(svn_boolean_t *done
}
}
- apr_pool_cleanup_register(pool, parameters, kwallet_terminate, NULL);
+ apr_pool_cleanup_register(pool, parameters, kwallet_terminate,
+ apr_pool_cleanup_null);
return SVN_NO_ERROR;
}
@@ -327,7 +328,8 @@ kwallet_password_set(svn_boolean_t *done
}
}
- apr_pool_cleanup_register(pool, parameters, kwallet_terminate, NULL);
+ apr_pool_cleanup_register(pool, parameters, kwallet_terminate,
+ apr_pool_cleanup_null);
return SVN_NO_ERROR;
}
Modified: subversion/branches/in-repo-authz/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_client/add.c?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_client/add.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_client/add.c Fri Dec 14 04:14:09 2012
@@ -274,7 +274,7 @@ add_file(const char *local_abspath,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
- apr_hash_t* properties = NULL;
+ apr_hash_t *properties;
apr_hash_index_t *hi;
const char *mimetype;
svn_node_kind_t kind;
@@ -290,6 +290,9 @@ add_file(const char *local_abspath,
if (is_special)
{
mimetype = NULL;
+ properties = apr_hash_make(pool);
+ apr_hash_set(properties, SVN_PROP_SPECIAL, APR_HASH_KEY_STRING,
+ svn_string_create(SVN_PROP_BOOLEAN_TRUE, pool));
}
else
{
@@ -310,54 +313,42 @@ add_file(const char *local_abspath,
}
/* This may fail on write-only files:
- we open them to estimate file type.
- That's why we postpone the add until after this step. */
+ we open them to estimate file type. */
SVN_ERR(svn_client__get_paths_auto_props(&properties, &mimetype,
local_abspath, magic_cookie,
file_autoprops, ctx, pool,
pool));
}
- if (is_special)
- /* This must be a special file. */
- SVN_ERR(svn_wc_prop_set4(ctx->wc_ctx, local_abspath, SVN_PROP_SPECIAL,
- svn_string_create(SVN_PROP_BOOLEAN_TRUE, pool),
+ /* loop through the hashtable and add the properties */
+ for (hi = apr_hash_first(pool, properties);
+ hi != NULL; hi = apr_hash_next(hi))
+ {
+ const char *pname = svn__apr_hash_index_key(hi);
+ const svn_string_t *pval = svn__apr_hash_index_val(hi);
+ svn_error_t *err;
+
+ /* It's probably best to pass 0 for force, so that if
+ the autoprops say to set some weird combination,
+ we just error and let the user sort it out. */
+ err = svn_wc_prop_set4(ctx->wc_ctx, local_abspath, pname, pval,
svn_depth_empty, FALSE, NULL,
NULL, NULL /* cancellation */,
NULL, NULL /* notification */,
- pool));
- else if (properties)
- {
- /* loop through the hashtable and add the properties */
- for (hi = apr_hash_first(pool, properties);
- hi != NULL; hi = apr_hash_next(hi))
- {
- const char *pname = svn__apr_hash_index_key(hi);
- const svn_string_t *pval = svn__apr_hash_index_val(hi);
- svn_error_t *err;
-
- /* It's probably best to pass 0 for force, so that if
- the autoprops say to set some weird combination,
- we just error and let the user sort it out. */
- err = svn_wc_prop_set4(ctx->wc_ctx, local_abspath, pname, pval,
- svn_depth_empty, FALSE, NULL,
- NULL, NULL /* cancellation */,
- NULL, NULL /* notification */,
- pool);
- if (err)
- {
- /* Don't leave the job half-done. If we fail to set a property,
- * (try to) un-add the file. */
- return svn_error_compose_create(
- err,
- svn_wc_revert4(ctx->wc_ctx,
- local_abspath,
- svn_depth_empty,
- FALSE /* use_commit_times */,
- NULL /* changelists */,
- NULL, NULL, NULL, NULL,
- pool));
- }
+ pool);
+ if (err)
+ {
+ /* Don't leave the job half-done. If we fail to set a property,
+ * (try to) un-add the file. */
+ return svn_error_compose_create(
+ err,
+ svn_wc_revert4(ctx->wc_ctx,
+ local_abspath,
+ svn_depth_empty,
+ FALSE /* use_commit_times */,
+ NULL /* changelists */,
+ NULL, NULL, NULL, NULL,
+ pool));
}
}
Modified: subversion/branches/in-repo-authz/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_client/commit.c?rev=1421664&r1=1421663&r2=1421664&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_client/commit.c Fri Dec 14 04:14:09 2012
@@ -30,11 +30,8 @@
#include <string.h>
#include <apr_strings.h>
#include <apr_hash.h>
-#include <apr_md5.h>
#include "svn_wc.h"
#include "svn_ra.h"
-#include "svn_delta.h"
-#include "svn_subst.h"
#include "svn_client.h"
#include "svn_string.h"
#include "svn_pools.h"
@@ -42,743 +39,14 @@
#include "svn_error_codes.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
-#include "svn_io.h"
-#include "svn_time.h"
#include "svn_sorts.h"
-#include "svn_props.h"
#include "client.h"
#include "private/svn_wc_private.h"
-#include "private/svn_subr_private.h"
#include "private/svn_ra_private.h"
-#include "private/svn_magic.h"
#include "svn_private_config.h"
-/* Import context baton.
-
- ### TODO: Add the following items to this baton:
- /` import editor/baton. `/
- const svn_delta_editor_t *editor;
- void *edit_baton;
-
- /` Client context baton `/
- svn_client_ctx_t `ctx;
-
- /` Paths (keys) excluded from the import (values ignored) `/
- apr_hash_t *excludes;
-*/
-typedef struct import_ctx_t
-{
- /* Whether any changes were made to the repository */
- svn_boolean_t repos_changed;
-
- /* A magic cookie for mime-type detection. */
- svn_magic__cookie_t *magic_cookie;
-
- /* Collection of all possible configuration file dictated auto-props and
- svn:auto-props. A hash mapping const char * file patterns to a
- second hash which maps const char * property names to const char *
- property values. Properties which don't have a value, e.g.
- svn:executable, simply map the property name to an empty string.
- May be NULL if autoprops are disabled. */
- apr_hash_t *autoprops;
-} import_ctx_t;
-
-
-/* Apply LOCAL_ABSPATH's contents (as a delta against the empty string) to
- FILE_BATON in EDITOR. Use POOL for any temporary allocation.
- PROPERTIES is the set of node properties set on this file.
-
- Fill DIGEST with the md5 checksum of the sent file; DIGEST must be
- at least APR_MD5_DIGESTSIZE bytes long. */
-
-/* ### how does this compare against svn_wc_transmit_text_deltas2() ??? */
-
-static svn_error_t *
-send_file_contents(const char *local_abspath,
- void *file_baton,
- const svn_delta_editor_t *editor,
- apr_hash_t *properties,
- unsigned char *digest,
- apr_pool_t *pool)
-{
- svn_stream_t *contents;
- svn_txdelta_window_handler_t handler;
- void *handler_baton;
- const svn_string_t *eol_style_val = NULL, *keywords_val = NULL;
- svn_boolean_t special = FALSE;
- svn_subst_eol_style_t eol_style;
- const char *eol;
- apr_hash_t *keywords;
-
- /* If there are properties, look for EOL-style and keywords ones. */
- if (properties)
- {
- eol_style_val = apr_hash_get(properties, SVN_PROP_EOL_STYLE,
- sizeof(SVN_PROP_EOL_STYLE) - 1);
- keywords_val = apr_hash_get(properties, SVN_PROP_KEYWORDS,
- sizeof(SVN_PROP_KEYWORDS) - 1);
- if (apr_hash_get(properties, SVN_PROP_SPECIAL, APR_HASH_KEY_STRING))
- special = TRUE;
- }
-
- /* Get an editor func that wants to consume the delta stream. */
- SVN_ERR(editor->apply_textdelta(file_baton, NULL, pool,
- &handler, &handler_baton));
-
- if (eol_style_val)
- svn_subst_eol_style_from_value(&eol_style, &eol, eol_style_val->data);
- else
- {
- eol = NULL;
- eol_style = svn_subst_eol_style_none;
- }
-
- if (keywords_val)
- SVN_ERR(svn_subst_build_keywords2(&keywords, keywords_val->data,
- APR_STRINGIFY(SVN_INVALID_REVNUM),
- "", 0, "", pool));
- else
- keywords = NULL;
-
- if (special)
- {
- SVN_ERR(svn_subst_read_specialfile(&contents, local_abspath,
- pool, pool));
- }
- else
- {
- /* Open the working copy file. */
- SVN_ERR(svn_stream_open_readonly(&contents, local_abspath, pool, pool));
-
- /* If we have EOL styles or keywords, then detranslate the file. */
- if (svn_subst_translation_required(eol_style, eol, keywords,
- FALSE, TRUE))
- {
- if (eol_style == svn_subst_eol_style_unknown)
- return svn_error_createf(SVN_ERR_IO_UNKNOWN_EOL, NULL,
- _("%s property on '%s' contains "
- "unrecognized EOL-style '%s'"),
- SVN_PROP_EOL_STYLE,
- svn_dirent_local_style(local_abspath,
- pool),
- eol_style_val->data);
-
- /* We're importing, so translate files with 'native' eol-style to
- * repository-normal form, not to this platform's native EOL. */
- if (eol_style == svn_subst_eol_style_native)
- eol = SVN_SUBST_NATIVE_EOL_STR;
-
- /* Wrap the working copy stream with a filter to detranslate it. */
- contents = svn_subst_stream_translated(contents,
- eol,
- TRUE /* repair */,
- keywords,
- FALSE /* expand */,
- pool);
- }
- }
-
- /* Send the file's contents to the delta-window handler. */
- return svn_error_trace(svn_txdelta_send_stream(contents, handler,
- handler_baton, digest,
- pool));
-}
-
-
-/* Import file PATH as EDIT_PATH in the repository directory indicated
- * by DIR_BATON in EDITOR.
- *
- * Accumulate file paths and their batons in FILES, which must be
- * non-null. (These are used to send postfix textdeltas later).
- *
- * If CTX->NOTIFY_FUNC is non-null, invoke it with CTX->NOTIFY_BATON
- * for each file.
- *
- * Use POOL for any temporary allocation.
- */
-static svn_error_t *
-import_file(const svn_delta_editor_t *editor,
- void *dir_baton,
- const char *local_abspath,
- const char *edit_path,
- const svn_io_dirent2_t *dirent,
- import_ctx_t *import_ctx,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
-{
- void *file_baton;
- const char *mimetype = NULL;
- unsigned char digest[APR_MD5_DIGESTSIZE];
- const char *text_checksum;
- apr_hash_t* properties;
- apr_hash_index_t *hi;
-
- SVN_ERR(svn_path_check_valid(local_abspath, pool));
-
- /* Add the file, using the pool from the FILES hash. */
- SVN_ERR(editor->add_file(edit_path, dir_baton, NULL, SVN_INVALID_REVNUM,
- pool, &file_baton));
-
- /* Remember that the repository was modified */
- import_ctx->repos_changed = TRUE;
-
- if (! dirent->special)
- {
- /* add automatic properties */
- SVN_ERR(svn_client__get_paths_auto_props(&properties, &mimetype,
- local_abspath,
- import_ctx->magic_cookie,
- import_ctx->autoprops,
- ctx, pool, pool));
- }
- else
- properties = apr_hash_make(pool);
-
- if (properties)
- {
- for (hi = apr_hash_first(pool, properties); hi; hi = apr_hash_next(hi))
- {
- const char *pname = svn__apr_hash_index_key(hi);
- const svn_string_t *pval = svn__apr_hash_index_val(hi);
-
- SVN_ERR(editor->change_file_prop(file_baton, pname, pval, pool));
- }
- }
-
- if (ctx->notify_func2)
- {
- svn_wc_notify_t *notify
- = svn_wc_create_notify(local_abspath, svn_wc_notify_commit_added,
- pool);
- notify->kind = svn_node_file;
- notify->mime_type = mimetype;
- notify->content_state = notify->prop_state
- = svn_wc_notify_state_inapplicable;
- notify->lock_state = svn_wc_notify_lock_state_inapplicable;
- (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
- }
-
- /* If this is a special file, we need to set the svn:special
- property and create a temporary detranslated version in order to
- send to the server. */
- if (dirent->special)
- {
- apr_hash_set(properties, SVN_PROP_SPECIAL, APR_HASH_KEY_STRING,
- svn_string_create(SVN_PROP_BOOLEAN_TRUE, pool));
- SVN_ERR(editor->change_file_prop(file_baton, SVN_PROP_SPECIAL,
- apr_hash_get(properties,
- SVN_PROP_SPECIAL,
- APR_HASH_KEY_STRING),
- pool));
- }
-
- /* Now, transmit the file contents. */
- SVN_ERR(send_file_contents(local_abspath, file_baton, editor,
- properties, digest, pool));
-
- /* Finally, close the file. */
- text_checksum =
- svn_checksum_to_cstring(svn_checksum__from_digest_md5(digest, pool), pool);
-
- return editor->close_file(file_baton, text_checksum, pool);
-}
-
-
-/* Return in CHILDREN a mapping of basenames to dirents for the importable
- * children of DIR_ABSPATH. EXCLUDES is a hash of absolute paths to filter
- * out. IGNORES and GLOBAL_IGNORES, if non-NULL, are lists of basename
- * patterns to filter out.
- * FILTER_CALLBACK and FILTER_BATON will be called for each absolute path,
- * allowing users to further filter the list of returned entries.
- *
- * Results are returned in RESULT_POOL; use SCRATCH_POOL for temporary data.*/
-static svn_error_t *
-get_filtered_children(apr_hash_t **children,
- const char *dir_abspath,
- apr_hash_t *excludes,
- apr_array_header_t *ignores,
- apr_array_header_t *global_ignores,
- svn_client_import_filter_func_t filter_callback,
- void *filter_baton,
- svn_client_ctx_t *ctx,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- apr_hash_t *dirents;
- apr_hash_index_t *hi;
- apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-
- SVN_ERR(svn_io_get_dirents3(&dirents, dir_abspath, TRUE, result_pool,
- scratch_pool));
-
- for (hi = apr_hash_first(scratch_pool, dirents); hi; hi = apr_hash_next(hi))
- {
- const char *base_name = svn__apr_hash_index_key(hi);
- const svn_io_dirent2_t *dirent = svn__apr_hash_index_val(hi);
- const char *local_abspath;
-
- svn_pool_clear(iterpool);
-
- local_abspath = svn_dirent_join(dir_abspath, base_name, iterpool);
-
- if (svn_wc_is_adm_dir(base_name, iterpool))
- {
- /* If someone's trying to import a directory named the same
- as our administrative directories, that's probably not
- what they wanted to do. If they are importing a file
- with that name, something is bound to blow up when they
- checkout what they've imported. So, just skip items with
- that name. */
- if (ctx->notify_func2)
- {
- svn_wc_notify_t *notify
- = svn_wc_create_notify(svn_dirent_join(local_abspath, base_name,
- iterpool),
- svn_wc_notify_skip, iterpool);
- notify->kind = svn_node_dir;
- notify->content_state = notify->prop_state
- = svn_wc_notify_state_inapplicable;
- notify->lock_state = svn_wc_notify_lock_state_inapplicable;
- (*ctx->notify_func2)(ctx->notify_baton2, notify, iterpool);
- }
-
- apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
- continue;
- }
- /* If this is an excluded path, exclude it. */
- if (apr_hash_get(excludes, local_abspath, APR_HASH_KEY_STRING))
- {
- apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
- continue;
- }
-
- if (ignores && svn_wc_match_ignore_list(base_name, ignores, iterpool))
- {
- apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
- continue;
- }
-
- if (global_ignores &&
- svn_wc_match_ignore_list(base_name, global_ignores, iterpool))
- {
- apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
- continue;
- }
-
- if (filter_callback)
- {
- svn_boolean_t filter = FALSE;
-
- SVN_ERR(filter_callback(filter_baton, &filter, local_abspath,
- dirent, iterpool));
-
- if (filter)
- {
- apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
- continue;
- }
- }
- }
- svn_pool_destroy(iterpool);
-
- *children = dirents;
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-import_dir(const svn_delta_editor_t *editor,
- void *dir_baton,
- const char *local_abspath,
- const char *edit_path,
- svn_depth_t depth,
- apr_hash_t *excludes,
- apr_array_header_t *global_ignores,
- svn_boolean_t no_ignore,
- svn_boolean_t no_autoprops,
- svn_boolean_t ignore_unknown_node_types,
- svn_client_import_filter_func_t filter_callback,
- void *filter_baton,
- import_ctx_t *import_ctx,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool);
-
-
-/* Import the children of DIR_ABSPATH, with other arguments similar to
- * import_dir(). */
-static svn_error_t *
-import_children(const char *dir_abspath,
- const char *edit_path,
- apr_hash_t *dirents,
- const svn_delta_editor_t *editor,
- void *dir_baton,
- svn_depth_t depth,
- apr_hash_t *excludes,
- apr_array_header_t *global_ignores,
- svn_boolean_t no_ignore,
- svn_boolean_t no_autoprops,
- svn_boolean_t ignore_unknown_node_types,
- svn_client_import_filter_func_t filter_callback,
- void *filter_baton,
- import_ctx_t *import_ctx,
- svn_client_ctx_t *ctx,
- apr_pool_t *scratch_pool)
-{
- apr_array_header_t *sorted_dirents;
- int i;
- apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-
- sorted_dirents = svn_sort__hash(dirents, svn_sort_compare_items_lexically,
- scratch_pool);
- for (i = 0; i < sorted_dirents->nelts; i++)
- {
- const char *this_abspath, *this_edit_path;
- svn_sort__item_t item = APR_ARRAY_IDX(sorted_dirents, i,
- svn_sort__item_t);
- const char *filename = item.key;
- const svn_io_dirent2_t *dirent = item.value;
-
- svn_pool_clear(iterpool);
-
- if (ctx->cancel_func)
- SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
-
- /* Typically, we started importing from ".", in which case
- edit_path is "". So below, this_path might become "./blah",
- and this_edit_path might become "blah", for example. */
- this_abspath = svn_dirent_join(dir_abspath, filename, iterpool);
- this_edit_path = svn_relpath_join(edit_path, filename, iterpool);
-
- if (dirent->kind == svn_node_dir && depth >= svn_depth_immediates)
- {
- /* Recurse. */
- svn_depth_t depth_below_here = depth;
- if (depth == svn_depth_immediates)
- depth_below_here = svn_depth_empty;
-
- SVN_ERR(import_dir(editor, dir_baton, this_abspath,
- this_edit_path, depth_below_here, excludes,
- global_ignores, no_ignore, no_autoprops,
- ignore_unknown_node_types, filter_callback,
- filter_baton, import_ctx, ctx, iterpool));
- }
- else if (dirent->kind == svn_node_file && depth >= svn_depth_files)
- {
- SVN_ERR(import_file(editor, dir_baton, this_abspath,
- this_edit_path, dirent,
- import_ctx, ctx, iterpool));
- }
- else if (dirent->kind != svn_node_dir && dirent->kind != svn_node_file)
- {
- if (ignore_unknown_node_types)
- {
- /*## warn about it*/
- if (ctx->notify_func2)
- {
- svn_wc_notify_t *notify
- = svn_wc_create_notify(this_abspath,
- svn_wc_notify_skip, iterpool);
- notify->kind = svn_node_dir;
- notify->content_state = notify->prop_state
- = svn_wc_notify_state_inapplicable;
- notify->lock_state = svn_wc_notify_lock_state_inapplicable;
- (*ctx->notify_func2)(ctx->notify_baton2, notify, iterpool);
- }
- }
- else
- return svn_error_createf
- (SVN_ERR_NODE_UNKNOWN_KIND, NULL,
- _("Unknown or unversionable type for '%s'"),
- svn_dirent_local_style(this_abspath, iterpool));
- }
- }
-
- svn_pool_destroy(iterpool);
- return SVN_NO_ERROR;
-}
-
-
-/* Import directory LOCAL_ABSPATH into the repository directory indicated by
- * DIR_BATON in EDITOR. EDIT_PATH is the path imported as the root
- * directory, so all edits are relative to that.
- *
- * DEPTH is the depth at this point in the descent (it may be changed
- * for recursive calls).
- *
- * Accumulate file paths and their batons in FILES, which must be
- * non-null. (These are used to send postfix textdeltas later).
- *
- * EXCLUDES is a hash whose keys are absolute paths to exclude from
- * the import (values are unused).
- *
- * GLOBAL_IGNORES is an array of const char * ignore patterns. Any child
- * of LOCAL_ABSPATH which matches one or more of the patterns is not imported.
- *
- * If NO_IGNORE is FALSE, don't import files or directories that match
- * ignore patterns.
- *
- * If FILTER_CALLBACK is not NULL, call it with FILTER_BATON on each to be
- * imported node below LOCAL_ABSPATH to allow filtering nodes.
- *
- * If CTX->NOTIFY_FUNC is non-null, invoke it with CTX->NOTIFY_BATON for each
- * directory.
- *
- * Use POOL for any temporary allocation. */
-static svn_error_t *
-import_dir(const svn_delta_editor_t *editor,
- void *dir_baton,
- const char *local_abspath,
- const char *edit_path,
- svn_depth_t depth,
- apr_hash_t *excludes,
- apr_array_header_t *global_ignores,
- svn_boolean_t no_ignore,
- svn_boolean_t no_autoprops,
- svn_boolean_t ignore_unknown_node_types,
- svn_client_import_filter_func_t filter_callback,
- void *filter_baton,
- import_ctx_t *import_ctx,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
-{
- apr_hash_t *dirents;
- void *this_dir_baton;
-
- SVN_ERR(svn_path_check_valid(local_abspath, pool));
- SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes, NULL,
- global_ignores, filter_callback,
- filter_baton, ctx, pool, pool));
-
- /* Import this directory, but not yet its children. */
- {
- /* Add the new subdirectory, getting a descent baton from the editor. */
- SVN_ERR(editor->add_directory(edit_path, dir_baton, NULL,
- SVN_INVALID_REVNUM, pool, &this_dir_baton));
-
- /* Remember that the repository was modified */
- import_ctx->repos_changed = TRUE;
-
- /* By notifying before the recursive call below, we display
- a directory add before displaying adds underneath the
- directory. To do it the other way around, just move this
- after the recursive call. */
- if (ctx->notify_func2)
- {
- svn_wc_notify_t *notify
- = svn_wc_create_notify(local_abspath, svn_wc_notify_commit_added,
- pool);
- notify->kind = svn_node_dir;
- notify->content_state = notify->prop_state
- = svn_wc_notify_state_inapplicable;
- notify->lock_state = svn_wc_notify_lock_state_inapplicable;
- (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
- }
- }
-
- /* Now import the children recursively. */
- SVN_ERR(import_children(local_abspath, edit_path, dirents, editor,
- this_dir_baton, depth, excludes, global_ignores,
- no_ignore, no_autoprops, ignore_unknown_node_types,
- filter_callback, filter_baton,
- import_ctx, ctx, pool));
-
- /* Finally, close the sub-directory. */
- SVN_ERR(editor->close_directory(this_dir_baton, pool));
-
- return SVN_NO_ERROR;
-}
-
-
-/* Recursively import PATH to a repository using EDITOR and
- * EDIT_BATON. PATH can be a file or directory.
- *
- * DEPTH is the depth at which to import PATH; it behaves as for
- * svn_client_import4().
- *
- * NEW_ENTRIES is an ordered array of path components that must be
- * created in the repository (where the ordering direction is
- * parent-to-child). If PATH is a directory, NEW_ENTRIES may be empty
- * -- the result is an import which creates as many new entries in the
- * top repository target directory as there are importable entries in
- * the top of PATH; but if NEW_ENTRIES is not empty, its last item is
- * the name of a new subdirectory in the repository to hold the
- * import. If PATH is a file, NEW_ENTRIES may not be empty, and its
- * last item is the name used for the file in the repository. If
- * NEW_ENTRIES contains more than one item, all but the last item are
- * the names of intermediate directories that are created before the
- * real import begins. NEW_ENTRIES may NOT be NULL.
- *
- * EXCLUDES is a hash whose keys are absolute paths to exclude from
- * the import (values are unused).
- *
- * AUTOPROPS is hash of all config file autoprops and
- * svn:auto-props inherited by the import target, see the
- * IMPORT_CTX member of the same name.
- *
- * LOCAL_IGNORES is an array of const char * ignore patterns which
- * correspond to the svn:ignore property (if any) set on the root of the
- * repository target and thus dictates which immediate children of that
- * target should be ignored and not imported.
- *
- * GLOBAL_IGNORES is an array of const char * ignore patterns which
- * correspond to the svn:global-ignores properties (if any) set on
- * the root of the repository target or inherited by it.
- *
- * If NO_IGNORE is FALSE, don't import files or directories that match
- * ignore patterns.
- *
- * If CTX->NOTIFY_FUNC is non-null, invoke it with CTX->NOTIFY_BATON for
- * each imported path, passing actions svn_wc_notify_commit_added.
- *
- * Use POOL for any temporary allocation.
- *
- * Note: the repository directory receiving the import was specified
- * when the editor was fetched. (I.e, when EDITOR->open_root() is
- * called, it returns a directory baton for that directory, which is
- * not necessarily the root.)
- */
-static svn_error_t *
-import(const char *local_abspath,
- const apr_array_header_t *new_entries,
- const svn_delta_editor_t *editor,
- void *edit_baton,
- svn_depth_t depth,
- apr_hash_t *excludes,
- apr_hash_t *autoprops,
- apr_array_header_t *local_ignores,
- apr_array_header_t *global_ignores,
- svn_boolean_t no_ignore,
- svn_boolean_t no_autoprops,
- svn_boolean_t ignore_unknown_node_types,
- svn_client_import_filter_func_t filter_callback,
- void *filter_baton,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
-{
- void *root_baton;
- apr_array_header_t *batons = NULL;
- const char *edit_path = "";
- import_ctx_t *import_ctx = apr_pcalloc(pool, sizeof(*import_ctx));
- const svn_io_dirent2_t *dirent;
-
- import_ctx->autoprops = autoprops;
- svn_magic__init(&import_ctx->magic_cookie, pool);
-
- /* Get a root dir baton. We pass an invalid revnum to open_root
- to mean "base this on the youngest revision". Should we have an
- SVN_YOUNGEST_REVNUM defined for these purposes? */
- SVN_ERR(editor->open_root(edit_baton, SVN_INVALID_REVNUM,
- pool, &root_baton));
-
- /* Import a file or a directory tree. */
- SVN_ERR(svn_io_stat_dirent(&dirent, local_abspath, FALSE, pool, pool));
-
- /* Make the intermediate directory components necessary for properly
- rooting our import source tree. */
- if (new_entries->nelts)
- {
- int i;
-
- batons = apr_array_make(pool, new_entries->nelts, sizeof(void *));
- for (i = 0; i < new_entries->nelts; i++)
- {
- const char *component = APR_ARRAY_IDX(new_entries, i, const char *);
- edit_path = svn_relpath_join(edit_path, component, pool);
-
- /* If this is the last path component, and we're importing a
- file, then this component is the name of the file, not an
- intermediate directory. */
- if ((i == new_entries->nelts - 1) && (dirent->kind == svn_node_file))
- break;
-
- APR_ARRAY_PUSH(batons, void *) = root_baton;
- SVN_ERR(editor->add_directory(edit_path,
- root_baton,
- NULL, SVN_INVALID_REVNUM,
- pool, &root_baton));
-
- /* Remember that the repository was modified */
- import_ctx->repos_changed = TRUE;
- }
- }
- else if (dirent->kind == svn_node_file)
- {
- return svn_error_create
- (SVN_ERR_NODE_UNKNOWN_KIND, NULL,
- _("New entry name required when importing a file"));
- }
-
- /* Note that there is no need to check whether PATH's basename is
- the same name that we reserve for our administrative
- subdirectories. It would be strange -- though not illegal -- to
- import the contents of a directory of that name, because the
- directory's own name is not part of those contents. Of course,
- if something underneath it also has our reserved name, then we'll
- error. */
-
- if (dirent->kind == svn_node_file)
- {
- /* This code path ignores EXCLUDES and FILTER, but they don't make
- much sense for a single file import anyway. */
- svn_boolean_t ignores_match = FALSE;
-
- if (!no_ignore)
- ignores_match =
- (svn_wc_match_ignore_list(local_abspath, global_ignores, pool)
- || svn_wc_match_ignore_list(local_abspath, local_ignores, pool));
-
- if (!ignores_match)
- SVN_ERR(import_file(editor, root_baton, local_abspath, edit_path,
- dirent, import_ctx, ctx, pool));
- }
- else if (dirent->kind == svn_node_dir)
- {
- apr_hash_t *dirents;
-
- /* If we are creating a new repository directory path to import to,
- then we disregard any svn:ignore property. */
- if (!no_ignore && new_entries->nelts)
- local_ignores = NULL;
-
- SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes,
- local_ignores, global_ignores,
- filter_callback, filter_baton, ctx,
- pool, pool));
-
- SVN_ERR(import_children(local_abspath, edit_path, dirents, editor,
- root_baton, depth, excludes, global_ignores,
- no_ignore, no_autoprops,
- ignore_unknown_node_types, filter_callback,
- filter_baton, import_ctx, ctx, pool));
-
- }
- else if (dirent->kind == svn_node_none
- || dirent->kind == svn_node_unknown)
- {
- return svn_error_createf(SVN_ERR_NODE_UNKNOWN_KIND, NULL,
- _("'%s' does not exist"),
- svn_dirent_local_style(local_abspath, pool));
- }
-
- /* Close up shop; it's time to go home. */
- SVN_ERR(editor->close_directory(root_baton, pool));
- if (batons && batons->nelts)
- {
- void **baton;
- while ((baton = (void **) apr_array_pop(batons)))
- {
- SVN_ERR(editor->close_directory(*baton, pool));
- }
- }
-
- if (import_ctx->repos_changed)
- return editor->close_edit(edit_baton, pool);
- else
- return editor->abort_edit(edit_baton, pool);
-}
-
-
struct capture_baton_t {
svn_commit_callback2_t original_callback;
void *original_baton;
@@ -866,209 +134,6 @@ get_ra_editor(const svn_delta_editor_t *
/*** Public Interfaces. ***/
-svn_error_t *
-svn_client_import5(const char *path,
- const char *url,
- svn_depth_t depth,
- svn_boolean_t no_ignore,
- svn_boolean_t no_autoprops,
- svn_boolean_t ignore_unknown_node_types,
- const apr_hash_t *revprop_table,
- svn_client_import_filter_func_t filter_callback,
- void *filter_baton,
- svn_commit_callback2_t commit_callback,
- void *commit_baton,
- svn_client_ctx_t *ctx,
- apr_pool_t *scratch_pool)
-{
- svn_error_t *err = SVN_NO_ERROR;
- const char *log_msg = "";
- const svn_delta_editor_t *editor;
- void *edit_baton;
- svn_ra_session_t *ra_session;
- apr_hash_t *excludes = apr_hash_make(scratch_pool);
- svn_node_kind_t kind;
- const char *local_abspath;
- apr_array_header_t *new_entries = apr_array_make(scratch_pool, 4,
- sizeof(const char *));
- const char *temp;
- const char *dir;
- apr_hash_t *commit_revprops;
- apr_pool_t *iterpool = svn_pool_create(scratch_pool);
- apr_hash_t *autoprops = NULL;
- apr_array_header_t *global_ignores;
- apr_hash_t *local_ignores_hash;
- apr_array_header_t *local_ignores_arr;
-
- if (svn_path_is_url(path))
- return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
- _("'%s' is not a local path"), path);
-
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
-
- /* Create a new commit item and add it to the array. */
- if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
- {
- /* If there's a log message gatherer, create a temporary commit
- item array solely to help generate the log message. The
- array is not used for the import itself. */
- svn_client_commit_item3_t *item;
- const char *tmp_file;
- apr_array_header_t *commit_items
- = apr_array_make(scratch_pool, 1, sizeof(item));
-
- item = svn_client_commit_item3_create(scratch_pool);
- item->path = apr_pstrdup(scratch_pool, path);
- item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
- APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
-
- SVN_ERR(svn_client__get_log_msg(&log_msg, &tmp_file, commit_items,
- ctx, scratch_pool));
- if (! log_msg)
- return SVN_NO_ERROR;
- if (tmp_file)
- {
- const char *abs_path;
- SVN_ERR(svn_dirent_get_absolute(&abs_path, tmp_file, scratch_pool));
- apr_hash_set(excludes, abs_path, APR_HASH_KEY_STRING, (void *)1);
- }
- }
-
- SVN_ERR(svn_io_check_path(local_abspath, &kind, scratch_pool));
-
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, url, NULL,
- NULL, FALSE, TRUE, ctx,
- scratch_pool));
-
- /* Figure out all the path components we need to create just to have
- a place to stick our imported tree. */
- SVN_ERR(svn_ra_check_path(ra_session, "", SVN_INVALID_REVNUM, &kind,
- iterpool));
-
- /* We can import into directories, but if a file already exists, that's
- an error. */
- if (kind == svn_node_file)
- return svn_error_createf
- (SVN_ERR_ENTRY_EXISTS, NULL,
- _("Path '%s' already exists"), url);
-
- while (kind == svn_node_none)
- {
- svn_pool_clear(iterpool);
-
- svn_uri_split(&temp, &dir, url, scratch_pool);
- APR_ARRAY_PUSH(new_entries, const char *) = dir;
- url = temp;
- SVN_ERR(svn_ra_reparent(ra_session, url, iterpool));
-
- SVN_ERR(svn_ra_check_path(ra_session, "", SVN_INVALID_REVNUM, &kind,
- iterpool));
- }
-
- /* Reverse the order of the components we added to our NEW_ENTRIES array. */
- if (new_entries->nelts)
- {
- int i, j;
- const char *component;
- for (i = 0; i < (new_entries->nelts / 2); i++)
- {
- j = new_entries->nelts - i - 1;
- component =
- APR_ARRAY_IDX(new_entries, i, const char *);
- APR_ARRAY_IDX(new_entries, i, const char *) =
- APR_ARRAY_IDX(new_entries, j, const char *);
- APR_ARRAY_IDX(new_entries, j, const char *) =
- component;
- }
- }
-
- /* The repository doesn't know about the reserved administrative
- directory. */
- if (new_entries->nelts
- /* What's this, what's this? This assignment is here because we
- use the value to construct the error message just below. It
- may not be aesthetically pleasing, but it's less ugly than
- calling APR_ARRAY_IDX twice. */
- && svn_wc_is_adm_dir(temp = APR_ARRAY_IDX(new_entries,
- new_entries->nelts - 1,
- const char *),
- scratch_pool))
- return svn_error_createf
- (SVN_ERR_CL_ADM_DIR_RESERVED, NULL,
- _("'%s' is a reserved name and cannot be imported"),
- svn_dirent_local_style(temp, scratch_pool));
-
- SVN_ERR(svn_client__ensure_revprop_table(&commit_revprops, revprop_table,
- log_msg, ctx, scratch_pool));
-
- /* Fetch RA commit editor. */
- SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session,
- svn_client__get_shim_callbacks(ctx->wc_ctx,
- NULL, scratch_pool)));
- SVN_ERR(svn_ra_get_commit_editor3(ra_session, &editor, &edit_baton,
- commit_revprops, commit_callback,
- commit_baton, NULL, TRUE,
- scratch_pool));
-
- /* Get inherited svn:auto-props, svn:global-ignores, and
- svn:ignores for the location we are importing to. */
- if (!no_autoprops)
- SVN_ERR(svn_client__get_all_auto_props(&autoprops, url, ctx,
- scratch_pool, iterpool));
- if (no_ignore)
- {
- global_ignores = NULL;
- local_ignores_arr = NULL;
- }
- else
- {
- svn_opt_revision_t rev;
- apr_array_header_t *config_ignores;
-
- SVN_ERR(svn_client__get_inherited_ignores(&global_ignores, url, ctx,
- scratch_pool, iterpool));
- SVN_ERR(svn_wc_get_default_ignores(&config_ignores, ctx->config,
- scratch_pool));
- global_ignores = apr_array_append(scratch_pool, global_ignores,
- config_ignores);
-
- rev.kind = svn_opt_revision_head;
- SVN_ERR(svn_client_propget5(&local_ignores_hash, NULL, SVN_PROP_IGNORE, url,
- &rev, &rev, NULL, svn_depth_empty, NULL, ctx,
- scratch_pool, scratch_pool));
- local_ignores_arr = apr_array_make(scratch_pool, 1, sizeof(const char *));
-
- if (apr_hash_count(local_ignores_hash))
- {
- svn_string_t *propval = apr_hash_get(local_ignores_hash, url,
- APR_HASH_KEY_STRING);
- if (propval)
- {
- svn_cstring_split_append(local_ignores_arr, propval->data,
- "\n\r\t\v ", FALSE, scratch_pool);
- }
- }
- }
-
- /* If an error occurred during the commit, abort the edit and return
- the error. We don't even care if the abort itself fails. */
- if ((err = import(local_abspath, new_entries, editor, edit_baton,
- depth, excludes, autoprops, local_ignores_arr,
- global_ignores, no_ignore, no_autoprops,
- ignore_unknown_node_types, filter_callback,
- filter_baton, ctx, iterpool)))
- {
- return svn_error_compose_create(
- err,
- editor->abort_edit(edit_baton, iterpool));
- }
-
- svn_pool_destroy(iterpool);
-
- return SVN_NO_ERROR;
-}
-
-
static svn_error_t *
reconcile_errors(svn_error_t *commit_err,
svn_error_t *unlock_err,