# File lib/puppet/transaction.rb, line 527
527:     def rollback
528:         @targets.clear
529:         @triggered.clear
530:         allevents = @changes.reverse.collect { |change|
531:             # skip changes that were never actually run
532:             unless change.changed
533:                 Puppet.debug "%s was not changed" % change.to_s
534:                 next
535:             end
536:             begin
537:                 events = change.backward
538:             rescue => detail
539:                 Puppet.err("%s rollback failed: %s" % [change,detail])
540:                 if Puppet[:trace]
541:                     puts detail.backtrace
542:                 end
543:                 next
544:                 # at this point, we would normally do error handling
545:                 # but i haven't decided what to do for that yet
546:                 # so just record that a sync failed for a given resource
547:                 #@@failures[change.property.parent] += 1
548:                 # this still could get hairy; what if file contents changed,
549:                 # but a chmod failed?  how would i handle that error? dern
550:             end
551: 
552:             # FIXME This won't work right now.
553:             relationship_graph.matching_edges(events).each do |edge|
554:                 @targets[edge.target] << edge
555:             end
556: 
557:             # Now check to see if there are any events for this child.
558:             # Kind of hackish, since going backwards goes a change at a
559:             # time, not a child at a time.
560:             trigger(change.property.resource)
561: 
562:             # And return the events for collection
563:             events
564:         }.flatten.reject { |e| e.nil? }
565:     end