Changeset 1218
- Timestamp:
- Oct 10, 2010, 4:27:39 AM (13 years ago)
- Location:
- trunk/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/SVN.cc
r1217 r1218 181 181 182 182 183 svn_error_t*SVN::client_blame(const std::string& path,184 185 183 void SVN::client_blame(const std::string& path, 184 svn_client_blame_receiver_t receiver, 185 void *baton, svn_revnum_t rev) 186 186 { 187 187 svn_opt_revision_t head; 188 188 head.kind=svn_opt_revision_number; 189 189 head.value.number=rev; 190 returnclient_blame_call(path, receiver, baton, head);191 } 192 193 svn_error_t*SVN::client_blame(const std::string& path,194 195 190 client_blame_call(path, receiver, baton, head); 191 } 192 193 void SVN::client_blame(const std::string& path, 194 svn_client_blame_receiver_t receiver, 195 void *baton) 196 196 { 197 197 svn_opt_revision_t head; 198 198 head.kind = ( svn_path_is_url(path.c_str()) ? 199 199 svn_opt_revision_head : svn_opt_revision_base ); 200 returnclient_blame_call(path, receiver, baton, head);201 } 202 203 204 svn_error_t*SVN::client_blame_call(const std::string& path,205 206 200 client_blame_call(path, receiver, baton, head); 201 } 202 203 204 void SVN::client_blame_call(const std::string& path, 205 svn_client_blame_receiver_t receiver, 206 void *baton, svn_opt_revision_t& head) 207 207 { 208 208 // Setup to use all revisions … … 216 216 false, receiver, baton, context_, 217 217 subpool); 218 if (err && err->apr_err!=SVN_ERR_CLIENT_IS_BINARY_FILE)218 if (err) 219 219 // cleanup will throw an exception 220 220 cleanup(err, subpool, "SVN::client_blame: svn_client_blame3 failed"); 221 221 svn_pool_destroy(subpool); 222 return err;223 222 } 224 223 … … 328 327 if (info->repos_root_URL) 329 328 rurb->path=info->repos_root_URL; 330 331 329 return SVN_NO_ERROR; 332 330 } -
trunk/lib/SVN.h
r1217 r1218 112 112 113 113 \a path can be either a URL or an WC target. 114 115 \return SVN_NO_ERROR or SVN_ERR_CLIENT_IS_BINARY_FILE, the 116 latter can be used to trigger on binary files. Note that errors 117 return from underlying subversion API must be cleared by the 118 receiver. 119 120 \see Subversion API (svn_error_clear). 121 */ 122 svn_error_t * client_blame(const std::string& path, 123 svn_client_blame_receiver_t receiver, 124 void *baton); 114 */ 115 void client_blame(const std::string& path, 116 svn_client_blame_receiver_t receiver, 117 void *baton); 125 118 126 119 /** … … 128 121 \a rev can be set. 129 122 */ 130 svn_error_t *client_blame(const std::string& path,131 132 123 void client_blame(const std::string& path, 124 svn_client_blame_receiver_t receiver, 125 void *baton, svn_revnum_t rev); 133 126 134 127 /** … … 288 281 */ 289 282 static svn_error_t* 290 root_url_receiver(void *baton, const char *path, const svn_info_t *info,291 apr_pool_t *pool);292 293 svn_error_t*client_blame_call(const std::string& path,294 295 283 root_url_receiver(void *baton, const char *path, 284 const svn_info_t *info, apr_pool_t *pool); 285 286 void client_blame_call(const std::string& path, 287 svn_client_blame_receiver_t receiver, 288 void *baton, svn_opt_revision_t& head); 296 289 297 290 svn_wc_adm_access_t* adm_access_; -
trunk/lib/SVNblame.cc
r978 r1218 31 31 32 32 SVNblame::SVNblame(const std::string& path) 33 : binary_(false),instance_(SVN::instance())33 : instance_(SVN::instance()) 34 34 { 35 if (svn_error_t* err= 36 instance_->client_blame(path.c_str(), blame_receiver, 37 static_cast<void*>(&blame_receiver_baton_))) { 38 // SVN_ERR_CLIENT_IS_BINARY_FILE is the only error allowed to 39 // escape the client_blame call 40 svn_error_clear(err); 41 binary_=true; 42 } 35 instance_->client_blame(path.c_str(), blame_receiver, 36 static_cast<void*>(&blame_receiver_baton_)); 43 37 blame_info_iterator_ = blame_receiver_baton_.blame_info.begin(); 44 38 } … … 46 40 47 41 SVNblame::SVNblame(const std::string& path, svn_revnum_t rev) 48 : binary_(false),instance_(SVN::instance())42 : instance_(SVN::instance()) 49 43 { 50 if (svn_error_t* err= 51 instance_->client_blame(path.c_str(), blame_receiver, 52 static_cast<void*>(&blame_receiver_baton_), 53 rev)) { 54 // SVN_ERR_CLIENT_IS_BINARY_FILE is the only error allowed to 55 // escape the client_blame call 56 svn_error_clear(err); 57 binary_=true; 58 } 44 instance_->client_blame(path.c_str(), blame_receiver, 45 static_cast<void*>(&blame_receiver_baton_), 46 rev); 59 47 blame_info_iterator_ = blame_receiver_baton_.blame_info.begin(); 60 48 } … … 75 63 { 76 64 return (*blame_info_iterator_)->author; 77 }78 79 80 bool SVNblame::binary(void)81 {82 return binary_;83 65 } 84 66 -
trunk/lib/SVNblame.h
r978 r1218 76 76 */ 77 77 std::string author(void); 78 79 /**80 Returns true if item is binary false otherwise81 82 Binary files are invalid for 'svn blame'.83 */84 bool binary(void);85 78 86 79 /** … … 164 157 }; 165 158 166 // binary_ is true if item in any revision has been binary.167 bool binary_;168 159 // blame_info_iterator_ is used in statistics analysis to traverse 169 160 // blame_receiver_baton.blame_info vector through calls to next().
Note: See TracChangeset
for help on using the changeset viewer.