summaryrefslogtreecommitdiff
path: root/subversion/libsvn_fs_base/bdb/changes-table.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_fs_base/bdb/changes-table.c')
-rw-r--r--subversion/libsvn_fs_base/bdb/changes-table.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/subversion/libsvn_fs_base/bdb/changes-table.c b/subversion/libsvn_fs_base/bdb/changes-table.c
index fa0bfee..80ff468 100644
--- a/subversion/libsvn_fs_base/bdb/changes-table.c
+++ b/subversion/libsvn_fs_base/bdb/changes-table.c
@@ -25,6 +25,7 @@
#include <apr_hash.h>
#include <apr_tables.h>
+#include "svn_hash.h"
#include "svn_fs.h"
#include "svn_pools.h"
#include "svn_path.h"
@@ -90,7 +91,7 @@ svn_fs_bdb__changes_add(svn_fs_t *fs,
svn_fs_base__str_to_dbt(&query, key);
svn_fs_base__skel_to_dbt(&value, skel, pool);
svn_fs_base__trail_debug(trail, "changes", "put");
- return BDB_WRAP(fs, _("creating change"),
+ return BDB_WRAP(fs, N_("creating change"),
bfd->changes->put(bfd->changes, trail->db_txn,
&query, &value, 0));
}
@@ -114,7 +115,7 @@ svn_fs_bdb__changes_delete(svn_fs_t *fs,
error should be propagated to the caller, though. */
if ((db_err) && (db_err != DB_NOTFOUND))
{
- SVN_ERR(BDB_WRAP(fs, _("deleting changes"), db_err));
+ SVN_ERR(BDB_WRAP(fs, N_("deleting changes"), db_err));
}
return SVN_NO_ERROR;
@@ -132,7 +133,7 @@ fold_change(apr_hash_t *changes,
svn_fs_path_change2_t *old_change, *new_change;
const char *path;
- if ((old_change = apr_hash_get(changes, change->path, APR_HASH_KEY_STRING)))
+ if ((old_change = svn_hash_gets(changes, change->path)))
{
/* This path already exists in the hash, so we have to merge
this change into the already existing one. */
@@ -244,7 +245,7 @@ fold_change(apr_hash_t *changes,
}
/* Add (or update) this path. */
- apr_hash_set(changes, path, APR_HASH_KEY_STRING, new_change);
+ svn_hash_sets(changes, path, new_change);
return SVN_NO_ERROR;
}
@@ -268,7 +269,7 @@ svn_fs_bdb__changes_fetch(apr_hash_t **changes_p,
/* Get a cursor on the first record matching KEY, and then loop over
the records, adding them to the return array. */
svn_fs_base__trail_debug(trail, "changes", "cursor");
- SVN_ERR(BDB_WRAP(fs, _("creating cursor for reading changes"),
+ SVN_ERR(BDB_WRAP(fs, N_("creating cursor for reading changes"),
bfd->changes->cursor(bfd->changes, trail->db_txn,
&cursor, 0)));
@@ -325,14 +326,14 @@ svn_fs_bdb__changes_fetch(apr_hash_t **changes_p,
/* KEY is the path. */
const void *hashkey;
apr_ssize_t klen;
- apr_hash_this(hi, &hashkey, &klen, NULL);
+ const char *child_relpath;
- /* If we come across our own path, ignore it. */
- if (strcmp(change->path, hashkey) == 0)
- continue;
+ apr_hash_this(hi, &hashkey, &klen, NULL);
- /* If we come across a child of our path, remove it. */
- if (svn_fspath__is_child(change->path, hashkey, subpool))
+ /* If we come across our own path, ignore it.
+ If we come across a child of our path, remove it. */
+ child_relpath = svn_fspath__skip_ancestor(change->path, hashkey);
+ if (child_relpath && *child_relpath)
apr_hash_set(changes, hashkey, klen, NULL);
}
}
@@ -352,7 +353,7 @@ svn_fs_bdb__changes_fetch(apr_hash_t **changes_p,
finished. Just return the (possibly empty) array. Any other
error, however, needs to get handled appropriately. */
if (db_err && (db_err != DB_NOTFOUND))
- err = BDB_WRAP(fs, _("fetching changes"), db_err);
+ err = BDB_WRAP(fs, N_("fetching changes"), db_err);
cleanup:
/* Close the cursor. */
@@ -365,7 +366,7 @@ svn_fs_bdb__changes_fetch(apr_hash_t **changes_p,
/* If our only error thus far was when we closed the cursor, return
that error. */
if (db_c_err)
- SVN_ERR(BDB_WRAP(fs, _("closing changes cursor"), db_c_err));
+ SVN_ERR(BDB_WRAP(fs, N_("closing changes cursor"), db_c_err));
/* Finally, set our return variable and get outta here. */
*changes_p = changes;
@@ -391,7 +392,7 @@ svn_fs_bdb__changes_fetch_raw(apr_array_header_t **changes_p,
/* Get a cursor on the first record matching KEY, and then loop over
the records, adding them to the return array. */
svn_fs_base__trail_debug(trail, "changes", "cursor");
- SVN_ERR(BDB_WRAP(fs, _("creating cursor for reading changes"),
+ SVN_ERR(BDB_WRAP(fs, N_("creating cursor for reading changes"),
bfd->changes->cursor(bfd->changes, trail->db_txn,
&cursor, 0)));
@@ -435,7 +436,7 @@ svn_fs_bdb__changes_fetch_raw(apr_array_header_t **changes_p,
finished. Just return the (possibly empty) array. Any other
error, however, needs to get handled appropriately. */
if (db_err && (db_err != DB_NOTFOUND))
- err = BDB_WRAP(fs, _("fetching changes"), db_err);
+ err = BDB_WRAP(fs, N_("fetching changes"), db_err);
cleanup:
/* Close the cursor. */
@@ -448,7 +449,7 @@ svn_fs_bdb__changes_fetch_raw(apr_array_header_t **changes_p,
/* If our only error thus far was when we closed the cursor, return
that error. */
if (db_c_err)
- SVN_ERR(BDB_WRAP(fs, _("closing changes cursor"), db_c_err));
+ SVN_ERR(BDB_WRAP(fs, N_("closing changes cursor"), db_c_err));
/* Finally, set our return variable and get outta here. */
*changes_p = changes;