# # patch "revision.cc" # from [278be7ae9f1e835cf402808d651e5a1d1a49d72f] # to [5da47400b94576212afb4a0471753dc9f9d756db] # ======================================================================== --- revision.cc 278be7ae9f1e835cf402808d651e5a1d1a49d72f +++ revision.cc 5da47400b94576212afb4a0471753dc9f9d756db @@ -735,6 +735,8 @@ // this function actually toposorts the whole graph, and then filters by the // passed in set. if anyone ever needs to toposort the whole graph, then, // this function would be a good thing to generalize... +// +// if @revisions is empty, no filtering is performed void toposort(std::set const & revisions, std::vector & sorted, @@ -762,7 +764,7 @@ // now stick them in our ordering (if wanted) and remove them from the // graph, calculating the new roots as we go L(F("new root: %s\n") % (roots.front())); - if (revisions.find(roots.front()) != revisions.end()) + if (revisions.empty() || revisions.find(roots.front()) != revisions.end()) sorted.push_back(roots.front()); for(gi i = graph.lower_bound(roots.front()); i != graph.upper_bound(roots.front()); i++) @@ -777,7 +779,7 @@ i != leaves.end(); ++i) { L(F("new leaf: %s\n") % (*i)); - if (revisions.find(*i) != revisions.end()) + if (revisions.empty() || revisions.find(*i) != revisions.end()) sorted.push_back(*i); } }