2a01d50430 2007-11-11 aku: ## -*- tcl -*- 2a01d50430 2007-11-11 aku: # # ## ### ##### ######## ############# ##################### 2a01d50430 2007-11-11 aku: ## Copyright (c) 2007 Andreas Kupries. 2a01d50430 2007-11-11 aku: # 2a01d50430 2007-11-11 aku: # This software is licensed as described in the file LICENSE, which 2a01d50430 2007-11-11 aku: # you should have received as part of this distribution. 2a01d50430 2007-11-11 aku: # 2a01d50430 2007-11-11 aku: # This software consists of voluntary contributions made by many 2a01d50430 2007-11-11 aku: # individuals. For exact contribution history, see the revision 2a01d50430 2007-11-11 aku: # history and logs, available at http://fossil-scm.hwaci.com/fossil 2a01d50430 2007-11-11 aku: # # ## ### ##### ######## ############# ##################### 2a01d50430 2007-11-11 aku: 00bf8c198e 2007-12-02 aku: ## Pass VII. This pass goes over the set of revision based changesets 2a01d50430 2007-11-11 aku: ## and breaks all dependency cycles they may be in. We need a 00bf8c198e 2007-12-02 aku: ## dependency tree. Identical to pass IX, except for the selection of 770a9b576a 2007-11-16 aku: ## the changesets. 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: # # ## ### ##### ######## ############# ##################### 2a01d50430 2007-11-11 aku: ## Requirements 2a01d50430 2007-11-11 aku: 94c39d6375 2007-11-14 aku: package require Tcl 8.4 ; # Required runtime. 94c39d6375 2007-11-14 aku: package require snit ; # OO system. 94c39d6375 2007-11-14 aku: package require struct::list ; # Higher order list operations. 94c39d6375 2007-11-14 aku: package require vc::tools::log ; # User feedback. 96b7bfb834 2007-11-16 aku: package require vc::fossil::import::cvs::repository ; # Repository management. 770a9b576a 2007-11-16 aku: package require vc::fossil::import::cvs::cyclebreaker ; # Breaking dependency cycles. 94c39d6375 2007-11-14 aku: package require vc::fossil::import::cvs::state ; # State storage. bf83201c7f 2007-11-27 aku: package require vc::fossil::import::cvs::integrity ; # State integrity checks. 770a9b576a 2007-11-16 aku: package require vc::fossil::import::cvs::project::rev ; # Project level changesets 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: # # ## ### ##### ######## ############# ##################### 2a01d50430 2007-11-11 aku: ## Register the pass with the management 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: vc::fossil::import::cvs::pass define \ 2a01d50430 2007-11-11 aku: BreakRevCsetCycles \ 2a01d50430 2007-11-11 aku: {Break Revision ChangeSet Dependency Cycles} \ 2a01d50430 2007-11-11 aku: ::vc::fossil::import::cvs::pass::breakrcycle 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: # # ## ### ##### ######## ############# ##################### 2a01d50430 2007-11-11 aku: ## 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: snit::type ::vc::fossil::import::cvs::pass::breakrcycle { 2a01d50430 2007-11-11 aku: # # ## ### ##### ######## ############# 2a01d50430 2007-11-11 aku: ## Public API 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: typemethod setup {} { 2a01d50430 2007-11-11 aku: # Define the names and structure of the persistent state of 2a01d50430 2007-11-11 aku: # this pass. 85bd219d0b 2007-11-13 aku: ce7fb48e8c 2007-11-16 aku: state reading revision ce7fb48e8c 2007-11-16 aku: state reading changeset 80b1e8936f 2007-11-29 aku: state reading csitem 2a01d50430 2007-11-11 aku: return 2a01d50430 2007-11-11 aku: } 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: typemethod load {} { 2a01d50430 2007-11-11 aku: # Pass manager interface. Executed to load data computed by 2a01d50430 2007-11-11 aku: # this pass into memory when this pass is skipped instead of 2a01d50430 2007-11-11 aku: # executed. 2a01d50430 2007-11-11 aku: return 2a01d50430 2007-11-11 aku: } 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: typemethod run {} { 2a01d50430 2007-11-11 aku: # Pass manager interface. Executed to perform the 2a01d50430 2007-11-11 aku: # functionality of the pass. 85bd219d0b 2007-11-13 aku: 2cf0462b82 2007-11-21 aku: cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break} 85bd219d0b 2007-11-13 aku: 85bd219d0b 2007-11-13 aku: state transaction { 2a0ec504c5 2007-11-21 aku: cyclebreaker run break-rev [myproc Changesets] 85bd219d0b 2007-11-13 aku: } 85bd219d0b 2007-11-13 aku: 96b7bfb834 2007-11-16 aku: repository printcsetstatistics 8c6488ded2 2007-11-27 aku: integrity changesets 2a01d50430 2007-11-11 aku: return 2a01d50430 2007-11-11 aku: } 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: typemethod discard {} { 2a01d50430 2007-11-11 aku: # Pass manager interface. Executed for all passes after the 2a01d50430 2007-11-11 aku: # run passes, to remove all data of this pass from the state, 2a01d50430 2007-11-11 aku: # as being out of date. 2a01d50430 2007-11-11 aku: return 2a01d50430 2007-11-11 aku: } 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: # # ## ### ##### ######## ############# 2a01d50430 2007-11-11 aku: ## Internal methods 2a01d50430 2007-11-11 aku: d58423cdc4 2007-11-21 aku: proc Changesets {} { 00bf8c198e 2007-12-02 aku: log write 2 breakrcycle {Selecting the revision changesets} 00bf8c198e 2007-12-02 aku: return [project::rev rev] 770a9b576a 2007-11-16 aku: } 85bd219d0b 2007-11-13 aku: 2a01d50430 2007-11-11 aku: # # ## ### ##### ######## ############# 2a01d50430 2007-11-11 aku: ## Configuration 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: pragma -hasinstances no ; # singleton 2a01d50430 2007-11-11 aku: pragma -hastypeinfo no ; # no introspection 2a01d50430 2007-11-11 aku: pragma -hastypedestroy no ; # immortal 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: # # ## ### ##### ######## ############# 2a01d50430 2007-11-11 aku: } 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: namespace eval ::vc::fossil::import::cvs::pass { 85bd219d0b 2007-11-13 aku: namespace export breakrcycle 85bd219d0b 2007-11-13 aku: namespace eval breakrcycle { 770a9b576a 2007-11-16 aku: namespace import ::vc::fossil::import::cvs::cyclebreaker 96b7bfb834 2007-11-16 aku: namespace import ::vc::fossil::import::cvs::repository 85bd219d0b 2007-11-13 aku: namespace import ::vc::fossil::import::cvs::state bf83201c7f 2007-11-27 aku: namespace import ::vc::fossil::import::cvs::integrity 85bd219d0b 2007-11-13 aku: namespace eval project { 85bd219d0b 2007-11-13 aku: namespace import ::vc::fossil::import::cvs::project::rev 85bd219d0b 2007-11-13 aku: } 2a01d50430 2007-11-11 aku: namespace import ::vc::tools::log 94c39d6375 2007-11-14 aku: log register breakrcycle 2a01d50430 2007-11-11 aku: } 2a01d50430 2007-11-11 aku: } 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: # # ## ### ##### ######## ############# ##################### 2a01d50430 2007-11-11 aku: ## Ready 2a01d50430 2007-11-11 aku: 2a01d50430 2007-11-11 aku: package provide vc::fossil::import::cvs::pass::breakrcycle 1.0 2a01d50430 2007-11-11 aku: return