source: trunk/lib/Node.cc @ 18

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

Directory tree created. Use purge() to remove non subversion controlled entries.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1// $Id: Node.cc 18 2005-12-30 17:41:33Z jari $
2
3#include "Node.h"
4#include "utility.h"
5
6#include <fstream>
7#include <iostream>
8#include <sstream>
9
10namespace theplu{
11namespace svnstat{
12
13  bool Node::subversion_controlled(void) 
14  {
15    std::string system_call = "svn info " + path_ + " > svnstat.tmp";
16    int system_return = system(system_call.c_str());
17    if (system_return){
18      std::cerr << "Error: svn info " << path_ << std::endl;     
19      return false;
20    }
21    std::cerr << "Ok: svn info " << path_ << std::endl;     
22    std::ifstream is("svnstat.tmp");
23    std::string line;
24    while (getline(is,line)){
25      std::stringstream ss(line);
26      std::string tag;
27      getline(ss,tag,':');
28      if (tag == std::string("Repository UUID"))
29        ss >> uuid_; 
30      else if (tag == std::string("Last Changed Author"))
31        ss >> author_;
32      else if (tag == std::string("Last Changed Rev"))
33        ss >> revision_;
34    }
35   
36    return true;
37  }
38
39
40  bool Node::subversion_controlled(void) const {
41    std::string system_call = "svn proplist " + path_ + ">&/dev/null";
42    return !system(system_call.c_str());
43  }
44
45}} // end of namespace svnstat and namespace theplu
Note: See TracBrowser for help on using the repository browser.