comparison contrib/hgk @ 7776:34ff1a1b5dd7

hgk: select first changeset at startup (issue1382)
author Martin Geisler <mg@daimi.au.dk>
date Mon, 16 Feb 2009 01:41:01 +0100
parents 5f7512f680cb
children 60cefb8b3c85
comparison
equal deleted inserted replaced
7775:5280c39778b6 7776:34ff1a1b5dd7
263 parsecommit $id $contents 0 {} 263 parsecommit $id $contents 0 {}
264 } 264 }
265 265
266 proc parsecommit {id contents listed olds} { 266 proc parsecommit {id contents listed olds} {
267 global commitinfo children nchildren parents nparents cdate ncleft 267 global commitinfo children nchildren parents nparents cdate ncleft
268 global firstparents
268 269
269 set inhdr 1 270 set inhdr 1
270 set comment {} 271 set comment {}
271 set headline {} 272 set headline {}
272 set auname {} 273 set auname {}
336 set cdate($id) $comdate 337 set cdate($id) $comdate
337 set comdate [clock format $comdate -format "%Y-%m-%d %H:%M:%S"] 338 set comdate [clock format $comdate -format "%Y-%m-%d %H:%M:%S"]
338 } 339 }
339 set commitinfo($id) [list $headline $auname $audate \ 340 set commitinfo($id) [list $headline $auname $audate \
340 $comname $comdate $comment $rev $branch] 341 $comname $comdate $comment $rev $branch]
342
343 if {[info exists firstparents]} {
344 set i [lsearch $firstparents $id]
345 if {$i != -1} {
346 # remove the parent from firstparents, possible building
347 # an empty list
348 set firstparents [concat \
349 [lrange $firstparents 0 [expr $i - 1]] \
350 [lrange $firstparents [expr $i + 1] end]]
351 if {$firstparents eq {}} {
352 # we have found all parents of the first changeset
353 # which means that we can safely select the first line
354 after idle {
355 selectline 0 0
356 }
357 }
358 }
359 } else {
360 # this is the first changeset, save the parents
361 set firstparents $olds
362 if {$firstparents eq {}} {
363 # a repository with a single changeset
364 after idle {
365 selectline 0 0
366 }
367 }
368 }
341 } 369 }
342 370
343 proc readrefs {} { 371 proc readrefs {} {
344 global tagids idtags headids idheads tagcontents env curid 372 global tagids idtags headids idheads tagcontents env curid
345 373