Merge branch 'maint'
authorShawn O. Pearce <spearce@spearce.org>
Mon, 1 Sep 2008 22:39:56 +0000 (15:39 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 1 Sep 2008 22:39:56 +0000 (15:39 -0700)
* maint:
git-gui: Fix string escaping in po2msg.sh
git gui: show diffs with a minimum of 1 context line

Conflicts:
lib/option.tcl

1  2 
git-gui.sh
lib/option.tcl
diff --combined git-gui.sh
index ec08b5a921ed8ebc17714b5f2e96682b68d0d6bd,86402d49f72c56d793f2f1958a9e3d3f8300f367..99de1a2571c4cee83436c8b2705e3abc45ae5c67
@@@ -668,7 -668,6 +668,7 @@@ set default_config(gui.pruneduringfetch
  set default_config(gui.trustmtime) false
  set default_config(gui.fastcopyblame) false
  set default_config(gui.copyblamethreshold) 40
 +set default_config(gui.blamehistoryctx) 7
  set default_config(gui.diffcontext) 5
  set default_config(gui.commitmsgwidth) 75
  set default_config(gui.newbranchtemplate) {}
@@@ -1620,15 -1619,6 +1620,15 @@@ static unsigned char file_merge_bits[] 
     0xfa, 0x17, 0x02, 0x10, 0xfe, 0x1f};
  } -maskdata $filemask
  
 +image create bitmap file_statechange -background white -foreground green -data {
 +#define file_merge_width 14
 +#define file_merge_height 15
 +static unsigned char file_statechange_bits[] = {
 +   0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x62, 0x10,
 +   0x62, 0x10, 0xba, 0x11, 0xba, 0x11, 0x62, 0x10, 0x62, 0x10, 0x02, 0x10,
 +   0x02, 0x10, 0x02, 0x10, 0xfe, 0x1f};
 +} -maskdata $filemask
 +
  set ui_index .vpane.files.index.list
  set ui_workdir .vpane.files.workdir.list
  
@@@ -1637,14 -1627,12 +1637,14 @@@ set all_icons(A$ui_index)   file_fullti
  set all_icons(M$ui_index)   file_fulltick
  set all_icons(D$ui_index)   file_removed
  set all_icons(U$ui_index)   file_merge
 +set all_icons(T$ui_index)   file_statechange
  
  set all_icons(_$ui_workdir) file_plain
  set all_icons(M$ui_workdir) file_mod
  set all_icons(D$ui_workdir) file_question
  set all_icons(U$ui_workdir) file_merge
  set all_icons(O$ui_workdir) file_plain
 +set all_icons(T$ui_workdir) file_statechange
  
  set max_status_desc 0
  foreach i {
                {MM {mc "Portions staged for commit"}}
                {MD {mc "Staged for commit, missing"}}
  
 +              {_T {mc "File type changed, not staged"}}
 +              {T_ {mc "File type changed, staged"}}
 +
                {_O {mc "Untracked, not staged"}}
                {A_ {mc "Staged for commit"}}
                {AM {mc "Portions staged for commit"}}
@@@ -1947,7 -1932,7 +1947,7 @@@ proc show_more_context {} 
  
  proc show_less_context {} {
        global repo_config
-       if {$repo_config(gui.diffcontext) >= 1} {
+       if {$repo_config(gui.diffcontext) > 1} {
                incr repo_config(gui.diffcontext) -1
                reshow_diff
        }
@@@ -2296,15 -2281,10 +2296,15 @@@ proc usage {} 
  switch -- $subcommand {
  browser -
  blame {
 -      set subcommand_args {rev? path}
 +      if {$subcommand eq "blame"} {
 +              set subcommand_args {[--line=<num>] rev? path}
 +      } else {
 +              set subcommand_args {rev? path}
 +      }
        if {$argv eq {}} usage
        set head {}
        set path {}
 +      set jump_spec {}
        set is_path 0
        foreach a $argv {
                if {$is_path || [file exists $_prefix$a]} {
                                set path {}
                        }
                        set is_path 1
 +              } elseif {[regexp {^--line=(\d+)$} $a a lnum]} {
 +                      if {$jump_spec ne {} || $head ne {}} usage
 +                      set jump_spec [list $lnum]
                } elseif {$head eq {}} {
                        if {$head ne {}} usage
                        set head $a
  
        switch -- $subcommand {
        browser {
 +              if {$jump_spec ne {}} usage
                if {$head eq {}} {
                        if {$path ne {} && [file isdirectory $path]} {
                                set head $current_branch
                        puts stderr [mc "fatal: cannot stat path %s: No such file or directory" $path]
                        exit 1
                }
 -              blame::new $head $path
 +              blame::new $head $path $jump_spec
        }
        }
        return
@@@ -2781,9 -2757,7 +2781,9 @@@ proc popup_diff_menu {ctxm x y X Y} 
        if {$::is_3way_diff
                || $current_diff_path eq {}
                || ![info exists file_states($current_diff_path)]
 -              || {_O} eq [lindex $file_states($current_diff_path) 0]} {
 +              || {_O} eq [lindex $file_states($current_diff_path) 0]
 +              || {_T} eq [lindex $file_states($current_diff_path) 0]
 +              || {T_} eq [lindex $file_states($current_diff_path) 0]} {
                set s disabled
        } else {
                set s normal
diff --combined lib/option.tcl
index eb958ffd47bf6b4be5b61a45191079dff99331a2,5e1346e601faf90114e9c62f11144f812835e872..2d4b97b7d3fb90d8c6575b4d4e645d52104b89c1
@@@ -125,8 -125,7 +125,8 @@@ proc do_options {} 
                {b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
                {b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}}
                {i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
-               {i-0..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
 +              {i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}}
+               {i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
                {i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
                {t gui.newbranchtemplate {mc "New Branch Name Template"}}
                } {