summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 03e4ec5)
raw | patch | inline | side by side (parent: 03e4ec5)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 11 Nov 2006 22:59:34 +0000 (17:59 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 12 Nov 2006 05:16:01 +0000 (00:16 -0500) |
If we are given a file whose path name contains an LF (\n) we now
escape it by inserting the common escape string \n instead of the
LF character whenever we display the name in the UI. This way the
text fields don't start to span multiple lines just to display one
file, and it keeps the line numbers correct within the file lists.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
escape it by inserting the common escape string \n instead of the
LF character whenever we display the name in the UI. This way the
text fields don't start to span multiple lines just to display one
file, and it keeps the line numbers correct within the file lists.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index f36594eea0f8a85a5abb75f51fff7123cf6b04b0..ab64684c91e0b9fdcc661e15f8142d10d8a54624 100755 (executable)
--- a/git-gui
+++ b/git-gui
set m [lindex $s 0]
set diff_3way 0
set diff_active 1
- set ui_fname_value $path
+ set ui_fname_value [escape_path $path]
set ui_fstatus_value [mapdesc $m $path]
- set ui_status_value "Loading diff of $path..."
+ set ui_status_value "Loading diff of [escape_path $path]..."
set cmd [list | git diff-index -p $PARENT -- $path]
switch $m {
} err ]} {
set diff_active 0
unlock_index
- set ui_status_value "Unable to display $path"
+ set ui_status_value "Unable to display [escape_path $path]"
error_popup "Error loading file:\n$err"
return
}
if {[catch {set fd [open $cmd r]} err]} {
set diff_active 0
unlock_index
- set ui_status_value "Unable to display $path"
+ set ui_status_value "Unable to display [escape_path $path]"
error_popup "Error loading diff:\n$err"
return
}
U* {
error_popup "Unmerged files cannot be committed.
-File $path has merge conflicts.
+File [escape_path $path] has merge conflicts.
You must resolve them and include the file before committing.
"
unlock_index
default {
error_popup "Unknown file state [lindex $s 0] detected.
-File $path cannot be committed by this program.
+File [escape_path $path] cannot be committed by this program.
"
}
}
return $r
}
+proc escape_path {path} {
+ regsub -all "\n" $path "\\n" path
+ return $path
+}
+
set next_icon_id 0
proc merge_state {path new_state} {
-align center -padx 5 -pady 1 \
-name [lindex $s 1] \
-image $new_icon
- $new_w insert $lno.1 "$path\n"
+ $new_w insert $lno.1 "[escape_path $path]\n"
$new_w conf -state disabled
} elseif {$new_icon != [mapicon $old_m $path]} {
$new_w conf -state normal
-align center -padx 5 -pady 1 \
-name [lindex $s 1] \
-image [mapicon $m $path]
- $w insert end "$path\n"
+ $w insert end "[escape_path $path]\n"
}
$ui_index conf -state disabled