[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] redocument get_mergeinfo_for_path().

From: Karl Fogel <kfogel_at_red-bean.com>
Date: 2007-11-22 00:35:12 CET

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.


* subversion/libsvn_fs_util/mergeinfo-sqlite-index.c
  (get_mergeinfo_for_path): Redocument, and fix an internal comment.

Index: subversion/libsvn_fs_util/mergeinfo-sqlite-index.c
--- subversion/libsvn_fs_util/mergeinfo-sqlite-index.c (revision 27973)
+++ subversion/libsvn_fs_util/mergeinfo-sqlite-index.c (working copy)
@@ -385,17 +385,27 @@
   return SVN_NO_ERROR;
-/* 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 *
 get_mergeinfo_for_path(sqlite3 *db,
                        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);
       if (path_mergeinfo)

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 22 00:35:23 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.