Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_patopsort.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_patopsort.tcl part of check-in [1c39e57637] - Updated to extended changeset string, and added tabular formatting. Further tweaked output, putting timestamp adjust messages on the same line as the changeset itself. by aku on 2007-11-27 09:04:46. [view]

@@ -72,8 +72,13 @@
     typemethod run {} {
 	# Pass manager interface. Executed to perform the
 	# functionality of the pass.
 
+	set len [string length [project::rev num]]
+	set myatfmt %${len}s
+	incr len 12
+	set mycsfmt %${len}s
+
 	cyclebreaker savecmd  [myproc SaveTimestamps]
 
 	state transaction {
 	    LoadSymbolChangesets
@@ -106,20 +111,24 @@
     proc SaveTimestamps {graph at cset} {
 	set cid [$cset id]
 
 	set date [GetTime [lindex [$graph node get $cset timerange] 1] \
-		      [struct::set contain $mysymchangesets $cset]]
-
-	log write 4 atopsort "Changeset @ $at: [$cset str]"
+		      [struct::set contain $mysymchangesets $cset] \
+		     message]
+
+	log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]]$message"
+
 	state run {
 	    INSERT INTO cstimestamp (cid,  pos, date)
 	    VALUES                  ($cid, $at, $date)
 	}
 	return
     }
 
-    proc GetTime {stamp expectchange} {
+    proc GetTime {stamp expectchange mv} {
 	::variable mylasttimestamp
+	upvar 1 $mv message
+	set message ""
 	if {$stamp > $mymaxtimestamp} {
 	    # A timestamp in the future is believed to be bogus and
 	    # shifted backwars in time to prevent it from forcing
 	    # other timestamps to be pushed even further in the
@@ -134,20 +143,23 @@
 	    # earlier timestamps depend on this one.
 
 	    incr mylasttimestamp
 	    if {!$expectchange} {
-		log write 4 atopsort "Timestamp [clock format $stamp] is in the future; shifted back to [clock format $mylasttimestamp]"
+		set message " Timestamp [clock format $stamp] is in the future; shifted back to [clock format $mylasttimestamp] ([expr {$mylasttimestamp - $stamp}])"
 	    }
 	} elseif {$stamp < ($mylasttimestamp)+1} {
 	    incr mylasttimestamp
 	    if {!$expectchange} {
-		log write 4 atopsort "Timestamp [clock format $stamp] adjusted to [clock format $mylasttimestamp]"
+		set message " Timestamp [clock format $stamp] adjusted to [clock format $mylasttimestamp] (+[expr {$mylasttimestamp - $stamp}])"
 	    }
 	} else {
 	    set mylasttimestamp $stamp
 	}
 	return $mylasttimestamp
     }
+
+    typevariable myatfmt ; # Format for log output to gain better alignment of the various columns.
+    typevariable mycsfmt ; # Ditto for the changesets.
 
     typevariable mysymchangesets {} ; # Set of the symbol changesets.
     typevariable mylasttimestamp 0  ; # Last delivered timestamp.
     typevariable mymaxtimestamp