wok-current rev 18438

rapidsvn: update client_ls.cpp
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Sep 23 16:47:20 2015 +0200 (2015-09-23)
parents 8310520e5aeb
children 243148b143dc
files rapidsvn/receipt rapidsvn/stuff/client_ls.cpp
line diff
     1.1 --- a/rapidsvn/receipt	Wed Sep 23 13:01:13 2015 +0200
     1.2 +++ b/rapidsvn/receipt	Wed Sep 23 16:47:20 2015 +0200
     1.3 @@ -20,7 +20,7 @@
     1.4  # Rules to configure and make the package.
     1.5  compile_rules()
     1.6  {
     1.7 -	cd $src
     1.8 +	cp $stuff/client_ls.cpp src/svncpp/client_ls.cpp
     1.9  	./configure --prefix=/usr \
    1.10  		--with-apr-config=apr-1-config \
    1.11  		--with-apu-config=apu-1-config \
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/rapidsvn/stuff/client_ls.cpp	Wed Sep 23 16:47:20 2015 +0200
     2.3 @@ -0,0 +1,89 @@
     2.4 +/*
     2.5 + * ====================================================================
     2.6 + * Copyright (c) 2002-2012 The RapidSVN Group.  All rights reserved.
     2.7 + *
     2.8 + * This program is free software: you can redistribute it and/or modify
     2.9 + * it under the terms of the GNU General Public License as published by
    2.10 + * the Free Software Foundation, either version 3 of the License, or
    2.11 + * (at your option) any later version.
    2.12 + *
    2.13 + * This program is distributed in the hope that it will be useful,
    2.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.16 + * GNU General Public License for more details.
    2.17 + *
    2.18 + * You should have received a copy of the GNU General Public License
    2.19 + * along with this program (in the file GPL.txt.
    2.20 + * If not, see <http://www.gnu.org/licenses/>.
    2.21 + *
    2.22 + * This software consists of voluntary contributions made by many
    2.23 + * individuals.  For exact contribution history, see the revision
    2.24 + * history and logs, available at http://rapidsvn.tigris.org/.
    2.25 + * ====================================================================
    2.26 + */
    2.27 +// subversion api
    2.28 +#include "svn_client.h"
    2.29 +#include "svn_path.h"
    2.30 +#include "svn_sorts.h"
    2.31 +//#include "svn_utf.h"
    2.32 +
    2.33 +// svncpp
    2.34 +#include "svncpp/client.hpp"
    2.35 +#include "svncpp/dirent.hpp"
    2.36 +#include "svncpp/exception.hpp"
    2.37 +
    2.38 +static bool isEmpty(const char * str)
    2.39 +{
    2.40 +	if (0 == str)
    2.41 +		return true;
    2.42 +	return 0 == *str;
    2.43 +}
    2.44 +
    2.45 +namespace svn
    2.46 +{
    2.47 +  static svn_error_t*
    2.48 +  listEntriesFunc(void *baton, const char *path,
    2.49 +        const svn_dirent_t *dirent, const svn_lock_t *lock,
    2.50 +        const char *abs_path, apr_pool_t *pool)
    2.51 +  {
    2.52 +    if (!isEmpty(path))
    2.53 +    {
    2.54 +      DirEntries * entries = static_cast<DirEntries *>(baton);
    2.55 +      entries->push_back(
    2.56 +        DirEntry(path, const_cast<svn_dirent_t *>(dirent)));
    2.57 +    }
    2.58 +    return 0;
    2.59 +  }
    2.60 +
    2.61 +  DirEntries
    2.62 +  Client::list(const char * pathOrUrl,
    2.63 +               svn_opt_revision_t * revision,
    2.64 +               bool recurse) throw(ClientException)
    2.65 +  {
    2.66 +    Pool pool;
    2.67 +
    2.68 +    DirEntries entries;
    2.69 +    svn_error_t * error =
    2.70 +      svn_client_list2(pathOrUrl,
    2.71 +                       revision,
    2.72 +                       revision,
    2.73 +                       recurse ? svn_depth_infinity : svn_depth_immediates,
    2.74 +                       SVN_DIRENT_ALL,
    2.75 +                       true,
    2.76 +                       listEntriesFunc,
    2.77 +                       &entries,
    2.78 +                       *m_context,
    2.79 +                       pool);
    2.80 +
    2.81 +    if (error != 0)
    2.82 +      throw ClientException(error);
    2.83 +
    2.84 +    return entries;
    2.85 +  }
    2.86 +}
    2.87 +
    2.88 +/* -----------------------------------------------------------------
    2.89 + * local variables:
    2.90 + * eval: (load-file "../../rapidsvn-dev.el")
    2.91 + * end:
    2.92 + */