Fossil SCM

Continuing namespace changes, fossil backend.

aku 2007-09-13 06:03 trunk
Commit 45cd12f05a0441b98bb91292c60ee8731aee0358
--- tools/lib/fossil.tcl
+++ tools/lib/fossil.tcl
@@ -5,21 +5,21 @@
55
# Requirements
66
77
package require Tcl 8.4
88
package require vc::tools::log ; # User feedback
99
10
-namespace eval ::fossil {
10
+namespace eval ::vc::fossil::ws {
1111
vc::tools::log::system fossil
1212
namespace import ::vc::tools::log::write
1313
}
1414
1515
# -----------------------------------------------------------------------------
1616
# API
1717
1818
# Define repository file, and connect to workspace in CWD.
1919
20
-proc ::fossil::new {} {
20
+proc ::vc::fossil::ws::new {} {
2121
variable fr [file normalize [fileutil::tempfile import2_fsl_rp_]]
2222
variable fossil
2323
2424
# pwd = workspace
2525
exec $fossil new $fr ; # create and
@@ -30,17 +30,17 @@
3030
return $fr
3131
}
3232
3333
# Move generated fossil repository to final destination
3434
35
-proc ::fossil::destination {path} {
35
+proc ::vc::fossil::ws::destination {path} {
3636
variable fr
3737
file rename $fr $path
3838
return
3939
}
4040
41
-namespace eval ::fossil {
41
+namespace eval ::vc::fossil::ws {
4242
# Repository file
4343
variable fr {}
4444
4545
# Fossil application
4646
variable fossil [auto_execok fossil]
@@ -49,19 +49,19 @@
4949
# exact command used). And the file the data goes to.
5050
variable debugcommit 0
5151
variable dcfile {}
5252
}
5353
54
-proc ::fossil::debugcommit {flag} {
54
+proc ::vc::fossil::ws::debugcommit {flag} {
5555
variable debugcommit $flag
5656
if {$debugcommit} {
5757
variable dcfile [file normalize cvs2fossil_commit.tcl]
5858
}
5959
return
6060
}
6161
62
-proc ::fossil::commit {break appname nosign meta ignore} {
62
+proc ::vc::fossil::ws::commit {break appname nosign meta ignore} {
6363
variable fossil
6464
variable lastuuid
6565
variable debugcommit
6666
variable dcfile
6767
@@ -148,14 +148,14 @@
148148
}
149149
150150
# -----------------------------------------------------------------------------
151151
# Internal helper commands
152152
153
-proc ::fossil::IGNORE {ignore path} {
153
+proc ::vc::fossil::ws::IGNORE {ignore path} {
154154
return [uplevel #0 [linsert $ignore end $path]]
155155
}
156156
157157
# -----------------------------------------------------------------------------
158158
# Ready
159159
160
-package provide fossil 1.0
160
+package provide vc::fossil::ws 1.0
161161
return
162162
--- tools/lib/fossil.tcl
+++ tools/lib/fossil.tcl
@@ -5,21 +5,21 @@
5 # Requirements
6
7 package require Tcl 8.4
8 package require vc::tools::log ; # User feedback
9
10 namespace eval ::fossil {
11 vc::tools::log::system fossil
12 namespace import ::vc::tools::log::write
13 }
14
15 # -----------------------------------------------------------------------------
16 # API
17
18 # Define repository file, and connect to workspace in CWD.
19
20 proc ::fossil::new {} {
21 variable fr [file normalize [fileutil::tempfile import2_fsl_rp_]]
22 variable fossil
23
24 # pwd = workspace
25 exec $fossil new $fr ; # create and
@@ -30,17 +30,17 @@
30 return $fr
31 }
32
33 # Move generated fossil repository to final destination
34
35 proc ::fossil::destination {path} {
36 variable fr
37 file rename $fr $path
38 return
39 }
40
41 namespace eval ::fossil {
42 # Repository file
43 variable fr {}
44
45 # Fossil application
46 variable fossil [auto_execok fossil]
@@ -49,19 +49,19 @@
49 # exact command used). And the file the data goes to.
50 variable debugcommit 0
51 variable dcfile {}
52 }
53
54 proc ::fossil::debugcommit {flag} {
55 variable debugcommit $flag
56 if {$debugcommit} {
57 variable dcfile [file normalize cvs2fossil_commit.tcl]
58 }
59 return
60 }
61
62 proc ::fossil::commit {break appname nosign meta ignore} {
63 variable fossil
64 variable lastuuid
65 variable debugcommit
66 variable dcfile
67
@@ -148,14 +148,14 @@
148 }
149
150 # -----------------------------------------------------------------------------
151 # Internal helper commands
152
153 proc ::fossil::IGNORE {ignore path} {
154 return [uplevel #0 [linsert $ignore end $path]]
155 }
156
157 # -----------------------------------------------------------------------------
158 # Ready
159
160 package provide fossil 1.0
161 return
162
--- tools/lib/fossil.tcl
+++ tools/lib/fossil.tcl
@@ -5,21 +5,21 @@
5 # Requirements
6
7 package require Tcl 8.4
8 package require vc::tools::log ; # User feedback
9
10 namespace eval ::vc::fossil::ws {
11 vc::tools::log::system fossil
12 namespace import ::vc::tools::log::write
13 }
14
15 # -----------------------------------------------------------------------------
16 # API
17
18 # Define repository file, and connect to workspace in CWD.
19
20 proc ::vc::fossil::ws::new {} {
21 variable fr [file normalize [fileutil::tempfile import2_fsl_rp_]]
22 variable fossil
23
24 # pwd = workspace
25 exec $fossil new $fr ; # create and
@@ -30,17 +30,17 @@
30 return $fr
31 }
32
33 # Move generated fossil repository to final destination
34
35 proc ::vc::fossil::ws::destination {path} {
36 variable fr
37 file rename $fr $path
38 return
39 }
40
41 namespace eval ::vc::fossil::ws {
42 # Repository file
43 variable fr {}
44
45 # Fossil application
46 variable fossil [auto_execok fossil]
@@ -49,19 +49,19 @@
49 # exact command used). And the file the data goes to.
50 variable debugcommit 0
51 variable dcfile {}
52 }
53
54 proc ::vc::fossil::ws::debugcommit {flag} {
55 variable debugcommit $flag
56 if {$debugcommit} {
57 variable dcfile [file normalize cvs2fossil_commit.tcl]
58 }
59 return
60 }
61
62 proc ::vc::fossil::ws::commit {break appname nosign meta ignore} {
63 variable fossil
64 variable lastuuid
65 variable debugcommit
66 variable dcfile
67
@@ -148,14 +148,14 @@
148 }
149
150 # -----------------------------------------------------------------------------
151 # Internal helper commands
152
153 proc ::vc::fossil::ws::IGNORE {ignore path} {
154 return [uplevel #0 [linsert $ignore end $path]]
155 }
156
157 # -----------------------------------------------------------------------------
158 # Ready
159
160 package provide vc::fossil::ws 1.0
161 return
162
--- tools/lib/importcvs.tcl
+++ tools/lib/importcvs.tcl
@@ -4,11 +4,11 @@
44
# -----------------------------------------------------------------------------
55
# Requirements
66
77
package require Tcl 8.4
88
package require cvs ; # Frontend, reading from source repository
9
-package require fossil ; # Backend, writing to destination repository.
9
+package require vc::fossil::ws ; # Backend, writing to destination repository.
1010
package require vc::tools::log ; # User feedback
1111
1212
namespace eval ::vc::fossil::import::cvs {
1313
vc::tools::log::system import
1414
namespace import ::vc::tools::log::write
@@ -39,11 +39,11 @@
3939
switch -exact -- $key {
4040
-debugcommit {
4141
if {![string is boolean -strict $value]} {
4242
return -code error "Expected boolean, got \"$value\""
4343
}
44
- fossil::debugcommit $value
44
+ vc::fossil::ws::debugcommit $value
4545
}
4646
-nosign {
4747
if {![string is boolean -strict $value]} {
4848
return -code error "Expected boolean, got \"$value\""
4949
}
@@ -76,12 +76,12 @@
7676
set nto 0
7777
7878
write 0 import {Begin conversion}
7979
write 0 import {Setting up workspaces}
8080
81
- cvs::workspace ; # cd's to workspace
82
- fossil::new ; # Uses cwd as workspace to connect to.
81
+ cvs::workspace ; # cd's to workspace
82
+ vc::fossil::ws::new ; # Uses cwd as workspace to connect to.
8383
8484
set ntrunk [cvs::ntrunk] ; set ntfmt %[string length $ntrunk]s
8585
set nmax [cvs::ncsets] ; set nmfmt %[string length $nmax]s
8686
8787
cvs::foreach_cset cset [cvs::root] {
@@ -94,11 +94,11 @@
9494
write 0 import "Within [format %.2f $tot] seconds (avg [format %.2f [expr {$tot/$nto}]] seconds/changeset)"
9595
9696
if {$stopat == $cset} return
9797
9898
cvs::wsclear
99
- fossil::destination $dst
99
+ vc::fossil::ws::destination $dst
100100
write 0 import Ok.
101101
return
102102
}
103103
104104
# -----------------------------------------------------------------------------
@@ -127,19 +127,19 @@
127127
proc ::vc::fossil::import::cvs::OneChangeSet {cset} {
128128
variable nosign
129129
variable stopat
130130
131131
if {$stopat == $cset} {
132
- fossil::commit 1 cvs2fossil $nosign \
132
+ vc::fossil::ws::commit 1 cvs2fossil $nosign \
133133
[cvs::wssetup $cset] ::cvs::wsignore
134134
write 0 import Stopped.
135135
return -code break
136136
}
137137
138138
set usec [lindex [time {
139139
foreach {uuid ad rm ch} \
140
- [fossil::commit 0 cvs2fossil $nosign \
140
+ [vc::fossil::ws::commit 0 cvs2fossil $nosign \
141141
[cvs::wssetup $cset] ::cvs::wsignore] \
142142
break
143143
} 1] 0]
144144
cvs::uuid $cset $uuid
145145
146146
--- tools/lib/importcvs.tcl
+++ tools/lib/importcvs.tcl
@@ -4,11 +4,11 @@
4 # -----------------------------------------------------------------------------
5 # Requirements
6
7 package require Tcl 8.4
8 package require cvs ; # Frontend, reading from source repository
9 package require fossil ; # Backend, writing to destination repository.
10 package require vc::tools::log ; # User feedback
11
12 namespace eval ::vc::fossil::import::cvs {
13 vc::tools::log::system import
14 namespace import ::vc::tools::log::write
@@ -39,11 +39,11 @@
39 switch -exact -- $key {
40 -debugcommit {
41 if {![string is boolean -strict $value]} {
42 return -code error "Expected boolean, got \"$value\""
43 }
44 fossil::debugcommit $value
45 }
46 -nosign {
47 if {![string is boolean -strict $value]} {
48 return -code error "Expected boolean, got \"$value\""
49 }
@@ -76,12 +76,12 @@
76 set nto 0
77
78 write 0 import {Begin conversion}
79 write 0 import {Setting up workspaces}
80
81 cvs::workspace ; # cd's to workspace
82 fossil::new ; # Uses cwd as workspace to connect to.
83
84 set ntrunk [cvs::ntrunk] ; set ntfmt %[string length $ntrunk]s
85 set nmax [cvs::ncsets] ; set nmfmt %[string length $nmax]s
86
87 cvs::foreach_cset cset [cvs::root] {
@@ -94,11 +94,11 @@
94 write 0 import "Within [format %.2f $tot] seconds (avg [format %.2f [expr {$tot/$nto}]] seconds/changeset)"
95
96 if {$stopat == $cset} return
97
98 cvs::wsclear
99 fossil::destination $dst
100 write 0 import Ok.
101 return
102 }
103
104 # -----------------------------------------------------------------------------
@@ -127,19 +127,19 @@
127 proc ::vc::fossil::import::cvs::OneChangeSet {cset} {
128 variable nosign
129 variable stopat
130
131 if {$stopat == $cset} {
132 fossil::commit 1 cvs2fossil $nosign \
133 [cvs::wssetup $cset] ::cvs::wsignore
134 write 0 import Stopped.
135 return -code break
136 }
137
138 set usec [lindex [time {
139 foreach {uuid ad rm ch} \
140 [fossil::commit 0 cvs2fossil $nosign \
141 [cvs::wssetup $cset] ::cvs::wsignore] \
142 break
143 } 1] 0]
144 cvs::uuid $cset $uuid
145
146
--- tools/lib/importcvs.tcl
+++ tools/lib/importcvs.tcl
@@ -4,11 +4,11 @@
4 # -----------------------------------------------------------------------------
5 # Requirements
6
7 package require Tcl 8.4
8 package require cvs ; # Frontend, reading from source repository
9 package require vc::fossil::ws ; # Backend, writing to destination repository.
10 package require vc::tools::log ; # User feedback
11
12 namespace eval ::vc::fossil::import::cvs {
13 vc::tools::log::system import
14 namespace import ::vc::tools::log::write
@@ -39,11 +39,11 @@
39 switch -exact -- $key {
40 -debugcommit {
41 if {![string is boolean -strict $value]} {
42 return -code error "Expected boolean, got \"$value\""
43 }
44 vc::fossil::ws::debugcommit $value
45 }
46 -nosign {
47 if {![string is boolean -strict $value]} {
48 return -code error "Expected boolean, got \"$value\""
49 }
@@ -76,12 +76,12 @@
76 set nto 0
77
78 write 0 import {Begin conversion}
79 write 0 import {Setting up workspaces}
80
81 cvs::workspace ; # cd's to workspace
82 vc::fossil::ws::new ; # Uses cwd as workspace to connect to.
83
84 set ntrunk [cvs::ntrunk] ; set ntfmt %[string length $ntrunk]s
85 set nmax [cvs::ncsets] ; set nmfmt %[string length $nmax]s
86
87 cvs::foreach_cset cset [cvs::root] {
@@ -94,11 +94,11 @@
94 write 0 import "Within [format %.2f $tot] seconds (avg [format %.2f [expr {$tot/$nto}]] seconds/changeset)"
95
96 if {$stopat == $cset} return
97
98 cvs::wsclear
99 vc::fossil::ws::destination $dst
100 write 0 import Ok.
101 return
102 }
103
104 # -----------------------------------------------------------------------------
@@ -127,19 +127,19 @@
127 proc ::vc::fossil::import::cvs::OneChangeSet {cset} {
128 variable nosign
129 variable stopat
130
131 if {$stopat == $cset} {
132 vc::fossil::ws::commit 1 cvs2fossil $nosign \
133 [cvs::wssetup $cset] ::cvs::wsignore
134 write 0 import Stopped.
135 return -code break
136 }
137
138 set usec [lindex [time {
139 foreach {uuid ad rm ch} \
140 [vc::fossil::ws::commit 0 cvs2fossil $nosign \
141 [cvs::wssetup $cset] ::cvs::wsignore] \
142 break
143 } 1] 0]
144 cvs::uuid $cset $uuid
145
146
--- tools/lib/pkgIndex.tcl
+++ tools/lib/pkgIndex.tcl
@@ -1,6 +1,6 @@
11
if {![package vsatisfies [package require Tcl] 8.4]} return
22
package ifneeded rcsparser 1.0 [list source [file join $dir rcsparser.tcl]]
33
package ifneeded cvs 1.0 [list source [file join $dir cvs.tcl]]
4
-package ifneeded fossil 1.0 [list source [file join $dir fossil.tcl]]
4
+package ifneeded vc::fossil::ws 1.0 [list source [file join $dir fossil.tcl]]
55
package ifneeded vc::fossil::import::cvs 1.0 [list source [file join $dir importcvs.tcl]]
66
package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
77
--- tools/lib/pkgIndex.tcl
+++ tools/lib/pkgIndex.tcl
@@ -1,6 +1,6 @@
1 if {![package vsatisfies [package require Tcl] 8.4]} return
2 package ifneeded rcsparser 1.0 [list source [file join $dir rcsparser.tcl]]
3 package ifneeded cvs 1.0 [list source [file join $dir cvs.tcl]]
4 package ifneeded fossil 1.0 [list source [file join $dir fossil.tcl]]
5 package ifneeded vc::fossil::import::cvs 1.0 [list source [file join $dir importcvs.tcl]]
6 package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
7
--- tools/lib/pkgIndex.tcl
+++ tools/lib/pkgIndex.tcl
@@ -1,6 +1,6 @@
1 if {![package vsatisfies [package require Tcl] 8.4]} return
2 package ifneeded rcsparser 1.0 [list source [file join $dir rcsparser.tcl]]
3 package ifneeded cvs 1.0 [list source [file join $dir cvs.tcl]]
4 package ifneeded vc::fossil::ws 1.0 [list source [file join $dir fossil.tcl]]
5 package ifneeded vc::fossil::import::cvs 1.0 [list source [file join $dir importcvs.tcl]]
6 package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
7

Keyboard Shortcuts

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