In the Subversion libraries, replace uses of "assert" and "abort" with the new SVN_ERR_ASSERT and SVN_ERR_MALFUNCTION macros where possible. Replace "if (cond) abort();" with "SVN_ERR_ASSERT(!cond)". This is a like-for-like change except that the new macros are not affected by the NDEBUG macro (so they are not compiled out in release-mode builds as "assert" could be), and they allow the application to have run-time control over their behaviour. (68 files affected.) Index: subversion/libsvn_client/blame.c =================================================================== --- subversion/libsvn_client/blame.c (revision 31931) +++ subversion/libsvn_client/blame.c (working copy) @@ -281,5 +281,5 @@ if (!last_file) { - assert(chain->blame == NULL); + SVN_ERR_ASSERT(chain->blame == NULL); chain->blame = blame_create(chain, rev, 0); } @@ -484,5 +484,5 @@ { /* We shouldn't get more than one revision before start. */ - assert(frb->last_filename == NULL); + SVN_ERR_ASSERT(frb->last_filename == NULL); /* The file existed before start_rev; generate no blame info for @@ -495,5 +495,5 @@ { svn_string_t *str; - assert(revnum <= frb->end_rev); + SVN_ERR_ASSERT(revnum <= frb->end_rev); /* Set values from revision props. */ @@ -682,5 +682,5 @@ /* The callback has to have been called at least once. */ - assert(frb.last_filename != NULL); + SVN_ERR_ASSERT(frb.last_filename != NULL); /* Create a pool for the iteration below. */ Index: subversion/libsvn_client/cat.c =================================================================== --- subversion/libsvn_client/cat.c (revision 31931) +++ subversion/libsvn_client/cat.c (working copy) @@ -63,8 +63,8 @@ svn_stream_t *input; - assert(revision->kind == svn_opt_revision_working || - revision->kind == svn_opt_revision_base || - revision->kind == svn_opt_revision_committed || - revision->kind == svn_opt_revision_unspecified); + SVN_ERR_ASSERT(revision->kind == svn_opt_revision_working || + revision->kind == svn_opt_revision_base || + revision->kind == svn_opt_revision_committed || + revision->kind == svn_opt_revision_unspecified); SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, FALSE, pool)); Index: subversion/libsvn_client/commit.c =================================================================== --- subversion/libsvn_client/commit.c (revision 31931) +++ subversion/libsvn_client/commit.c (working copy) @@ -1551,8 +1551,6 @@ while (strcmp(target, base_dir) != 0) { - if ((target[0] == '\0') || - svn_dirent_is_root(target, strlen(target)) - ) - abort(); + SVN_ERR_ASSERT((target[0] != '\0') && + !svn_dirent_is_root(target, strlen(target))); APR_ARRAY_PUSH(dirs_to_lock, @@ -1736,5 +1734,5 @@ goto cleanup; - assert(*commit_info_p); + SVN_ERR_ASSERT(*commit_info_p); bump_err = svn_wc_process_committed_queue(queue, base_dir_access, Index: subversion/libsvn_client/commit_util.c =================================================================== --- subversion/libsvn_client/commit_util.c (revision 31931) +++ subversion/libsvn_client/commit_util.c (working copy) @@ -248,6 +248,6 @@ return SVN_NO_ERROR; - assert(entry); - assert(url); + SVN_ERR_ASSERT(entry); + SVN_ERR_ASSERT(url); if (ctx->cancel_func) @@ -961,5 +961,5 @@ int i; - assert(ci && ci->nelts); + SVN_ERR_ASSERT(ci && ci->nelts); /* Sort our commit items by their URLs. */ @@ -1193,5 +1193,5 @@ if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE) { - assert(parent_baton); + SVN_ERR_ASSERT(parent_baton); SVN_ERR(editor->delete_entry(path, item->revision, parent_baton, pool)); @@ -1203,5 +1203,5 @@ if (kind == svn_node_file) { - assert(parent_baton); + SVN_ERR_ASSERT(parent_baton); SVN_ERR(editor->add_file (path, parent_baton, copyfrom_url, @@ -1211,5 +1211,5 @@ else { - assert(parent_baton); + SVN_ERR_ASSERT(parent_baton); SVN_ERR(editor->add_directory (path, parent_baton, copyfrom_url, @@ -1250,5 +1250,5 @@ if (! file_baton) { - assert(parent_baton); + SVN_ERR_ASSERT(parent_baton); SVN_ERR(editor->open_file(path, parent_baton, item->revision, @@ -1314,5 +1314,5 @@ if (! file_baton) { - assert(parent_baton); + SVN_ERR_ASSERT(parent_baton); SVN_ERR(editor->open_file(path, parent_baton, item->revision, Index: subversion/libsvn_client/copy.c =================================================================== --- subversion/libsvn_client/copy.c (revision 31931) +++ subversion/libsvn_client/copy.c (working copy) @@ -599,5 +599,5 @@ create nor delete the empty PATH, so if someone is calling us with such, the code is just plain wrong. */ - assert(! svn_path_is_empty(path)); + SVN_ERR_ASSERT(! svn_path_is_empty(path)); /* Check to see if we need to add the path as a directory. */ Index: subversion/libsvn_client/diff.c =================================================================== --- subversion/libsvn_client/diff.c (revision 31931) +++ subversion/libsvn_client/diff.c (working copy) @@ -1128,7 +1128,6 @@ int levels_to_lock = SVN_WC__LEVELS_TO_LOCK_FROM_DEPTH(depth); - /* Assert that we have valid input. */ - assert(! svn_path_is_url(path1)); - assert(! svn_path_is_url(path2)); + SVN_ERR_ASSERT(! svn_path_is_url(path1)); + SVN_ERR_ASSERT(! svn_path_is_url(path2)); /* Currently we support only the case where path1 and path2 are the @@ -1269,6 +1268,5 @@ svn_boolean_t server_supports_depth; - /* Assert that we have valid input. */ - assert(! svn_path_is_url(path2)); + SVN_ERR_ASSERT(! svn_path_is_url(path2)); /* Convert path1 to a URL to feed to do_diff. */ Index: subversion/libsvn_client/merge.c =================================================================== --- subversion/libsvn_client/merge.c (revision 31931) +++ subversion/libsvn_client/merge.c (working copy) @@ -1082,5 +1082,5 @@ child = svn_path_is_child(merge_b->target, path, subpool); - assert(child != NULL); + SVN_ERR_ASSERT(child != NULL); /* If this is a merge from the same repository as our working copy, @@ -2192,7 +2192,7 @@ /* Assert that we have sane input. */ - assert(SVN_IS_VALID_REVNUM(start) - && SVN_IS_VALID_REVNUM(end) - && (start > end)); + SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(start) + && SVN_IS_VALID_REVNUM(end) + && (start > end)); /* First, we get the real mergeinfo. */ @@ -2376,11 +2376,8 @@ parent = APR_ARRAY_IDX(children_with_mergeinfo, parent_index, svn_client__merge_path_t *); - if (!parent) - { - /* If CHILD is a subtree then its parent must be in - CHILDREN_WITH_MERGEINFO, see the global comment - 'THE CHILDREN_WITH_MERGEINFO ARRAY'. */ - abort(); - } + /* If CHILD is a subtree then its parent must be in + CHILDREN_WITH_MERGEINFO, see the global comment + 'THE CHILDREN_WITH_MERGEINFO ARRAY'. */ + SVN_ERR_ASSERT(parent); } @@ -5931,5 +5928,5 @@ /* mergeinfo hashes contain paths that start with slashes; ra APIs take paths without slashes. */ - assert(*path); + SVN_ERR_ASSERT(*path); path++; @@ -5942,5 +5939,5 @@ /* This function should not receive any "rollback" ranges. */ - assert(range->start < range->end); + SVN_ERR_ASSERT(range->start < range->end); svn_pool_clear(iterpool); @@ -6168,5 +6165,5 @@ /* We only got here because we had mergeinfo for the source; if there were no segments, then our logic was wrong. */ - abort(); + SVN_ERR_MALFUNCTION(); } else Index: subversion/libsvn_client/mergeinfo.c =================================================================== --- subversion/libsvn_client/mergeinfo.c (revision 31931) +++ subversion/libsvn_client/mergeinfo.c (working copy) @@ -959,5 +959,5 @@ /* pb == NULL would imply that there was an *empty* path in the paths given to the driver (which is different from "/"). */ - assert(pb != NULL); + SVN_ERR_ASSERT(pb != NULL); /* We'll just act like everything is a file. */ @@ -973,5 +973,5 @@ path_suffix = svn_path_is_child(pb->inherited_mergeinfo_path, path, NULL); - assert(path_suffix != NULL); + SVN_ERR_ASSERT(path_suffix != NULL); SVN_ERR(should_elide_mergeinfo(&elides, @@ -1062,5 +1062,5 @@ return SVN_NO_ERROR; - assert (intersection->nelts == 1); + SVN_ERR_ASSERT(intersection->nelts == 1); return fleb->log_receiver(fleb->log_receiver_baton, log_entry, pool); } Index: subversion/libsvn_client/switch.c =================================================================== --- subversion/libsvn_client/switch.c (revision 31931) +++ subversion/libsvn_client/switch.c (working copy) @@ -111,6 +111,6 @@ /* Sanity check. Without these, the switch is meaningless. */ - assert(path); - assert(switch_url && (switch_url[0] != '\0')); + SVN_ERR_ASSERT(path); + SVN_ERR_ASSERT(switch_url && (switch_url[0] != '\0')); /* ### Need to lock the whole target tree to invalidate wcprops. Does Index: subversion/libsvn_client/update.c =================================================================== --- subversion/libsvn_client/update.c (revision 31931) +++ subversion/libsvn_client/update.c (working copy) @@ -134,5 +134,5 @@ /* Sanity check. Without this, the update is meaningless. */ - assert(path); + SVN_ERR_ASSERT(path); if (svn_path_is_url(path)) Index: subversion/libsvn_client/util.c =================================================================== --- subversion/libsvn_client/util.c (revision 31931) +++ subversion/libsvn_client/util.c (working copy) @@ -177,5 +177,5 @@ svn_boolean_t need_wc_cleanup = FALSE; - assert(repos_root != NULL || ra_session != NULL); + SVN_ERR_ASSERT(repos_root != NULL || ra_session != NULL); /* If we have a WC path... */ Index: subversion/libsvn_delta/path_driver.c =================================================================== --- subversion/libsvn_delta/path_driver.c (revision 31931) +++ subversion/libsvn_delta/path_driver.c (working copy) @@ -55,5 +55,5 @@ /* Assert that we are in a stable state. */ - assert(db_stack && db_stack->nelts); + SVN_ERR_ASSERT(db_stack && db_stack->nelts); /* Get the parent dir baton. */ @@ -88,5 +88,5 @@ /* Assert that we are in a stable state. */ - assert(db_stack && db_stack->nelts); + SVN_ERR_ASSERT(db_stack && db_stack->nelts); /* Close the most recent directory pushed to the stack. */ Index: subversion/libsvn_delta/svndiff.c =================================================================== --- subversion/libsvn_delta/svndiff.c (revision 31931) +++ subversion/libsvn_delta/svndiff.c (working copy) @@ -599,5 +599,5 @@ } } - assert(data == insend); + SVN_ERR_ASSERT(data == insend); window->ops = ops; Index: subversion/libsvn_delta/text_delta.c =================================================================== --- subversion/libsvn_delta/text_delta.c (revision 31931) +++ subversion/libsvn_delta/text_delta.c (working copy) @@ -605,8 +605,8 @@ /* Make sure the source view didn't slide backwards. */ - assert(window->sview_len == 0 - || (window->sview_offset >= ab->sbuf_offset - && (window->sview_offset + window->sview_len - >= ab->sbuf_offset + ab->sbuf_len))); + SVN_ERR_ASSERT(window->sview_len == 0 + || (window->sview_offset >= ab->sbuf_offset + && (window->sview_offset + window->sview_len + >= ab->sbuf_offset + ab->sbuf_len))); /* Make sure there's enough room in the target buffer. */ @@ -653,5 +653,5 @@ len = window->tview_len; svn_txdelta_apply_instructions(window, ab->sbuf, ab->tbuf, &len); - assert(len == window->tview_len); + SVN_ERR_ASSERT(len == window->tview_len); /* Write out the output. */ Index: subversion/libsvn_diff/diff_file.c =================================================================== --- subversion/libsvn_diff/diff_file.c (revision 31931) +++ subversion/libsvn_diff/diff_file.c (working copy) @@ -1399,5 +1399,5 @@ { struct trailing_context_printer *tcp = baton; - assert(tcp->lines_to_print > 0); + SVN_ERR_ASSERT(tcp->lines_to_print > 0); SVN_ERR(svn_stream_write(tcp->fob->real_output_stream, data, len)); tcp->lines_to_print--; @@ -1672,5 +1672,5 @@ SVN_ERR(output_hunk(baton, 2, latest_start, latest_length)); else /* unknown style */ - abort(); + SVN_ERR_MALFUNCTION(); return SVN_NO_ERROR; Index: subversion/libsvn_diff/diff_memory.c =================================================================== --- subversion/libsvn_diff/diff_memory.c (revision 31931) +++ subversion/libsvn_diff/diff_memory.c (working copy) @@ -693,5 +693,5 @@ { struct trailing_context_printer *tcp = baton; - assert(tcp->lines_to_print > 0); + SVN_ERR_ASSERT(tcp->lines_to_print > 0); SVN_ERR(svn_stream_write(tcp->mob->real_output_stream, data, len)); tcp->lines_to_print--; @@ -842,5 +842,5 @@ latest_start, latest_length)); else /* unknown style */ - abort(); + SVN_ERR_MALFUNCTION(); return SVN_NO_ERROR; Index: subversion/libsvn_diff/token.c =================================================================== --- subversion/libsvn_diff/token.c (revision 31931) +++ subversion/libsvn_diff/token.c (working copy) @@ -75,6 +75,5 @@ int rv; - if (!token) - abort(); + SVN_ERR_ASSERT(token); parent = NULL; Index: subversion/libsvn_fs/access.c =================================================================== --- subversion/libsvn_fs/access.c (revision 31931) +++ subversion/libsvn_fs/access.c (working copy) @@ -36,5 +36,5 @@ svn_fs_access_t *ac; - assert(username != NULL); + SVN_ERR_ASSERT(username != NULL); ac = apr_pcalloc(pool, sizeof(*ac)); Index: subversion/libsvn_fs_base/reps-strings.c =================================================================== --- subversion/libsvn_fs_base/reps-strings.c (revision 31931) +++ subversion/libsvn_fs_base/reps-strings.c (working copy) @@ -189,6 +189,6 @@ { struct compose_handler_baton *cb = baton; - assert(!cb->done || window == NULL); - assert(cb->trail && cb->trail->pool); + SVN_ERR_ASSERT(!cb->done || window == NULL); + SVN_ERR_ASSERT(cb->trail && cb->trail->pool); if (!cb->init && !window) @@ -197,5 +197,5 @@ /* We should never get here if we've already expanded a self-compressed window. */ - assert(!cb->source_buf); + SVN_ERR_ASSERT(!cb->source_buf); if (cb->window) @@ -208,5 +208,5 @@ ended. */ apr_size_t source_len = window->tview_len; - assert(cb->window->sview_len == source_len); + SVN_ERR_ASSERT(cb->window->sview_len == source_len); cb->source_buf = apr_palloc(cb->window_pool, source_len); svn_txdelta_apply_instructions(window, NULL, @@ -232,5 +232,5 @@ /* Copy the (first) window into the baton. */ apr_pool_t *window_pool = svn_pool_create(cb->trail->pool); - assert(cb->window_pool == NULL); + SVN_ERR_ASSERT(cb->window_pool == NULL); cb->window = svn_txdelta_window_dup(window, window_pool); cb->window_pool = window_pool; @@ -307,7 +307,7 @@ SVN_ERR(svn_stream_close(wstream)); - assert(!cb->init); - assert(cb->window != NULL); - assert(cb->window_pool != NULL); + SVN_ERR_ASSERT(!cb->init); + SVN_ERR_ASSERT(cb->window != NULL); + SVN_ERR_ASSERT(cb->window_pool != NULL); return SVN_NO_ERROR; } @@ -355,5 +355,5 @@ /* The source view length should not be 0 if there are source copy ops in the window. */ - assert(cb.window->sview_len > 0 || cb.window->src_ops == 0); + SVN_ERR_ASSERT(cb.window->sview_len > 0 || cb.window->src_ops == 0); /* cb.window is the combined delta window. Read the source text @@ -398,5 +398,5 @@ if (offset > 0) { - assert(target_len > offset); + SVN_ERR_ASSERT(target_len > offset); target_len -= offset; memcpy(buf, target_buf + offset, target_len); @@ -730,5 +730,5 @@ rep_delta_chunk_t *last_chunk; - assert(chunks->nelts); + SVN_ERR_ASSERT(chunks->nelts); last_chunk = APR_ARRAY_IDX(chunks, chunks->nelts - 1, @@ -1220,5 +1220,5 @@ _("Rep '%s' is not mutable"), rep_key); - assert(rep->kind == rep_kind_fulltext); + SVN_ERR_ASSERT(rep->kind == rep_kind_fulltext); /* If rep has no string, just return success. Else, clear the Index: subversion/libsvn_fs_base/revs-txns.c =================================================================== --- subversion/libsvn_fs_base/revs-txns.c (revision 31931) +++ subversion/libsvn_fs_base/revs-txns.c (working copy) @@ -316,6 +316,5 @@ transaction_t *txn; - /* Don't you dare call this with an invalid REVISION. */ - assert(SVN_IS_VALID_REVNUM(revision)); + SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(revision)); /* Make sure the TXN is not committed already. */ Index: subversion/libsvn_fs_base/trail.c =================================================================== --- subversion/libsvn_fs_base/trail.c (revision 31931) +++ subversion/libsvn_fs_base/trail.c (working copy) @@ -90,6 +90,5 @@ If we're already inside a trail operation, abort() -- this is a coding problem (and will likely hang the repository anyway). */ - if (bfd->in_txn_trail) - abort(); + SVN_ERR_ASSERT(bfd->in_txn_trail); SVN_ERR(BDB_WRAP(fs, "beginning Berkeley DB transaction", Index: subversion/libsvn_fs_base/tree.c =================================================================== --- subversion/libsvn_fs_base/tree.c (revision 31931) +++ subversion/libsvn_fs_base/tree.c (working copy) @@ -523,6 +523,5 @@ const char *id_path = NULL; - /* Make some assertions about the function input. */ - assert(child && child->parent && txn_id); + SVN_ERR_ASSERT(child && child->parent && txn_id); /* Initialize our return variables (default: self-inheritance). */ @@ -828,5 +827,5 @@ case copy_id_inherit_unknown: default: - abort(); /* uh-oh -- somebody didn't calculate copy-ID + SVN_ERR_MALFUNCTION(); /* uh-oh -- somebody didn't calculate copy-ID inheritance data. */ } @@ -2982,5 +2981,5 @@ future. */ - abort(); + SVN_ERR_MALFUNCTION(); } @@ -4768,5 +4767,5 @@ apr_hash_pool_get(args->children_atop_mergeinfo_trees); - assert(svn_fs_base__dag_node_kind(node) == svn_node_dir); + SVN_ERR_ASSERT(svn_fs_base__dag_node_kind(node) == svn_node_dir); SVN_ERR(svn_fs_base__dag_dir_entries(&entries, node, trail, trail->pool)); Index: subversion/libsvn_fs_fs/dag.c =================================================================== --- subversion/libsvn_fs_fs/dag.c (revision 31931) +++ subversion/libsvn_fs_fs/dag.c (working copy) @@ -723,8 +723,5 @@ (If they're the same, we haven't cloned the transaction's root directory yet.) */ - if (svn_fs_fs__id_eq(root_id, base_root_id)) - { - abort(); - } + SVN_ERR_ASSERT(!svn_fs_fs__id_eq(root_id, base_root_id)); /* One way or another, root_id now identifies a cloned root node. */ Index: subversion/libsvn_fs_fs/fs_fs.c =================================================================== --- subversion/libsvn_fs_fs/fs_fs.c (revision 31931) +++ subversion/libsvn_fs_fs/fs_fs.c (working copy) @@ -903,5 +903,5 @@ const char *contents; - assert (1 <= format && format <= SVN_FS_FS__FORMAT_NUMBER); + SVN_ERR_ASSERT(1 <= format && format <= SVN_FS_FS__FORMAT_NUMBER); if (format >= SVN_FS_FS__MIN_LAYOUT_FORMAT_OPTION_FORMAT) { @@ -2514,5 +2514,5 @@ svn_stream_t *stream; - assert(rs->chunk_index <= this_chunk); + SVN_ERR_ASSERT(rs->chunk_index <= this_chunk); /* Skip windows to reach the current chunk if we aren't there yet. */ @@ -2555,5 +2555,5 @@ struct rep_state *rs; - assert(rb->rs_list->nelts >= 2); + SVN_ERR_ASSERT(rb->rs_list->nelts >= 2); pool = svn_pool_create(rb->pool); Index: subversion/libsvn_fs/fs-loader.c =================================================================== --- subversion/libsvn_fs/fs-loader.c (revision 31931) +++ subversion/libsvn_fs/fs-loader.c (working copy) @@ -322,5 +322,5 @@ or /dev/tty is not acceptable default behavior for server processes, since those may both be equivalent to /dev/null. */ - abort(); + SVN_ERR_MALFUNCTION(); } Index: subversion/libsvn_fs_fs/lock.c =================================================================== --- subversion/libsvn_fs_fs/lock.c (revision 31931) +++ subversion/libsvn_fs_fs/lock.c (working copy) @@ -330,5 +330,5 @@ apr_pool_t *subpool; - assert(lock); + SVN_ERR_ASSERT(lock); /* Iterate in reverse, creating the lock for LOCK->path, and then @@ -392,5 +392,5 @@ apr_pool_t *subpool; - assert(lock); + SVN_ERR_ASSERT(lock); /* Iterate in reverse, deleting the lock for LOCK->path, and then Index: subversion/libsvn_fs_fs/tree.c =================================================================== --- subversion/libsvn_fs_fs/tree.c (revision 31931) +++ subversion/libsvn_fs_fs/tree.c (working copy) @@ -166,6 +166,5 @@ const char *key; - /* Assert valid input. */ - assert(*path == '/'); + SVN_ERR_ASSERT(*path == '/'); locate_cache(&cache, &key, root, path, pool); @@ -195,6 +194,5 @@ const char *key; - /* Assert valid input and state. */ - assert(*path == '/'); + SVN_ERR_ASSERT(*path == '/'); locate_cache(&cache, &key, root, path, pool); @@ -246,5 +244,5 @@ b.list = apr_array_make(b.pool, 1, sizeof(const char *)); - assert(root->is_txn_root); + SVN_ERR_ASSERT(root->is_txn_root); locate_cache(&cache, NULL, root, NULL, b.pool); @@ -457,6 +455,5 @@ const char *copyroot_path; - /* Make some assertions about the function input. */ - assert(child && child->parent && txn_id); + SVN_ERR_ASSERT(child && child->parent && txn_id); /* Initialize some convenience variables. */ @@ -756,5 +753,5 @@ case copy_id_inherit_unknown: default: - abort(); /* uh-oh -- somebody didn't calculate copy-ID + SVN_ERR_MALFUNCTION(); /* uh-oh -- somebody didn't calculate copy-ID inheritance data. */ } @@ -1609,5 +1606,5 @@ for the caller to do, and we might want to consider whether this response is really appropriate. */ - abort(); + SVN_ERR_MALFUNCTION(); } else @@ -2103,5 +2100,5 @@ future. */ - abort(); + SVN_ERR_MALFUNCTION(); } Index: subversion/libsvn_ra/compat.c =================================================================== --- subversion/libsvn_ra/compat.c (revision 31931) +++ subversion/libsvn_ra/compat.c (working copy) @@ -75,5 +75,5 @@ /* It's impossible to find the predecessor path of a NULL path. */ - assert(path); + SVN_ERR_ASSERT(path); /* Initialize our return values for the action and copyfrom_rev in @@ -542,5 +542,5 @@ /* The API demands a certain ordering of our revision inputs. Enforce it. */ - assert((peg_revision >= start_rev) && (start_rev >= end_rev)); + SVN_ERR_ASSERT((peg_revision >= start_rev) && (start_rev >= end_rev)); /* Sanity check: verify that the peg-object exists in repos. */ Index: subversion/libsvn_ra_neon/fetch.c =================================================================== --- subversion/libsvn_ra_neon/fetch.c (revision 31931) +++ subversion/libsvn_ra_neon/fetch.c (working copy) @@ -926,5 +926,5 @@ } - assert(num_props == -1); + SVN_ERR_ASSERT(num_props == -1); } else @@ -2116,8 +2116,7 @@ else { - SVN_ERR(svn_error_createf(SVN_ERR_XML_UNKNOWN_ENCODING, NULL, - _("Unknown XML encoding: '%s'"), - rb->encoding->data)); - abort(); /* Not reached. */ + return svn_error_createf(SVN_ERR_XML_UNKNOWN_ENCODING, NULL, + _("Unknown XML encoding: '%s'"), + rb->encoding->data); } Index: subversion/libsvn_ra_neon/log.c =================================================================== --- subversion/libsvn_ra_neon/log.c (revision 31931) +++ subversion/libsvn_ra_neon/log.c (working copy) @@ -309,5 +309,5 @@ if (! SVN_IS_VALID_REVNUM(lb->log_entry->revision)) { - assert(lb->nest_level); + SVN_ERR_ASSERT(lb->nest_level); lb->nest_level--; } Index: subversion/libsvn_ra_neon/replay.c =================================================================== --- subversion/libsvn_ra_neon/replay.c (revision 31931) +++ subversion/libsvn_ra_neon/replay.c (working copy) @@ -217,5 +217,5 @@ } else - abort(); + SVN_ERR_MALFUNCTION(); push_dir(rb, dir_baton, name, subpool); Index: subversion/libsvn_ra/ra_loader.c =================================================================== --- subversion/libsvn_ra/ra_loader.c (revision 31931) +++ subversion/libsvn_ra/ra_loader.c (working copy) @@ -750,5 +750,5 @@ apr_pool_t *pool) { - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); return session->vtable->get_file(session, path, revision, stream, fetched_rev, props, pool); @@ -763,5 +763,5 @@ apr_pool_t *pool) { - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); return session->vtable->get_dir(session, dirents, fetched_rev, props, path, revision, SVN_DIRENT_ALL, pool); @@ -777,5 +777,5 @@ apr_pool_t *pool) { - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); return session->vtable->get_dir(session, dirents, fetched_rev, props, path, revision, dirent_fields, pool); @@ -797,5 +797,5 @@ { const char *path = APR_ARRAY_IDX(paths, i, const char *); - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); } @@ -824,6 +824,6 @@ apr_pool_t *pool) { - assert(svn_path_is_empty(update_target) - || svn_path_is_single_path_component(update_target)); + SVN_ERR_ASSERT(svn_path_is_empty(update_target) + || svn_path_is_single_path_component(update_target)); return session->vtable->do_update(session, reporter, report_baton, @@ -845,6 +845,6 @@ { struct reporter_3in2_baton *b = apr_palloc(pool, sizeof(*b)); - assert(svn_path_is_empty(update_target) - || svn_path_is_single_path_component(update_target)); + SVN_ERR_ASSERT(svn_path_is_empty(update_target) + || svn_path_is_single_path_component(update_target)); *reporter = &reporter_3in2_wrapper; *report_baton = b; @@ -869,6 +869,6 @@ apr_pool_t *pool) { - assert(svn_path_is_empty(switch_target) - || svn_path_is_single_path_component(switch_target)); + SVN_ERR_ASSERT(svn_path_is_empty(switch_target) + || svn_path_is_single_path_component(switch_target)); return session->vtable->do_switch(session, reporter, report_baton, @@ -890,6 +890,6 @@ { struct reporter_3in2_baton *b = apr_palloc(pool, sizeof(*b)); - assert(svn_path_is_empty(switch_target) - || svn_path_is_single_path_component(switch_target)); + SVN_ERR_ASSERT(svn_path_is_empty(switch_target) + || svn_path_is_single_path_component(switch_target)); *reporter = &reporter_3in2_wrapper; *report_baton = b; @@ -912,6 +912,6 @@ apr_pool_t *pool) { - assert(svn_path_is_empty(status_target) - || svn_path_is_single_path_component(status_target)); + SVN_ERR_ASSERT(svn_path_is_empty(status_target) + || svn_path_is_single_path_component(status_target)); return session->vtable->do_status(session, reporter, report_baton, @@ -931,6 +931,6 @@ { struct reporter_3in2_baton *b = apr_palloc(pool, sizeof(*b)); - assert(svn_path_is_empty(status_target) - || svn_path_is_single_path_component(status_target)); + SVN_ERR_ASSERT(svn_path_is_empty(status_target) + || svn_path_is_single_path_component(status_target)); *reporter = &reporter_3in2_wrapper; *report_baton = b; @@ -955,6 +955,6 @@ apr_pool_t *pool) { - assert(svn_path_is_empty(diff_target) - || svn_path_is_single_path_component(diff_target)); + SVN_ERR_ASSERT(svn_path_is_empty(diff_target) + || svn_path_is_single_path_component(diff_target)); return session->vtable->do_diff(session, reporter, report_baton, @@ -979,6 +979,6 @@ { struct reporter_3in2_baton *b = apr_palloc(pool, sizeof(*b)); - assert(svn_path_is_empty(diff_target) - || svn_path_is_single_path_component(diff_target)); + SVN_ERR_ASSERT(svn_path_is_empty(diff_target) + || svn_path_is_single_path_component(diff_target)); *reporter = &reporter_3in2_wrapper; *report_baton = b; @@ -1003,6 +1003,6 @@ apr_pool_t *pool) { - assert(svn_path_is_empty(diff_target) - || svn_path_is_single_path_component(diff_target)); + SVN_ERR_ASSERT(svn_path_is_empty(diff_target) + || svn_path_is_single_path_component(diff_target)); return svn_ra_do_diff2(session, reporter, report_baton, revision, diff_target, recurse, ignore_ancestry, TRUE, @@ -1029,5 +1029,5 @@ { const char *path = APR_ARRAY_IDX(paths, i, const char *); - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); } } @@ -1062,5 +1062,5 @@ { const char *path = APR_ARRAY_IDX(paths, i, const char *); - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); } } @@ -1082,5 +1082,5 @@ apr_pool_t *pool) { - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); return session->vtable->check_path(session, path, revision, kind, pool); } @@ -1092,5 +1092,5 @@ apr_pool_t *pool) { - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); return session->vtable->stat(session, path, revision, dirent, pool); } @@ -1137,5 +1137,5 @@ svn_error_t *err; - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); err = session->vtable->get_locations(session, locations, path, peg_revision, location_revisions, pool); @@ -1164,5 +1164,5 @@ svn_error_t *err; - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); err = session->vtable->get_location_segments(session, path, peg_revision, start_rev, end_rev, @@ -1192,5 +1192,5 @@ void *handler2_baton; - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); svn_compat_wrap_file_rev_handler(&handler2, &handler2_baton, @@ -1213,5 +1213,5 @@ svn_error_t *err; - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); if (include_merged_revisions) @@ -1246,5 +1246,5 @@ const void *path; apr_hash_this(hi, &path, NULL, NULL); - assert(*((const char *)path) != '/'); + SVN_ERR_ASSERT(*((const char *)path) != '/'); } @@ -1271,5 +1271,5 @@ const void *path; apr_hash_this(hi, &path, NULL, NULL); - assert(*((const char *)path) != '/'); + SVN_ERR_ASSERT(*((const char *)path) != '/'); } @@ -1283,5 +1283,5 @@ apr_pool_t *pool) { - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); return session->vtable->get_lock(session, lock, path, pool); } @@ -1292,5 +1292,5 @@ apr_pool_t *pool) { - assert(*path != '/'); + SVN_ERR_ASSERT(*path != '/'); return session->vtable->get_locks(session, locks, path, pool); } Index: subversion/libsvn_ra_serf/commit.c =================================================================== --- subversion/libsvn_ra_serf/commit.c (revision 31931) +++ subversion/libsvn_ra_serf/commit.c (working copy) @@ -1534,5 +1534,5 @@ #endif - abort(); + SVN_ERR_MALFUNCTION(); } @@ -1897,5 +1897,5 @@ #endif - abort(); + SVN_ERR_MALFUNCTION(); } @@ -1926,5 +1926,5 @@ if (svn_ra_serf__merge_get_status(merge_ctx) != 200) { - abort(); + SVN_ERR_MALFUNCTION(); } @@ -1950,8 +1950,5 @@ pool)); - if (delete_ctx->status != 204) - { - abort(); - } + SVN_ERR_ASSERT(delete_ctx->status == 204); return SVN_NO_ERROR; @@ -1990,11 +1987,7 @@ 403 if DELETE was forbidden (indicates MKACTIVITY was forbidden too), 404 if the activity wasn't found. */ - if (delete_ctx->status != 204 && - delete_ctx->status != 403 && - delete_ctx->status != 404 - ) - { - abort(); - } + SVN_ERR_ASSERT(delete_ctx->status == 204 || + delete_ctx->status == 403 || + delete_ctx->status == 404); return SVN_NO_ERROR; Index: subversion/libsvn_ra_serf/locks.c =================================================================== --- subversion/libsvn_ra_serf/locks.c (revision 31931) +++ subversion/libsvn_ra_serf/locks.c (working copy) @@ -170,23 +170,9 @@ else if (state == LOCK_TYPE) { - if (strcmp(name.name, "write") == 0) - { - /* Do nothing. */ - } - else - { - abort(); - } + SVN_ERR_ASSERT(strcmp(name.name, "write") == 0); } else if (state == LOCK_SCOPE) { - if (strcmp(name.name, "exclusive") == 0) - { - /* Do nothing. */ - } - else - { - abort(); - } + SVN_ERR_ASSERT(strcmp(name.name, "exclusive") == 0); } Index: subversion/libsvn_ra_serf/log.c =================================================================== --- subversion/libsvn_ra_serf/log.c (revision 31931) +++ subversion/libsvn_ra_serf/log.c (working copy) @@ -300,5 +300,5 @@ if (! SVN_IS_VALID_REVNUM(info->log_entry->revision)) { - assert(log_ctx->nest_level); + SVN_ERR_ASSERT(log_ctx->nest_level); log_ctx->nest_level--; } Index: subversion/libsvn_ra_serf/merge.c =================================================================== --- subversion/libsvn_ra_serf/merge.c (revision 31931) +++ subversion/libsvn_ra_serf/merge.c (working copy) @@ -230,5 +230,5 @@ else { - abort(); + SVN_ERR_MALFUNCTION(); } Index: subversion/libsvn_ra_serf/update.c =================================================================== --- subversion/libsvn_ra_serf/update.c (revision 31931) +++ subversion/libsvn_ra_serf/update.c (working copy) @@ -535,8 +535,5 @@ report_dir_t *prev, *sibling; - if (dir->ref_count) - { - abort(); - } + SVN_ERR_ASSERT(dir->ref_count == 0); svn_ra_serf__walk_all_props(dir->props, dir->base_name, dir->base_rev, @@ -566,6 +563,5 @@ prev = sibling; sibling = sibling->sibling; - if (!sibling) - abort(); + SVN_ERR_ASSERT(sibling); } @@ -594,8 +590,5 @@ } - if (dir->ref_count) - { - abort(); - } + SVN_ERR_ASSERT(dir->ref_count == 0); SVN_ERR(open_dir(dir)); @@ -1144,8 +1137,5 @@ info->url, info->target_rev, "0", all_props, FALSE, &ctx->done_propfinds, info->dir->pool); - if (!info->propfind) - { - abort(); - } + SVN_ERR_ASSERT(info->propfind); ctx->active_propfinds++; @@ -1553,5 +1543,5 @@ else { - abort(); + SVN_ERR_MALFUNCTION(); } @@ -1618,5 +1608,5 @@ else { - abort(); + SVN_ERR_MALFUNCTION(); } } @@ -1698,8 +1688,5 @@ &ctx->done_propfinds, info->dir->pool); - if (!info->dir->propfind) - { - abort(); - } + SVN_ERR_ASSERT(info->dir->propfind); ctx->active_propfinds++; @@ -2449,5 +2436,5 @@ report_context_t *report = report_baton; #endif - abort(); + SVN_ERR_MALFUNCTION(); } Index: subversion/libsvn_ra_serf/util.c =================================================================== --- subversion/libsvn_ra_serf/util.c (revision 31931) +++ subversion/libsvn_ra_serf/util.c (working copy) @@ -318,8 +318,5 @@ svn_ra_serf__connection_t *our_conn = closed_baton; - if (why) - { - abort(); - } + SVN_ERR_ASSERT(why == APR_SUCCESS); if (our_conn->using_ssl) Index: subversion/libsvn_ra_svn/client.c =================================================================== --- subversion/libsvn_ra_svn/client.c (revision 31931) +++ subversion/libsvn_ra_svn/client.c (working copy) @@ -1407,5 +1407,5 @@ if (! SVN_IS_VALID_REVNUM(log_entry->revision)) { - assert(nest_level); + SVN_ERR_ASSERT(nest_level); nest_level--; } Index: subversion/libsvn_ra_svn/editorp.c =================================================================== --- subversion/libsvn_ra_svn/editorp.c (revision 31931) +++ subversion/libsvn_ra_svn/editorp.c (working copy) @@ -119,5 +119,5 @@ static svn_error_t *check_for_error(ra_svn_edit_baton_t *eb, apr_pool_t *pool) { - assert(!eb->got_status); + SVN_ERR_ASSERT(!eb->got_status); if (svn_ra_svn__input_waiting(eb->conn, pool)) { @@ -174,6 +174,6 @@ const char *token = make_token('d', b->eb, pool); - assert((copy_path && SVN_IS_VALID_REVNUM(copy_rev)) - || (!copy_path && !SVN_IS_VALID_REVNUM(copy_rev))); + SVN_ERR_ASSERT((copy_path && SVN_IS_VALID_REVNUM(copy_rev)) + || (!copy_path && !SVN_IS_VALID_REVNUM(copy_rev))); SVN_ERR(check_for_error(b->eb, pool)); SVN_ERR(svn_ra_svn_write_cmd(b->conn, pool, "add-dir", "ccc(?cr)", path, @@ -244,6 +244,6 @@ const char *token = make_token('c', b->eb, pool); - assert((copy_path && SVN_IS_VALID_REVNUM(copy_rev)) - || (!copy_path && !SVN_IS_VALID_REVNUM(copy_rev))); + SVN_ERR_ASSERT((copy_path && SVN_IS_VALID_REVNUM(copy_rev)) + || (!copy_path && !SVN_IS_VALID_REVNUM(copy_rev))); SVN_ERR(check_for_error(b->eb, pool)); SVN_ERR(svn_ra_svn_write_cmd(b->conn, pool, "add-file", "ccc(?cr)", path, @@ -365,5 +365,5 @@ svn_error_t *err; - assert(!eb->got_status); + SVN_ERR_ASSERT(!eb->got_status); eb->got_status = TRUE; SVN_ERR(svn_ra_svn_write_cmd(eb->conn, pool, "close-edit", "")); Index: subversion/libsvn_ra_svn/marshal.c =================================================================== --- subversion/libsvn_ra_svn/marshal.c (revision 31931) +++ subversion/libsvn_ra_svn/marshal.c (working copy) @@ -282,5 +282,5 @@ apr_size_t len; - assert(conn->read_ptr == conn->read_end); + SVN_ERR_ASSERT(conn->read_ptr == conn->read_end); SVN_ERR(writebuf_flush(conn, pool)); len = sizeof(conn->read_buf); @@ -347,5 +347,5 @@ svn_boolean_t lparen = FALSE; - assert(conn->read_ptr == conn->read_end); + SVN_ERR_ASSERT(conn->read_ptr == conn->read_end); while (1) { @@ -470,5 +470,5 @@ { rev = va_arg(ap, svn_revnum_t); - assert(opt || SVN_IS_VALID_REVNUM(rev)); + SVN_ERR_ASSERT(opt || SVN_IS_VALID_REVNUM(rev)); if (SVN_IS_VALID_REVNUM(rev)) SVN_ERR(svn_ra_svn_write_number(conn, pool, rev)); @@ -477,5 +477,5 @@ { str = va_arg(ap, const svn_string_t *); - assert(opt || str); + SVN_ERR_ASSERT(opt || str); if (str) SVN_ERR(svn_ra_svn_write_string(conn, pool, str)); @@ -484,5 +484,5 @@ { cstr = va_arg(ap, const char *); - assert(opt || cstr); + SVN_ERR_ASSERT(opt || cstr); if (cstr) SVN_ERR(svn_ra_svn_write_cstring(conn, pool, cstr)); @@ -491,5 +491,5 @@ { cstr = va_arg(ap, const char *); - assert(opt || cstr); + SVN_ERR_ASSERT(opt || cstr); if (cstr) SVN_ERR(svn_ra_svn_write_word(conn, pool, cstr)); @@ -512,5 +512,5 @@ return SVN_NO_ERROR; else - abort(); + SVN_ERR_MALFUNCTION(); } SVN_ERR(svn_ra_svn_end_list(conn, pool)); @@ -761,5 +761,5 @@ break; default: - abort(); + SVN_ERR_MALFUNCTION(); } } Index: subversion/libsvn_repos/delta.c =================================================================== --- subversion/libsvn_repos/delta.c (revision 31931) +++ subversion/libsvn_repos/delta.c (working copy) @@ -504,6 +504,5 @@ int i; - /* Sanity-check our input. */ - assert(target_path); + SVN_ERR_ASSERT(target_path); /* Make a subpool for local allocations. */ @@ -725,6 +724,5 @@ svn_boolean_t changed = TRUE; - /* Sanity-check our input. */ - assert(target_path); + SVN_ERR_ASSERT(target_path); /* Make a subpool for local allocations. */ @@ -831,6 +829,5 @@ svn_boolean_t allowed; - /* Sanity-check our input. */ - assert(target_path && edit_path); + SVN_ERR_ASSERT(target_path && edit_path); if (c->authz_read_func) @@ -889,6 +886,5 @@ svn_boolean_t allowed; - /* Sanity-check our input. */ - assert(target_path && source_path && edit_path); + SVN_ERR_ASSERT(target_path && source_path && edit_path); if (c->authz_read_func) @@ -942,5 +938,5 @@ apr_pool_t *pool) { - assert(edit_path); + SVN_ERR_ASSERT(edit_path); if (tgt_kind == svn_node_dir) @@ -969,5 +965,5 @@ apr_pool_t *subpool; - assert(target_path); + SVN_ERR_ASSERT(target_path); /* Compare the property lists. */ Index: subversion/libsvn_repos/node_tree.c =================================================================== --- subversion/libsvn_repos/node_tree.c (revision 31931) +++ subversion/libsvn_repos/node_tree.c (working copy) @@ -258,5 +258,5 @@ struct node_baton *nb = apr_pcalloc(pool, sizeof(*nb)); - assert(parent_baton && path); + SVN_ERR_ASSERT(parent_baton && path); nb->edit_baton = eb; Index: subversion/libsvn_repos/replay.c =================================================================== --- subversion/libsvn_repos/replay.c (revision 31931) +++ subversion/libsvn_repos/replay.c (working copy) @@ -289,5 +289,5 @@ } else - abort(); + SVN_ERR_MALFUNCTION(); } Index: subversion/libsvn_repos/rev_hunt.c =================================================================== --- subversion/libsvn_repos/rev_hunt.c (revision 31931) +++ subversion/libsvn_repos/rev_hunt.c (working copy) @@ -591,5 +591,5 @@ reassigned fs_path. Else, the path wouldn't have existed at future_revision and svn_fs_history would have thrown. */ - assert(fs_path != NULL); + SVN_ERR_ASSERT(fs_path != NULL); *is_ancestor = (history && strcmp(path, fs_path) == 0); @@ -676,6 +676,5 @@ const svn_fs_id_t *id; - /* Sanity check. */ - assert(location_revisions_orig->elt_size == sizeof(svn_revnum_t)); + SVN_ERR_ASSERT(location_revisions_orig->elt_size == sizeof(svn_revnum_t)); /* Ensure that FS_PATH is absolute, because our path-math below will @@ -890,6 +889,6 @@ /* Are the revision properly ordered? They better be -- the API demands it. */ - assert(end_rev <= start_rev); - assert(start_rev <= peg_revision); + SVN_ERR_ASSERT(end_rev <= start_rev); + SVN_ERR_ASSERT(start_rev <= peg_revision); /* Ensure that PATH is absolute, because our path-math will depend @@ -1443,5 +1442,5 @@ /* We must have at least one revision to get. */ - assert(mainline_path_revisions->nelts > 0); + SVN_ERR_ASSERT(mainline_path_revisions->nelts > 0); /* We switch betwwen two pools while looping, since we need information from Index: subversion/libsvn_subr/cache-inprocess.c =================================================================== --- subversion/libsvn_subr/cache-inprocess.c (revision 31931) +++ subversion/libsvn_subr/cache-inprocess.c (working copy) @@ -285,6 +285,6 @@ * *never* has a partial page (except for in the temporary state * that we're about to fake). */ - assert(page->next != NULL); - assert(cache->partial_page == NULL); + SVN_ERR_ASSERT(page->next != NULL); + SVN_ERR_ASSERT(cache->partial_page == NULL); erase_page(cache, page); @@ -321,5 +321,5 @@ struct cache_page *oldest_page = cache->sentinel->prev; - assert(oldest_page != cache->sentinel); + SVN_ERR_ASSERT(oldest_page != cache->sentinel); /* Erase the page and put it in cache->partial_page. */ @@ -327,5 +327,5 @@ } - assert(cache->partial_page != NULL); + SVN_ERR_ASSERT(cache->partial_page != NULL); { @@ -428,7 +428,7 @@ cache->dup_func = dup_func; - assert(pages >= 1); + SVN_ERR_ASSERT(pages >= 1); cache->unallocated_pages = pages; - assert(items_per_page >= 1); + SVN_ERR_ASSERT(items_per_page >= 1); cache->items_per_page = items_per_page; Index: subversion/libsvn_subr/hash.c =================================================================== --- subversion/libsvn_subr/hash.c (revision 31931) +++ subversion/libsvn_subr/hash.c (working copy) @@ -270,5 +270,5 @@ apr_pool_t *pool) { - assert(oldhash != NULL); + SVN_ERR_ASSERT(oldhash != NULL); return hash_write(hash, oldhash, stream, terminator, pool); } Index: subversion/libsvn_subr/io.c =================================================================== --- subversion/libsvn_subr/io.c (revision 31931) +++ subversion/libsvn_subr/io.c (working copy) @@ -326,5 +326,5 @@ struct temp_file_cleanup_s *baton = NULL; - assert(f || unique_name_p); + SVN_ERR_ASSERT(f || unique_name_p); if (delete_when == svn_io_file_del_on_pool_cleanup) @@ -1546,6 +1546,5 @@ svn_path_local_style(lock_file, pool)); default: - /* Cannot happen. */ - abort(); + SVN_ERR_MALFUNCTION(); } } @@ -2268,5 +2267,5 @@ args[i++] = NULL; - assert(i == nargs); + SVN_ERR_ASSERT(i == nargs); SVN_ERR(svn_io_run_cmd(dir, diff_utf8, args, pexitcode, NULL, TRUE, @@ -2394,5 +2393,5 @@ args[i++] = svn_path_local_style(yours, pool); args[i++] = NULL; - assert(i == nargs); + SVN_ERR_ASSERT(i == nargs); /* Run diff3, output the merged text into the scratch file. */ Index: subversion/libsvn_subr/mergeinfo.c =================================================================== --- subversion/libsvn_subr/mergeinfo.c (revision 31931) +++ subversion/libsvn_subr/mergeinfo.c (working copy) @@ -659,5 +659,5 @@ Only one of these loops should end up running, if anything. */ - assert (!(i < (*rangelist)->nelts && j < changes->nelts)); + SVN_ERR_ASSERT(!(i < (*rangelist)->nelts && j < changes->nelts)); for (; i < (*rangelist)->nelts; i++) @@ -1449,6 +1449,6 @@ apr_hash_this(hi, &key, &klen, &value); original_path = key; - assert(klen >= prefix_len); - assert(strncmp(key, prefix, prefix_len) == 0); + SVN_ERR_ASSERT(klen >= prefix_len); + SVN_ERR_ASSERT(strncmp(key, prefix, prefix_len) == 0); apr_hash_set(*out_catalog, original_path + prefix_len, klen-prefix_len, value); Index: subversion/libsvn_subr/path.c =================================================================== --- subversion/libsvn_subr/path.c (revision 31931) +++ subversion/libsvn_subr/path.c (working copy) @@ -1213,5 +1213,5 @@ svn_error_t *err; - assert(svn_path_is_canonical(path, pool)); + SVN_ERR_ASSERT(svn_path_is_canonical(path, pool)); err = svn_io_stat(&finfo, path, APR_FINFO_TYPE, pool); Index: subversion/libsvn_subr/prompt.c =================================================================== --- subversion/libsvn_subr/prompt.c (revision 31931) +++ subversion/libsvn_subr/prompt.c (working copy) @@ -141,5 +141,5 @@ /* ### APR_EOL_STR holds more than two chars? Who ever heard of such a thing? */ - abort(); + SVN_ERR_MALFUNCTION(); } Index: subversion/libsvn_subr/stream.c =================================================================== --- subversion/libsvn_subr/stream.c (revision 31931) +++ subversion/libsvn_subr/stream.c (working copy) @@ -94,5 +94,5 @@ svn_stream_read(svn_stream_t *stream, char *buffer, apr_size_t *len) { - assert(stream->read_fn != NULL); + SVN_ERR_ASSERT(stream->read_fn != NULL); return stream->read_fn(stream->baton, buffer, len); } @@ -102,5 +102,5 @@ svn_stream_write(svn_stream_t *stream, const char *data, apr_size_t *len) { - assert(stream->write_fn != NULL); + SVN_ERR_ASSERT(stream->write_fn != NULL); return stream->write_fn(stream->baton, data, len); } Index: subversion/libsvn_subr/subst.c =================================================================== --- subversion/libsvn_subr/subst.c (revision 31931) +++ subversion/libsvn_subr/subst.c (working copy) @@ -1257,5 +1257,5 @@ break; default: - abort(); + SVN_ERR_MALFUNCTION(); } @@ -1378,5 +1378,5 @@ /* The docstring requires that *some* translation be requested. */ - assert(eol_str || keywords); + SVN_ERR_ASSERT(eol_str || keywords); baton = create_translation_baton(eol_str, repair, keywords, expand, pool); @@ -1525,5 +1525,5 @@ break; default: - abort (); + SVN_ERR_MALFUNCTION(); } Index: subversion/libsvn_subr/utf.c =================================================================== --- subversion/libsvn_subr/utf.c (revision 31931) +++ subversion/libsvn_subr/utf.c (working copy) @@ -243,8 +243,8 @@ * APR_LOCALE_CHARSET are both UTF-8 (CCSID 1208), so we won't get far * with this assert active. */ - assert(frompage != SVN_APR_DEFAULT_CHARSET - && topage != SVN_APR_DEFAULT_CHARSET - && (frompage != SVN_APR_LOCALE_CHARSET - || topage != SVN_APR_LOCALE_CHARSET)); + SVN_ERR_ASSERT(frompage != SVN_APR_DEFAULT_CHARSET + && topage != SVN_APR_DEFAULT_CHARSET + && (frompage != SVN_APR_LOCALE_CHARSET + || topage != SVN_APR_LOCALE_CHARSET)); #endif Index: subversion/libsvn_wc/adm_crawler.c =================================================================== --- subversion/libsvn_wc/adm_crawler.c (revision 31931) +++ subversion/libsvn_wc/adm_crawler.c (working copy) @@ -104,5 +104,5 @@ SVN_ERR(svn_wc_entry(&entry, file_path, adm_access, FALSE, pool)); - assert(entry != NULL); + SVN_ERR_ASSERT(entry != NULL); SVN_ERR(svn_io_set_file_affected_time(entry->cmt_date, Index: subversion/libsvn_wc/adm_files.c =================================================================== --- subversion/libsvn_wc/adm_files.c (revision 31931) +++ subversion/libsvn_wc/adm_files.c (working copy) @@ -1076,5 +1076,5 @@ apr_file_t *file; - assert(fp || new_name); + SVN_ERR_ASSERT(fp || new_name); /* Use a self-explanatory name for the file :-) . */ Index: subversion/libsvn_wc/ambient_depth_filter_editor.c =================================================================== --- subversion/libsvn_wc/ambient_depth_filter_editor.c (revision 31931) +++ subversion/libsvn_wc/ambient_depth_filter_editor.c (working copy) @@ -116,6 +116,5 @@ struct dir_baton *d; - if (pb && (! path)) - abort(); + SVN_ERR_ASSERT(path && /* ### JAF Debugging - intentional wrong operator */ (! pb)); if (pb && pb->ambiently_excluded) @@ -171,6 +170,5 @@ struct file_baton *f = apr_pcalloc(pool, sizeof(*f)); - if (! path) - abort(); + SVN_ERR_ASSERT(path); if (pb->ambiently_excluded) Index: subversion/libsvn_wc/diff.c =================================================================== --- subversion/libsvn_wc/diff.c (revision 31931) +++ subversion/libsvn_wc/diff.c (working copy) @@ -516,5 +516,5 @@ apr_hash_t *baseprops = NULL; - assert(! eb->use_text_base); + SVN_ERR_ASSERT(! eb->use_text_base); SVN_ERR(svn_wc_adm_retrieve(&adm_access, dir_baton->edit_baton->anchor, @@ -669,5 +669,5 @@ since an added directory can only contain added files and these will already have been compared. */ - assert(!dir_baton->added); + SVN_ERR_ASSERT(!dir_baton->added); /* Everything we do below is useless if we are comparing to BASE. */ @@ -837,5 +837,5 @@ /* We can't show additions for files that don't exist. */ - assert(!(entry->schedule == svn_wc_schedule_delete && !eb->use_text_base)); + SVN_ERR_ASSERT(!(entry->schedule == svn_wc_schedule_delete && !eb->use_text_base)); /* If the file was added *with history*, then we don't want to @@ -1674,5 +1674,5 @@ struct callbacks_wrapper_baton *b = diff_baton; - assert(originalprops); + SVN_ERR_ASSERT(originalprops); return b->callbacks->file_deleted(adm_access, state, path, Index: subversion/libsvn_wc/entries.c =================================================================== --- subversion/libsvn_wc/entries.c (revision 31931) +++ subversion/libsvn_wc/entries.c (working copy) @@ -2478,5 +2478,5 @@ remove the SVN_WC_ENTRY_THIS_DIR entry as that would leave the entries file in an invalid state. */ - assert(entry != this_dir_entry); + SVN_ERR_ASSERT(entry != this_dir_entry); if (! entry->deleted) apr_hash_set(entries, name, APR_HASH_KEY_STRING, NULL); @@ -2567,6 +2567,5 @@ svn_boolean_t entry_was_deleted_p = FALSE; - /* ENTRY is rather necessary! */ - assert(entry); + SVN_ERR_ASSERT(entry); /* Load ADM_ACCESS's whole entries file. */ @@ -2599,6 +2598,6 @@ /* Make certain that both folding operations had the same result. */ - assert(orig_modify_flags == modify_flags); - assert(orig_schedule == entry->schedule); + SVN_ERR_ASSERT(orig_modify_flags == modify_flags); + SVN_ERR_ASSERT(orig_schedule == entry->schedule); } @@ -2797,10 +2796,9 @@ svn_wc_entry_t *entry = alloc_entry(pool); - /* Sanity checks. */ - assert(! repos || svn_path_is_ancestor(repos, url)); - assert(depth == svn_depth_empty - || depth == svn_depth_files - || depth == svn_depth_immediates - || depth == svn_depth_infinity); + SVN_ERR_ASSERT(! repos || svn_path_is_ancestor(repos, url)); + SVN_ERR_ASSERT(depth == svn_depth_empty + || depth == svn_depth_files + || depth == svn_depth_immediates + || depth == svn_depth_infinity); /* Create the entries file, which must not exist prior to this. */ Index: subversion/libsvn_wc/lock.c =================================================================== --- subversion/libsvn_wc/lock.c (revision 31931) +++ subversion/libsvn_wc/lock.c (working copy) @@ -1386,5 +1386,6 @@ NULL); - assert(! adm_access->set_owner || apr_hash_count(adm_access->set) == 0); + SVN_ERR_ASSERT(! adm_access->set_owner + || apr_hash_count(adm_access->set) == 0); } Index: subversion/libsvn_wc/props.c =================================================================== --- subversion/libsvn_wc/props.c (revision 31931) +++ subversion/libsvn_wc/props.c (working copy) @@ -2283,5 +2283,5 @@ { *value = svn_string_create(SVN_PROP_BOOLEAN_TRUE, pool); - assert(*value != NULL); + SVN_ERR_ASSERT(*value != NULL); return SVN_NO_ERROR; } Index: subversion/libsvn_wc/status.c =================================================================== --- subversion/libsvn_wc/status.c (revision 31931) +++ subversion/libsvn_wc/status.c (working copy) @@ -1230,7 +1230,5 @@ svn_wc_status2_t *status_in_parent; - /* Don't do this. Just do NOT do this to me. */ - if (pb && (! path)) - abort(); + SVN_ERR_ASSERT(path || (! pb)); /* Construct the full path of this directory. */ Index: subversion/libsvn_wc/translate.c =================================================================== --- subversion/libsvn_wc/translate.c (revision 31931) +++ subversion/libsvn_wc/translate.c (working copy) @@ -46,5 +46,5 @@ read_handler_unsupported(void *baton, char *buffer, apr_size_t *len) { - abort(); + SVN_ERR_MALFUNCTION(); return SVN_NO_ERROR; } @@ -53,5 +53,5 @@ write_handler_unsupported(void *baton, const char *buffer, apr_size_t *len) { - abort(); + SVN_ERR_MALFUNCTION(); return SVN_NO_ERROR; } Index: subversion/libsvn_wc/update_editor.c =================================================================== --- subversion/libsvn_wc/update_editor.c (revision 31931) +++ subversion/libsvn_wc/update_editor.c (working copy) @@ -361,7 +361,5 @@ struct bump_dir_info *bdi; - /* Don't do this. Just do NOT do this to me. */ - if (pb && (! path)) - abort(); + SVN_ERR_ASSERT(path || (! pb)); /* Okay, no easy out, so allocate and initialize a dir baton. */ @@ -701,7 +699,5 @@ struct file_baton *f = apr_pcalloc(pool, sizeof(*f)); - /* I rather need this information, yes. */ - if (! path) - abort(); + SVN_ERR_ASSERT(path); /* Make the file's on-disk name. */ @@ -1259,7 +1255,7 @@ /* Semantic check. Either both "copyfrom" args are valid, or they're NULL and SVN_INVALID_REVNUM. A mixture is illegal semantics. */ - if ((copyfrom_path && (! SVN_IS_VALID_REVNUM(copyfrom_revision))) - || ((! copyfrom_path) && (SVN_IS_VALID_REVNUM(copyfrom_revision)))) - abort(); + SVN_ERR_ASSERT((copyfrom_path && SVN_IS_VALID_REVNUM(copyfrom_revision)) + || (!copyfrom_path && + !SVN_IS_VALID_REVNUM(copyfrom_revision))); SVN_ERR(check_path_under_root(pb->path, db->name, pool)); @@ -1495,5 +1491,5 @@ SVN_ERR(svn_wc_conflicted_p(&text_conflicted, &prop_conflicted, db->path, entry, pool)); - assert(! text_conflicted); + SVN_ERR_ASSERT(! text_conflicted); if (prop_conflicted) { @@ -2723,6 +2719,6 @@ if (fb->added_with_history && ! fb->received_textdelta) { - assert(! fb->text_base_path && ! fb->new_text_base_path - && fb->copied_text_base); + SVN_ERR_ASSERT(! fb->text_base_path && ! fb->new_text_base_path + && fb->copied_text_base); /* Set up the base paths like apply_textdelta does. */ @@ -3476,5 +3472,5 @@ apr_pool_t *pool) { - assert(switch_url); + SVN_ERR_ASSERT(switch_url); return make_editor(target_revision, anchor, svn_wc_adm_access_path(anchor), @@ -3505,5 +3501,5 @@ apr_pool_t *pool) { - assert(switch_url); + SVN_ERR_ASSERT(switch_url); return svn_wc_get_switch_editor3(target_revision, anchor, target, @@ -3932,5 +3928,5 @@ if (copyfrom_url) { - assert(SVN_IS_VALID_REVNUM(copyfrom_rev)); + SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(copyfrom_rev)); tmp_entry.copyfrom_url = copyfrom_url; Index: subversion/libsvn_wc/util.c =================================================================== --- subversion/libsvn_wc/util.c (revision 31931) +++ subversion/libsvn_wc/util.c (working copy) @@ -100,5 +100,5 @@ } else /* No problem, the dir already existed, so just leave. */ - assert(kind == svn_node_dir); + SVN_ERR_ASSERT(kind == svn_node_dir); return SVN_NO_ERROR; Index: subversion/libsvn_fs_base/bdb/env.c =================================================================== --- subversion/libsvn_fs_base/bdb/env.c (revision 31931) +++ subversion/libsvn_fs_base/bdb/env.c (working copy) @@ -510,5 +510,5 @@ bdb_env_t *bdb = bdb_baton->bdb; - assert(bdb_baton->env == bdb_baton->bdb->env); + SVN_ERR_ASSERT(bdb_baton->env == bdb_baton->bdb->env); /* Neutralize bdb_baton's pool cleanup to prevent double-close. See Index: subversion/libsvn_fs_base/bdb/nodes-table.c =================================================================== --- subversion/libsvn_fs_base/bdb/nodes-table.c (revision 31931) +++ subversion/libsvn_fs_base/bdb/nodes-table.c (working copy) @@ -89,6 +89,5 @@ const char *next_node_id; - /* TXN_ID is required! */ - assert(txn_id); + SVN_ERR_ASSERT(txn_id); /* Get the current value associated with the `next-key' key in the table. */ @@ -133,6 +132,5 @@ svn_error_t *err; - /* TXN_ID is required! */ - assert(txn_id); + SVN_ERR_ASSERT(txn_id); /* Create and return the new successor ID. */ Index: subversion/libsvn_fs_base/util/fs_skels.c =================================================================== --- subversion/libsvn_fs_base/util/fs_skels.c (revision 31931) +++ subversion/libsvn_fs_base/util/fs_skels.c (working copy) @@ -1157,5 +1157,5 @@ } else /* unknown kind */ - abort(); + SVN_ERR_MALFUNCTION(); /* Validate and return the skel. */ @@ -1236,5 +1236,5 @@ svn_fs_base__prepend(svn_fs_base__str_atom("dir", pool), header_skel); else - abort(); + SVN_ERR_MALFUNCTION(); /* ### do we really need to check *node->FOO_key ? if a key doesn't