- Timestamp:
- May 8, 2007, 9:44:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Trac.cc
r295 r296 127 127 if (milestone(first, str.end())) 128 128 continue; 129 if (source(first, str.end())) 130 continue; 129 131 hs_ << *first; 130 132 ++first; … … 188 190 for (std::string::const_iterator i(first); i!=last && *i!=' '; ++i) 189 191 if (isalnum(*i)) 190 first = i ;192 first = i+1; 191 193 192 194 std::string milestone(milestone_begin, first); … … 199 201 hs_.stream() << anchor(conf.trac_root()+"milestone/"+milestone, 200 202 std::string(first_orig, first)); 203 return true; 204 } 205 206 207 bool Trac::source(std::string::const_iterator& first, 208 const std::string::const_iterator& last) 209 { 210 if (first==last) 211 return false; 212 213 const std::string::const_iterator first_orig(first); 214 215 if (match(first, last, Str("source:")).empty()){ 216 first = first_orig; 217 return false; 218 } 219 220 std::string node; 221 std::string rev; 222 std::string line; 223 const std::string::const_iterator node_begin(first); 224 225 node = match(first, last, not2Char('@', ' ')); 226 if (!node.empty() && node[0]=='/') 227 node = node.substr(1, node.size()-1); 228 229 if (*first == '@'){ 230 ++first; 231 rev = match(first, last, Digit()); 232 if (*first == '#') { 233 ++first; 234 line = match(first, last, notChar(' ')); 235 } 236 } 237 238 const Configuration& conf = Configuration::instance(); 239 std::string href(conf.trac_root()+node); 240 if (!rev.empty()) { 241 href += "@"+rev; 242 if (!line.empty()) 243 href += "#"+line; 244 } 245 hs_.stream() << anchor(href, std::string(first_orig, first)); 201 246 return true; 202 247 }
Note: See TracChangeset
for help on using the changeset viewer.