@@ -2585,6 +2585,7 @@ proc makewindow {} {
2585
2585
bind $fstring <Key-Return> {dofind 1 1}
2586
2586
bind $sha1entry <Key-Return> {gotocommit; break }
2587
2587
bind $sha1entry <<PasteSelection>> clearsha1
2588
+ bind $sha1entry <<Paste>> clearsha1
2588
2589
bind $cflist <1> {sel_flist %W %x %y; break }
2589
2590
bind $cflist <B1-Motion> {sel_flist %W %x %y; break }
2590
2591
bind $cflist <ButtonRelease-1> {treeclick %W %x %y}
@@ -3870,7 +3871,7 @@ proc read_line_source {fd inst} {
3870
3871
set id $nullid2
3871
3872
}
3872
3873
if {[commitinview $id $curview ]} {
3873
- selectline [rowofcommit $id ] 1 [list $fname $lnum ]
3874
+ selectline [rowofcommit $id ] 1 [list $fname $lnum ] 1
3874
3875
} else {
3875
3876
error_popup [mc " That line comes from commit %s, \
3876
3877
which is not in this view" [shortids $id ]]
@@ -5205,11 +5206,15 @@ proc dohidelocalchanges {} {
5205
5206
# spawn off a process to do git diff-index --cached HEAD
5206
5207
proc dodiffindex {} {
5207
5208
global lserial showlocalchanges vfilelimit curview
5208
- global hasworktree
5209
+ global hasworktree git_version
5209
5210
5210
5211
if {!$showlocalchanges || !$hasworktree } return
5211
5212
incr lserial
5212
- set cmd " |git diff-index --cached HEAD"
5213
+ if {[package vcompare $git_version " 1.7.2" ] >= 0} {
5214
+ set cmd " |git diff-index --cached --ignore-submodules=dirty HEAD"
5215
+ } else {
5216
+ set cmd " |git diff-index --cached HEAD"
5217
+ }
5213
5218
if {$vfilelimit($curview) ne {}} {
5214
5219
set cmd [concat $cmd -- $vfilelimit($curview) ]
5215
5220
}
@@ -7161,7 +7166,7 @@ proc make_idmark {id} {
7161
7166
$canv raise $t
7162
7167
}
7163
7168
7164
- proc selectline {l isnew {desired_loc {}}} {
7169
+ proc selectline {l isnew {desired_loc {}} {switch_to_patch 0} } {
7165
7170
global canv ctext commitinfo selectedline
7166
7171
global canvy0 linespc parents children curview
7167
7172
global currentid sha1entry
@@ -7187,6 +7192,10 @@ proc selectline {l isnew {desired_loc {}}} {
7187
7192
setcanvscroll
7188
7193
}
7189
7194
7195
+ if {$cmitmode ne " patch" && $switch_to_patch } {
7196
+ set cmitmode " patch"
7197
+ }
7198
+
7190
7199
set y [expr {$canvy0 + $l * $linespc }]
7191
7200
set ymax [lindex [$canv cget -scrollregion] 3]
7192
7201
set ytop [expr {$y - $linespc - 1}]
@@ -7705,7 +7714,7 @@ proc addtocflist {ids} {
7705
7714
}
7706
7715
7707
7716
proc diffcmd {ids flags} {
7708
- global log_showroot nullid nullid2
7717
+ global log_showroot nullid nullid2 git_version
7709
7718
7710
7719
set i [lsearch -exact $ids $nullid ]
7711
7720
set j [lsearch -exact $ids $nullid2 ]
@@ -7726,6 +7735,9 @@ proc diffcmd {ids flags} {
7726
7735
}
7727
7736
}
7728
7737
} elseif {$j >= 0} {
7738
+ if {[package vcompare $git_version " 1.7.2" ] >= 0} {
7739
+ set flags " $flags --ignore-submodules=dirty"
7740
+ }
7729
7741
set cmd [concat | git diff-index --cached $flags ]
7730
7742
if {[llength $ids ] > 1} {
7731
7743
# comparing index with specific revision
@@ -11575,7 +11587,29 @@ proc prefsok {} {
11575
11587
proc formatdate {d} {
11576
11588
global datetimeformat
11577
11589
if {$d ne {}} {
11578
- set d [clock format [lindex $d 0] -format $datetimeformat ]
11590
+ # If $datetimeformat includes a timezone, display in the
11591
+ # timezone of the argument. Otherwise, display in local time.
11592
+ if {[string match {*%[zZ]*} $datetimeformat ]} {
11593
+ if {[catch {set d [clock format [lindex $d 0] -timezone [lindex $d 1] -format $datetimeformat ]}]} {
11594
+ # Tcl < 8.5 does not support -timezone. Emulate it by
11595
+ # setting TZ (e.g. TZ=<-0430>+04:30).
11596
+ global env
11597
+ if {[info exists env(TZ)]} {
11598
+ set savedTZ $env(TZ)
11599
+ }
11600
+ set zone [lindex $d 1]
11601
+ set sign [string map {+ - - +} [string index $zone 0]]
11602
+ set env(TZ) <$zone >$sign [string range $zone 1 2]:[string range $zone 3 4]
11603
+ set d [clock format [lindex $d 0] -format $datetimeformat ]
11604
+ if {[info exists savedTZ]} {
11605
+ set env(TZ) $savedTZ
11606
+ } else {
11607
+ unset env(TZ)
11608
+ }
11609
+ }
11610
+ } else {
11611
+ set d [clock format [lindex $d 0] -format $datetimeformat ]
11612
+ }
11579
11613
}
11580
11614
return $d
11581
11615
}
0 commit comments