1. Stefan Saasen
  2. git

Commits

Junio C Hamano  committed e8c8063 Merge

Merge with gitk.

This merges commit
466e4fdd6696c89700294e1a54fa73e1fb94643b
from gitk into our head commit
ef0bd2e6e643f09a8294937caf99463328b9215a

Sincerely,
jit-merge command.

  • Participants
  • Parent commits ef0bd2e, 466e4fd
  • Branches master

Comments (0)

Files changed (1)

File gitk

View file
 
 proc getcommits {rargs} {
     global commits commfd phase canv mainfont env
-    global startmsecs nextupdate
+    global startmsecs nextupdate ncmupdate
     global ctext maincursor textcursor leftover
 
     # check that we can find a .git directory somewhere...
     set phase getcommits
     set startmsecs [clock clicks -milliseconds]
     set nextupdate [expr $startmsecs + 100]
+    set ncmupdate 0
     if [catch {
 	set parse_args [concat --default HEAD $rargs]
 	set parsed_args [split [eval exec git-rev-parse $parse_args] "\n"]
     }
     set leftover {}
     fconfigure $commfd -blocking 0 -translation lf
-    fileevent $commfd readable "getcommitlines $commfd"
+    fileevent $commfd readable [list getcommitlines $commfd]
     $canv delete all
     $canv create text 3 3 -anchor nw -text "Reading commits..." \
 	-font $mainfont -tags textitems
     global commits parents cdate children nchildren
     global commitlisted phase commitinfo nextupdate
     global stopped redisplaying leftover
+    global numcommits ncmupdate
 
     set stuff [read $commfd]
     if {$stuff == {}} {
 	set commitlisted($id) 1
 	parsecommit $id $cmit 1
 	drawcommit $id
-	if {[clock clicks -milliseconds] >= $nextupdate} {
+	if {[clock clicks -milliseconds] >= $nextupdate
+	    && $numcommits >= $ncmupdate + 100} {
 	    doupdate
+	    set ncmupdate $numcommits
 	}
 	while {$redisplaying} {
 	    set redisplaying 0
 		foreach id $commits {
 		    drawcommit $id
 		    if {$stopped} break
-		    if {[clock clicks -milliseconds] >= $nextupdate} {
+		    if {[clock clicks -milliseconds] >= $nextupdate
+			&& $numcommits >= $ncmupdate + 100} {
 			doupdate
+			set ncmupdate $numcommits
 		    }
 		}
 	    }
     incr nextupdate 100
     fileevent $commfd readable {}
     update
-    fileevent $commfd readable "getcommitlines $commfd"
+    fileevent $commfd readable [list getcommitlines $commfd]
 }
 
 proc readcommit {id} {
 
 proc drawcommit {id} {
     global phase todo nchildren datemode nextupdate
-    global startcommits
+    global startcommits numcommits ncmupdate
 
     if {$phase != "incrdraw"} {
 	set phase incrdraw
 	    if {![info exists commitlisted($id)]} {
 		break
 	    }
-	    if {[clock clicks -milliseconds] >= $nextupdate} {
+	    if {[clock clicks -milliseconds] >= $nextupdate
+		&& $numcommits >= $ncmupdate} {
 		doupdate
+		set ncmupdate $numcommits
 		if {$stopped} break
 	    }
 	}
 }
 
 proc drawgraph {} {
-    global nextupdate startmsecs startcommits todo
+    global nextupdate startmsecs startcommits todo ncmupdate
 
     if {$startcommits == {}} return
     set startmsecs [clock clicks -milliseconds]
     set nextupdate [expr $startmsecs + 100]
+    set ncmupdate 0
     initgraph
     set todo [lindex $startcommits 0]
     drawrest 0 1
 proc drawrest {level startix} {
     global phase stopped redisplaying selectedline
     global datemode currentparents todo
-    global numcommits
+    global numcommits ncmupdate
     global nextupdate startmsecs startcommits idline
 
     if {$level >= 0} {
 		if {$level < 0} break
 		drawslants $level
 	    }
-	    if {[clock clicks -milliseconds] >= $nextupdate} {
+	    if {[clock clicks -milliseconds] >= $nextupdate
+	        && $numcommits >= $ncmupdate + 100} {
 		update
 		incr nextupdate 100
+		set ncmupdate $numcommits
 	    }
 	}
     }