Changeset 1108


Ignore:
Timestamp:
Jul 1, 2010, 3:14:23 PM (13 years ago)
Author:
Peter Johansson
Message:

refs #458. If we lack read permission for rev, no date is retrived and
we use the date of the previous rev. This should be OK in the case
when call the log for the entire repository, but might be problematic
when calling logs of sub-nodes. Added an assertion to check that we
don't use the workaround when calling log for a sub-node.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.7-stable/lib/SVNlog.cc

    r847 r1108  
    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
     
    9292  {
    9393    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);
     94    std::string d;
     95    if (date && date[0])
     96      d = date;
     97    else if (!lb->commits.empty()) {
     98      // FIXME: this is a bit hackish to fix the problem reported in
     99      // ticket #458. If we lack read permission for rev, no date is
     100      // retrived and we use the date of the previous rev. That should
     101      // be OK if we call the super-root and previous rev truly is
     102      // rev-1 (super-root contains all revs). That should be the
     103      // typical case where this happens. If this would happen when
     104      // calling the log of a sub-node (e.g. the trunk) this could be
     105      // problematic because log is more or less sparse and when
     106      // merging two sparse logs together this workaround could have
     107      // strange effects such as rev+1 having a earlier date than
     108      // rev. To ensure that we only allow this workaround when
     109      // calling super-root, let's do the following check:
     110      assert(rev == lb->commits.rbegin()->rev()+1);
     111      d = lb->commits.rbegin()->date();
     112    }
     113    else {
     114      std::stringstream msg;
     115      msg << "No date defined for revision: " << rev;
     116      throw SVNException(msg.str());
     117    }
    96118    std::string a;
    97119    if (author && author[0])
Note: See TracChangeset for help on using the changeset viewer.