Merge branch 'jn/maint-svn-fe'

* jn/maint-svn-fe:
  t9010 fails when no svn is available
  vcs-svn: fix intermittent repo_tree corruption
  treap: make treap_insert return inserted node
  t9010 (svn-fe): Eliminate dependency on svn perl bindings
This commit is contained in:
Junio C Hamano
2010-12-16 12:49:35 -08:00
5 changed files with 38 additions and 10 deletions

View File

@ -131,7 +131,7 @@ static void repo_write_dirent(uint32_t *path, uint32_t mode,
if (dent == key) {
dent->mode = REPO_MODE_DIR;
dent->content_offset = 0;
dent_insert(&dir->entries, dent);
dent = dent_insert(&dir->entries, dent);
}
if (dent_offset(dent) < dent_pool.committed) {
@ -142,7 +142,7 @@ static void repo_write_dirent(uint32_t *path, uint32_t mode,
dent->name_offset = name;
dent->mode = REPO_MODE_DIR;
dent->content_offset = dir_o;
dent_insert(&dir->entries, dent);
dent = dent_insert(&dir->entries, dent);
}
dir = repo_dir_from_dirent(dent);

View File

@ -188,11 +188,12 @@ a_attr uint32_t MAYBE_UNUSED a_pre##insert_recurse(uint32_t cur_node, uint32_t i
return ret; \
} \
} \
a_attr void MAYBE_UNUSED a_pre##insert(struct trp_root *treap, a_type *node) \
a_attr a_type *MAYBE_UNUSED a_pre##insert(struct trp_root *treap, a_type *node) \
{ \
uint32_t offset = trpn_offset(a_base, node); \
trp_node_new(a_base, a_field, offset); \
treap->trp_root = a_pre##insert_recurse(treap->trp_root, offset); \
return trpn_pointer(a_base, offset); \
} \
a_attr uint32_t MAYBE_UNUSED a_pre##remove_recurse(uint32_t cur_node, uint32_t rem_node) \
{ \

View File

@ -21,7 +21,9 @@ The caller:
. Allocates a `struct trp_root` variable and sets it to {~0}.
. Adds new nodes to the set using `foo_insert`.
. Adds new nodes to the set using `foo_insert`. Any pointers
to existing nodes cannot be relied upon any more, so the caller
might retrieve them anew with `foo_pointer`.
. Can find a specific item in the set using `foo_search`.
@ -73,10 +75,14 @@ int (*cmp)(node_type \*a, node_type \*b)
and returning a value less than, equal to, or greater than zero
according to the result of comparison.
void foo_insert(struct trp_root *treap, node_type \*node)::
node_type {asterisk}foo_insert(struct trp_root *treap, node_type \*node)::
Insert node into treap. If inserted multiple times,
a node will appear in the treap multiple times.
+
The return value is the address of the node within the treap,
which might differ from `node` if `pool_alloc` had to call
`realloc` to expand the pool.
void foo_remove(struct trp_root *treap, node_type \*node)::