source: trunk/lib/SVNinfo.cc @ 687

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

Merged patch release 0.6.6 to trunk. Delta 0.6.6 - 0.6.5

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
RevLine 
[129]1// $Id: SVNinfo.cc 687 2008-08-04 19:37:10Z peter $
2
3/*
4  Copyright (C) 2006 Jari Häkkinen
[408]5  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
[129]6
[687]7  This file is part of svndigest, http://dev.thep.lu.se/svndigest
[129]8
[149]9  svndigest is free software; you can redistribute it and/or modify it
[129]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
[149]14  svndigest is distributed in the hope that it will be useful, but
[129]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 {
[149]31namespace svndigest {
[129]32
33
34  SVNinfo::SVNinfo(const std::string& path)
35  {
[318]36    SVN::instance()->client_info(path, info_receiver,
37                                 static_cast<void*>(&info_receiver_baton_));
[129]38  }
39
40
[318]41  svn_error_t* SVNinfo::info_receiver(void *baton, const char *,
42                                      const svn_info_t *info, apr_pool_t*)
[129]43  {
44    if (!info)
[135]45      throw SVNException(std::string("SVNinfo::info_receriver: ") +
46                         "Failed to acquire an svn info object");
[142]47
48    info_receiver_baton* irb=static_cast<struct info_receiver_baton*>(baton);
[312]49    if (info->URL)
50      irb->url_=info->URL;
[142]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
[140]60    return SVN_NO_ERROR;
[129]61  }
62
[149]63}} // end of namespace svndigest and namespace theplu
Note: See TracBrowser for help on using the repository browser.