Re: [PATCH] gitk: add Update menu item.
- From
- Sven Verdoolaege <skimo@kotnet.org>
- Date
- Sep 20, 2005, 14:56 UTC
- Message-ID
- <20050920145658.GA13292MdfPADPa@greensroom.kotnet.org>
- In-Reply-To
- <20050920122423.GA4228MdfPADPa@greensroom.kotnet.org>
On Tue, Sep 20, 2005 at 02:24:23PM +0200, Sven Verdoolaege wrote:
> Update will redraw the commits if any commits have been added to any > of the selected heads. The new commits appear on the top. >
It appears I sent this patch to soon. With the additional patch below, it seems to work, that is, it survives a rebase.
I can send a replacement patch combining the two patches if anyone is interested.
skimo
diff --git a/gitk b/gitk --- a/gitk +++ b/gitk @@ -68,6 +68,7 @@ proc getcommitlines {commfd} { global oldcommits commits parents cdate children global commitlisted phase commitinfo nextupdate global stopped redisplaying leftover + global canv set stuff [read $commfd] if {$stuff == {}} { @@ -126,6 +127,7 @@ to allow selection of commits to be disp set olds [lrange $ids 1 end] set cmit [string range $cmit [expr {$j + 1}] end] if {$phase == "updatecommits"} { + $canv delete all set oldcommits $commits set commits {} set phase getcommits @@ -133,7 +135,7 @@ to allow selection of commits to be disp lappend commits $id set commitlisted($id) 1 parsecommit $id $cmit 1 [lrange $ids 1 end] - drawcommit $id + drawcommit $id 1 if {[clock clicks -milliseconds] >= $nextupdate} { doupdate 1 } @@ -143,7 +145,7 @@ to allow selection of commits to be disp set stopped 0 set phase "getcommits" foreach id $commits { - drawcommit $id + drawcommit $id 1 if {$stopped} break if {[clock clicks -milliseconds] >= $nextupdate} { doupdate 1 @@ -1449,7 +1451,7 @@ proc decidenext {{noread 0}} { return $level } -proc drawcommit {id} { +proc drawcommit {id reading} { global phase todo nchildren datemode nextupdate global numcommits ncmupdate displayorder todo onscreen @@ -1478,7 +1480,7 @@ proc drawcommit {id} { break } } - drawmore 1 + drawmore $reading } proc finishcommits {} { @@ -1487,7 +1489,7 @@ proc finishcommits {} { if {$phase == "incrdraw"} { foreach id $oldcommits { - drawcommit $id + drawcommit $id 0 } set oldcommits {} drawrest @@ -3636,7 +3638,7 @@ proc rereadrefs {} { } proc updatecommits {rargs} { - global phase + global commfd phase global startmsecs nextupdate ncmupdate global idtags idheads idotherrefs global leftover