Changeset 309
- Timestamp:
- May 12, 2007, 3:26:38 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Trac.cc
r308 r309 96 96 return false; 97 97 const std::string::const_iterator first_orig(first); 98 if (match(first, last, Str("changeset:")).empty()){98 if (match(first, last, std::string("changeset:")).empty()){ 99 99 first = first_orig; 100 100 return false; … … 118 118 119 119 const std::string::const_iterator first_orig(first); 120 if (match(first, last, Str("comment:ticket:")).empty()){120 if (match(first, last, std::string("comment:ticket:")).empty()){ 121 121 first = first_orig; 122 122 return false; … … 153 153 const std::string::const_iterator& last) 154 154 { 155 if (diff3(first, last)) 156 return true; 155 157 if (diff1(first, last)) 156 return true;157 if (diff3(first, last))158 158 return true; 159 159 if (diff2(first, last)) … … 170 170 171 171 const std::string::const_iterator first_orig(first); 172 if (match(first, last, Str("diff:")).empty()){172 if (match(first, last, std::string("diff:")).empty()){ 173 173 first = first_orig; 174 174 return false; … … 198 198 href = std::string(Configuration::instance().trac_root()+ 199 199 "changeset?new="+new_rev+"&new_path="+node+"&old="+ 200 old_rev+"&old path="+node);200 old_rev+"&old_path="+node); 201 201 hs_.stream() << anchor(href, std::string(first_orig, first)); 202 202 return true; … … 211 211 212 212 const std::string::const_iterator first_orig(first); 213 if (match(first, last, Str("diff:")).empty()){213 if (match(first, last, std::string("diff:")).empty()){ 214 214 first = first_orig; 215 215 return false; … … 241 241 242 242 const std::string::const_iterator first_orig(first); 243 if (match(first, last, Str("diff:")).empty()){243 if (match(first, last, std::string("diff:")).empty()){ 244 244 first = first_orig; 245 245 return false; … … 252 252 ++first; 253 253 std::string old_rev(match(first, last, AlNum())); 254 if (!match_begin(first, first+1, std::string("//"))) { 255 first = first_orig; 256 return false; 257 } 258 first+2; 254 if (match(first, last, std::string("//")).empty()) { 255 first = first_orig; 256 return false; 257 } 259 258 std::string new_path = match(first, last, not2Char('@', ' ')); 260 259 if (*first!='@'){ … … 341 340 return false; 342 341 } 342 ++first; // eating ']' 343 343 std::string href(Configuration::instance().trac_root()+"log/?rev="+ 344 344 rev+"&stop_rev="+stop_rev); … … 396 396 const std::string::const_iterator first_orig(first); 397 397 398 if (match(first, last, Str("milestone:")).empty()){398 if (match(first, last, std::string("milestone:")).empty()){ 399 399 first = first_orig; 400 400 return false; … … 427 427 if (log(first, str.end())) 428 428 continue; 429 if (comment(first, str.end())) 430 continue; 429 431 if (ticket(first, str.end())) 430 continue;431 if (comment(first, str.end()))432 432 continue; 433 433 if (changeset(first, str.end())) … … 453 453 const std::string::const_iterator first_orig(first); 454 454 455 if (match(first, last, Str("source:")).empty()){455 if (match(first, last, std::string("source:")).empty()){ 456 456 first = first_orig; 457 457 return false; … … 531 531 const std::string::const_iterator first_orig(first); 532 532 533 if (match(first, last, Str("ticket:")).empty()){ 534 first = first_orig; 535 return false; 536 } 537 533 if (match(first, last, std::string("ticket:")).empty()){ 534 first = first_orig; 535 return false; 536 } 538 537 std::string ticket = match(first, last, Digit()); 539 538 540 539 const Configuration& conf = Configuration::instance(); 541 hs_.stream() << anchor(conf.trac_root()+"ticket/"+ticket,"#"+ticket); 540 hs_.stream() << anchor(conf.trac_root()+"ticket/"+ticket, 541 std::string(first_orig, first)); 542 542 return true; 543 543 } -
trunk/lib/Trac.h
r308 r309 119 119 120 120 /// 121 /// \brief search for diff:trunk@12 +:123121 /// \brief search for diff:trunk@12:123 122 122 /// 123 123 /// Search in range [\a first, \a last) for expression … … 136 136 137 137 /// 138 /// @brief search for diff:tags/1.0 or diff:tags/1.0// 1.0.1138 /// @brief search for diff:tags/1.0 or diff:tags/1.0//tags/1.0.1 139 139 /// 140 140 /// Search in range [\a first, \a last) for expression … … 162 162 /// 163 163 /// The created anchor goes to 164 /// trac-root/changeset?new=236&new_path=trunk&old= 236&old_path=tags/1.0164 /// trac-root/changeset?new=236&new_path=trunk&old=123&old_path=tags/1.0 165 165 /// 166 166 /// @return true if expression is found -
trunk/lib/html_utility.cc
r289 r309 46 46 for (size_t i=0; i<level; ++i) 47 47 ss << "../"; 48 hs << href;48 ss << href; 49 49 ss << "\">"; 50 50 hs << name; -
trunk/lib/utility.cc
r303 r309 174 174 175 175 176 std::string match(std::string::const_iterator& first, 177 const std::string::const_iterator& last, 178 std::string str) 179 { 180 if (match_begin(first, last, str)){ 181 first+=str.size(); 182 return str; 183 } 184 return std::string(); 185 } 186 176 187 notChar::notChar(char c) 177 188 : char_(c) … … 183 194 {} 184 195 185 186 Str::Str(std::string s)187 : str_(s)188 {}189 190 196 191 197 not2Str::not2Str(std::string s1, std::string s2) -
trunk/lib/utility.h
r308 r309 150 150 } 151 151 152 153 std::string match(std::string::const_iterator& first, 154 const std::string::const_iterator& last, 155 std::string); 156 152 157 struct AlNum 153 158 { … … 183 188 const char char1_; 184 189 const char char2_; 185 };186 187 class Str188 {189 public:190 Str(std::string);191 inline bool operator()(std::string::const_iterator i) const192 { return (std::equal(str_.begin(), str_.end(), i)); }193 194 private:195 const std::string str_;196 190 }; 197 191 -
trunk/test/Makefile.am
r267 r309 4 4 5 5 # Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson 6 # Copyright (C) 2007 Peter Johansson 6 7 # 7 8 # This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest … … 22 23 # 02111-1307, USA. 23 24 24 check_PROGRAMS = gnuplot_pipe parser 25 check_PROGRAMS = gnuplot_pipe parser trac 25 26 26 27 TESTS = $(check_PROGRAMS) … … 36 37 gnuplot_pipe_SOURCES = gnuplot_pipe.cc 37 38 parser_SOURCES = parser.cc 39 trac_SOURCES = trac.cc 38 40 39 41 test_repo.sh: test_repo.sh.in Makefile.am
Note: See TracChangeset
for help on using the changeset viewer.