Check-in [08f8085700]
Not logged in
Overview

SHA1 Hash:08f8085700fef9944101ad38f239acfb7ad3b192
Date: 2007-12-06 03:54:15
User: aku
Comment:Added progress feedback to the file import, and moved the log output to level 8.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified tools/cvs2fossil/lib/c2f_file.tcl from [44f7ae687c] to [5721cadfcc].

@@ -344,14 +344,17 @@
 	fconfigure $ac -translation binary
 
 	# First traverse the expansion graph, this gives us the
 	# revisions in the order we have to expand them, which we do.
 
+	set max [llength [$ex nodes]]
+	set myimport 0
+
 	gtcore datacmd   [mymethod ExpandData]
 	gtcore formatcmd [mymethod ExpandFormat]
 	gtcore sortcmd   [mymethod ExpandSort]
-	gtcore savecmd   [mymethod Expand1 $ac $dir]
+	gtcore savecmd   [mymethod Expand1 $ac $dir $max]
 
 	gtcore traverse $ex ; # The graph is gone after the call
 	close $ac
 
 	# Now traverse the import graph, this builds the instruction
@@ -377,11 +380,13 @@
     method ExpandSort   {graph candidates} {
 	# candidates = list(item), item = list(node revnr)
 	# Sort by node and revnr -> Trunk revisions come first.
 	return [lsort -index 1 -dict [lsort -index 0 -dict $candidates]]
     }
-    method Expand1 {chan dir graph node} {
+    method Expand1 {chan dir max graph node} {
+	log progress 3 file $myimport $max ; incr myimport
+
 	set revnr           [$graph node get $node revnr]
 	set fname          r$revnr
 	struct::list assign [$graph node get $node text] offset length
 
 	if {$length < 0} {
@@ -392,20 +397,20 @@
 	}
 
 	if {![$graph node keyexists $node __base__]} {
 	    # Full text node. Get the data, decode it, and save.
 
-	    log write 2 file {Expanding <$revnr>, full text}
+	    log write 8 file {Expanding <$revnr>, full text}
 
 	    fileutil::writeFile -translation binary $dir/$fname $data
 	} else {
 	    # Delta node. __base__ is the name of the file containing
 	    # the baseline. The patch is at the specified location of
 	    # the archive file.
 
 	    set fbase [$graph node get $node __base__]
-	    log write 2 file {Expanding <$revnr>, is delta of <$fbase>}
+	    log write 8 file {Expanding <$revnr>, is delta of <$fbase>}
 
 	    set base [fileutil::cat -translation binary $dir/$fbase]
 
 	    # Writing the patch to disk is just for better
 	    # debugging. It is not used otherwise.

Modified tools/cvs2fossil/lib/c2f_fossil.tcl from [368156861d] to [ebb0d19e1f].

@@ -58,15 +58,21 @@
 	# add   = list ('A', path)
 	# delta = list ('D', path, src)
 
 	array set id {}
 	$self InWorkspace
+
+	set n   0
+	set max [llength $map]
+
 	foreach insn $map {
+	    log progress 3 fossil $n $max ; incr n
+
 	    struct::list assign $insn cmd pa pb
 	    switch -exact -- $cmd {
 		A {
-		    log write 2 fossil {Importing   <$pa>,}
+		    log write 8 fossil {Importing   <$pa>,}
 
 		    # Result = 'inserted as record :FOO:'
 		    #           0        1  2     3
 		    set res [Do test-content-put $pa]
 		    integrity assert {
@@ -73,11 +79,11 @@
 			[regexp {^inserted as record \d+$} $res]
 		    } {Unable to process unexpected fossil output '$res'}
 		    set id($pa) [lindex $res 3]
 		}
 		D {
-		    log write 2 fossil {Compressing <$pa>, as delta of <$pb>}
+		    log write 8 fossil {Compressing <$pa>, as delta of <$pb>}
 
 		    Do test-content-deltify $id($pa) $id($pb) 1
 		}
 	    }
 	}