File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -2296,10 +2296,15 @@ proc usage {} {
22962296switch -- $subcommand {
22972297browser -
22982298blame {
2299- set subcommand_args {rev? path}
2299+ if {$subcommand eq " blame" } {
2300+ set subcommand_args {[ --line=<num>] rev? path}
2301+ } else {
2302+ set subcommand_args {rev? path}
2303+ }
23002304 if {$argv eq {}} usage
23012305 set head {}
23022306 set path {}
2307+ set jump_spec {}
23032308 set is_path 0
23042309 foreach a $argv {
23052310 if {$is_path || [ file exists $_prefix$a ] } {
@@ -2313,6 +2318,9 @@ blame {
23132318 set path {}
23142319 }
23152320 set is_path 1
2321+ } elseif {[ regexp {^--line=(\d+)$} $a a lnum] } {
2322+ if {$jump_spec ne {} || $head ne {}} usage
2323+ set jump_spec [ list $lnum ]
23162324 } elseif {$head eq {}} {
23172325 if {$head ne {}} usage
23182326 set head $a
@@ -2344,6 +2352,7 @@ blame {
23442352
23452353 switch -- $subcommand {
23462354 browser {
2355+ if {$jump_spec ne {}} usage
23472356 if {$head eq {}} {
23482357 if {$path ne {} && [ file isdirectory $path ] } {
23492358 set head $current_branch
@@ -2359,7 +2368,7 @@ blame {
23592368 puts stderr [ mc " fatal: cannot stat path %s: No such file or directory" $path ]
23602369 exit 1
23612370 }
2362- blame::new $head $path
2371+ blame::new $head $path $jump_spec
23632372 }
23642373 }
23652374 return
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ field tooltip_t {} ; # Text widget in $tooltip_wm
5858field tooltip_timer {} ; # Current timer event for our tooltip
5959field tooltip_commit {} ; # Commit(s) in tooltip
6060
61- constructor new {i_commit i_path} {
61+ constructor new {i_commit i_path i_jump } {
6262 global cursor_ptr
6363 variable active_color
6464 variable group_colors
@@ -338,7 +338,7 @@ constructor new {i_commit i_path} {
338338 wm protocol $top WM_DELETE_WINDOW " destroy $top "
339339 bind $top <Destroy> [cb _kill]
340340
341- _load $this {}
341+ _load $this $i_jump
342342}
343343
344344method _kill {} {
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ method _enter {} {
151151 append p [lindex $n 1]
152152 }
153153 append p $name
154- blame::new $browser_commit $p
154+ blame::new $browser_commit $p {}
155155 }
156156 }
157157 }
You can’t perform that action at this time.
0 commit comments