@@ -597,6 +597,28 @@ if {[is_Windows]} {
597
597
if {![ info exists env(DISPLAY)] } {
598
598
set env(DISPLAY) :9999
599
599
}
600
+ } else {
601
+ catch {
602
+ image create photo gitlogo -width 16 -height 16
603
+
604
+ gitlogo put #33CC33 -to 7 0 9 2
605
+ gitlogo put #33CC33 -to 4 2 12 4
606
+ gitlogo put #33CC33 -to 7 4 9 6
607
+ gitlogo put #CC3333 -to 4 6 12 8
608
+ gitlogo put gray26 -to 4 9 6 10
609
+ gitlogo put gray26 -to 3 10 6 12
610
+ gitlogo put gray26 -to 8 9 13 11
611
+ gitlogo put gray26 -to 8 11 10 12
612
+ gitlogo put gray26 -to 11 11 13 14
613
+ gitlogo put gray26 -to 3 12 5 14
614
+ gitlogo put gray26 -to 5 13
615
+ gitlogo put gray26 -to 10 13
616
+ gitlogo put gray26 -to 4 14 12 15
617
+ gitlogo put gray26 -to 5 15 11 16
618
+ gitlogo redither
619
+
620
+ wm iconphoto . -default gitlogo
621
+ }
600
622
}
601
623
602
624
######################################################################
@@ -918,19 +940,25 @@ git-version proc _parse_config {arr_name args} {
918
940
}
919
941
920
942
proc load_config {include_global} {
921
- global repo_config global_config default_config
943
+ global repo_config global_config system_config default_config
922
944
923
945
if {$include_global } {
946
+ _parse_config system_config --system
924
947
_parse_config global_config --global
925
948
}
926
949
_parse_config repo_config
927
950
928
951
foreach name [ array names default_config] {
952
+ if {[ catch {set v $system_config($name) }] } {
953
+ set system_config($name ) $default_config($name)
954
+ }
955
+ }
956
+ foreach name [ array names system_config] {
929
957
if {[ catch {set v $global_config($name) }] } {
930
- set global_config($name ) $default_config ($name)
958
+ set global_config($name ) $system_config ($name)
931
959
}
932
960
if {[ catch {set v $repo_config($name) }] } {
933
- set repo_config($name ) $default_config ($name)
961
+ set repo_config($name ) $system_config ($name)
934
962
}
935
963
}
936
964
}
@@ -1463,10 +1491,8 @@ proc rescan_done {fd buf after} {
1463
1491
prune_selection
1464
1492
unlock_index
1465
1493
display_all_files
1466
- if {$current_diff_path ne {}} reshow_diff
1467
- if {$current_diff_path eq {}} select_first_diff
1468
-
1469
- uplevel #0 $after
1494
+ if {$current_diff_path ne {}} { reshow_diff $after }
1495
+ if {$current_diff_path eq {}} { select_first_diff $after }
1470
1496
}
1471
1497
1472
1498
proc prune_selection {} {
@@ -1978,16 +2004,16 @@ proc do_rescan {} {
1978
2004
}
1979
2005
1980
2006
proc ui_do_rescan {} {
1981
- rescan {force_first_diff; ui_ready}
2007
+ rescan {force_first_diff ui_ready}
1982
2008
}
1983
2009
1984
2010
proc do_commit {} {
1985
2011
commit_tree
1986
2012
}
1987
2013
1988
- proc next_diff {} {
2014
+ proc next_diff {{after {}} } {
1989
2015
global next_diff_p next_diff_w next_diff_i
1990
- show_diff $next_diff_p $next_diff_w {}
2016
+ show_diff $next_diff_p $next_diff_w {} {} $after
1991
2017
}
1992
2018
1993
2019
proc find_anchor_pos {lst name} {
@@ -2072,25 +2098,42 @@ proc next_diff_after_action {w path {lno {}} {mmask {}}} {
2072
2098
}
2073
2099
}
2074
2100
2075
- proc select_first_diff {} {
2101
+ proc select_first_diff {after } {
2076
2102
global ui_workdir
2077
2103
2078
2104
if {[ find_next_diff $ui_workdir {} 1 {^_?U}] ||
2079
2105
[ find_next_diff $ui_workdir {} 1 {[^O] $}]} {
2080
- next_diff
2106
+ next_diff $after
2107
+ } else {
2108
+ uplevel #0 $after
2081
2109
}
2082
2110
}
2083
2111
2084
- proc force_first_diff {} {
2085
- global current_diff_path
2112
+ proc force_first_diff {after } {
2113
+ global ui_workdir current_diff_path file_states
2086
2114
2087
2115
if {[ info exists file_states($current_diff_path )] } {
2088
2116
set state [ lindex $file_states($current_diff_path) 0]
2117
+ } else {
2118
+ set state {OO}
2119
+ }
2089
2120
2090
- if {[ string index $state 1] ne {O}} return
2121
+ set reselect 0
2122
+ if {[ string first {U} $state ] >= 0} {
2123
+ # Already a conflict, do nothing
2124
+ } elseif {[ find_next_diff $ui_workdir $current_diff_path {} {^_?U}] } {
2125
+ set reselect 1
2126
+ } elseif {[ string index $state 1] ne {O}} {
2127
+ # Already a diff & no conflicts, do nothing
2128
+ } elseif {[ find_next_diff $ui_workdir $current_diff_path {} {[^O] $}]} {
2129
+ set reselect 1
2091
2130
}
2092
2131
2093
- select_first_diff
2132
+ if {$reselect } {
2133
+ next_diff $after
2134
+ } else {
2135
+ uplevel #0 $after
2136
+ }
2094
2137
}
2095
2138
2096
2139
proc toggle_or_diff {w x y} {
@@ -2246,6 +2289,9 @@ if {[is_enabled transport]} {
2246
2289
.mbar add cascade -label [ mc Merge] -menu .mbar.merge
2247
2290
.mbar add cascade -label [ mc Remote] -menu .mbar.remote
2248
2291
}
2292
+ if {[ is_enabled multicommit] || [ is_enabled singlecommit] } {
2293
+ .mbar add cascade -label [ mc Tools] -menu .mbar.tools
2294
+ }
2249
2295
. configure -menu .mbar
2250
2296
2251
2297
# -- Repository Menu
@@ -2520,6 +2566,20 @@ if {[is_MacOSX]} {
2520
2566
-command do_options
2521
2567
}
2522
2568
2569
+ # -- Tools Menu
2570
+ #
2571
+ if {[ is_enabled multicommit] || [ is_enabled singlecommit] } {
2572
+ set tools_menubar .mbar.tools
2573
+ menu $tools_menubar
2574
+ $tools_menubar add separator
2575
+ $tools_menubar add command -label [ mc " Add..." ] -command tools_add::dialog
2576
+ $tools_menubar add command -label [ mc " Remove..." ] -command tools_remove::dialog
2577
+ set tools_tailcnt 3
2578
+ if {[ array names repo_config guitool.*.cmd] ne {}} {
2579
+ tools_populate_all
2580
+ }
2581
+ }
2582
+
2523
2583
# -- Help Menu
2524
2584
#
2525
2585
.mbar add cascade -label [ mc Help] -menu .mbar.help
0 commit comments