Changeset 1115 for trunk/lib/SVNlog.cc


Ignore:
Timestamp:
Jul 3, 2010, 10:13:59 PM (11 years ago)
Author:
Peter Johansson
Message:

Merging patch release 0.7.5 to the trunk. Delta 0.7.5 - 0.7.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/SVNlog.cc

    r978 r1115  
    33/*
    44  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    5   Copyright (C) 2009 Peter Johansson
     5  Copyright (C) 2009, 2010 Peter Johansson
    66
    77  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    2828#include <algorithm>
    2929#include <cassert>
     30#include <iostream>
    3031#include <stdexcept>
    3132#include <sstream>
     
    9293  {
    9394    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    }
    96120    std::string a;
    97121    if (author && author[0])
     
    100124    if (msg)
    101125      message = msg;
    102     lb->commits.insert(lb->commits.end(), Commitment(a, date, message, rev));
     126    lb->commits.insert(lb->commits.end(), Commitment(a, d, message, rev));
    103127    return SVN_NO_ERROR;
    104128  }
Note: See TracChangeset for help on using the changeset viewer.