Changeset 579 for trunk/lib/SVN.cc


Ignore:
Timestamp:
Mar 18, 2008, 3:11:51 PM (13 years ago)
Author:
Peter Johansson
Message:

Merged patch release 0.6.5 to the trunk. Delta 0.6.5 - 0.6.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/SVN.cc

    r519 r579  
    44  Copyright (C) 2006 Jari Häkkinen
    55  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
     6  Copyright (C) 2008 Peter Johansson
    67
    78  This file is part of svndigest, http://trac.thep.lu.se/svndigest
     
    9899    // setup, maybe this is unnecessary?
    99100    const char* canonical_path=svn_path_internal_style(path.c_str(), pool_);
    100     if (svn_error_t *err=svn_wc_adm_open3(&adm_access_, NULL, canonical_path,
    101                                           false, -1, context_->cancel_func,
    102                                           context_->cancel_baton, pool_))
     101    if ((err=svn_wc_adm_open3(&adm_access_, NULL, canonical_path,
     102                              false, -1, context_->cancel_func,
     103                              context_->cancel_baton, pool_))){
     104      if (err->apr_err == SVN_ERR_WC_NOT_DIRECTORY)
     105        cleanup_failed_init(err, std::string(err->message), true);
    103106      cleanup_failed_init(err, "SVN: svn_wc_adm_open3 failed");
     107    }
    104108
    105109    // get a session to the repository
    106110    struct root_url_receiver_baton rurb;
    107111    client_info(path, root_url_receiver, static_cast<void*>(&rurb));
    108     if (svn_error_t *err=svn_client_open_ra_session(&ra_session_,
    109                                                     rurb.path.c_str(),
    110                                                     context_, pool_))
     112    if ((err=svn_client_open_ra_session(&ra_session_,
     113                                        rurb.path.c_str(),
     114                                        context_, pool_)))
    111115      cleanup_failed_init(err, "SVN: svn_client_open_ra_session failed");
    112116  }
     
    118122      svn_error_clear(svn_wc_adm_close(adm_access_));
    119123    svn_pool_destroy(pool_);
    120     apr_allocator_destroy(allocator_);
     124    pool_=NULL;
    121125    // other apr resources acquired in svn_cmdline_init are destroyed
    122126    // at program exit, ok since SVN is a singleton
     
    125129
    126130  void SVN::cleanup(svn_error_t *err,apr_pool_t *pool,
    127                     const std::string& message)
    128   {
    129     svn_handle_error2(err,stderr,false,"svndigest: ");
     131                    std::string message, bool mute)
     132  {
     133    if (!mute)
     134      svn_handle_error2(err,stderr,false,"svndigest: ");
    130135    svn_error_clear(err);
    131     if (pool)
     136    if (pool){
    132137      svn_pool_destroy(pool);
     138      pool=NULL;
     139    }
    133140    if (message.length()>0)
    134141      throw SVNException(message);
     
    136143
    137144
    138   void SVN::cleanup_failed_init(svn_error_t *err, const std::string& message)
    139   {
    140     cleanup(err,pool_);
    141     apr_allocator_destroy(allocator_);
     145  void SVN::cleanup_failed_init(svn_error_t *err, const std::string& message,
     146                                bool mute)
     147  {
     148    cleanup(err,pool_, "", true);
    142149    throw SVNException(message);
    143150  }
Note: See TracChangeset for help on using the changeset viewer.