source: trunk/lib/SVNinfo.cc @ 408

Last change on this file since 408 was 408, checked in by Jari Häkkinen, 14 years ago

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