Mercurial > hg
comparison contrib/hgk @ 3093:edefbb3a3b08
hgk: add --limit, and revranges
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Wed, 13 Sep 2006 18:24:58 -0700 |
parents | d0fcce3728d1 |
children | a33ddd20105c |
comparison
equal
deleted
inserted
replaced
3092:d0fcce3728d1 | 3093:edefbb3a3b08 |
---|---|
28 set commits {} | 28 set commits {} |
29 set phase getcommits | 29 set phase getcommits |
30 set startmsecs [clock clicks -milliseconds] | 30 set startmsecs [clock clicks -milliseconds] |
31 set nextupdate [expr $startmsecs + 100] | 31 set nextupdate [expr $startmsecs + 100] |
32 set ncmupdate 1 | 32 set ncmupdate 1 |
33 set limit 0 | |
34 set revargs {} | |
35 for {set i 0} {$i < [llength $rargs]} {incr i} { | |
36 set opt [lindex $rargs $i] | |
37 if {$opt == "--limit"} { | |
38 incr i | |
39 set limit [lindex $rargs $i] | |
40 } else { | |
41 lappend revargs $opt | |
42 } | |
43 } | |
33 if [catch { | 44 if [catch { |
34 set parse_args [concat --default HEAD $rargs] | 45 set parse_args [concat --default HEAD $revargs] |
35 set parsed_args [split [eval exec hg debug-rev-parse $parse_args] "\n"] | 46 set parsed_args [split [eval exec hg debug-rev-parse $parse_args] "\n"] |
36 }] { | 47 } err] { |
37 # if git-rev-parse failed for some reason... | 48 # if git-rev-parse failed for some reason... |
38 if {$rargs == {}} { | 49 if {$rargs == {}} { |
39 set rargs HEAD | 50 set revargs HEAD |
40 } | 51 } |
41 set parsed_args $rargs | 52 set parsed_args $revargs |
53 } | |
54 if {$limit > 0} { | |
55 set parsed_args [concat -n $limit $parsed_args] | |
42 } | 56 } |
43 if [catch { | 57 if [catch { |
44 set commfd [open "|hg debug-rev-list --header --topo-order --parents $parsed_args" r] | 58 set commfd [open "|hg debug-rev-list --header --topo-order --parents $parsed_args" r] |
45 } err] { | 59 } err] { |
46 puts stderr "Error executing hg debug-rev-list: $err" | 60 puts stderr "Error executing hg debug-rev-list: $err" |