Changeset 1115 for trunk/lib/SVNlog.cc
- Timestamp:
- Jul 3, 2010, 10:13:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/SVNlog.cc
r978 r1115 3 3 /* 4 4 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 5 Copyright (C) 2009 Peter Johansson5 Copyright (C) 2009, 2010 Peter Johansson 6 6 7 7 This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 28 28 #include <algorithm> 29 29 #include <cassert> 30 #include <iostream> 30 31 #include <stdexcept> 31 32 #include <sstream> … … 92 93 { 93 94 struct log_receiver_baton *lb=static_cast<struct log_receiver_baton*>(baton); 94 if (!date || !date[0]) 95 throw SVNException("No date defined for revision: " + rev); 95 std::string d; 96 if (date && date[0]) 97 d = date; 98 else if (!lb->commits.empty()) { 99 // FIXME: this is a bit hackish to fix the problem reported in 100 // ticket #458. If we lack read permission for rev, no date is 101 // retrived and we use the date of the previous rev. That should 102 // be OK if we call the super-root and previous rev truly is 103 // rev-1 (super-root contains all revs). That should be the 104 // typical case where this happens. If this would happen when 105 // calling the log of a sub-node (e.g. the trunk) this could be 106 // problematic because log is more or less sparse and when 107 // merging two sparse logs together this workaround could have 108 // strange effects such as rev+1 having a earlier date than 109 // rev. To ensure that we only allow this workaround when 110 // calling super-root, we have the assert below: 111 std::cerr << "no date defined for revision: " << rev << "\n"; 112 assert(rev == lb->commits.rbegin()->revision()+1); 113 d = lb->commits.rbegin()->date(); 114 } 115 else { 116 std::stringstream msg; 117 msg << "No date defined for revision: " << rev; 118 throw SVNException(msg.str()); 119 } 96 120 std::string a; 97 121 if (author && author[0]) … … 100 124 if (msg) 101 125 message = msg; 102 lb->commits.insert(lb->commits.end(), Commitment(a, d ate, message, rev));126 lb->commits.insert(lb->commits.end(), Commitment(a, d, message, rev)); 103 127 return SVN_NO_ERROR; 104 128 }
Note: See TracChangeset
for help on using the changeset viewer.