svn commit: r1333766 - /subversion/trunk/tools/dist/nightly.sh

2012-05-03 Thread gmcdonald
Author: gmcdonald
Date: Fri May  4 06:29:52 2012
New Revision: 1333766

URL: http://svn.apache.org/viewvc?rev=1333766&view=rev
Log:
Comment out the calling of function that commits nightlies to svn.
We don't need this as we have them available at 
http://ci.apache.org/projects/subversion/nightlies/

I asume actual release candidates will be manually committed or otherwise
made available.

* dist/nightly.sh: comment out call to post-candidates


Modified:
subversion/trunk/tools/dist/nightly.sh

Modified: subversion/trunk/tools/dist/nightly.sh
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/dist/nightly.sh?rev=1333766&r1=1333765&r2=1333766&view=diff
==
--- subversion/trunk/tools/dist/nightly.sh (original)
+++ subversion/trunk/tools/dist/nightly.sh Fri May  4 06:29:52 2012
@@ -72,8 +72,8 @@ cd ..
 
 # Create the information page
 echo '---moving results-'
-./release.py --base-dir ${abscwd}/roll post-candidates trunk-nightly $head \
---target $target
+# ./release.py --base-dir ${abscwd}/roll post-candidates trunk-nightly $head \
+# --target $target
 if [ ! -d "$target/dist" ]; then mkdir "$target/dist"; fi
 if [ -d "$target/dist/r$head" ]; then rm -r "$target/dist/r$head"; fi
 mv roll/deploy $target/dist/r$head




svn commit: r1333739 - /subversion/trunk/subversion/libsvn_delta/editor.c

2012-05-03 Thread gstein
Author: gstein
Date: Fri May  4 01:39:23 2012
New Revision: 1333739

URL: http://svn.apache.org/viewvc?rev=1333739&view=rev
Log:
Ev2 shims:

The editor collects a bunch of data while in debug mode, to verify a
bunch of constraints. There are a number of other constraints we can
look for, so code up the assertions...

* subversion/libsvn_delta/editor.c:
  (MARK_PARENT_STABLE): used to mark the parent of a node as needing
to stay where it is (no delets, move, replace).
  (VERIFY_PARENT_MAY_EXIST): there are cases wen we know a parent
doesn't exist (thus an operation on a child is not possible), and
this macro can catch those.
  (CHILD_DELETIONS_ALLOWED): added directories, and directories moved
away cannot possibly have children which can be deleted. catch
these situations.
  (mark_parent_stable): helper function for the above macro
  (svn_editor_add_directory, svn_editor_add_file,
  svn_editor_add_symlink, svn_editor_add_absent,
  svn_editor_alter_directory, svn_editor_alter_file,
  svn_editor_alter_symlink): use VERIFY_PARENT_MAY_EXIST() to
eliminate definitely-missing parents. use MARK_PARENT_STABLE() to
deny structural changes to the parent, now that we've performed an
operation on a child.
  (svn_editor_delete): ensure a parent might exist, and that deletions
are allowed in this directory. use MARK_PARENT_STABLE() now that
we've munged a child.
  (svn_editor_copy): verify the parents of the source and destination
might exist. stabilize the parent of the destination.
  (svn_editor_move): verify the parents of the source and destination,
and that deletions are allowed in the source directory. mark both
source and destination as needing to remain stable.
  (svn_editor_create): verify all parents exist and that deletions are
allowed. mark all new parents as needing to be stable.

Modified:
subversion/trunk/subversion/libsvn_delta/editor.c

Modified: subversion/trunk/subversion/libsvn_delta/editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/editor.c?rev=1333739&r1=1333738&r2=1333739&view=diff
==
--- subversion/trunk/subversion/libsvn_delta/editor.c (original)
+++ subversion/trunk/subversion/libsvn_delta/editor.c Fri May  4 01:39:23 2012
@@ -129,6 +129,36 @@ static const int marker_added_dir;
 #define CHECK_UNKNOWN_CHILD(editor, relpath) \
   SVN_ERR_ASSERT(check_unknown_child(editor, relpath))
 
+/* When a child is changed in some way, mark the parent directory as needing
+   to be "stable" (no future structural changes). IOW, only allow "alter" on
+   the parent. Prevents parent-add/delete/move after any child operation.  */
+#define MARK_PARENT_STABLE(editor, relpath) \
+  mark_parent_stable(editor, relpath)
+
+/* If the parent is MARKER_ALLOW_ADD, then it has been moved-away, and we
+   know it does not exist. All other cases: it might exist.  */
+#define VERIFY_PARENT_MAY_EXIST(editor, relpath) \
+  SVN_ERR_ASSERT(apr_hash_get((editor)->completed_nodes, \
+  svn_relpath_dirname(relpath, \
+  (editor)->scratch_pool), \
+  APR_HASH_KEY_STRING) != MARKER_ALLOW_ADD)
+
+/* If the parent is MARKER_ADDED_DIR, then we should not be deleting
+   children(*). If the parent is MARKER_ALLOW_ADD, then it has been
+   moved-away, so children cannot exist. That leaves MARKER_DONE,
+   MARKER_ALLOW_ALTER, and NULL as possible values. Just assert that
+   we didn't get either of the bad ones.
+
+   (*) if the child as added via add_*(), then it would have been marked
+   as completed and delete/move-away already test against completed nodes.
+   This test is to beware of trying to delete "children" that are not
+   actually (and can't possibly be) present.  */
+#define CHILD_DELETIONS_ALLOWED(editor, relpath) \
+  SVN_ERR_ASSERT(!allow_either(editor, \
+   svn_relpath_dirname(relpath, \
+   (editor)->scratch_pool), \
+   MARKER_ADDED_DIR, MARKER_ALLOW_ADD))
+
 static svn_boolean_t
 allow_either(const svn_editor_t *editor,
  const char *relpath,
@@ -166,6 +196,31 @@ check_unknown_child(const svn_editor_t *
   return TRUE;
 }
 
+static void
+mark_parent_stable(const svn_editor_t *editor,
+   const char *relpath)
+{
+  const char *parent = svn_relpath_dirname(relpath, editor->scratch_pool);
+  const void *marker = apr_hash_get(editor->completed_nodes,
+parent, APR_HASH_KEY_STRING);
+
+  /* If RELPATH has already been marked (to disallow adds, or that it
+ has been fully-completed), then do nothing.  */
+  if (marker == MARKER_ALLOW_ALTER
+  || marker == MARKER_DONE
+  || marker == MARKER_ADDED_DIR)
+return;
+
+  /* If the marker is MARKER_ALLOW_ADD, then that mea

svn commit: r1333728 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py

2012-05-03 Thread gstein
Author: gstein
Date: Fri May  4 01:12:34 2012
New Revision: 1333728

URL: http://svn.apache.org/viewvc?rev=1333728&view=rev
Log:
Followup to r1333602: don't keep installing handlers. One is more than
enough! (symptom: massive repeat of output)

* subversion/tests/cmdline/svntest/main.py:
  (execute_tests): only add a handler if the current set is empty

Modified:
subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1333728&r1=1333727&r2=1333728&view=diff
==
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Fri May  4 
01:12:34 2012
@@ -1716,17 +1716,21 @@ def execute_tests(test_list, serial_only
   else:
 parser = _create_parser()
 
-  # Now that we have some options, let's get the logger configured before
-  # doing anything more
-  if options.log_with_timestamps:
-formatter = AbbreviatedFormatter('%(levelshort)s:'
- ' [%(asctime)s] %(message)s',
- datefmt='%Y-%m-%d %H:%M:%S')
-  else:
-formatter = AbbreviatedFormatter('%(levelshort)s: %(message)s')
-  handler = logging.StreamHandler(sys.stdout)
-  handler.setFormatter(formatter)
-  logger.addHandler(handler)
+  # If there are no handlers registered yet, then install our own with
+  # our custom formatter. (anything currently installed *is* our handler
+  # as tested above)
+  if not logger.handlers:
+# Now that we have some options, let's get the logger configured before
+# doing anything more
+if options.log_with_timestamps:
+  formatter = AbbreviatedFormatter('%(levelshort)s:'
+   ' [%(asctime)s] %(message)s',
+   datefmt='%Y-%m-%d %H:%M:%S')
+else:
+  formatter = AbbreviatedFormatter('%(levelshort)s: %(message)s')
+handler = logging.StreamHandler(sys.stdout)
+handler.setFormatter(formatter)
+logger.addHandler(handler)
 
   # parse the positional arguments (test nums, names)
   for arg in test_selection:




svn commit: r1333631 - /subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py

2012-05-03 Thread danielsh
Author: danielsh
Date: Thu May  3 21:23:36 2012
New Revision: 1333631

URL: http://svn.apache.org/viewvc?rev=1333631&view=rev
Log:
Force svnwcsub working copies to use consistent timestamps between multiple
dentically-configured svnwcsub instances.

* tools/server-side/svnpubsub/svnwcsub.py
  (WorkingCopy._get_match, BackgroundWorker._update,
   BackgroundWorker._cleanup):
 Set use-commit-times=on.

Modified:
subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py

Modified: subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py?rev=1333631&r1=1333630&r2=1333631&view=diff
==
--- subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py (original)
+++ subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py Thu May  3 
21:23:36 2012
@@ -110,6 +110,8 @@ class WorkingCopy(object):
 logging.info("autopopulate %s from %s" % (self.path, self.url))
 subprocess.check_call([svnbin, 'co', '-q',
'--non-interactive',
+   '--config-option',
+   'config:miscellany:use-commit-times=on',
'--', self.url, self.path],
   env=env)
 
@@ -242,6 +244,8 @@ class BackgroundWorker(threading.Thread)
 '--non-interactive',
 '--trust-server-cert',
 '--ignore-externals',
+'--config-option',
+'config:miscellany:use-commit-times=on',
 wc.path]
 subprocess.check_call(args, env=self.env)
 
@@ -257,6 +261,8 @@ class BackgroundWorker(threading.Thread)
 args = [self.svnbin, 'cleanup',
 '--non-interactive',
 '--trust-server-cert',
+'--config-option',
+'config:miscellany:use-commit-times=on',
 wc.path]
 subprocess.check_call(args, env=self.env)
 




svn commit: r1333602 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py

2012-05-03 Thread gstein
Author: gstein
Date: Thu May  3 20:12:52 2012
New Revision: 1333602

URL: http://svn.apache.org/viewvc?rev=1333602&view=rev
Log:
As a followup to some recent logging changes in the tests, write a
custom Formatter in order to have "short" loglevel indicators.

This also takes some care to insert safeguards against code attempting
to use the logging module *before* we have had a chance to configure it.

* subversion/tests/cmdline/svntest/main.py:
  (logger): set to None to catch early-usage in this module
  (class AbbreviatedFormatter): a Formatter subclass to define a
"levelshort" substitution value for format strings
  (execute_tests): set up the LOGGER global, and configure the root
logger after we have parsed the options.

Modified:
subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1333602&r1=1333601&r2=1333602&view=diff
==
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Thu May  3 
20:12:52 2012
@@ -78,12 +78,8 @@ SVN_VER_MINOR = 8
 
 default_num_threads = 5
 
-# Set up logging
-logger = logging.getLogger()
-handler = logging.StreamHandler(sys.stdout)
-formatter = logging.Formatter('%(message)s')
-handler.setFormatter(formatter)
-logger.addHandler(handler)
+# Don't try to use this before calling execute_tests()
+logger = None
 
 
 class SVNProcessTerminatedBySignal(Failure):
@@ -1651,6 +1647,28 @@ def get_target_milestones_for_issues(iss
 
   return issue_dict
 
+
+class AbbreviatedFormatter(logging.Formatter):
+  """A formatter with abbreviated loglevel indicators in the output.
+
+  Use %(levelshort)s in the format string to get a single character
+  representing the loglevel..
+  """
+
+  _level_short = {
+logging.CRITICAL : 'C',
+logging.ERROR : 'E',
+logging.WARNING : 'W',
+logging.INFO : 'I',
+logging.DEBUG : 'D',
+logging.NOTSET : '-',
+}
+
+  def format(self, record):
+record.levelshort = self._level_short[record.levelno]
+return logging.Formatter.format(self, record)
+
+
 # Main func.  This is the "entry point" that all the test scripts call
 # to run their list of tests.
 #
@@ -1661,6 +1679,7 @@ def execute_tests(test_list, serial_only
   exiting the process.  This function can be used when a caller doesn't
   want the process to die."""
 
+  global logger
   global pristine_url
   global pristine_greek_repos_url
   global svn_binary
@@ -1677,6 +1696,19 @@ def execute_tests(test_list, serial_only
 
   testnums = []
 
+  # Initialize the LOGGER global variable so the option parsing can set
+  # its loglevel, as appropriate.
+  logger = logging.getLogger()
+
+  # Did some chucklehead log something before we configured it? If they
+  # did, then a default handler/formatter would get installed. We want
+  # to be the one to install the first (and only) handler.
+  for handler in logger.handlers:
+if not isinstance(handler.formatter, AbbreviatedFormatter):
+  raise Exception('Logging occurred before configuration. Some code'
+  ' path needs to be fixed. Examine the log output'
+  ' to find what/where logged something.')
+
   if not options:
 # Override which tests to run from the commandline
 (parser, args) = _parse_options()
@@ -1684,10 +1716,17 @@ def execute_tests(test_list, serial_only
   else:
 parser = _create_parser()
 
+  # Now that we have some options, let's get the logger configured before
+  # doing anything more
   if options.log_with_timestamps:
-formatter = logging.Formatter('[%(asctime)s] %(message)s',
-  '%Y-%m-%d %H:%M:%S')
-handler.setFormatter(formatter)
+formatter = AbbreviatedFormatter('%(levelshort)s:'
+ ' [%(asctime)s] %(message)s',
+ datefmt='%Y-%m-%d %H:%M:%S')
+  else:
+formatter = AbbreviatedFormatter('%(levelshort)s: %(message)s')
+  handler = logging.StreamHandler(sys.stdout)
+  handler.setFormatter(formatter)
+  logger.addHandler(handler)
 
   # parse the positional arguments (test nums, names)
   for arg in test_selection:




svn commit: r1333601 - in /subversion/branches/ev2-export/subversion/libsvn_client: client.h commit.c commit_util.c copy.c

2012-05-03 Thread hwright
Author: hwright
Date: Thu May  3 20:05:40 2012
New Revision: 1333601

URL: http://svn.apache.org/viewvc?rev=1333601&view=rev
Log:
On the ev2-export branch:
A first hack at commit support.

This fails miserably, because we don't yet install the pristine file during
the commit, and the post commit update process expects us to have done so.  I
hope to continue working on this problem.

There are also a few crashes in the delta path driver, which I think are
unrelated, and a result of recent changes on trunk.

* subversion/libsvn_client/commit_util.c
  (do_item_commit, svn_client__do_commit): Rewrite for Ev2.

* subversion/libsvn_client/commit.c
  (get_ra_editor): Return an Ev2 editor.
  (svn_client_commit6): Use an Ev2 editor to drive the commit.

* subversion/libsvn_client/client.h
  (svn_client__do_commit): Update params.

* subversion/libsvn_client/copy.c
  (wc_to_repos_copy): Use an Ev2 editor to drive the commit.

Modified:
subversion/branches/ev2-export/subversion/libsvn_client/client.h
subversion/branches/ev2-export/subversion/libsvn_client/commit.c
subversion/branches/ev2-export/subversion/libsvn_client/commit_util.c
subversion/branches/ev2-export/subversion/libsvn_client/copy.c

Modified: subversion/branches/ev2-export/subversion/libsvn_client/client.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/client.h?rev=1333601&r1=1333600&r2=1333601&view=diff
==
--- subversion/branches/ev2-export/subversion/libsvn_client/client.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/client.h Thu May  3 
20:05:40 2012
@@ -921,8 +921,7 @@ svn_client__condense_commit_items(const 
 svn_error_t *
 svn_client__do_commit(const char *base_url,
   const apr_array_header_t *commit_items,
-  const svn_delta_editor_t *editor,
-  void *edit_baton,
+  svn_editor_t *editor,
   const char *notify_path_prefix,
   apr_hash_t **sha1_checksums,
   svn_client_ctx_t *ctx,

Modified: subversion/branches/ev2-export/subversion/libsvn_client/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/commit.c?rev=1333601&r1=1333600&r2=1333601&view=diff
==
--- subversion/branches/ev2-export/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/commit.c Thu May  3 
20:05:40 2012
@@ -619,8 +619,7 @@ capture_commit_info(const svn_commit_inf
 
 
 static svn_error_t *
-get_ra_editor(const svn_delta_editor_t **editor,
-  void **edit_baton,
+get_ra_editor(svn_editor_t **editor,
   svn_ra_session_t *ra_session,
   svn_client_ctx_t *ctx,
   const char *log_msg,
@@ -638,7 +637,6 @@ get_ra_editor(const svn_delta_editor_t *
   SVN_ERR(svn_client__ensure_revprop_table(&commit_revprops, revprop_table,
log_msg, ctx, pool));
 
-#ifdef ENABLE_EV2_SHIMS
   if (commit_items)
 {
   int i;
@@ -663,16 +661,16 @@ get_ra_editor(const svn_delta_editor_t *
 }
   svn_pool_destroy(iterpool);
 }
-#endif
 
   /* Fetch RA commit editor. */
   SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session,
 svn_client__get_shim_callbacks(ctx->wc_ctx,
relpath_map, pool)));
-  SVN_ERR(svn_ra_get_commit_editor3(ra_session, editor, edit_baton,
+  SVN_ERR(svn_ra_get_commit_editor4(ra_session, editor,
 commit_revprops, commit_callback,
 commit_baton, lock_tokens, keep_locks,
-pool));
+ctx->cancel_func, ctx->cancel_baton,
+pool, pool));
 
   return SVN_NO_ERROR;
 }
@@ -1279,8 +1277,7 @@ svn_client_commit6(const apr_array_heade
svn_client_ctx_t *ctx,
apr_pool_t *pool)
 {
-  const svn_delta_editor_t *editor;
-  void *edit_baton;
+  svn_editor_t *editor;
   struct capture_baton_t cb;
   svn_ra_session_t *ra_session;
   const char *log_msg;
@@ -1624,10 +1621,9 @@ svn_client_commit6(const apr_array_heade
 goto cleanup;
 
   cmt_err = svn_error_trace(
-  get_ra_editor(&editor, &edit_baton, ra_session, ctx,
-log_msg, commit_items, revprop_table,
-lock_tokens, keep_locks, capture_commit_info,
-&cb, pool));
+  get_ra_editor(&editor, ra_session, ctx, log_msg,
+commit_items, revprop_table, lock_tokens,
+keep_locks, capture_commit_info, &cb, pool));
 
   if (cmt_err)

Re: svn commit: r1333326 - in /subversion/trunk/subversion: include/private/svn_hash_private.h libsvn_fs_fs/temp_serializer.c libsvn_subr/hash.c

2012-05-03 Thread Hyrum K Wright
On Thu, May 3, 2012 at 2:16 AM,   wrote:
> Author: stefan2
> Date: Thu May  3 07:16:11 2012
> New Revision: 126
>
> URL: http://svn.apache.org/viewvc?rev=126&view=rev
> Log:
> Introduce private API functions that wrap apr_hash_make_custom
> and return hash tables that are 2 to 4 times faster than the APR default.
> Both yield repeatable results (each instance will store items in the same
> order if the keys are the same). The first, svn_hask__make will return
> a hash table that behaves like pre APR 1.4.6 default hashes.
>
> * subversion/include/private/svn_hash_private.h
>  (svn_hash__make, svn_hash__make_fast): new private API
> * subversion/libsvn_subr/hash.c
>  (svn_hash_from_cstring_keys): use new API
>  (hashfunc_compatible, LOWER_7BITS_SET, BIT_7_SET, READ_CHUNK,
>   hashfunc_fast): implement efficient hash functions
>  (svn_hash__make, svn_hash__make_fast): implement new private API
> * subversion/libsvn_fs_fs/temp_serializer.c
>  (deserialize_dir, svn_fs_fs__deserialize_properties): use new API
>
> Modified:
>    subversion/trunk/subversion/include/private/svn_hash_private.h
>    subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c
>    subversion/trunk/subversion/libsvn_subr/hash.c
>
> Modified: subversion/trunk/subversion/include/private/svn_hash_private.h
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_hash_private.h?rev=126&r1=125&r2=126&view=diff
> ==
> --- subversion/trunk/subversion/include/private/svn_hash_private.h (original)
> +++ subversion/trunk/subversion/include/private/svn_hash_private.h Thu May  3 
> 07:16:11 2012
> @@ -102,6 +102,31 @@ svn_hash__get_bool(apr_hash_t *hash,
>
>  /** @} */
>
> +/**
> + * @defgroup svn_hash_create Create optimized APR hash tables
> + * @{
> + */
> +
> +/** Returns a hash table, allocated in @a pool, with the same ordering of
> + * elements as APR 1.4.5 or earlier (using apr_hashfunc_default) but uses
> + * a faster hash function implementation.
> + *
> + * @since New in 1.8.
> + */
> +apr_hash_t *
> +svn_hash__make(apr_pool_t *pool);
> +
> +/** Returns a hash table, allocated in @a pool, that is faster to modify
> + * and access then the ones returned by @ref svn_hash__make. The element
> + * order does not match any APR default.
> + *
> + * @since New in 1.8.
> + */
> +apr_hash_t *
> +svn_hash__make_fast(apr_pool_t *pool);
> +
> +/** @} */
> +
>  /** @} */
>
>  #ifdef __cplusplus
>
> Modified: subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c?rev=126&r1=125&r2=126&view=diff
> ==
> --- subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c Thu May  3 
> 07:16:11 2012
> @@ -30,6 +30,7 @@
>
>  #include "private/svn_fs_util.h"
>  #include "private/svn_temp_serializer.h"
> +#include "private/svn_hash_private.h"
>
>  #include "temp_serializer.h"
>
> @@ -359,7 +360,7 @@ serialize_dir(apr_hash_t *entries, apr_p
>  static apr_hash_t *
>  deserialize_dir(void *buffer, hash_data_t *hash_data, apr_pool_t *pool)
>  {
> -  apr_hash_t *result = apr_hash_make(pool);
> +  apr_hash_t *result = svn_hash__make(pool);
>   apr_size_t i;
>   apr_size_t count;
>   svn_fs_dirent_t *entry;
> @@ -678,7 +679,7 @@ svn_fs_fs__deserialize_properties(void *
>                                   apr_size_t data_len,
>                                   apr_pool_t *pool)
>  {
> -  apr_hash_t *hash = apr_hash_make(pool);
> +  apr_hash_t *hash = svn_hash__make(pool);
>   properties_data_t *properties = (properties_data_t *)data;
>   size_t i;
>
>
> Modified: subversion/trunk/subversion/libsvn_subr/hash.c
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/hash.c?rev=126&r1=125&r2=126&view=diff
> ==
> --- subversion/trunk/subversion/libsvn_subr/hash.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/hash.c Thu May  3 07:16:11 2012
> @@ -40,6 +40,7 @@
>  #include "svn_pools.h"
>
>  #include "private/svn_dep_compat.h"
> +#include "private/svn_string_private.h"
>  #include "private/svn_hash_private.h"
>
>  #include "svn_private_config.h"
> @@ -496,7 +497,7 @@ svn_hash_from_cstring_keys(apr_hash_t **
>                            apr_pool_t *pool)
>  {
>   int i;
> -  apr_hash_t *hash = apr_hash_make(pool);
> +  apr_hash_t *hash = svn_hash__make(pool);
>   for (i = 0; i < keys->nelts; i++)
>     {
>       const char *key =
> @@ -561,3 +562,127 @@ svn_hash__get_bool(apr_hash_t *hash, con
>   return default_value;
>  }
>
> +
> +
> +/*** Optimized hash functions ***/
> +
> +/* Optimized version of apr_hashfunc_default. It assumes that the CPU has
> + * 32-bit multiplic

svn commit: r1333596 - in /subversion/branches/ev2-export: ./ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ subversion/libsvn_fs/ subversion/libsvn

2012-05-03 Thread hwright
Author: hwright
Date: Thu May  3 19:48:38 2012
New Revision: 1333596

URL: http://svn.apache.org/viewvc?rev=1333596&view=rev
Log:
On the ev2-export branch:
Bring up-to-date with trunk.

Modified:
subversion/branches/ev2-export/   (props changed)
subversion/branches/ev2-export/COMMITTERS
subversion/branches/ev2-export/subversion/include/private/svn_subr_private.h
subversion/branches/ev2-export/subversion/include/svn_hash.h
subversion/branches/ev2-export/subversion/libsvn_client/merge.c
subversion/branches/ev2-export/subversion/libsvn_client/patch.c
subversion/branches/ev2-export/subversion/libsvn_delta/compat.c
subversion/branches/ev2-export/subversion/libsvn_fs/fs-loader.c
subversion/branches/ev2-export/subversion/libsvn_fs_fs/caching.c
subversion/branches/ev2-export/subversion/libsvn_fs_fs/fs_fs.c
subversion/branches/ev2-export/subversion/libsvn_fs_fs/temp_serializer.c
subversion/branches/ev2-export/subversion/libsvn_ra_serf/property.c
subversion/branches/ev2-export/subversion/libsvn_ra_serf/ra_serf.h
subversion/branches/ev2-export/subversion/libsvn_ra_serf/serf.c
subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c
subversion/branches/ev2-export/subversion/libsvn_ra_serf/util.c
subversion/branches/ev2-export/subversion/libsvn_repos/repos.c
subversion/branches/ev2-export/subversion/libsvn_subr/hash.c
subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c
subversion/branches/ev2-export/subversion/svnrdump/dump_editor.c
subversion/branches/ev2-export/subversion/svnrdump/load_editor.c

subversion/branches/ev2-export/subversion/tests/cmdline/merge_symmetric_tests.py
subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py
subversion/branches/ev2-export/subversion/tests/cmdline/svntest/sandbox.py
subversion/branches/ev2-export/subversion/tests/libsvn_wc/op-depth-test.c
subversion/branches/ev2-export/tools/dist/nightly.sh

Propchange: subversion/branches/ev2-export/
--
  Merged /subversion/trunk:r1332744-1333595

Modified: subversion/branches/ev2-export/COMMITTERS
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/COMMITTERS?rev=1333596&r1=1333595&r2=1333596&view=diff
==
--- subversion/branches/ev2-export/COMMITTERS [UTF-8] (original)
+++ subversion/branches/ev2-export/COMMITTERS [UTF-8] Thu May  3 19:48:38 2012
@@ -93,7 +93,7 @@ Commit access for specific areas:
  clkao   Chia-liang Kao (Swig-Perl b.)
 joeswatosh   Joe Swatosh  (Swig-Ruby b.)
 jrvernooij   Jelmer Vernooij   (Python bindings)
-  sage   Sage LaTorra  (Ctypes-Python 
bindings)
+  sage   Sage LaTorra  (Ctypes-Python b.)
 rdonch   Роман Донченко  (Swig-Python b.)
 
   Packages:

Modified: 
subversion/branches/ev2-export/subversion/include/private/svn_subr_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/include/private/svn_subr_private.h?rev=1333596&r1=1333595&r2=1333596&view=diff
==
--- 
subversion/branches/ev2-export/subversion/include/private/svn_subr_private.h 
(original)
+++ 
subversion/branches/ev2-export/subversion/include/private/svn_subr_private.h 
Thu May  3 19:48:38 2012
@@ -220,6 +220,90 @@ svn_checksum_t *
 svn_checksum__from_digest_sha1(const unsigned char *digest,
apr_pool_t *result_pool);
 
+
+/**
+ * @defgroup svn_hash_support Hash table serialization support
+ * @{
+ */
+
+/**/
+
+/**
+ * @defgroup svn_hash_misc Miscellaneous hash APIs
+ * @{
+ */
+
+/**
+ * Clear any key/value pairs in the hash table.  A wrapper for a
+ * apr_hash_clear(), which isn't available until APR 1.3.0.
+ *
+ * @since New in 1.5.
+ */
+svn_error_t *
+svn_hash__clear(apr_hash_t *hash, apr_pool_t *pool);
+
+/** @} */
+
+
+/**
+ * @defgroup svn_hash_getters Specialized getter APIs for hashes
+ * @{
+ */
+
+/** Find the value of a @a key in @a hash, return the value.
+ *
+ * If @a hash is @c NULL or if the @a key cannot be found, the
+ * @a default_value will be returned.
+ *
+ * @since New in 1.7.
+ */
+const char *
+svn_hash__get_cstring(apr_hash_t *hash,
+  const char *key,
+  const char *default_value);
+
+/** Like svn_hash_get_cstring(), but for boolean values.
+ *
+ * Parses the value as a boolean value. The recognized representations
+ * are 'TRUE'/'FALSE', 'yes'/'no', 'on'/'off', '1'/'0'; case does not
+ * matter.
+ *
+ * @since New in 1.7.
+ */
+svn_boolean_t
+svn_hash__get_bool(apr_hash_t *hash,
+   const char *key,
+   svn_boolean_t default_value);
+
+/** @} */
+
+/**
+ * @defgroup svn

svn commit: r1333523 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py

2012-05-03 Thread stsp
Author: stsp
Date: Thu May  3 16:11:13 2012
New Revision: 1333523

URL: http://svn.apache.org/viewvc?rev=1333523&view=rev
Log:
* subversion/tests/cmdline/svntest/main.py: Stop showing the log level of each
   line in the log. It clutters the output and makes it hard to copy/paste
   test output for reuse during test development.

Modified:
subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1333523&r1=1333522&r2=1333523&view=diff
==
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Thu May  3 
16:11:13 2012
@@ -81,7 +81,7 @@ default_num_threads = 5
 # Set up logging
 logger = logging.getLogger()
 handler = logging.StreamHandler(sys.stdout)
-formatter = logging.Formatter('[%(levelname)s] %(message)s')
+formatter = logging.Formatter('%(message)s')
 handler.setFormatter(formatter)
 logger.addHandler(handler)
 
@@ -1685,7 +1685,7 @@ def execute_tests(test_list, serial_only
 parser = _create_parser()
 
   if options.log_with_timestamps:
-formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s',
+formatter = logging.Formatter('[%(asctime)s] %(message)s',
   '%Y-%m-%d %H:%M:%S')
 handler.setFormatter(formatter)
 




svn commit: r1333521 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py

2012-05-03 Thread stsp
Author: stsp
Date: Thu May  3 16:05:49 2012
New Revision: 1333521

URL: http://svn.apache.org/viewvc?rev=1333521&view=rev
Log:
Disable logging with timestamps in the test suite by default.
Add a new option --log-with-timestamps that enables timestamp logging.

The output with timestamps is often too long to fit in 80 columns and it
makes copy/pasting test output harder (e.g. when fixing up expected output
during test development).

* subversion/tests/cmdline/svntest/main.py
  (log_with_timestamps): Remove this global flag. It is now an option.
  (_create_parser): Add --log-with-timestamps option.
  (execute_tests): Use the timestamp logging formatter if --log-with-timestamps
   was specified on the command line.

Modified:
subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1333521&r1=1333520&r2=1333521&view=diff
==
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Thu May  3 
16:05:49 2012
@@ -78,18 +78,10 @@ SVN_VER_MINOR = 8
 
 default_num_threads = 5
 
-# This enables both a time stamp prefix on all log lines and a
-# '' line after running every external command.
-log_with_timestamps = True
-
 # Set up logging
 logger = logging.getLogger()
 handler = logging.StreamHandler(sys.stdout)
-if log_with_timestamps:
-  formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s',
-'%Y-%m-%d %H:%M:%S')
-else:
-  formatter = logging.Formatter('[%(levelname)s] %(message)s')
+formatter = logging.Formatter('[%(levelname)s] %(message)s')
 handler.setFormatter(formatter)
 logger.addHandler(handler)
 
@@ -529,9 +521,8 @@ def run_command_stdin(command, error_exp
and not any(map(lambda arg: 'prop_tests-12' in arg, varargs)):
   raise Failure("Repository diskpath in %s: %r" % (name, lines))
 
-  if log_with_timestamps:
-stop = time.time()
-logger.info('' % (stop - start))
+  stop = time.time()
+  logger.info('' % (stop - start))
   for x in stdout_lines:
 logger.info(x.rstrip())
   for x in stderr_lines:
@@ -903,9 +894,8 @@ def copy_repos(src_path, dst_path, head_
   load_out.close()
   load_err.close()
 
-  if log_with_timestamps:
-stop = time.time()
-logger.info('' % (stop - start))
+  stop = time.time()
+  logger.info('' % (stop - start))
 
   if saved_quiet is None:
 del os.environ['SVN_DBG_QUIET']
@@ -1559,6 +1549,8 @@ def _create_parser():
 help="Set log level (numerically or symbolically). " +
  "Symbolic levels are: CRITICAL, ERROR, WARNING, " +
  "INFO, DEBUG")
+  parser.add_option('--log-with-timestamps', action='store_true',
+help="Show timestamps in test log.")
   parser.add_option('--keep-local-tmp', action='store_true',
 help="Don't remove svn-test-work/local_tmp after test " +
  "run is complete.  Useful for debugging failures.")
@@ -1692,6 +1684,11 @@ def execute_tests(test_list, serial_only
   else:
 parser = _create_parser()
 
+  if options.log_with_timestamps:
+formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s',
+  '%Y-%m-%d %H:%M:%S')
+handler.setFormatter(formatter)
+
   # parse the positional arguments (test nums, names)
   for arg in test_selection:
 appended = False




[Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin

2012-05-03 Thread Apache subversion Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Subversion Wiki" for 
change notification.

The "MultiLayerMoves" page has been changed by PhilipMartin:
http://wiki.apache.org/subversion/MultiLayerMoves?action=diff&rev1=28&rev2=29

  
  the op-depth=2 tree X/B gets removed and a new op-depth=2 tree X/Y is 
created.  There is no base-deleted tree for X/B so the move to X/Y is not 
recorded.  Should the move to X/Y be recorded and if so where?  Perhaps in the 
not-present node for X/B?
  
+ Part of the problem is the multi-layer mixed-rev copy. If we had chosen a 
single-layer mixed-rev copy then X, X/B and X/B/C would all be op-depth=1 and 
the X/B to X/Y move would introduce base-deleted X/B at op-depth=2. [Possibly. 
It's hard to know exactly how such a model would work.]
+ 


[Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin

2012-05-03 Thread Apache subversion Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Subversion Wiki" for 
change notification.

The "MultiLayerMoves" page has been changed by PhilipMartin:
http://wiki.apache.org/subversion/MultiLayerMoves?action=diff&rev1=27&rev2=28

  
  Move A to X, a mixed-rev move:
  
- || op-depth || local-relpath || presence || revision || moved-to ||
+ || op-depth || local-relpath || presence || revision || moved-to || 
moved-here ||
- ||  0   ||A  || normal   ||   1  ||  ||
+ ||  0   ||A  || normal   ||   1  ||  ||   
 ||
- ||  0   ||A/B|| normal   ||   2  ||  ||
+ ||  0   ||A/B|| normal   ||   2  ||  ||   
 ||
- ||  0   ||A/B/C  || normal   ||   3  ||  ||
+ ||  0   ||A/B/C  || normal   ||   3  ||  ||   
 ||
- ||  1   ||A  || base-deleted ||  ||   X  ||
+ ||  1   ||A  || base-deleted ||  ||   X  ||   
 ||
- ||  1   ||A/B|| base-deleted ||  ||  ||
+ ||  1   ||A/B|| base-deleted ||  ||  ||   
 ||
- ||  1   ||A/B/C  || base-deleted ||  ||  ||
+ ||  1   ||A/B/C  || base-deleted ||  ||  ||   
 ||
- ||  1   ||X  || normal   ||   1  ||  ||
+ ||  1   ||X  || normal   ||   1  ||  ||  
1 ||
- ||  1   ||X/B|| not-present  ||  ||  ||
+ ||  1   ||X/B|| not-present  ||  ||  ||   
 ||
- ||  2   ||X/B|| normal   ||   2  ||  ||
+ ||  2   ||X/B|| normal   ||   2  ||  ||  
1 ||
- ||  2   ||X/B/C  || not-present  ||  ||  ||
+ ||  2   ||X/B/C  || not-present  ||  ||  ||   
 ||
- ||  3   ||X/B/C  || normal   ||   3  ||  ||
+ ||  3   ||X/B/C  || normal   ||   3  ||  ||  
1 ||
- || '''table H2''' ||
+  '''table H2''' ||
  
  Nested moves inside X are now a problem. Consider moving X/B to X/Y:
  
- || op-depth || local-relpath || presence || revision || moved-to ||
+ || op-depth || local-relpath || presence || revision || moved-to || 
moved-here ||
- ||  0   ||A  || normal   ||   1  ||  ||
+ ||  0   ||A  || normal   ||   1  ||  ||   
 ||
- ||  0   ||A/B|| normal   ||   2  ||  ||
+ ||  0   ||A/B|| normal   ||   2  ||  ||   
 ||
- ||  0   ||A/B/C  || normal   ||   3  ||  ||
+ ||  0   ||A/B/C  || normal   ||   3  ||  ||   
 ||
- ||  1   ||A  || base-deleted ||  ||   X  ||
+ ||  1   ||A  || base-deleted ||  ||   X  ||   
 ||
- ||  1   ||A/B|| base-deleted ||  ||  ||
+ ||  1   ||A/B|| base-deleted ||  ||  ||   
 ||
- ||  1   ||A/B/C  || base-deleted ||  ||  ||
+ ||  1   ||A/B/C  || base-deleted ||  ||  ||   
 ||
- ||  1   ||X  || normal   ||   1  ||  ||
+ ||  1   ||X  || normal   ||   1  ||  || 1 
 ||
- ||  1   ||X/B|| not-present  ||  ||  ||
+ ||  1   ||X/B|| not-present  ||  ||  ||   
 ||
- ||  2   ||X/Y|| normal   ||   2  ||  ||
+ ||  2   ||X/Y|| normal   ||   2  ||  ||   
 ||
- ||  2   ||X/Y/C  || not-present  ||  ||  ||
+ ||  2   ||X/Y/C  || not-present  ||  ||  ||   
 ||
- ||  3   ||X/Y/C  || normal   ||   3  ||  ||
+ ||  3   ||X/Y/C  || normal   ||   3  ||  ||   
 ||
- || '''table H3''' ||
+  '''table H3''' ||
  
  the op-depth=2 tree X/B gets removed and a new op-depth=2 tree X/Y is 
created.  There is no base-deleted tree for X/B so the move to X/Y is not 
recorded.  Should the move to X/Y be recorded and if so where?  Perhaps in the 
not-present node for X/B?
  


svn commit: r1333514 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py

2012-05-03 Thread stsp
Author: stsp
Date: Thu May  3 15:47:43 2012
New Revision: 1333514

URL: http://svn.apache.org/viewvc?rev=1333514&view=rev
Log:
* subversion/tests/cmdline/svntest/main.py
  (_create_parser): Document available levels for --set-log-level.

Modified:
subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1333514&r1=1333513&r2=1333514&view=diff
==
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Thu May  3 
15:47:43 2012
@@ -1556,7 +1556,9 @@ def _create_parser():
 help="Configuration file for tests.")
   parser.add_option('--set-log-level', action='callback', type='str',
 callback=set_log_level,
-   help="Set log level (numerically or symbolically)")
+help="Set log level (numerically or symbolically). " +
+ "Symbolic levels are: CRITICAL, ERROR, WARNING, " +
+ "INFO, DEBUG")
   parser.add_option('--keep-local-tmp', action='store_true',
 help="Don't remove svn-test-work/local_tmp after test " +
  "run is complete.  Useful for debugging failures.")




svn commit: r1333458 - /subversion/trunk/subversion/svnrdump/load_editor.c

2012-05-03 Thread hwright
Author: hwright
Date: Thu May  3 13:47:03 2012
New Revision: 1333458

URL: http://svn.apache.org/viewvc?rev=1333458&view=rev
Log:
* subversion/svnrdump/load_editor.c
  (new_revision_record): Fix binding of a cast.

Modified:
subversion/trunk/subversion/svnrdump/load_editor.c

Modified: subversion/trunk/subversion/svnrdump/load_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.c?rev=1333458&r1=1333457&r2=1333458&view=diff
==
--- subversion/trunk/subversion/svnrdump/load_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/load_editor.c Thu May  3 13:47:03 2012
@@ -567,7 +567,7 @@ new_revision_record(void **revision_bato
  several separate operations. It is highly susceptible to race conditions.
  Calculate the revision 'offset' for finding copyfrom sources.
  It might be positive or negative. */
-  rb->rev_offset = (apr_int32_t) (rb->rev) - (head_rev + 1);
+  rb->rev_offset = (apr_int32_t) ((rb->rev) - (head_rev + 1));
 
   /* Stash the oldest (non-zero) dumpstream revision seen. */
   if ((rb->rev > 0) && (!SVN_IS_VALID_REVNUM(pb->oldest_dumpstream_rev)))




svn commit: r1333399 - /subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

2012-05-03 Thread philip
Author: philip
Date: Thu May  3 10:23:45 2012
New Revision: 199

URL: http://svn.apache.org/viewvc?rev=199&view=rev
Log:
A new multi-layer move test.  It's a PASS for now but I'm not
sure exactly how it should behave.

* subversion/tests/libsvn_wc/op-depth-test.c
  (mixed_rev_move): New test.
  (test_funcs): Add new test.

Modified:
subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=199&r1=198&r2=199&view=diff
==
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Thu May  3 
10:23:45 2012
@@ -4865,6 +4865,106 @@ test_follow_moved_to(const svn_test_opts
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+mixed_rev_move(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+  apr_array_header_t *moved_tos;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "mixed_rev_move", opts, pool));
+
+  SVN_ERR(wc_mkdir(&b, "A"));
+  SVN_ERR(wc_commit(&b, ""));
+  SVN_ERR(wc_mkdir(&b, "A/B"));
+  SVN_ERR(wc_commit(&b, ""));
+  SVN_ERR(wc_mkdir(&b, "A/B/C"));
+  SVN_ERR(wc_commit(&b, ""));
+
+  {
+nodes_row_t nodes[] = {
+  {0, "",  "normal", 0, ""},
+  {0, "A", "normal", 1, "A"},
+  {0, "A/B",   "normal", 2, "A/B"},
+  {0, "A/B/C", "normal", 3, "A/B/C"},
+  {0}
+};
+SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  SVN_ERR(wc_move(&b, "A", "X"));
+
+  {
+nodes_row_t nodes[] = {
+  {0, "",  "normal",   0, ""},
+  {0, "A", "normal",   1, "A"},
+  {0, "A/B",   "normal",   2, "A/B"},
+  {0, "A/B/C", "normal",   3, "A/B/C"},
+  {1, "A", "base-deleted", NO_COPY_FROM, "X"},
+  {1, "A/B",   "base-deleted", NO_COPY_FROM},
+  {1, "A/B/C", "base-deleted", NO_COPY_FROM},
+  {1, "X", "normal",   1, "A", MOVED_HERE},
+  {1, "X/B",   "not-present",  2, "A/B"},
+  {2, "X/B",   "normal",   2, "A/B", MOVED_HERE},
+  {2, "X/B/C", "not-present",  3, "A/B/C"},
+  {3, "X/B/C", "normal",   3, "A/B/C", MOVED_HERE},
+  {0}
+};
+SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* ### These values PASS but I'm not sure they are correct. */
+  SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A/B/C"), pool, pool));
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B/C"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+  SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A/B"), pool, pool));
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+  SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A"), pool, pool));
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+
+  /* This move doesn't record moved-to */
+  SVN_ERR(wc_move(&b, "X/B", "X/Y"));
+
+  {
+nodes_row_t nodes[] = {
+  {0, "",  "normal",   0, ""},
+  {0, "A", "normal",   1, "A"},
+  {0, "A/B",   "normal",   2, "A/B"},
+  {0, "A/B/C", "normal",   3, "A/B/C"},
+  {1, "A", "base-deleted", NO_COPY_FROM, "X"},
+  {1, "A/B",   "base-deleted", NO_COPY_FROM},
+  {1, "A/B/C", "base-deleted", NO_COPY_FROM},
+  {1, "X", "normal",   1, "A", MOVED_HERE},
+  {1, "X/B",   "not-present",  2, "A/B"},
+  {2, "X/Y",   "normal",   2, "A/B"},
+  {2, "X/Y/C", "not-present",  NO_COPY_FROM},
+  {3, "X/Y/C", "normal",   3, "A/B/C"},
+  {0}
+};
+SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* ### These values are unchanged, is that right? */
+  SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A/B/C"), pool, pool));
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B/C"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+  SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+ wc_path(&b, "A/B"), pool, pool));
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 1);
+
+  return SVN_NO_ERROR;
+}
+
 
 /* -- */
 /* The list of test functions */
@@ -4960,5 +5060,7 @@ struct svn_test_descriptor_t test_funcs[
"scan_delete"),
 SVN_TEST_OPTS_PASS(test_follow_moved_to,
"follow_moved_to"),
+SVN_TEST_OPTS_PASS(mixed_rev_move,
+   "mixed_rev_move"),
 SVN_TEST_NULL
   };




[Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin

2012-05-03 Thread Apache subversion Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Subversion Wiki" for 
change notification.

The "MultiLayerMoves" page has been changed by PhilipMartin:
http://wiki.apache.org/subversion/MultiLayerMoves?action=diff&rev1=26&rev2=27

  
   * Suppose the user attempts to revert, or delete, X/B in the mixed-revision 
move: does that break the move leaving A deleted and X/B copied?  Does revert 
fail?
  
- == Problem Cases ==
+ == Update Conflict ==
  
  Move A to B:
  
@@ -311, +311 @@

  
  Perhaps that is not a problem: since B/f is deleted there is no working file 
to accept the A/f changes so this is a form of tree conflict. Perhaps we end up 
with A moved-to B but broken (because the revisions don't match) and a tree 
conflict (on A/f?). After the update the conflict resolution is either to break 
the move into copy+delete or to update the revisions.  Since the resolution 
happens after the update it is probably possible to avoid the mixed-rev state.
  
+ = Problem Case =
+ 
+ A mixed-rev BASE tree:
+ 
+ || op-depth || local-relpath || presence || revision ||
+ ||  0   ||A  || normal   ||   1  ||
+ ||  0   ||A/B|| normal   ||   2  ||
+ ||  0   ||A/B/C  || normal   ||   3  ||
+  '''table H1''' ||
+ 
+ Move A to X, a mixed-rev move:
+ 
+ || op-depth || local-relpath || presence || revision || moved-to ||
+ ||  0   ||A  || normal   ||   1  ||  ||
+ ||  0   ||A/B|| normal   ||   2  ||  ||
+ ||  0   ||A/B/C  || normal   ||   3  ||  ||
+ ||  1   ||A  || base-deleted ||  ||   X  ||
+ ||  1   ||A/B|| base-deleted ||  ||  ||
+ ||  1   ||A/B/C  || base-deleted ||  ||  ||
+ ||  1   ||X  || normal   ||   1  ||  ||
+ ||  1   ||X/B|| not-present  ||  ||  ||
+ ||  2   ||X/B|| normal   ||   2  ||  ||
+ ||  2   ||X/B/C  || not-present  ||  ||  ||
+ ||  3   ||X/B/C  || normal   ||   3  ||  ||
+ || '''table H2''' ||
+ 
+ Nested moves inside X are now a problem. Consider moving X/B to X/Y:
+ 
+ || op-depth || local-relpath || presence || revision || moved-to ||
+ ||  0   ||A  || normal   ||   1  ||  ||
+ ||  0   ||A/B|| normal   ||   2  ||  ||
+ ||  0   ||A/B/C  || normal   ||   3  ||  ||
+ ||  1   ||A  || base-deleted ||  ||   X  ||
+ ||  1   ||A/B|| base-deleted ||  ||  ||
+ ||  1   ||A/B/C  || base-deleted ||  ||  ||
+ ||  1   ||X  || normal   ||   1  ||  ||
+ ||  1   ||X/B|| not-present  ||  ||  ||
+ ||  2   ||X/Y|| normal   ||   2  ||  ||
+ ||  2   ||X/Y/C  || not-present  ||  ||  ||
+ ||  3   ||X/Y/C  || normal   ||   3  ||  ||
+ || '''table H3''' ||
+ 
+ the op-depth=2 tree X/B gets removed and a new op-depth=2 tree X/Y is 
created.  There is no base-deleted tree for X/B so the move to X/Y is not 
recorded.  Should the move to X/Y be recorded and if so where?  Perhaps in the 
not-present node for X/B?
+ 


svn commit: r1333354 - in /subversion/trunk/subversion: include/private/svn_subr_private.h libsvn_subr/hash.c

2012-05-03 Thread stefan2
Author: stefan2
Date: Thu May  3 08:23:25 2012
New Revision: 154

URL: http://svn.apache.org/viewvc?rev=154&view=rev
Log:
Make clear that svn_hash__make_fast returns a hash with platform-
dependent item order. Also, improve READ_CHUNK macro.

* subversion/include/private/svn_subr_private.h
  (svn_hash__make_fast): improve docstring
* subversion/libsvn_subr/hash.c
  (READ_CHUNK): reformat, remove trailing ';', improve docstring

Modified:
subversion/trunk/subversion/include/private/svn_subr_private.h
subversion/trunk/subversion/libsvn_subr/hash.c

Modified: subversion/trunk/subversion/include/private/svn_subr_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_subr_private.h?rev=154&r1=153&r2=154&view=diff
==
--- subversion/trunk/subversion/include/private/svn_subr_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_subr_private.h Thu May  3 
08:23:25 2012
@@ -293,7 +293,7 @@ svn_hash__make(apr_pool_t *pool);
 
 /** Returns a hash table, allocated in @a pool, that is faster to modify
  * and access then the ones returned by @ref svn_hash__make. The element
- * order does not match any APR default.
+ * order does not match any APR default and is platform dependent.
  *
  * @since New in 1.8.
  */

Modified: subversion/trunk/subversion/libsvn_subr/hash.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/hash.c?rev=154&r1=153&r2=154&view=diff
==
--- subversion/trunk/subversion/libsvn_subr/hash.c (original)
+++ subversion/trunk/subversion/libsvn_subr/hash.c Thu May  3 08:23:25 2012
@@ -619,11 +619,10 @@ hashfunc_compatible(const char *char_key
 #define LOWER_7BITS_SET 0x7f7f7f7f
 #define BIT_7_SET   0x80808080
 
-/* Read 4 bytes as little endian at P 
+/* Read 4 bytes at P. LE / BE interpretation is platform-dependent
  */
 #if SVN_UNALIGNED_ACCESS_IS_OK
-#  define READ_CHUNK(p)\
- *(const apr_uint32_t *)(p);
+#  define READ_CHUNK(p) *(const apr_uint32_t *)(p)
 #else
 #  define READ_CHUNK(p) \
  (   (apr_uint32_t)p[0]\




svn commit: r1333340 - in /subversion/trunk/subversion: include/private/ libsvn_client/ libsvn_fs/ libsvn_fs_fs/ libsvn_ra_serf/ libsvn_repos/ libsvn_subr/ libsvn_wc/ svnrdump/

2012-05-03 Thread stefan2
Author: stefan2
Date: Thu May  3 07:54:28 2012
New Revision: 140

URL: http://svn.apache.org/viewvc?rev=140&view=rev
Log:
Move private API declarations from svn_hash_private.h to
svn_subr_private.h. Also, fix serf build.

* subversion/include/private/svn_hash_pivate.h
  drop
* subversion/include/private/svn_subr_pivate.h
  (svn_hash__clear, svn_hash__get_cstring, svn_hash__get_bool,
   svn_hash__make, svn_hash__make_fast): move here

* subversion/libsvn_client/merge.c,
  subversion/libsvn_client/patch.c,
  subversion/libsvn_fs/fs-loader.c,
  subversion/libsvn_fs_fs/caching.c,
  subversion/libsvn_fs_fs/fs_fs.c,
  subversion/libsvn_fs_fs/temp_serializer.c,
  subversion/libsvn_ra_serf/serf.c,
  subversion/libsvn_repos/repos.c,
  subversion/libsvn_subr/hash.c,
  subversion/libsvn_wc/adm_ops.c,
  subversion/svnrdump/dump_editor.c:
 include subversion/include/private/svn_subr_pivate.h

Suggested by: gstein
Found by: gstein

Removed:
subversion/trunk/subversion/include/private/svn_hash_private.h
Modified:
subversion/trunk/subversion/include/private/svn_subr_private.h
subversion/trunk/subversion/libsvn_client/merge.c
subversion/trunk/subversion/libsvn_client/patch.c
subversion/trunk/subversion/libsvn_fs/fs-loader.c
subversion/trunk/subversion/libsvn_fs_fs/caching.c
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c
subversion/trunk/subversion/libsvn_ra_serf/serf.c
subversion/trunk/subversion/libsvn_repos/repos.c
subversion/trunk/subversion/libsvn_subr/hash.c
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/svnrdump/dump_editor.c

Modified: subversion/trunk/subversion/include/private/svn_subr_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_subr_private.h?rev=140&r1=139&r2=140&view=diff
==
--- subversion/trunk/subversion/include/private/svn_subr_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_subr_private.h Thu May  3 
07:54:28 2012
@@ -220,6 +220,90 @@ svn_checksum_t *
 svn_checksum__from_digest_sha1(const unsigned char *digest,
apr_pool_t *result_pool);
 
+
+/**
+ * @defgroup svn_hash_support Hash table serialization support
+ * @{
+ */
+
+/**/
+
+/**
+ * @defgroup svn_hash_misc Miscellaneous hash APIs
+ * @{
+ */
+
+/**
+ * Clear any key/value pairs in the hash table.  A wrapper for a
+ * apr_hash_clear(), which isn't available until APR 1.3.0.
+ *
+ * @since New in 1.5.
+ */
+svn_error_t *
+svn_hash__clear(apr_hash_t *hash, apr_pool_t *pool);
+
+/** @} */
+
+
+/**
+ * @defgroup svn_hash_getters Specialized getter APIs for hashes
+ * @{
+ */
+
+/** Find the value of a @a key in @a hash, return the value.
+ *
+ * If @a hash is @c NULL or if the @a key cannot be found, the
+ * @a default_value will be returned.
+ *
+ * @since New in 1.7.
+ */
+const char *
+svn_hash__get_cstring(apr_hash_t *hash,
+  const char *key,
+  const char *default_value);
+
+/** Like svn_hash_get_cstring(), but for boolean values.
+ *
+ * Parses the value as a boolean value. The recognized representations
+ * are 'TRUE'/'FALSE', 'yes'/'no', 'on'/'off', '1'/'0'; case does not
+ * matter.
+ *
+ * @since New in 1.7.
+ */
+svn_boolean_t
+svn_hash__get_bool(apr_hash_t *hash,
+   const char *key,
+   svn_boolean_t default_value);
+
+/** @} */
+
+/**
+ * @defgroup svn_hash_create Create optimized APR hash tables
+ * @{
+ */
+
+/** Returns a hash table, allocated in @a pool, with the same ordering of
+ * elements as APR 1.4.5 or earlier (using apr_hashfunc_default) but uses
+ * a faster hash function implementation.
+ *
+ * @since New in 1.8.
+ */
+apr_hash_t *
+svn_hash__make(apr_pool_t *pool);
+
+/** Returns a hash table, allocated in @a pool, that is faster to modify
+ * and access then the ones returned by @ref svn_hash__make. The element
+ * order does not match any APR default.
+ *
+ * @since New in 1.8.
+ */
+apr_hash_t *
+svn_hash__make_fast(apr_pool_t *pool);
+
+/** @} */
+
+/** @} */
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=140&r1=139&r2=140&view=diff
==
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Thu May  3 07:54:28 2012
@@ -59,7 +59,7 @@
 #include "private/svn_fspath.h"
 #include "private/svn_ra_private.h"
 #include "private/svn_client_private.h"
-#include "private/svn_hash_private.h"
+#include "private/svn_subr_private.h"
 
 #include "svn_private_config.h"
 

Modified: 

svn commit: r1333328 - /subversion/trunk/subversion/libsvn_subr/hash.c

2012-05-03 Thread stefan2
Author: stefan2
Date: Thu May  3 07:18:03 2012
New Revision: 128

URL: http://svn.apache.org/viewvc?rev=128&view=rev
Log:
No functional change.

* subversion/libsvn_subr/hash.c
  remove used include; add docstrings

Modified:
subversion/trunk/subversion/libsvn_subr/hash.c

Modified: subversion/trunk/subversion/libsvn_subr/hash.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/hash.c?rev=128&r1=127&r2=128&view=diff
==
--- subversion/trunk/subversion/libsvn_subr/hash.c (original)
+++ subversion/trunk/subversion/libsvn_subr/hash.c Thu May  3 07:18:03 2012
@@ -40,7 +40,6 @@
 #include "svn_pools.h"
 
 #include "private/svn_dep_compat.h"
-#include "private/svn_string_private.h"
 #include "private/svn_hash_private.h"
 
 #include "svn_private_config.h"
@@ -615,9 +614,13 @@ hashfunc_compatible(const char *char_key
 return hash;
 }
 
+/* Used to detect NUL chars 
+ */
 #define LOWER_7BITS_SET 0x7f7f7f7f
 #define BIT_7_SET   0x80808080
 
+/* Read 4 bytes as little endian at P 
+ */
 #if SVN_UNALIGNED_ACCESS_IS_OK
 #  define READ_CHUNK(p)\
  *(const apr_uint32_t *)(p);




svn commit: r1333326 - in /subversion/trunk/subversion: include/private/svn_hash_private.h libsvn_fs_fs/temp_serializer.c libsvn_subr/hash.c

2012-05-03 Thread stefan2
Author: stefan2
Date: Thu May  3 07:16:11 2012
New Revision: 126

URL: http://svn.apache.org/viewvc?rev=126&view=rev
Log:
Introduce private API functions that wrap apr_hash_make_custom
and return hash tables that are 2 to 4 times faster than the APR default.
Both yield repeatable results (each instance will store items in the same
order if the keys are the same). The first, svn_hask__make will return
a hash table that behaves like pre APR 1.4.6 default hashes.

* subversion/include/private/svn_hash_private.h
  (svn_hash__make, svn_hash__make_fast): new private API
* subversion/libsvn_subr/hash.c
  (svn_hash_from_cstring_keys): use new API
  (hashfunc_compatible, LOWER_7BITS_SET, BIT_7_SET, READ_CHUNK,
   hashfunc_fast): implement efficient hash functions
  (svn_hash__make, svn_hash__make_fast): implement new private API
* subversion/libsvn_fs_fs/temp_serializer.c
  (deserialize_dir, svn_fs_fs__deserialize_properties): use new API

Modified:
subversion/trunk/subversion/include/private/svn_hash_private.h
subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c
subversion/trunk/subversion/libsvn_subr/hash.c

Modified: subversion/trunk/subversion/include/private/svn_hash_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_hash_private.h?rev=126&r1=125&r2=126&view=diff
==
--- subversion/trunk/subversion/include/private/svn_hash_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_hash_private.h Thu May  3 
07:16:11 2012
@@ -102,6 +102,31 @@ svn_hash__get_bool(apr_hash_t *hash,
 
 /** @} */
 
+/**
+ * @defgroup svn_hash_create Create optimized APR hash tables
+ * @{
+ */
+
+/** Returns a hash table, allocated in @a pool, with the same ordering of
+ * elements as APR 1.4.5 or earlier (using apr_hashfunc_default) but uses
+ * a faster hash function implementation.
+ *
+ * @since New in 1.8.
+ */
+apr_hash_t *
+svn_hash__make(apr_pool_t *pool);
+
+/** Returns a hash table, allocated in @a pool, that is faster to modify
+ * and access then the ones returned by @ref svn_hash__make. The element
+ * order does not match any APR default.
+ *
+ * @since New in 1.8.
+ */
+apr_hash_t *
+svn_hash__make_fast(apr_pool_t *pool);
+
+/** @} */
+
 /** @} */
 
 #ifdef __cplusplus

Modified: subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c?rev=126&r1=125&r2=126&view=diff
==
--- subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c Thu May  3 
07:16:11 2012
@@ -30,6 +30,7 @@
 
 #include "private/svn_fs_util.h"
 #include "private/svn_temp_serializer.h"
+#include "private/svn_hash_private.h"
 
 #include "temp_serializer.h"
 
@@ -359,7 +360,7 @@ serialize_dir(apr_hash_t *entries, apr_p
 static apr_hash_t *
 deserialize_dir(void *buffer, hash_data_t *hash_data, apr_pool_t *pool)
 {
-  apr_hash_t *result = apr_hash_make(pool);
+  apr_hash_t *result = svn_hash__make(pool);
   apr_size_t i;
   apr_size_t count;
   svn_fs_dirent_t *entry;
@@ -678,7 +679,7 @@ svn_fs_fs__deserialize_properties(void *
   apr_size_t data_len,
   apr_pool_t *pool)
 {
-  apr_hash_t *hash = apr_hash_make(pool);
+  apr_hash_t *hash = svn_hash__make(pool);
   properties_data_t *properties = (properties_data_t *)data;
   size_t i;
 

Modified: subversion/trunk/subversion/libsvn_subr/hash.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/hash.c?rev=126&r1=125&r2=126&view=diff
==
--- subversion/trunk/subversion/libsvn_subr/hash.c (original)
+++ subversion/trunk/subversion/libsvn_subr/hash.c Thu May  3 07:16:11 2012
@@ -40,6 +40,7 @@
 #include "svn_pools.h"
 
 #include "private/svn_dep_compat.h"
+#include "private/svn_string_private.h"
 #include "private/svn_hash_private.h"
 
 #include "svn_private_config.h"
@@ -496,7 +497,7 @@ svn_hash_from_cstring_keys(apr_hash_t **
apr_pool_t *pool)
 {
   int i;
-  apr_hash_t *hash = apr_hash_make(pool);
+  apr_hash_t *hash = svn_hash__make(pool);
   for (i = 0; i < keys->nelts; i++)
 {
   const char *key =
@@ -561,3 +562,127 @@ svn_hash__get_bool(apr_hash_t *hash, con
   return default_value;
 }
 
+
+
+/*** Optimized hash functions ***/
+
+/* Optimized version of apr_hashfunc_default. It assumes that the CPU has
+ * 32-bit multiplications with high throughput of at least 1 operation
+ * every 3 cycles. Latency is not an issue. Another optimization is a
+ * mildly unrolled main loop.
+ */
+static unsigned int
+hashfunc_compatible(const char *char_key, apr_ssize_t *klen)
+{
+unsigned i