Changeset 318 for trunk/lib/SVNlog.cc


Ignore:
Timestamp:
May 18, 2007, 11:35:45 AM (14 years ago)
Author:
Jari Häkkinen
Message:

Fixes #167 and addresses #74. Interfaces have changed. SVN::instance usage has changed, read SVN class documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/SVNlog.cc

    r282 r318  
    3535
    3636
    37   SVNlog::SVNlog(std::string path)
     37  SVNlog::SVNlog(const std::string& path)
    3838  {
    39     SVN* svn = SVN::instance();
    40     svn->client_log(path, &lb_);
     39    SVN::instance()->client_log(path, log_message_receiver,
     40                                static_cast<void*>(&lb_));
    4141    assert(date().size()==author().size());
    4242    assert(date().size()==revision().size());
    4343    assert(date().size()==message().size());
    44 
    4544  }
    4645
     
    8281  }
    8382
     83
     84  svn_error_t*
     85  SVNlog::log_message_receiver(void *baton, apr_hash_t *changed_paths,
     86                               svn_revnum_t rev, const char *author,
     87                               const char *date, const char *msg,
     88                               apr_pool_t *pool)
     89  {
     90    struct log_receiver_baton *lb=static_cast<struct log_receiver_baton*>(baton);
     91    if (date && date[0])
     92      lb->commit_dates.push_back(date);
     93    else
     94      throw SVNException("No date defined for revision: " + rev);
     95    if (author && author[0])
     96      lb->authors.push_back(author);
     97    else
     98      lb->authors.push_back("");
     99    lb->rev.push_back(rev);
     100    if (msg)
     101      lb->msg.push_back(std::string(msg));
     102    else
     103      lb->msg.push_back(std::string(""));
     104    return SVN_NO_ERROR;
     105  }
     106
    84107}} // end of namespace svndigest and namespace theplu
Note: See TracChangeset for help on using the changeset viewer.