Fossil SCM

Added helper class managing access to fossil repositories. Already has a basic method to import and delta-compress a series of files. Used 'test' commands of fossil to get the necessary low-level access.

aku 2007-12-05 07:52 trunk
Commit b6bf21e2a81ce241a94584d9fca9accf5d97276b
--- a/tools/cvs2fossil/lib/c2f_fossil.tcl
+++ b/tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -0,0 +1,136 @@
1
+## -*- tcl -*-
2
+# # ## ### ##### ######## ############# #####################
3
+## Copyright (c) 2007
4
+## Copyright (c) 2007-2008 Andreas Kupries.
5
+#
6
+# This software is licensed as described in the file LICENSE, which
7
+# you should have received as part of this distribution.
8
+#
9
+# This software consists of voluntary contributions made by many
10
+# individuals. For exact contribution history, see the revision
11
+# history and logs, available at http://fossil-scm.hwaci.com/fossil
12
+# # ## ### ##### ######## ############# #####################
13
+
14
+## Fossil, a helper class managing the access to fossil repositories.
15
+
16
+# # ## ### ##### ######## ############# #####################
17
+## Requirements
18
+
19
+package require Tcl 8.4 ; # Required runtime.
20
+package require fileutil ; # Temp.dir/file
21
+package require snit ; # OO system.
22
+package require vc::tools::trouble ; # Error reporting.
23
+package require vc::tools::log ; # User feedback
24
+package require vc::fossil::import::cvs::integrity ; # State integrity checks.
25
+
26
+# #ax [llength $map]
27
+
28
+ foreach insn $map {
29
+ log progress 3 fossil $n $max ; incr n
30
+
31
+ struct::list assign $insn cmd pa pb
32
+ switch -exact -- $cmd {
33
+ A {
34
+ log write 8 fossil {Importing <$pa>,}
35
+
36
+ # Result = 'inserted as record :FOO:'
37
+ # 0 1 st-content-put $pa]
38
+ integrit$myrepositoryilable at http://fo ; Do open $myrepositoryuuid [eval $cmd]
39
+$map]
40
+
41
+ foreach insn $== $uuid}il $n $max ; incr n
42
+
43
+ struct## -*- tcl -*-
44
+# # ## ### ##### ######## ############# #####################
45
+## Copyright (c) 2007
46
+## Copyright (c) 2007-2008 Andreas Kupries.
47
+#
48
+# This software is licensed as described in the file LICENSE, which
49
+# you should have received as part of this distribution.
50
+#
51
+# This software consists of voluntary contributions made by many
52
+# individuals. For exact contribution history, see the revision
53
+# history and lo
54
+package checks.
55
+
56
+# #ax [llength $3 fossil $n $max ; incr n
57
+
58
+ struct::list assign $insn cmd pa pb
59
+ switch -exact 2 pa pb
60
+ switch -exact -- $cmd {
61
+ A {
62
+ log write 8 fossil {Importing <$pa>,}
63
+
64
+ # Result = 'inserted as record :FOO:'
65
+ # 0 1 st-content-put $pa]
66
+ integrit$myrepositoryilable at http://fo ; Do open $myrepositoryuuid [eval $cmd]
67
+$map]
68
+
69
+ foreach insn $== $uuid}il $n $max ; incr n
70
+
71
+ struct## -*- tcl 2e require snit ; # OO system.
72
+package require vc::tools::trouble ; # Error reporting.
73
+package require vc::tools::log ; # User feedback
74
+package require vc::fossil::import::cvs::integrity ; # State integrity checks.
75
+
76
+# #ax [llength $map]
77
+
78
+ foreach insn $map {
79
+ log progress 3 fossil $n $max ; incr n
80
+
81
+ struct::list assign $insn cmd pa pb
82
+ switch -exact -- $cmd {
83
+ A {
84
+ log write 8 fossil {Importing <$pa>,}
85
+
86
+ # Result = 'inserted as record :FOO:'
87
+ # 0 1 st-content-put $pa]
88
+ integrit$myrepositoryilable at http://fo ; Do open $myrepositoryuuid [eval $cmd]
89
+$map]
90
+
91
+ foreach insn $== $uuid}il $n $max ; incr n
92
+
93
+ struct## -*- tcl -*-
94
+# # ## ### ##### ######## ############# #####################
95
+## Copyright (c) 2007
96
+## Copyright (c) 2007-2008 Andreas Kupries.
97
+#
98
+# This software is licensed as described in the file LICENSE, which
99
+# you should have received as part of this distribution.
100
+#
101
+# This software consists of voluntary contributions made by many
102
+# individuals. For exact contribution history, see the revision
103
+# history and lo
104
+package require vc::fossil::import::cvs::integrity ; # State integrity checks.
105
+
106
+# #ax [llength $map]
107
+
108
+ foreach insn $map {
109
+ log progress 3 fossil $n $max ; incr n
110
+
111
+ struct::list assign $insn cmd pa pb
112
+ switch -exact -- $cmd {
113
+ A {
114
+ log write 8 fossil {Importing <$pa>,}
115
+
116
+ # Result = 'inserted as record :FOO:'
117
+ # 0 1 st-content-put $pa]
118
+ integrit$myrepositoryilable at http://fo ; Do open $myrepositoryuuid [eval $cmd]
119
+$map]
120
+
121
+ foreach insn $== $uuid}il $n $max ; incr n
122
+
123
+ struct## -*- tcl -*-
124
+# # ## ### ##### ######## ############# #####################
125
+## Copyright (c) 2007
126
+## Copyright (c) 2007-2008 Andreas Kupries.
127
+#
128
+# This software is licensed as described in the file LICENSE, which
129
+# you should have received as part of this distribution.
130
+#
131
+# This software consists of voluntary contributions made by many
132
+# individuals. For exact contribution history, see the revision
133
+# history and logs, available at http://fossil-scm.hwaci.com/fossil
134
+# # ## ### ##### ######## ############# #####################
135
+
136
+## Fossil, a helper class managing the access
--- a/tools/cvs2fossil/lib/c2f_fossil.tcl
+++ b/tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/cvs2fossil/lib/c2f_fossil.tcl
+++ b/tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -0,0 +1,136 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007
4 ## Copyright (c) 2007-2008 Andreas Kupries.
5 #
6 # This software is licensed as described in the file LICENSE, which
7 # you should have received as part of this distribution.
8 #
9 # This software consists of voluntary contributions made by many
10 # individuals. For exact contribution history, see the revision
11 # history and logs, available at http://fossil-scm.hwaci.com/fossil
12 # # ## ### ##### ######## ############# #####################
13
14 ## Fossil, a helper class managing the access to fossil repositories.
15
16 # # ## ### ##### ######## ############# #####################
17 ## Requirements
18
19 package require Tcl 8.4 ; # Required runtime.
20 package require fileutil ; # Temp.dir/file
21 package require snit ; # OO system.
22 package require vc::tools::trouble ; # Error reporting.
23 package require vc::tools::log ; # User feedback
24 package require vc::fossil::import::cvs::integrity ; # State integrity checks.
25
26 # #ax [llength $map]
27
28 foreach insn $map {
29 log progress 3 fossil $n $max ; incr n
30
31 struct::list assign $insn cmd pa pb
32 switch -exact -- $cmd {
33 A {
34 log write 8 fossil {Importing <$pa>,}
35
36 # Result = 'inserted as record :FOO:'
37 # 0 1 st-content-put $pa]
38 integrit$myrepositoryilable at http://fo ; Do open $myrepositoryuuid [eval $cmd]
39 $map]
40
41 foreach insn $== $uuid}il $n $max ; incr n
42
43 struct## -*- tcl -*-
44 # # ## ### ##### ######## ############# #####################
45 ## Copyright (c) 2007
46 ## Copyright (c) 2007-2008 Andreas Kupries.
47 #
48 # This software is licensed as described in the file LICENSE, which
49 # you should have received as part of this distribution.
50 #
51 # This software consists of voluntary contributions made by many
52 # individuals. For exact contribution history, see the revision
53 # history and lo
54 package checks.
55
56 # #ax [llength $3 fossil $n $max ; incr n
57
58 struct::list assign $insn cmd pa pb
59 switch -exact 2 pa pb
60 switch -exact -- $cmd {
61 A {
62 log write 8 fossil {Importing <$pa>,}
63
64 # Result = 'inserted as record :FOO:'
65 # 0 1 st-content-put $pa]
66 integrit$myrepositoryilable at http://fo ; Do open $myrepositoryuuid [eval $cmd]
67 $map]
68
69 foreach insn $== $uuid}il $n $max ; incr n
70
71 struct## -*- tcl 2e require snit ; # OO system.
72 package require vc::tools::trouble ; # Error reporting.
73 package require vc::tools::log ; # User feedback
74 package require vc::fossil::import::cvs::integrity ; # State integrity checks.
75
76 # #ax [llength $map]
77
78 foreach insn $map {
79 log progress 3 fossil $n $max ; incr n
80
81 struct::list assign $insn cmd pa pb
82 switch -exact -- $cmd {
83 A {
84 log write 8 fossil {Importing <$pa>,}
85
86 # Result = 'inserted as record :FOO:'
87 # 0 1 st-content-put $pa]
88 integrit$myrepositoryilable at http://fo ; Do open $myrepositoryuuid [eval $cmd]
89 $map]
90
91 foreach insn $== $uuid}il $n $max ; incr n
92
93 struct## -*- tcl -*-
94 # # ## ### ##### ######## ############# #####################
95 ## Copyright (c) 2007
96 ## Copyright (c) 2007-2008 Andreas Kupries.
97 #
98 # This software is licensed as described in the file LICENSE, which
99 # you should have received as part of this distribution.
100 #
101 # This software consists of voluntary contributions made by many
102 # individuals. For exact contribution history, see the revision
103 # history and lo
104 package require vc::fossil::import::cvs::integrity ; # State integrity checks.
105
106 # #ax [llength $map]
107
108 foreach insn $map {
109 log progress 3 fossil $n $max ; incr n
110
111 struct::list assign $insn cmd pa pb
112 switch -exact -- $cmd {
113 A {
114 log write 8 fossil {Importing <$pa>,}
115
116 # Result = 'inserted as record :FOO:'
117 # 0 1 st-content-put $pa]
118 integrit$myrepositoryilable at http://fo ; Do open $myrepositoryuuid [eval $cmd]
119 $map]
120
121 foreach insn $== $uuid}il $n $max ; incr n
122
123 struct## -*- tcl -*-
124 # # ## ### ##### ######## ############# #####################
125 ## Copyright (c) 2007
126 ## Copyright (c) 2007-2008 Andreas Kupries.
127 #
128 # This software is licensed as described in the file LICENSE, which
129 # you should have received as part of this distribution.
130 #
131 # This software consists of voluntary contributions made by many
132 # individuals. For exact contribution history, see the revision
133 # history and logs, available at http://fossil-scm.hwaci.com/fossil
134 # # ## ### ##### ######## ############# #####################
135
136 ## Fossil, a helper class managing the access
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -7,10 +7,11 @@
77
package ifneeded vc::fossil::import::cvs::file 1.0 [list source [file join $dir c2f_file.tcl]]
88
package ifneeded vc::fossil::import::cvs::file::lodmgr 1.0 [list source [file join $dir c2f_flodmgr.tcl]]
99
package ifneeded vc::fossil::import::cvs::file::rev 1.0 [list source [file join $dir c2f_frev.tcl]]
1010
package ifneeded vc::fossil::import::cvs::file::sym 1.0 [list source [file join $dir c2f_fsym.tcl]]
1111
package ifneeded vc::fossil::import::cvs::file::trunk 1.0 [list source [file join $dir c2f_ftrunk.tcl]]
12
+package ifneeded vc::fossil::import::cvs::fossil 1.0 [list source [file join $dir c2f_fossil.tcl]]
1213
package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]]
1314
package ifneeded vc::fossil::import::cvs::integrity 1.0 [list source [file join $dir c2f_integrity.tcl]]
1415
package ifneeded vc::fossil::import::cvs::pass 1.0 [list source [file join $dir c2f_pass.tcl]]
1516
package ifneeded vc::fossil::import::cvs::pass::collar 1.0 [list source [file join $dir c2f_pcollar.tcl]]
1617
package ifneeded vc::fossil::import::cvs::pass::collrev 1.0 [list source [file join $dir c2f_pcollrev.tcl]]
1718
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -7,10 +7,11 @@
7 package ifneeded vc::fossil::import::cvs::file 1.0 [list source [file join $dir c2f_file.tcl]]
8 package ifneeded vc::fossil::import::cvs::file::lodmgr 1.0 [list source [file join $dir c2f_flodmgr.tcl]]
9 package ifneeded vc::fossil::import::cvs::file::rev 1.0 [list source [file join $dir c2f_frev.tcl]]
10 package ifneeded vc::fossil::import::cvs::file::sym 1.0 [list source [file join $dir c2f_fsym.tcl]]
11 package ifneeded vc::fossil::import::cvs::file::trunk 1.0 [list source [file join $dir c2f_ftrunk.tcl]]
 
12 package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]]
13 package ifneeded vc::fossil::import::cvs::integrity 1.0 [list source [file join $dir c2f_integrity.tcl]]
14 package ifneeded vc::fossil::import::cvs::pass 1.0 [list source [file join $dir c2f_pass.tcl]]
15 package ifneeded vc::fossil::import::cvs::pass::collar 1.0 [list source [file join $dir c2f_pcollar.tcl]]
16 package ifneeded vc::fossil::import::cvs::pass::collrev 1.0 [list source [file join $dir c2f_pcollrev.tcl]]
17
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -7,10 +7,11 @@
7 package ifneeded vc::fossil::import::cvs::file 1.0 [list source [file join $dir c2f_file.tcl]]
8 package ifneeded vc::fossil::import::cvs::file::lodmgr 1.0 [list source [file join $dir c2f_flodmgr.tcl]]
9 package ifneeded vc::fossil::import::cvs::file::rev 1.0 [list source [file join $dir c2f_frev.tcl]]
10 package ifneeded vc::fossil::import::cvs::file::sym 1.0 [list source [file join $dir c2f_fsym.tcl]]
11 package ifneeded vc::fossil::import::cvs::file::trunk 1.0 [list source [file join $dir c2f_ftrunk.tcl]]
12 package ifneeded vc::fossil::import::cvs::fossil 1.0 [list source [file join $dir c2f_fossil.tcl]]
13 package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]]
14 package ifneeded vc::fossil::import::cvs::integrity 1.0 [list source [file join $dir c2f_integrity.tcl]]
15 package ifneeded vc::fossil::import::cvs::pass 1.0 [list source [file join $dir c2f_pass.tcl]]
16 package ifneeded vc::fossil::import::cvs::pass::collar 1.0 [list source [file join $dir c2f_pcollar.tcl]]
17 package ifneeded vc::fossil::import::cvs::pass::collrev 1.0 [list source [file join $dir c2f_pcollrev.tcl]]
18

Keyboard Shortcuts

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