You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2013/01/26 19:37:38 UTC
svn commit: r1438937 - /subversion/trunk/subversion/libsvn_client/blame.c
Author: julianfoad
Date: Sat Jan 26 18:37:38 2013
New Revision: 1438937
URL: http://svn.apache.org/viewvc?rev=1438937&view=rev
Log:
* subversion/libsvn_client/blame.c
(blame, diff_baton, blame_create, blame_insert_range): Constify the 'rev' pointer.
(add_file_blame): Fix doc string.
(window_handler, file_rev_handler): Write doc strings.
Modified:
subversion/trunk/subversion/libsvn_client/blame.c
Modified: subversion/trunk/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/blame.c?rev=1438937&r1=1438936&r2=1438937&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/blame.c (original)
+++ subversion/trunk/subversion/libsvn_client/blame.c Sat Jan 26 18:37:38 2013
@@ -54,9 +54,9 @@ struct rev
/* One chunk of blame */
struct blame
{
- struct rev *rev; /* the responsible revision */
- apr_off_t start; /* the starting diff-token (line) */
- struct blame *next; /* the next chunk */
+ const struct rev *rev; /* the responsible revision */
+ apr_off_t start; /* the starting diff-token (line) */
+ struct blame *next; /* the next chunk */
};
/* A chain of blame chunks */
@@ -70,7 +70,7 @@ struct blame_chain
/* The baton use for the diff output routine. */
struct diff_baton {
struct blame_chain *chain;
- struct rev *rev;
+ const struct rev *rev;
};
/* The baton used for a file revision. */
@@ -118,7 +118,7 @@ struct delta_baton {
at token START, and allocated in CHAIN->mainpool. */
static struct blame *
blame_create(struct blame_chain *chain,
- struct rev *rev,
+ const struct rev *rev,
apr_off_t start)
{
struct blame *blame;
@@ -217,7 +217,7 @@ blame_delete_range(struct blame_chain *c
at token START and continuing for LENGTH tokens */
static svn_error_t *
blame_insert_range(struct blame_chain *chain,
- struct rev *rev,
+ const struct rev *rev,
apr_off_t start,
apr_off_t length)
{
@@ -273,8 +273,8 @@ static const svn_diff_output_fns_t outpu
output_diff_modified
};
-/* Add the blame for the diffs between LAST_FILE and CUR_FILE with the rev
- specified in FRB. LAST_FILE may be NULL in which
+/* Add the blame for the diffs between LAST_FILE and CUR_FILE to CHAIN,
+ for revision REV. LAST_FILE may be NULL in which
case blame is added for every line of CUR_FILE. */
static svn_error_t *
add_file_blame(const char *last_file,
@@ -306,6 +306,13 @@ add_file_blame(const char *last_file,
return SVN_NO_ERROR;
}
+/* The delta window handler for the text delta between the previously seen
+ * revision and the revision currently being handled.
+ *
+ * Record the blame information for this revision in BATON->file_rev_baton.
+ *
+ * Implements svn_txdelta_window_handler_t.
+ */
static svn_error_t *
window_handler(svn_txdelta_window_t *window, void *baton)
{
@@ -398,7 +405,15 @@ check_mimetype(const apr_array_header_t
return SVN_NO_ERROR;
}
-
+/* Calculate and record blame information for one revision of the file,
+ * by comparing the file content against the previously seen revision.
+ *
+ * This handler is called once for each interesting revision of the file.
+ *
+ * Record the blame information for this revision in (file_rev_baton) BATON.
+ *
+ * Implements svn_file_rev_handler_t.
+ */
static svn_error_t *
file_rev_handler(void *baton, const char *path, svn_revnum_t revnum,
apr_hash_t *rev_props,