Fossil SCM

fossil-scm / tools / cvs2fossil / lib / c2f_pbreakscycle.tcl
Source Blame History 126 lines
258366a… aku 1 ## -*- tcl -*-
258366a… aku 2 # # ## ### ##### ######## ############# #####################
258366a… aku 3 ## Copyright (c) 2007 Andreas Kupries.
258366a… aku 4 #
258366a… aku 5 # This software is licensed as described in the file LICENSE, which
258366a… aku 6 # you should have received as part of this distribution.
258366a… aku 7 #
258366a… aku 8 # This software consists of voluntary contributions made by many
258366a… aku 9 # individuals. For exact contribution history, see the revision
258366a… aku 10 # history and logs, available at http://fossil-scm.hwaci.com/fossil
258366a… aku 11 # # ## ### ##### ######## ############# #####################
258366a… aku 12
00bf8c1… aku 13 ## Pass IX. This pass goes over the set of symbol based changesets and
00bf8c1… aku 14 ## breaks all dependency cycles they may be in. We need a dependency
00bf8c1… aku 15 ## tree. Identical to pass VII, except for the selection of the
00bf8c1… aku 16 ## changesets.
258366a… aku 17
258366a… aku 18 # # ## ### ##### ######## ############# #####################
258366a… aku 19 ## Requirements
258366a… aku 20
258366a… aku 21 package require Tcl 8.4 ; # Required runtime.
258366a… aku 22 package require snit ; # OO system.
770a9b5… aku 23 package require struct::list ; # Higher order list operations.
00bf8c1… aku 24 package require vc::tools::log ; # User feedback.
770a9b5… aku 25 package require vc::fossil::import::cvs::cyclebreaker ; # Breaking dependency cycles.
96b7bfb… aku 26 package require vc::fossil::import::cvs::repository ; # Repository management.
258366a… aku 27 package require vc::fossil::import::cvs::state ; # State storage.
bf83201… aku 28 package require vc::fossil::import::cvs::integrity ; # State integrity checks.
770a9b5… aku 29 package require vc::fossil::import::cvs::project::rev ; # Project level changesets
258366a… aku 30
258366a… aku 31 # # ## ### ##### ######## ############# #####################
258366a… aku 32 ## Register the pass with the management
258366a… aku 33
258366a… aku 34 vc::fossil::import::cvs::pass define \
258366a… aku 35 BreakSymCsetCycles \
258366a… aku 36 {Break Symbol ChangeSet Dependency Cycles} \
258366a… aku 37 ::vc::fossil::import::cvs::pass::breakscycle
258366a… aku 38
258366a… aku 39 # # ## ### ##### ######## ############# #####################
b679ca3… aku 40 ##
258366a… aku 41
258366a… aku 42 snit::type ::vc::fossil::import::cvs::pass::breakscycle {
258366a… aku 43 # # ## ### ##### ######## #############
258366a… aku 44 ## Public API
258366a… aku 45
258366a… aku 46 typemethod setup {} {
258366a… aku 47 # Define the names and structure of the persistent state of
258366a… aku 48 # this pass.
ce7fb48… aku 49
e288af3… aku 50 state use revision
e288af3… aku 51 state use tag
e288af3… aku 52 state use branch
e288af3… aku 53 state use symbol
e288af3… aku 54 state use changeset
e288af3… aku 55 state use csitem
e288af3… aku 56 state use cssuccessor
258366a… aku 57 return
258366a… aku 58 }
258366a… aku 59
258366a… aku 60 typemethod load {} {
258366a… aku 61 # Pass manager interface. Executed to load data computed by
258366a… aku 62 # this pass into memory when this pass is skipped instead of
258366a… aku 63 # executed.
258366a… aku 64 return
258366a… aku 65 }
258366a… aku 66
258366a… aku 67 typemethod run {} {
258366a… aku 68 # Pass manager interface. Executed to perform the
258366a… aku 69 # functionality of the pass.
770a9b5… aku 70
2cf0462… aku 71 cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
7f15be9… aku 72
770a9b5… aku 73 state transaction {
2a0ec50… aku 74 cyclebreaker run break-sym [myproc Changesets]
770a9b5… aku 75 }
8c6488d… aku 76
8c6488d… aku 77 repository printcsetstatistics
00bf8c1… aku 78 integrity changesets
258366a… aku 79 return
258366a… aku 80 }
258366a… aku 81
258366a… aku 82 typemethod discard {} {
258366a… aku 83 # Pass manager interface. Executed for all passes after the
258366a… aku 84 # run passes, to remove all data of this pass from the state,
258366a… aku 85 # as being out of date.
258366a… aku 86 return
258366a… aku 87 }
258366a… aku 88
258366a… aku 89 # # ## ### ##### ######## #############
258366a… aku 90 ## Internal methods
770a9b5… aku 91
2cf0462… aku 92 proc Changesets {} {
00bf8c1… aku 93 log write 2 breakscycle {Selecting the symbol changesets}
00bf8c1… aku 94 return [project::rev sym]
2cf0462… aku 95 }
258366a… aku 96
258366a… aku 97 # # ## ### ##### ######## #############
258366a… aku 98 ## Configuration
258366a… aku 99
258366a… aku 100 pragma -hasinstances no ; # singleton
258366a… aku 101 pragma -hastypeinfo no ; # no introspection
258366a… aku 102 pragma -hastypedestroy no ; # immortal
258366a… aku 103
258366a… aku 104 # # ## ### ##### ######## #############
258366a… aku 105 }
258366a… aku 106
258366a… aku 107 namespace eval ::vc::fossil::import::cvs::pass {
258366a… aku 108 namespace export breakscycle
258366a… aku 109 namespace eval breakscycle {
770a9b5… aku 110 namespace import ::vc::fossil::import::cvs::cyclebreaker
96b7bfb… aku 111 namespace import ::vc::fossil::import::cvs::repository
258366a… aku 112 namespace import ::vc::fossil::import::cvs::state
bf83201… aku 113 namespace import ::vc::fossil::import::cvs::integrity
770a9b5… aku 114 namespace eval project {
770a9b5… aku 115 namespace import ::vc::fossil::import::cvs::project::rev
770a9b5… aku 116 }
00bf8c1… aku 117 namespace import ::vc::tools::log
00bf8c1… aku 118 log register breakscycle
258366a… aku 119 }
258366a… aku 120 }
258366a… aku 121
258366a… aku 122 # # ## ### ##### ######## ############# #####################
258366a… aku 123 ## Ready
258366a… aku 124
258366a… aku 125 package provide vc::fossil::import::cvs::pass::breakscycle 1.0
258366a… aku 126 return

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button