QSvnError QSvn::add(const QStringList &items, svn_depth_t depth, bool force, bool no_ignore, bool addparents) { foreach(const QString &item, items) { QSvnPool localpool(pool); QSvnError err = svn_client_add4(item.toUtf8().constData(), depth, force, no_ignore, addparents, ctx, localpool); if (err.isError()) { return err; } }
QString QSvn::urlFromPath(const QString &path) { QString ret; svn_error_t *err = nullptr; QSvnPool localpool(pool); svn_opt_revision_t rev; rev.kind = svn_opt_revision_working; rev.value.number = 0; err = svn_client_status5(nullptr, ctx, path.toUtf8().constData(), &rev, svn_depth_empty, true, false, true, true, false, nullptr, [](void *baton, const char *path, const svn_client_status_t *status, apr_pool_t *scratch_pool) -> svn_error_t * { Q_UNUSED(path); Q_UNUSED(status); Q_UNUSED(scratch_pool); QString *ret = (QString *)baton; *ret = QString::fromUtf8(status->repos_root_url); if (strlen(status->repos_relpath) > 0) { *ret += "/" + QString::fromUtf8(status->repos_relpath); } return SVN_NO_ERROR; }, (void *)&ret, localpool); if (err) { emit error(err->message); } return ret; }
bool GitStatus::IsInExternal(const CTGitPath& path) const { #if 0 if (apr_hash_count(m_statushash) == 0) return false; GitPool localpool(m_pool); apr_hash_index_t *hi; const char* key; for (hi = apr_hash_first(localpool, m_externalhash); hi; hi = apr_hash_next(hi)) { apr_hash_this(hi, (const void**)&key, NULL, NULL); if (key) { if (CTGitPath(CUnicodeUtils::GetUnicode(key)).IsAncestorOf(path)) return true; } } #endif return false; }