# HG changeset patch # User Pascal Bellard # Date 1443019640 -7200 # Node ID 256efd525f0c37ae3ded9b43135cee2fe02da1ce # Parent 8310520e5aeb0cc0cf8fd4d4a662da1ac0a2b97b rapidsvn: update client_ls.cpp diff -r 8310520e5aeb -r 256efd525f0c rapidsvn/receipt --- a/rapidsvn/receipt Wed Sep 23 13:01:13 2015 +0200 +++ b/rapidsvn/receipt Wed Sep 23 16:47:20 2015 +0200 @@ -20,7 +20,7 @@ # Rules to configure and make the package. compile_rules() { - cd $src + cp $stuff/client_ls.cpp src/svncpp/client_ls.cpp ./configure --prefix=/usr \ --with-apr-config=apr-1-config \ --with-apu-config=apu-1-config \ diff -r 8310520e5aeb -r 256efd525f0c rapidsvn/stuff/client_ls.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rapidsvn/stuff/client_ls.cpp Wed Sep 23 16:47:20 2015 +0200 @@ -0,0 +1,89 @@ +/* + * ==================================================================== + * Copyright (c) 2002-2012 The RapidSVN Group. All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (in the file GPL.txt. + * If not, see . + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ +// subversion api +#include "svn_client.h" +#include "svn_path.h" +#include "svn_sorts.h" +//#include "svn_utf.h" + +// svncpp +#include "svncpp/client.hpp" +#include "svncpp/dirent.hpp" +#include "svncpp/exception.hpp" + +static bool isEmpty(const char * str) +{ + if (0 == str) + return true; + return 0 == *str; +} + +namespace svn +{ + static svn_error_t* + listEntriesFunc(void *baton, const char *path, + const svn_dirent_t *dirent, const svn_lock_t *lock, + const char *abs_path, apr_pool_t *pool) + { + if (!isEmpty(path)) + { + DirEntries * entries = static_cast(baton); + entries->push_back( + DirEntry(path, const_cast(dirent))); + } + return 0; + } + + DirEntries + Client::list(const char * pathOrUrl, + svn_opt_revision_t * revision, + bool recurse) throw(ClientException) + { + Pool pool; + + DirEntries entries; + svn_error_t * error = + svn_client_list2(pathOrUrl, + revision, + revision, + recurse ? svn_depth_infinity : svn_depth_immediates, + SVN_DIRENT_ALL, + true, + listEntriesFunc, + &entries, + *m_context, + pool); + + if (error != 0) + throw ClientException(error); + + return entries; + } +} + +/* ----------------------------------------------------------------- + * local variables: + * eval: (load-file "../../rapidsvn-dev.el") + * end: + */