summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2008-09-17 21:07:36 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2008-09-24 19:48:32 (GMT)
commit6fc835a3f36146006bb33362368cf9d314877e51 (patch)
treee2b83a1b420e4f4011a74bd1f2a9399c32dbdc25
parenta1c3feb7fac7fe90ff8a05779d7db9cf77e79ae1 (diff)
downloadgit-6fc835a3f36146006bb33362368cf9d314877e51.zip
git-6fc835a3f36146006bb33362368cf9d314877e51.tar.gz
git-6fc835a3f36146006bb33362368cf9d314877e51.tar.bz2
git-gui: Support the encoding menu in gui blame.
Allow dynamically changing the encoding from the blame viewer as well. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Tested-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rw-r--r--lib/blame.tcl17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/blame.tcl b/lib/blame.tcl
index 84d55b5..eb61374 100644
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
@@ -256,9 +256,16 @@ constructor new {i_commit i_path i_jump} {
$w.ctxm add command \
-label [mc "Copy Commit"] \
-command [cb _copycommit]
+ $w.ctxm add separator
+ menu $w.ctxm.enc
+ build_encoding_menu $w.ctxm.enc [cb _setencoding]
+ $w.ctxm add cascade \
+ -label [mc "Encoding"] \
+ -menu $w.ctxm.enc
$w.ctxm add command \
-label [mc "Do Full Copy Detection"] \
-command [cb _fullcopyblame]
+ $w.ctxm add separator
$w.ctxm add command \
-label [mc "Show History Context"] \
-command [cb _gitkcommit]
@@ -791,6 +798,16 @@ method _click {cur_w pos} {
_showcommit $this $cur_w $lno
}
+method _setencoding {enc} {
+ force_path_encoding $path $enc
+ _load $this [list \
+ $highlight_column \
+ $highlight_line \
+ [lindex [$w_file xview] 0] \
+ [lindex [$w_file yview] 0] \
+ ]
+}
+
method _load_commit {cur_w cur_d pos} {
upvar #0 $cur_d line_data
set lno [lindex [split [$cur_w index $pos] .] 0]