Changeset 1144


Ignore:
Timestamp:
Jul 25, 2010, 12:06:27 AM (9 years ago)
Author:
Peter Johansson
Message:

refs #326. Let SVNproperty retrieve info from config file

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Configuration.cc

    r1143 r1144  
    522522
    523523
     524  const std::map<std::string, std::string>*
     525  Configuration::svn_properties(const std::string&) const
     526  {
     527    return NULL;
     528  }
     529
     530
    524531  std::string Configuration::trac_root(void) const
    525532  {
  • trunk/lib/Configuration.h

    r1143 r1144  
    113113     */
    114114    bool output_file(void) const;
     115
     116    /**
     117       svn properties set in config file
     118
     119       This is supposed to be used only in SVNproperty class
     120
     121       \return NULL if there is no prop for \a filename in config
     122     */
     123    const std::map<std::string, std::string>*
     124    svn_properties(const std::string& filename) const;
    115125
    116126    ///
     
    179189    bool output_file_;
    180190    std::string trac_root_;
     191
     192    std::vector<std::map<std::string, std::string> > svn_props_;
    181193  };
    182194
  • trunk/lib/SVNproperty.cc

    r1137 r1144  
    2222
    2323#include "SVNproperty.h"
     24
     25#include "Configuration.h"
    2426#include "SVN.h"
     27#include "utility.h"
    2528
    2629#include <string>
     
    3437  {
    3538    SVN::instance()->client_proplist(path, property_);
    36     std::map<std::string, std::string>::const_iterator i = property_.begin();
    37     std::map<std::string, std::string>::const_iterator e = property_.end();
     39
     40    const Configuration& config = Configuration::instance();
     41    typedef std::map<std::string, std::string> str_map;
     42    const str_map* props = config.svn_properties(file_name(path));
     43    std::map<std::string, std::string>::const_iterator i;
     44    std::map<std::string, std::string>::const_iterator e;
     45    if (props) {
     46      i = props->begin();
     47      e = props->end();
     48      // we can not use map::insert because we want config to have precedence
     49      for ( ; i!=e; ++i)
     50        property_[i->first] = i->second;
     51    }
     52   
     53    i = property_.begin();
     54    e = property_.end();
    3855    for ( ; i!=e ; ++i)
    3956      if (i->first == "svndigest:ignore")
Note: See TracChangeset for help on using the changeset viewer.