Fossil SCM

Modified sorting of timeline entries for the same second to properly split files and file versions from each other, and to have newer revisions later. Further added a storage for error messages to be repeated when the importer exist. First user is the code reporting corrupted archive files detected during a checkout.

aku 2007-09-20 03:51 trunk
Commit a5476aed2741947407eed9ea34a57e1d11889a6c
--- tools/lib/cvs.tcl
+++ tools/lib/cvs.tcl
@@ -6,10 +6,11 @@
66
77
package require Tcl 8.4
88
package require fileutil ; # Tcllib (traverse directory hierarchy)
99
package require vc::rcs::parser ; # Handling the RCS archive files.
1010
package require vc::tools::log ; # User feedback
11
+package require vc::tools::trouble ; # Error handling
1112
package require vc::cvs::cmd ; # Access to cvs application.
1213
package require vc::cvs::ws::files ; # Scan CVS repository for relevant files.
1314
package require vc::cvs::ws::timeline ; # Manage timeline of all changes.
1415
package require vc::cvs::ws::csets ; # Manage the changesets found in the timeline
1516
package require struct::tree
@@ -17,10 +18,12 @@
1718
namespace eval ::vc::cvs::ws {
1819
vc::tools::log::system cvs
1920
namespace import ::vc::tools::log::write
2021
namespace import ::vc::rcs::parser::process
2122
namespace import ::vc::cvs::cmd::dova
23
+
24
+ namespace eval trouble { namespace import ::vc::tools::trouble::* }
2225
}
2326
2427
# -----------------------------------------------------------------------------
2528
# API
2629
@@ -354,11 +357,11 @@
354357
# problem, but otherwise ignore it. As a consequence the
355358
# destination repository will not contain the full history
356359
# of the named file. By ignoring the problem we however
357360
# get as much as is possible.
358361
359
- write 0 cvs "EE Corrupted archive file. Inaccessible revision."
362
+ trouble::add "$f: Corrupted archive file. Inaccessible revision $r."
360363
return
361364
}
362365
return -code error $msg
363366
}
364367
return
365368
--- tools/lib/cvs.tcl
+++ tools/lib/cvs.tcl
@@ -6,10 +6,11 @@
6
7 package require Tcl 8.4
8 package require fileutil ; # Tcllib (traverse directory hierarchy)
9 package require vc::rcs::parser ; # Handling the RCS archive files.
10 package require vc::tools::log ; # User feedback
 
11 package require vc::cvs::cmd ; # Access to cvs application.
12 package require vc::cvs::ws::files ; # Scan CVS repository for relevant files.
13 package require vc::cvs::ws::timeline ; # Manage timeline of all changes.
14 package require vc::cvs::ws::csets ; # Manage the changesets found in the timeline
15 package require struct::tree
@@ -17,10 +18,12 @@
17 namespace eval ::vc::cvs::ws {
18 vc::tools::log::system cvs
19 namespace import ::vc::tools::log::write
20 namespace import ::vc::rcs::parser::process
21 namespace import ::vc::cvs::cmd::dova
 
 
22 }
23
24 # -----------------------------------------------------------------------------
25 # API
26
@@ -354,11 +357,11 @@
354 # problem, but otherwise ignore it. As a consequence the
355 # destination repository will not contain the full history
356 # of the named file. By ignoring the problem we however
357 # get as much as is possible.
358
359 write 0 cvs "EE Corrupted archive file. Inaccessible revision."
360 return
361 }
362 return -code error $msg
363 }
364 return
365
--- tools/lib/cvs.tcl
+++ tools/lib/cvs.tcl
@@ -6,10 +6,11 @@
6
7 package require Tcl 8.4
8 package require fileutil ; # Tcllib (traverse directory hierarchy)
9 package require vc::rcs::parser ; # Handling the RCS archive files.
10 package require vc::tools::log ; # User feedback
11 package require vc::tools::trouble ; # Error handling
12 package require vc::cvs::cmd ; # Access to cvs application.
13 package require vc::cvs::ws::files ; # Scan CVS repository for relevant files.
14 package require vc::cvs::ws::timeline ; # Manage timeline of all changes.
15 package require vc::cvs::ws::csets ; # Manage the changesets found in the timeline
16 package require struct::tree
@@ -17,10 +18,12 @@
18 namespace eval ::vc::cvs::ws {
19 vc::tools::log::system cvs
20 namespace import ::vc::tools::log::write
21 namespace import ::vc::rcs::parser::process
22 namespace import ::vc::cvs::cmd::dova
23
24 namespace eval trouble { namespace import ::vc::tools::trouble::* }
25 }
26
27 # -----------------------------------------------------------------------------
28 # API
29
@@ -354,11 +357,11 @@
357 # problem, but otherwise ignore it. As a consequence the
358 # destination repository will not contain the full history
359 # of the named file. By ignoring the problem we however
360 # get as much as is possible.
361
362 trouble::add "$f: Corrupted archive file. Inaccessible revision $r."
363 return
364 }
365 return -code error $msg
366 }
367 return
368
--- tools/lib/cvs_timeline.tcl
+++ tools/lib/cvs_timeline.tcl
@@ -30,16 +30,18 @@
3030
variable timeline
3131
3232
::foreach date [lsort -dict [array names timeline]] {
3333
# file revision operation author commitmsg
3434
# 0 1 2 3 4/end
35
- # b c a
35
+ # d e b c a
3636
37
- set entries [lsort -index 3 \
38
- [lsort -index 2 \
39
- [lsort -index end \
40
- $timeline($date)]]]
37
+ set entries [lsort -index 1 \
38
+ [lsort -index 0 \
39
+ [lsort -index 3 \
40
+ [lsort -index 2 \
41
+ [lsort -index end \
42
+ $timeline($date)]]]]]
4143
#puts [join $entries \n]
4244
4345
::foreach entry $entries {
4446
lassign $entry file revision operation author cmsg
4547
set code [catch {uplevel 1 $script} res]
4648
--- tools/lib/cvs_timeline.tcl
+++ tools/lib/cvs_timeline.tcl
@@ -30,16 +30,18 @@
30 variable timeline
31
32 ::foreach date [lsort -dict [array names timeline]] {
33 # file revision operation author commitmsg
34 # 0 1 2 3 4/end
35 # b c a
36
37 set entries [lsort -index 3 \
38 [lsort -index 2 \
39 [lsort -index end \
40 $timeline($date)]]]
 
 
41 #puts [join $entries \n]
42
43 ::foreach entry $entries {
44 lassign $entry file revision operation author cmsg
45 set code [catch {uplevel 1 $script} res]
46
--- tools/lib/cvs_timeline.tcl
+++ tools/lib/cvs_timeline.tcl
@@ -30,16 +30,18 @@
30 variable timeline
31
32 ::foreach date [lsort -dict [array names timeline]] {
33 # file revision operation author commitmsg
34 # 0 1 2 3 4/end
35 # d e b c a
36
37 set entries [lsort -index 1 \
38 [lsort -index 0 \
39 [lsort -index 3 \
40 [lsort -index 2 \
41 [lsort -index end \
42 $timeline($date)]]]]]
43 #puts [join $entries \n]
44
45 ::foreach entry $entries {
46 lassign $entry file revision operation author cmsg
47 set code [catch {uplevel 1 $script} res]
48
--- tools/lib/pkgIndex.tcl
+++ tools/lib/pkgIndex.tcl
@@ -9,5 +9,6 @@
99
package ifneeded vc::fossil::ws 1.0 [list source [file join $dir fossil.tcl]]
1010
package ifneeded vc::fossil::import::cvs 1.0 [list source [file join $dir importcvs.tcl]]
1111
package ifneeded vc::fossil::import::stats 1.0 [list source [file join $dir import_statistics.tcl]]
1212
package ifneeded vc::fossil::import::map 1.0 [list source [file join $dir import_map.tcl]]
1313
package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
14
+package ifneeded vc::tools::trouble 1.0 [list source [file join $dir trouble.tcl]]
1415
1516
ADDED tools/lib/trouble.tcl
--- tools/lib/pkgIndex.tcl
+++ tools/lib/pkgIndex.tcl
@@ -9,5 +9,6 @@
9 package ifneeded vc::fossil::ws 1.0 [list source [file join $dir fossil.tcl]]
10 package ifneeded vc::fossil::import::cvs 1.0 [list source [file join $dir importcvs.tcl]]
11 package ifneeded vc::fossil::import::stats 1.0 [list source [file join $dir import_statistics.tcl]]
12 package ifneeded vc::fossil::import::map 1.0 [list source [file join $dir import_map.tcl]]
13 package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
 
14
15 DDED tools/lib/trouble.tcl
--- tools/lib/pkgIndex.tcl
+++ tools/lib/pkgIndex.tcl
@@ -9,5 +9,6 @@
9 package ifneeded vc::fossil::ws 1.0 [list source [file join $dir fossil.tcl]]
10 package ifneeded vc::fossil::import::cvs 1.0 [list source [file join $dir importcvs.tcl]]
11 package ifneeded vc::fossil::import::stats 1.0 [list source [file join $dir import_statistics.tcl]]
12 package ifneeded vc::fossil::import::map 1.0 [list source [file join $dir import_map.tcl]]
13 package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
14 package ifneeded vc::tools::trouble 1.0 [list source [file join $dir trouble.tcl]]
15
16 DDED tools/lib/trouble.tcl
--- a/tools/lib/trouble.tcl
+++ b/tools/lib/trouble.tcl
@@ -0,0 +1,57 @@
1
+# -----------------------------------------------------------------------------
2
+# Tool packages. Error reporting.
3
+
4
+# -----------------------------------------------------------------------------
5
+# Requirements
6
+
7
+package require Tcl 8.4
8
+package require vc::tools::log
9
+
10
+namespace eval ::vc::tools::trouble {
11
+ ::vc::tools::log::system trouble
12
+ namespace import ::vc::tools::log::write
13
+}
14
+
15
+# -----------------------------------------------------------------------------
16
+# API
17
+
18
+# vc::tools::trouble::add message - Report error (shown in general
19
+# log), and remember for re-display at exit.
20
+
21
+# -----------------------------------------------------------------------------
22
+# API Implementation
23
+
24
+proc ::vc::tools::trouble::add {text} {
25
+ variable messages
26
+ lappend messages $text
27
+ write trouble 0 $text
28
+ return
29
+}
30
+
31
+# -----------------------------------------------------------------------------
32
+# Internals. Hook into the application exit, show the remembered messages, then
33
+# pass through the regular command.
34
+
35
+rename ::exit vc::tools::trouble::EXIT
36
+proc ::exit {{status 0}} {
37
+ variable ::vc::tools::trouble::messages
38
+ foreach m $messages {
39
+ write trouble 0 $m
40
+ }
41
+ ::vc::tools::trouble::EXIT $status
42
+ # Not reached.
43
+ return
44
+}
45
+
46
+namespace eval ::vc::tools::trouble {
47
+ # List of the remembered error messages to be shown at exit
48
+ variable messages {}
49
+
50
+ namespace export add
51
+}
52
+
53
+# -----------------------------------------------------------------------------
54
+# Ready
55
+
56
+package provide vc::tools::trouble 1.0
57
+return
--- a/tools/lib/trouble.tcl
+++ b/tools/lib/trouble.tcl
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/lib/trouble.tcl
+++ b/tools/lib/trouble.tcl
@@ -0,0 +1,57 @@
1 # -----------------------------------------------------------------------------
2 # Tool packages. Error reporting.
3
4 # -----------------------------------------------------------------------------
5 # Requirements
6
7 package require Tcl 8.4
8 package require vc::tools::log
9
10 namespace eval ::vc::tools::trouble {
11 ::vc::tools::log::system trouble
12 namespace import ::vc::tools::log::write
13 }
14
15 # -----------------------------------------------------------------------------
16 # API
17
18 # vc::tools::trouble::add message - Report error (shown in general
19 # log), and remember for re-display at exit.
20
21 # -----------------------------------------------------------------------------
22 # API Implementation
23
24 proc ::vc::tools::trouble::add {text} {
25 variable messages
26 lappend messages $text
27 write trouble 0 $text
28 return
29 }
30
31 # -----------------------------------------------------------------------------
32 # Internals. Hook into the application exit, show the remembered messages, then
33 # pass through the regular command.
34
35 rename ::exit vc::tools::trouble::EXIT
36 proc ::exit {{status 0}} {
37 variable ::vc::tools::trouble::messages
38 foreach m $messages {
39 write trouble 0 $m
40 }
41 ::vc::tools::trouble::EXIT $status
42 # Not reached.
43 return
44 }
45
46 namespace eval ::vc::tools::trouble {
47 # List of the remembered error messages to be shown at exit
48 variable messages {}
49
50 namespace export add
51 }
52
53 # -----------------------------------------------------------------------------
54 # Ready
55
56 package provide vc::tools::trouble 1.0
57 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