129 |
02 Aug 06 |
jari |
// $Id$ |
129 |
02 Aug 06 |
jari |
2 |
|
129 |
02 Aug 06 |
jari |
3 |
/* |
978 |
12 Dec 09 |
peter |
Copyright (C) 2006 Jari Häkkinen |
978 |
12 Dec 09 |
peter |
Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2023 Peter Johansson |
129 |
02 Aug 06 |
jari |
7 |
|
687 |
04 Aug 08 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
129 |
02 Aug 06 |
jari |
9 |
|
149 |
12 Aug 06 |
jari |
svndigest is free software; you can redistribute it and/or modify it |
129 |
02 Aug 06 |
jari |
under the terms of the GNU General Public License as published by |
693 |
11 Sep 08 |
jari |
the Free Software Foundation; either version 3 of the License, or |
129 |
02 Aug 06 |
jari |
(at your option) any later version. |
129 |
02 Aug 06 |
jari |
14 |
|
149 |
12 Aug 06 |
jari |
svndigest is distributed in the hope that it will be useful, but |
129 |
02 Aug 06 |
jari |
WITHOUT ANY WARRANTY; without even the implied warranty of |
129 |
02 Aug 06 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
129 |
02 Aug 06 |
jari |
General Public License for more details. |
129 |
02 Aug 06 |
jari |
19 |
|
129 |
02 Aug 06 |
jari |
You should have received a copy of the GNU General Public License |
693 |
11 Sep 08 |
jari |
along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
129 |
02 Aug 06 |
jari |
22 |
*/ |
129 |
02 Aug 06 |
jari |
23 |
|
1619 |
12 Mar 23 |
peter |
24 |
#include <config.h> |
1619 |
12 Mar 23 |
peter |
25 |
|
129 |
02 Aug 06 |
jari |
26 |
#include "SVNinfo.h" |
129 |
02 Aug 06 |
jari |
27 |
#include "SVN.h" |
129 |
02 Aug 06 |
jari |
28 |
|
129 |
02 Aug 06 |
jari |
29 |
#include <string> |
129 |
02 Aug 06 |
jari |
30 |
|
129 |
02 Aug 06 |
jari |
31 |
namespace theplu { |
149 |
12 Aug 06 |
jari |
32 |
namespace svndigest { |
129 |
02 Aug 06 |
jari |
33 |
|
129 |
02 Aug 06 |
jari |
34 |
|
129 |
02 Aug 06 |
jari |
35 |
SVNinfo::SVNinfo(const std::string& path) |
129 |
02 Aug 06 |
jari |
36 |
{ |
318 |
18 May 07 |
jari |
37 |
SVN::instance()->client_info(path, info_receiver, |
318 |
18 May 07 |
jari |
38 |
static_cast<void*>(&info_receiver_baton_)); |
129 |
02 Aug 06 |
jari |
39 |
} |
129 |
02 Aug 06 |
jari |
40 |
|
129 |
02 Aug 06 |
jari |
41 |
|
318 |
18 May 07 |
jari |
42 |
svn_error_t* SVNinfo::info_receiver(void *baton, const char *, |
318 |
18 May 07 |
jari |
43 |
const svn_info_t *info, apr_pool_t*) |
129 |
02 Aug 06 |
jari |
44 |
{ |
129 |
02 Aug 06 |
jari |
45 |
if (!info) |
135 |
03 Aug 06 |
jari |
46 |
throw SVNException(std::string("SVNinfo::info_receriver: ") + |
135 |
03 Aug 06 |
jari |
47 |
"Failed to acquire an svn info object"); |
142 |
08 Aug 06 |
jari |
48 |
|
142 |
08 Aug 06 |
jari |
49 |
info_receiver_baton* irb=static_cast<struct info_receiver_baton*>(baton); |
312 |
17 May 07 |
peter |
50 |
if (info->URL) |
312 |
17 May 07 |
peter |
51 |
irb->url_=info->URL; |
142 |
08 Aug 06 |
jari |
52 |
if (info->repos_root_URL) |
142 |
08 Aug 06 |
jari |
53 |
irb->repos_root_url_=info->repos_root_URL; |
142 |
08 Aug 06 |
jari |
54 |
if (info->last_changed_author) |
142 |
08 Aug 06 |
jari |
55 |
irb->last_changed_author_=info->last_changed_author; |
142 |
08 Aug 06 |
jari |
56 |
if (info->last_changed_rev) |
142 |
08 Aug 06 |
jari |
57 |
irb->last_changed_rev_=info->last_changed_rev; |
142 |
08 Aug 06 |
jari |
58 |
if (info->rev) |
142 |
08 Aug 06 |
jari |
59 |
irb->rev_=info->rev; |
142 |
08 Aug 06 |
jari |
60 |
|
140 |
04 Aug 06 |
jari |
61 |
return SVN_NO_ERROR; |
129 |
02 Aug 06 |
jari |
62 |
} |
129 |
02 Aug 06 |
jari |
63 |
|
149 |
12 Aug 06 |
jari |
64 |
}} // end of namespace svndigest and namespace theplu |