Ignore:
Timestamp:
May 8, 2007, 2:48:07 PM (14 years ago)
Author:
Peter Johansson
Message:

fixed trac link problem. fixes #178 and refs #180. Also changed format of config file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Configuration.cc

    r274 r289  
    7979        getline(ss, tmp);
    8080        std::string value = trim(tmp);
    81         if (key=="trac-ticket")
    82           trac_ticket_=value;
    83         if (key=="trac-revision")
    84           trac_revision_=value;
    85        
     81        if (key=="trac-ticket"){
     82          std::cerr << "svndigest: warning: config variable trac-ticket "
     83                    << "is deprecated. Use trac-root instead.\n";
     84          trac_root_ = value.substr(0,value.size()-7);
     85        }
     86        if (key=="trac-revision"){
     87          std::cerr << "svndigest: warning: config variable trac-revision "
     88                    << "is deprecated. Use trac-root instead.\n";
     89          trac_root_ = value.substr(0,value.size()-10);
     90        }
     91        if (key=="trac-root")
     92          trac_root_=value;
    8693      }
    8794    }
     
    8996
    9097
    91   Configuration* Configuration::instance(void)
     98  Configuration& Configuration::instance(void)
    9299  {
    93100    if (!instance_)
    94101      instance_ = new Configuration;
    95     return instance_;
     102    return *instance_;
    96103  }
    97104
     
    100107  {
    101108    copyright_alias_.clear();
    102     trac_ticket_ = "";
    103     trac_revision_ = "";
     109    trac_root_ = "";
     110  }
     111
     112
     113  std::string Configuration::trac_root(void) const
     114  {
     115    return trac_root_;
    104116  }
    105117
     
    124136       << "### Section for setting trac environment\n"
    125137       << "[trac]\n"
    126        << "# If trac-ticket is set, svndigest will create anchors for\n"
    127        << "# ticket to the Trac page.\n"
    128        << "trac-ticket = " << conf.trac_ticket() << "\n";
    129     os << "# If trac-revision is set, svndigest will create anchors for\n"
    130        << "# revisions to the Trac page.\n"
    131        << "trac-revision = " << conf.trac_revision() << "\n";
     138       << "# If trac-root is set, svndigest will create anchors to "
     139       << "the Trac page.\n"
     140       << "# trac-root = http://lev.thep.lu.se/trac/svndigest/\n";
     141    if (!conf.trac_root().empty())
     142      os << "trac-root = " << conf.trac_root() << "\n";
    132143
    133144    return os;
Note: See TracChangeset for help on using the changeset viewer.