| 220 | } |
| 221 | |
| 222 | static svn_error_t * |
| 223 | kdev_logReceiver (void *baton, |
| 224 | apr_hash_t * changedPaths, |
| 225 | svn_revnum_t rev, |
| 226 | const char *author, |
| 227 | const char *date, |
| 228 | const char *msg, |
| 229 | apr_pool_t * pool) |
| 230 | { |
| 231 | auto* client = (SvnClient *) baton; |
| 232 | |
| 233 | KDevelop::VcsEvent ev; |
| 234 | ev.setAuthor( QString::fromUtf8( author ) ); |
| 235 | ev.setDate( QDateTime::fromString( QString::fromUtf8( date ), Qt::ISODate ) ); |
| 236 | ev.setMessage( QString::fromUtf8( msg ) ); |
| 237 | KDevelop::VcsRevision vcsrev; |
| 238 | vcsrev.setRevisionValue( QVariant( qlonglong( rev ) ), KDevelop::VcsRevision::GlobalNumber ); |
| 239 | ev.setRevision( vcsrev ); |
| 240 | |
| 241 | if (changedPaths != nullptr) |
| 242 | { |
| 243 | for (apr_hash_index_t *hi = apr_hash_first (pool, changedPaths); |
| 244 | hi != nullptr; |
| 245 | hi = apr_hash_next (hi)) |
| 246 | { |
| 247 | char *path; |
| 248 | void *val; |
| 249 | apr_hash_this (hi, (const void **)&path, nullptr, &val); |
| 250 | |
| 251 | auto *log_item = reinterpret_cast<svn_log_changed_path_t *> (val); |
| 252 | KDevelop::VcsItemEvent iev; |
| 253 | iev.setRepositoryLocation( QString::fromUtf8( path ) ); |
| 254 | iev.setRepositoryCopySourceLocation( QString::fromUtf8( log_item->copyfrom_path ) ); |
| 255 | KDevelop::VcsRevision irev; |
| 256 | irev.setRevisionValue( QVariant( qlonglong( log_item->copyfrom_rev ) ), |
| 257 | KDevelop::VcsRevision::GlobalNumber ); |
| 258 | iev.setRepositoryCopySourceRevision( irev ); |
| 259 | switch( log_item->action ) |
| 260 | { |
| 261 | case 'A': |
| 262 | iev.setActions( KDevelop::VcsItemEvent::Added ); |
| 263 | break; |
| 264 | case 'M': |
| 265 | iev.setActions( KDevelop::VcsItemEvent::Modified ); |
| 266 | break; |
| 267 | case 'D': |
| 268 | iev.setActions( KDevelop::VcsItemEvent::Deleted ); |
| 269 | break; |
| 270 | case 'R': |
| 271 | iev.setActions( KDevelop::VcsItemEvent::Replaced ); |
| 272 | break; |
| 273 | } |
| 274 | |
| 275 | auto items = ev.items(); |
| 276 | items.append( iev ); |
| 277 | ev.setItems( items ); |
| 278 | } |
| 279 | } |
nothing calls this directly
no test coverage detected