Differences From:
File
tools/cvs2fossil/lib/c2f_fsym.tcl
part of check-in
[b679ca3356]
- Code cleanup. Removed trailing whitespace across the board.
by
aku on
2007-11-25 07:54:09.
[view]
To:
File
tools/cvs2fossil/lib/c2f_fsym.tcl
part of check-in
[47d52d1efd]
- Added convenience method for assertions and used it in place of the existing if/trouble internal constructions. Changed API of 'log write' so that we can defer substituation of the message to when the write actually happen, and converted all places which would be hit by double-substitution. The remaining 'log write' calls will be converted incrementally.
by
aku on
2007-11-28 05:39:49.
[view]
@@ -19,8 +19,9 @@
package require snit ; # OO system.
package require vc::tools::trouble ; # Error reporting.
package require vc::fossil::import::cvs::file::rev ; # CVS per file revisions.
package require vc::fossil::import::cvs::state ; # State storage.
+package require vc::fossil::import::cvs::integrity ; # State integrity checks.
# # ## ### ##### ######## ############# #####################
##
@@ -34,12 +35,12 @@
set mynr $nr
set mysymbol $symbol
switch -exact -- $mytype {
- branch { SetupBranch }
- tag { }
- default { trouble internal "Bad symbol type '$mytype'" }
+ branch { SetupBranch ; return }
+ tag { return }
}
+ integrity assert 0 {Bad symbol type '$mytype'}
return
}
method defid {} {
@@ -114,9 +115,9 @@
# Branch acessor methods.
method setchildrevnr {revnr} {
- if {$mybranchchildrevnr ne ""} { trouble internal "Child already defined" }
+ integrity assert {$mybranchchildrevnr eq ""} {Child already defined}
set mybranchchildrevnr $revnr
return
}
@@ -285,8 +286,9 @@
namespace export sym
namespace eval sym {
namespace import ::vc::fossil::import::cvs::file::rev
namespace import ::vc::fossil::import::cvs::state
+ namespace import ::vc::fossil::import::cvs::integrity
namespace import ::vc::tools::trouble
}
}