FreeBSD/contrib/subversion/subversion/svnserve/serve.c
/* Send a log entry to the client. */
Send a log entry to the client.
Send a log entry to the client .
static svn_error_t *log_receiver(void *baton,
                                 svn_log_entry_t *log_entry,
                                 apr_pool_t *pool)
{
  log_baton_t *b = baton;
  svn_ra_svn_conn_t *conn = b->conn;
  apr_hash_index_t *h;
  svn_boolean_t invalid_revnum = FALSE;
  const svn_string_t *author, *date, *message;
  unsigned revprop_count;
  if (log_entry->revision == SVN_INVALID_REVNUM)
    {
      if (b->stack_depth == 0)
        return SVN_NO_ERROR;
      log_entry->revision = 0;
      invalid_revnum = TRUE;
      b->stack_depth--;
    }
  svn_compat_log_revprops_out_string(&author, &date, &message,
                                     log_entry->revprops);
  svn_compat_log_revprops_clear(log_entry->revprops);
  if (log_entry->revprops)
    revprop_count = apr_hash_count(log_entry->revprops);
  else
    revprop_count = 0;
  SVN_ERR(svn_ra_svn__start_list(conn, pool));
  SVN_ERR(svn_ra_svn__start_list(conn, pool));
  if (log_entry->changed_paths2)
    {
      for (h = apr_hash_first(pool, log_entry->changed_paths2); h;
                                                        h = apr_hash_next(h))
        {
          const char *path = apr_hash_this_key(h);
          svn_log_changed_path2_t *change = apr_hash_this_val(h);
          SVN_ERR(svn_ra_svn__write_data_log_changed_path(
                      conn, pool,
                      path,
                      change->action,
                      change->copyfrom_path,
                      change->copyfrom_rev,
                      change->node_kind,
                      change->text_modified  == svn_tristate_true,
                      change->props_modified == svn_tristate_true));
        }
    }
  SVN_ERR(svn_ra_svn__end_list(conn, pool));
  SVN_ERR(svn_ra_svn__write_data_log_entry(conn, pool,
                                           log_entry->revision,
                                           author, date, message,
                                           log_entry->has_children,
                                           invalid_revnum, revprop_count));
  SVN_ERR(svn_ra_svn__start_list(conn, pool));
  if (revprop_count)
    SVN_ERR(svn_ra_svn__write_proplist(conn, pool, log_entry->revprops));
  SVN_ERR(svn_ra_svn__end_list(conn, pool));
  SVN_ERR(svn_ra_svn__write_boolean(conn, pool, log_entry->subtractive_merge));
  SVN_ERR(svn_ra_svn__end_list(conn, pool));
  if (log_entry->has_children)
    b->stack_depth++;
  return SVN_NO_ERROR;
}
static svn_error_t * log_receiver ( void * baton , svn_log_entry_t * log_entry , apr_pool_t * pool ) { log_baton_t * b = baton ; svn_ra_svn_conn_t * conn = b -> conn ; apr_hash_index_t * h ; svn_boolean_t invalid_revnum = FALSE ; const svn_string_t * author , * date , * message ; unsigned revprop_count ; if ( log_entry -> revision == SVN_INVALID_REVNUM ) { if ( b -> stack_depth == 0 ) return SVN_NO_ERROR ; log_entry -> revision = 0 ; invalid_revnum = TRUE ; b -> stack_depth -- ; } svn_compat_log_revprops_out_string ( & author , & date , & message , log_entry -> revprops ) ; svn_compat_log_revprops_clear ( log_entry -> revprops ) ; if ( log_entry -> revprops ) revprop_count = apr_hash_count ( log_entry -> revprops ) ; else revprop_count = 0 ; SVN_ERR ( svn_ra_svn__start_list ( conn , pool ) ) ; SVN_ERR ( svn_ra_svn__start_list ( conn , pool ) ) ; if ( log_entry -> changed_paths2 ) { for ( h = apr_hash_first ( pool , log_entry -> changed_paths2 ) ; h ; h = apr_hash_next ( h ) ) { const char * path = apr_hash_this_key ( h ) ; svn_log_changed_path2_t * change = apr_hash_this_val ( h ) ; SVN_ERR ( svn_ra_svn__write_data_log_changed_path ( conn , pool , path , change -> action , change -> copyfrom_path , change -> copyfrom_rev , change -> node_kind , change -> text_modified == svn_tristate_true , change -> props_modified == svn_tristate_true ) ) ; } } SVN_ERR ( svn_ra_svn__end_list ( conn , pool ) ) ; SVN_ERR ( svn_ra_svn__write_data_log_entry ( conn , pool , log_entry -> revision , author , date , message , log_entry -> has_children , invalid_revnum , revprop_count ) ) ; SVN_ERR ( svn_ra_svn__start_list ( conn , pool ) ) ; if ( revprop_count ) SVN_ERR ( svn_ra_svn__write_proplist ( conn , pool , log_entry -> revprops ) ) ; SVN_ERR ( svn_ra_svn__end_list ( conn , pool ) ) ; SVN_ERR ( svn_ra_svn__write_boolean ( conn , pool , log_entry -> subtractive_merge ) ) ; SVN_ERR ( svn_ra_svn__end_list ( conn , pool ) ) ; if ( log_entry -> has_children ) b -> stack_depth ++ ; return SVN_NO_ERROR ; }
Send a log entry to the client.
Send a log entry to the client .
/* If the stack depth is zero, we've seen the last revision, so don't
         send it, just return. */ /* Because the svn protocol won't let us send an invalid revnum, we have
         to fudge here and send an additional flag. */ /* send LOG_ENTRY */ /* send LOG_ENTRY->CHANGED_PATHS2 */ /* text_modified and props_modified are never unknown */ /* send LOG_ENTRY main members */ /* send LOG_ENTRY->REVPROPS */ /* send LOG_ENTRY members that were added in later SVN releases */