Something is wrong with http://svn.collab.net/repos/svn/ and I can't
commit right now (see http://pastebin.ca/793128). Or maybe the
problem is with my client? Not sure.
Anyway, below is the patch I was going to commit. Review welcome,
especially by Kamesh.
I'd like to make some actual code changes next, to remove the need for
the cautions about pool usage (this function can take care of most of
those lifetime issues internally). But that's a separate change.
(get_mergeinfo_for_path): Redocument, and fix an internal comment.
--- subversion/libsvn_fs_util/mergeinfo-sqlite-index.c (revision 27973)
+++ subversion/libsvn_fs_util/mergeinfo-sqlite-index.c (working copy)
@@ -385,17 +385,27 @@
-/* A helper for svn_fs_mergeinfo__get_mergeinfo() that retrieves
- mergeinfo on PATH at REV from DB by taking care of elided mergeinfo
- if INHERIT is svn_mergeinfo_inherited or svn_mergeinfo_nearest_ancestor.
- Pass NULL for RESULT if you only want CACHE to be
- updated. Otherwise, both RESULT and CACHE are updated with the appropriate
- mergeinfo for PATH.
- Perform all allocation in POOL. Due to the nature of APR pools,
+/* Helper for svn_fs_mergeinfo__get_mergeinfo().
+ Update CACHE (and RESULT iff RESULT is non-null) with mergeinfo for
+ PATH at REV, retrieved from DB.
+ If INHERIT is svn_mergeinfo_explicit, then retrieve only explicit
+ mergeinfo on PATH. Else if it is svn_mergeinfo_nearest_ancestor,
+ then retrieve the mergeinfo for PATH's parent, recursively. Else
+ if it is svn_mergeinfo_inherit, then:
+ - If the explicit mergeinfo for PATH has ever been changed (that
+ is, the mergeinfo_changed rev > 0), retrieve explicit mergeinfo;
+ - Else, retrieve mergeinfo for PATH's parent, recursively.
+ Perform all allocations in POOL. Due to the nature of APR pools,
and the recursion in this function, invoke this function using a
sub-pool. To preserve RESULT, use mergeinfo_hash_dup() before
- clearing or destroying POOL. */
+ clearing or destroying POOL.
static svn_error_t *
const char *path,
@@ -417,8 +427,8 @@
- /* Lookup the mergeinfo for PATH, starting with the cache, the
- moving on to the SQLite index.. */
+ /* Look up the explicit mergeinfo for PATH, starting with the
+ cache, then moving on to the SQLite index. */
path_mergeinfo = apr_hash_get(cache, path, APR_HASH_KEY_STRING);
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Thu Nov 22 00:35:23 2007