summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 94a4dd9)
raw | patch | inline | side by side (parent: 94a4dd9)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 29 Jul 2007 08:06:51 +0000 (04:06 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 29 Jul 2007 08:07:13 +0000 (04:07 -0400) |
Resetting a large number of files on a slow filesystem can take
considerable time, just as switching branches in such a case can
take more than two seconds. We now take advantage of the progress
meter output by read-tree and show it in the main window status
bar, just like we do during checkout (branch switch).
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
considerable time, just as switching branches in such a case can
take more than two seconds. We now take advantage of the progress
meter output by read-tree and show it in the main window status
bar, just like we do during checkout (branch switch).
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/merge.tcl | patch | blob | history |
diff --git a/lib/merge.tcl b/lib/merge.tcl
index f6a2df3c064b3132d7607211656a7aee53638881..66d1bcd8263e4a346993d9cfa99cbde080959a7b 100644 (file)
--- a/lib/merge.tcl
+++ b/lib/merge.tcl
}
if {[ask_popup $op_question] eq {yes}} {
- set fd [git_read read-tree --reset -u HEAD]
+ set fd [git_read --stderr read-tree --reset -u -v HEAD]
fconfigure $fd -blocking 0 -translation binary
fileevent $fd readable [namespace code [list _reset_wait $fd]]
- ui_status {Aborting... please wait...}
+ $::main_status start {Aborting} {files reset}
} else {
unlock_index
}
proc _reset_wait {fd} {
global ui_comm
- read $fd
+ $::main_status update_meter [read $fd]
+
+ fconfigure $fd -blocking 1
if {[eof $fd]} {
- close $fd
+ set fail [catch {close $fd} err]
+ $::main_status stop
unlock_index
$ui_comm delete 0.0 end
catch {file delete [gitdir MERGE_MSG]}
catch {file delete [gitdir GITGUI_MSG]}
+ if {$fail} {
+ warn_popup "Abort failed.\n\n$err"
+ }
rescan {ui_status {Abort completed. Ready.}}
+ } else {
+ fconfigure $fd -blocking 0
}
}