Exemple #1
0
/* 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
   case blame is added for every line of CUR_FILE. */
static svn_error_t *
add_file_blame(const char *last_file,
               const char *cur_file,
               struct blame_chain *chain,
               struct rev *rev,
               const svn_diff_file_options_t *diff_options,
               apr_pool_t *pool)
{
  if (!last_file)
    {
      SVN_ERR_ASSERT(chain->blame == NULL);
      chain->blame = blame_create(chain, rev, 0);
    }
  else
    {
      svn_diff_t *diff;
      struct diff_baton diff_baton;

      diff_baton.chain = chain;
      diff_baton.rev = rev;

      /* We have a previous file.  Get the diff and adjust blame info. */
      SVN_ERR(svn_diff_file_diff_2(&diff, last_file, cur_file,
                                   diff_options, pool));
      SVN_ERR(svn_diff_output(diff, &diff_baton, &output_fns));
    }

  return SVN_NO_ERROR;
}
Exemple #2
0
svn_error_t *diff_playlist_tracks_apply(svn_diff_t *diff,
                                        sp_playlist *playlist,
                                        sp_track **tracks,
                                        int num_tracks,
                                        sp_session *session) {
  sp_playlist_add_ref(playlist);

  struct output_baton_t *baton = malloc(sizeof (struct output_baton_t));
  baton->playlist = playlist;
  baton->tracks = tracks;
  baton->num_tracks = num_tracks;
  baton->session = session;

  svn_error_t *result = svn_diff_output(diff, baton, &output_fns_vtable);
  
  free(baton);
  sp_playlist_release(playlist);
  return result;
}
Exemple #3
0
/* 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
   case blame is added for every line of CUR_FILE. */
static svn_error_t *
add_file_blame (const char *last_file, const char *cur_file,
                struct file_rev_baton *frb)
{
  if (!last_file)
    {
      assert (frb->blame == NULL);
      frb->blame = blame_create (frb, frb->rev, 0);
    }
  else
    {
      svn_diff_t *diff;

      /* We have a previous file.  Get the diff and adjust blame info. */
      SVN_ERR (svn_diff_file_diff (&diff, last_file, cur_file,
                                   frb->currpool));
      SVN_ERR (svn_diff_output (diff, frb, &output_fns));
    }

  return SVN_NO_ERROR;
}