source: tags/0.6.8/lib/SVNinfo.cc @ 848

Last change on this file since 848 was 731, checked in by Peter Johansson, 13 years ago

update copyright statements

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1// $Id: SVNinfo.cc 731 2008-12-15 19:03:04Z peter $
2
3/*
4  Copyright (C) 2006 Jari Häkkinen
5  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
6  Copyright (C) 2008 Peter Johansson
7
8  This file is part of svndigest, http://dev.thep.lu.se/svndigest
9
10  svndigest is free software; you can redistribute it and/or modify it
11  under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14
15  svndigest is distributed in the hope that it will be useful, but
16  WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  General Public License for more details.
19
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23  02111-1307, USA.
24*/
25
26#include "SVNinfo.h"
27#include "SVN.h"
28
29#include <string>
30
31namespace theplu {
32namespace svndigest {
33
34
35  SVNinfo::SVNinfo(const std::string& path)
36  {
37    SVN::instance()->client_info(path, info_receiver,
38                                 static_cast<void*>(&info_receiver_baton_));
39  }
40
41
42  svn_error_t* SVNinfo::info_receiver(void *baton, const char *,
43                                      const svn_info_t *info, apr_pool_t*)
44  {
45    if (!info)
46      throw SVNException(std::string("SVNinfo::info_receriver: ") +
47                         "Failed to acquire an svn info object");
48
49    info_receiver_baton* irb=static_cast<struct info_receiver_baton*>(baton);
50    if (info->URL)
51      irb->url_=info->URL;
52    if (info->repos_root_URL)
53      irb->repos_root_url_=info->repos_root_URL;
54    if (info->last_changed_author)
55      irb->last_changed_author_=info->last_changed_author;
56    if (info->last_changed_rev)
57      irb->last_changed_rev_=info->last_changed_rev;
58    if (info->rev)
59      irb->rev_=info->rev;
60
61    return SVN_NO_ERROR;
62  }
63
64}} // end of namespace svndigest and namespace theplu
Note: See TracBrowser for help on using the repository browser.