2007-05-08 03:35:48 +00:00
|
|
|
# git-gui index (add/remove) support
|
|
|
|
# Copyright (C) 2006, 2007 Shawn Pearce
|
|
|
|
|
2007-10-23 20:55:32 +00:00
|
|
|
proc _delete_indexlock {} {
|
|
|
|
if {[catch {file delete -- [gitdir index.lock]} err]} {
|
|
|
|
error_popup [strcat [mc "Unable to unlock the index."] "\n\n$err"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
proc close_and_unlock_index {fd after} {
|
|
|
|
if {![catch {_close_updateindex $fd} err]} {
|
2007-10-23 20:55:32 +00:00
|
|
|
unlock_index
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
uplevel #0 $after
|
|
|
|
} else {
|
|
|
|
rescan_on_error $err $after
|
2007-10-23 20:55:32 +00:00
|
|
|
}
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proc _close_updateindex {fd} {
|
|
|
|
fconfigure $fd -blocking 1
|
|
|
|
close $fd
|
|
|
|
}
|
|
|
|
|
|
|
|
proc rescan_on_error {err {after {}}} {
|
|
|
|
global use_ttk NS
|
|
|
|
|
|
|
|
set w .indexfried
|
|
|
|
Dialog $w
|
|
|
|
wm withdraw $w
|
|
|
|
wm title $w [strcat "[appname] ([reponame]): " [mc "Index Error"]]
|
|
|
|
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
|
|
|
|
set s [mc "Updating the Git index failed. A rescan will be automatically started to resynchronize git-gui."]
|
|
|
|
text $w.msg -yscrollcommand [list $w.vs set] \
|
|
|
|
-width [string length $s] -relief flat \
|
|
|
|
-borderwidth 0 -highlightthickness 0 \
|
|
|
|
-background [get_bg_color $w]
|
|
|
|
$w.msg tag configure bold -font font_uibold -justify center
|
|
|
|
${NS}::scrollbar $w.vs -command [list $w.msg yview]
|
|
|
|
$w.msg insert end $s bold \n\n$err {}
|
|
|
|
$w.msg configure -state disabled
|
|
|
|
|
|
|
|
${NS}::button $w.continue \
|
|
|
|
-text [mc "Continue"] \
|
|
|
|
-command [list destroy $w]
|
|
|
|
${NS}::button $w.unlock \
|
|
|
|
-text [mc "Unlock Index"] \
|
|
|
|
-command "destroy $w; _delete_indexlock"
|
|
|
|
grid $w.msg - $w.vs -sticky news
|
|
|
|
grid $w.unlock $w.continue - -sticky se -padx 2 -pady 2
|
|
|
|
grid columnconfigure $w 0 -weight 1
|
|
|
|
grid rowconfigure $w 0 -weight 1
|
|
|
|
|
|
|
|
wm protocol $w WM_DELETE_WINDOW update
|
|
|
|
bind $w.continue <Visibility> "
|
|
|
|
grab $w
|
|
|
|
focus %W
|
|
|
|
"
|
|
|
|
wm deiconify $w
|
|
|
|
tkwait window $w
|
2007-10-23 20:55:32 +00:00
|
|
|
|
2019-12-01 02:28:32 +00:00
|
|
|
$::main_status stop_all
|
2007-10-23 20:55:32 +00:00
|
|
|
unlock_index
|
Subject: git-gui: fix syntax error because of missing semicolon
For some asynchronous operations, we build a chain of callbacks to
execute when the operation is done. These callbacks are held in $after,
and a new callback can be added by appending to $after. Once the
operation is done, $after is executed as a script.
But if we don't append a semi-colon after the procedure calls, they will
appear to Tcl as arguments to the previous procedure's arguments. So,
for example, if $after is "foo", and we just append "bar", then $after
becomes "foo bar", and bar will be treated as an argument to foo. If foo
does not accept any optional arguments, it would result in Tcl throwing
an error. If instead we do append a semi-colon, $after will look like
"foo;bar;", and these will be treated as two separate procedure calls.
Before d9c6469 (git-gui: update status bar to track operations,
2019-12-01), this problem was masked because ui_ready/ui_status did
accept an optional argument. In d9c6469, ui_ready stopped accepting an
optional argument, and this error started showing up.
Another instance of this problem is when a call to ui_status without a
trailing semicolon. ui_status never accepted an optional argument to
begin with, but the issue never managed to surface.
So, fix these errors by making sure we always append a semi-colon after
procedure calls when multiple callbacks are involved in $after.
Helped-by: Pratyush Yadav <me@yadavpratyush.com>
Signed-off-by: Ansgar Röber <ansgar.roeber@rwth-aachen.de>
2020-04-09 18:03:25 +00:00
|
|
|
rescan [concat $after {ui_ready;}] 0
|
2007-10-23 20:55:32 +00:00
|
|
|
}
|
|
|
|
|
2019-12-01 02:28:31 +00:00
|
|
|
proc update_indexinfo {msg path_list after} {
|
2007-07-06 03:16:13 +00:00
|
|
|
global update_index_cp
|
2007-05-08 03:35:48 +00:00
|
|
|
|
|
|
|
if {![lock_index update]} return
|
|
|
|
|
|
|
|
set update_index_cp 0
|
2019-12-01 02:28:31 +00:00
|
|
|
set path_list [lsort $path_list]
|
|
|
|
set total_cnt [llength $path_list]
|
|
|
|
set batch [expr {int($total_cnt * .01) + 1}]
|
2007-05-08 03:35:48 +00:00
|
|
|
if {$batch > 25} {set batch 25}
|
|
|
|
|
2019-12-01 02:28:32 +00:00
|
|
|
set status_bar_operation [$::main_status start $msg [mc "files"]]
|
2007-07-09 05:17:09 +00:00
|
|
|
set fd [git_write update-index -z --index-info]
|
2007-05-08 03:35:48 +00:00
|
|
|
fconfigure $fd \
|
|
|
|
-blocking 0 \
|
|
|
|
-buffering full \
|
|
|
|
-buffersize 512 \
|
|
|
|
-encoding binary \
|
|
|
|
-translation binary
|
|
|
|
fileevent $fd writable [list \
|
|
|
|
write_update_indexinfo \
|
|
|
|
$fd \
|
2019-12-01 02:28:31 +00:00
|
|
|
$path_list \
|
|
|
|
$total_cnt \
|
2007-05-08 03:35:48 +00:00
|
|
|
$batch \
|
2019-12-01 02:28:32 +00:00
|
|
|
$status_bar_operation \
|
2007-05-08 03:35:48 +00:00
|
|
|
$after \
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-12-01 02:28:32 +00:00
|
|
|
proc write_update_indexinfo {fd path_list total_cnt batch status_bar_operation \
|
|
|
|
after} {
|
2007-07-06 03:16:13 +00:00
|
|
|
global update_index_cp
|
2007-05-08 03:35:48 +00:00
|
|
|
global file_states current_diff_path
|
|
|
|
|
2019-12-01 02:28:31 +00:00
|
|
|
if {$update_index_cp >= $total_cnt} {
|
2019-12-01 02:28:32 +00:00
|
|
|
$status_bar_operation stop
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
close_and_unlock_index $fd $after
|
2007-05-08 03:35:48 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
for {set i $batch} \
|
2019-12-01 02:28:31 +00:00
|
|
|
{$update_index_cp < $total_cnt && $i > 0} \
|
2007-05-08 03:35:48 +00:00
|
|
|
{incr i -1} {
|
2019-12-01 02:28:31 +00:00
|
|
|
set path [lindex $path_list $update_index_cp]
|
2007-05-08 03:35:48 +00:00
|
|
|
incr update_index_cp
|
|
|
|
|
|
|
|
set s $file_states($path)
|
|
|
|
switch -glob -- [lindex $s 0] {
|
|
|
|
A? {set new _O}
|
2010-12-09 20:46:23 +00:00
|
|
|
MT -
|
|
|
|
TM -
|
2008-08-22 20:10:27 +00:00
|
|
|
T_ {set new _T}
|
2010-12-09 20:46:23 +00:00
|
|
|
M? {set new _M}
|
|
|
|
TD -
|
2007-05-08 03:35:48 +00:00
|
|
|
D_ {set new _D}
|
|
|
|
D? {set new _?}
|
|
|
|
?? {continue}
|
|
|
|
}
|
|
|
|
set info [lindex $s 2]
|
|
|
|
if {$info eq {}} continue
|
|
|
|
|
2012-02-04 20:54:36 +00:00
|
|
|
puts -nonewline $fd "$info\t[encoding convertto utf-8 $path]\0"
|
2007-05-08 03:35:48 +00:00
|
|
|
display_file $path $new
|
|
|
|
}
|
|
|
|
|
2019-12-01 02:28:32 +00:00
|
|
|
$status_bar_operation update $update_index_cp $total_cnt
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
|
2019-12-01 02:28:31 +00:00
|
|
|
proc update_index {msg path_list after} {
|
2007-07-06 03:16:13 +00:00
|
|
|
global update_index_cp
|
2007-05-08 03:35:48 +00:00
|
|
|
|
|
|
|
if {![lock_index update]} return
|
|
|
|
|
|
|
|
set update_index_cp 0
|
2019-12-01 02:28:31 +00:00
|
|
|
set path_list [lsort $path_list]
|
|
|
|
set total_cnt [llength $path_list]
|
|
|
|
set batch [expr {int($total_cnt * .01) + 1}]
|
2007-05-08 03:35:48 +00:00
|
|
|
if {$batch > 25} {set batch 25}
|
|
|
|
|
2019-12-01 02:28:32 +00:00
|
|
|
set status_bar_operation [$::main_status start $msg [mc "files"]]
|
2007-07-09 05:17:09 +00:00
|
|
|
set fd [git_write update-index --add --remove -z --stdin]
|
2007-05-08 03:35:48 +00:00
|
|
|
fconfigure $fd \
|
|
|
|
-blocking 0 \
|
|
|
|
-buffering full \
|
|
|
|
-buffersize 512 \
|
|
|
|
-encoding binary \
|
|
|
|
-translation binary
|
|
|
|
fileevent $fd writable [list \
|
|
|
|
write_update_index \
|
|
|
|
$fd \
|
2019-12-01 02:28:31 +00:00
|
|
|
$path_list \
|
|
|
|
$total_cnt \
|
2007-05-08 03:35:48 +00:00
|
|
|
$batch \
|
2019-12-01 02:28:32 +00:00
|
|
|
$status_bar_operation \
|
2007-05-08 03:35:48 +00:00
|
|
|
$after \
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-12-01 02:28:32 +00:00
|
|
|
proc write_update_index {fd path_list total_cnt batch status_bar_operation \
|
|
|
|
after} {
|
2007-07-06 03:16:13 +00:00
|
|
|
global update_index_cp
|
2007-05-08 03:35:48 +00:00
|
|
|
global file_states current_diff_path
|
|
|
|
|
2019-12-01 02:28:31 +00:00
|
|
|
if {$update_index_cp >= $total_cnt} {
|
2019-12-01 02:28:32 +00:00
|
|
|
$status_bar_operation stop
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
close_and_unlock_index $fd $after
|
2007-05-08 03:35:48 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
for {set i $batch} \
|
2019-12-01 02:28:31 +00:00
|
|
|
{$update_index_cp < $total_cnt && $i > 0} \
|
2007-05-08 03:35:48 +00:00
|
|
|
{incr i -1} {
|
2019-12-01 02:28:31 +00:00
|
|
|
set path [lindex $path_list $update_index_cp]
|
2007-05-08 03:35:48 +00:00
|
|
|
incr update_index_cp
|
|
|
|
|
|
|
|
switch -glob -- [lindex $file_states($path) 0] {
|
|
|
|
AD {set new __}
|
|
|
|
?D {set new D_}
|
|
|
|
_O -
|
2010-12-09 20:46:23 +00:00
|
|
|
AT -
|
2007-05-08 03:35:48 +00:00
|
|
|
AM {set new A_}
|
2010-12-09 20:46:23 +00:00
|
|
|
TM -
|
|
|
|
MT -
|
2008-08-22 20:10:27 +00:00
|
|
|
_T {set new T_}
|
2008-08-30 21:00:49 +00:00
|
|
|
_U -
|
2007-05-08 03:35:48 +00:00
|
|
|
U? {
|
|
|
|
if {[file exists $path]} {
|
|
|
|
set new M_
|
|
|
|
} else {
|
|
|
|
set new D_
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?M {set new M_}
|
|
|
|
?? {continue}
|
|
|
|
}
|
2012-02-04 20:54:36 +00:00
|
|
|
puts -nonewline $fd "[encoding convertto utf-8 $path]\0"
|
2007-05-08 03:35:48 +00:00
|
|
|
display_file $path $new
|
|
|
|
}
|
|
|
|
|
2019-12-01 02:28:32 +00:00
|
|
|
$status_bar_operation update $update_index_cp $total_cnt
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
proc checkout_index {msg path_list after capture_error} {
|
2007-07-06 03:16:13 +00:00
|
|
|
global update_index_cp
|
2007-05-08 03:35:48 +00:00
|
|
|
|
|
|
|
if {![lock_index update]} return
|
|
|
|
|
|
|
|
set update_index_cp 0
|
2019-12-01 02:28:31 +00:00
|
|
|
set path_list [lsort $path_list]
|
|
|
|
set total_cnt [llength $path_list]
|
|
|
|
set batch [expr {int($total_cnt * .01) + 1}]
|
2007-05-08 03:35:48 +00:00
|
|
|
if {$batch > 25} {set batch 25}
|
|
|
|
|
2019-12-01 02:28:32 +00:00
|
|
|
set status_bar_operation [$::main_status start $msg [mc "files"]]
|
2007-07-09 05:17:09 +00:00
|
|
|
set fd [git_write checkout-index \
|
|
|
|
--index \
|
|
|
|
--quiet \
|
|
|
|
--force \
|
|
|
|
-z \
|
|
|
|
--stdin \
|
|
|
|
]
|
2007-05-08 03:35:48 +00:00
|
|
|
fconfigure $fd \
|
|
|
|
-blocking 0 \
|
|
|
|
-buffering full \
|
|
|
|
-buffersize 512 \
|
|
|
|
-encoding binary \
|
|
|
|
-translation binary
|
|
|
|
fileevent $fd writable [list \
|
|
|
|
write_checkout_index \
|
|
|
|
$fd \
|
2019-12-01 02:28:31 +00:00
|
|
|
$path_list \
|
|
|
|
$total_cnt \
|
2007-05-08 03:35:48 +00:00
|
|
|
$batch \
|
2019-12-01 02:28:32 +00:00
|
|
|
$status_bar_operation \
|
2007-05-08 03:35:48 +00:00
|
|
|
$after \
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
$capture_error \
|
2007-05-08 03:35:48 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-12-01 02:28:32 +00:00
|
|
|
proc write_checkout_index {fd path_list total_cnt batch status_bar_operation \
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
after capture_error} {
|
2007-07-06 03:16:13 +00:00
|
|
|
global update_index_cp
|
2007-05-08 03:35:48 +00:00
|
|
|
global file_states current_diff_path
|
|
|
|
|
2019-12-01 02:28:31 +00:00
|
|
|
if {$update_index_cp >= $total_cnt} {
|
2019-12-01 02:28:32 +00:00
|
|
|
$status_bar_operation stop
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
|
|
|
|
# We do not unlock the index directly here because this
|
|
|
|
# operation expects to potentially run in parallel with file
|
|
|
|
# deletions scheduled by revert_helper. We're done with the
|
|
|
|
# update index, so we close it, but actually unlocking the index
|
|
|
|
# and dealing with potential errors is deferred to the chord
|
|
|
|
# body that runs when all async operations are completed.
|
|
|
|
#
|
|
|
|
# (See after_chord in revert_helper.)
|
|
|
|
|
|
|
|
if {[catch {_close_updateindex $fd} err]} {
|
|
|
|
uplevel #0 $capture_error [list $err]
|
|
|
|
}
|
|
|
|
|
|
|
|
uplevel #0 $after
|
|
|
|
|
2007-05-08 03:35:48 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
for {set i $batch} \
|
2019-12-01 02:28:31 +00:00
|
|
|
{$update_index_cp < $total_cnt && $i > 0} \
|
2007-05-08 03:35:48 +00:00
|
|
|
{incr i -1} {
|
2019-12-01 02:28:31 +00:00
|
|
|
set path [lindex $path_list $update_index_cp]
|
2007-05-08 03:35:48 +00:00
|
|
|
incr update_index_cp
|
|
|
|
switch -glob -- [lindex $file_states($path) 0] {
|
|
|
|
U? {continue}
|
|
|
|
?M -
|
2008-08-22 20:10:27 +00:00
|
|
|
?T -
|
2007-05-08 03:35:48 +00:00
|
|
|
?D {
|
2012-02-04 20:54:36 +00:00
|
|
|
puts -nonewline $fd "[encoding convertto utf-8 $path]\0"
|
2007-05-08 03:35:48 +00:00
|
|
|
display_file $path ?_
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-01 02:28:32 +00:00
|
|
|
$status_bar_operation update $update_index_cp $total_cnt
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proc unstage_helper {txt paths} {
|
|
|
|
global file_states current_diff_path
|
|
|
|
|
|
|
|
if {![lock_index begin-update]} return
|
|
|
|
|
2019-12-01 02:28:31 +00:00
|
|
|
set path_list [list]
|
2007-05-08 03:35:48 +00:00
|
|
|
set after {}
|
|
|
|
foreach path $paths {
|
|
|
|
switch -glob -- [lindex $file_states($path) 0] {
|
|
|
|
A? -
|
|
|
|
M? -
|
2010-12-09 20:46:23 +00:00
|
|
|
T? -
|
2007-05-08 03:35:48 +00:00
|
|
|
D? {
|
2019-12-01 02:28:31 +00:00
|
|
|
lappend path_list $path
|
2007-05-08 03:35:48 +00:00
|
|
|
if {$path eq $current_diff_path} {
|
|
|
|
set after {reshow_diff;}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-01 02:28:31 +00:00
|
|
|
if {$path_list eq {}} {
|
2007-05-08 03:35:48 +00:00
|
|
|
unlock_index
|
|
|
|
} else {
|
|
|
|
update_indexinfo \
|
|
|
|
$txt \
|
2019-12-01 02:28:31 +00:00
|
|
|
$path_list \
|
Subject: git-gui: fix syntax error because of missing semicolon
For some asynchronous operations, we build a chain of callbacks to
execute when the operation is done. These callbacks are held in $after,
and a new callback can be added by appending to $after. Once the
operation is done, $after is executed as a script.
But if we don't append a semi-colon after the procedure calls, they will
appear to Tcl as arguments to the previous procedure's arguments. So,
for example, if $after is "foo", and we just append "bar", then $after
becomes "foo bar", and bar will be treated as an argument to foo. If foo
does not accept any optional arguments, it would result in Tcl throwing
an error. If instead we do append a semi-colon, $after will look like
"foo;bar;", and these will be treated as two separate procedure calls.
Before d9c6469 (git-gui: update status bar to track operations,
2019-12-01), this problem was masked because ui_ready/ui_status did
accept an optional argument. In d9c6469, ui_ready stopped accepting an
optional argument, and this error started showing up.
Another instance of this problem is when a call to ui_status without a
trailing semicolon. ui_status never accepted an optional argument to
begin with, but the issue never managed to surface.
So, fix these errors by making sure we always append a semi-colon after
procedure calls when multiple callbacks are involved in $after.
Helped-by: Pratyush Yadav <me@yadavpratyush.com>
Signed-off-by: Ansgar Röber <ansgar.roeber@rwth-aachen.de>
2020-04-09 18:03:25 +00:00
|
|
|
[concat $after {ui_ready;}]
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc do_unstage_selection {} {
|
|
|
|
global current_diff_path selected_paths
|
|
|
|
|
|
|
|
if {[array size selected_paths] > 0} {
|
|
|
|
unstage_helper \
|
2016-05-08 10:52:54 +00:00
|
|
|
[mc "Unstaging selected files from commit"] \
|
2007-05-08 03:35:48 +00:00
|
|
|
[array names selected_paths]
|
|
|
|
} elseif {$current_diff_path ne {}} {
|
|
|
|
unstage_helper \
|
2007-09-13 13:19:05 +00:00
|
|
|
[mc "Unstaging %s from commit" [short_path $current_diff_path]] \
|
2007-05-08 03:35:48 +00:00
|
|
|
[list $current_diff_path]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc add_helper {txt paths} {
|
|
|
|
global file_states current_diff_path
|
|
|
|
|
|
|
|
if {![lock_index begin-update]} return
|
|
|
|
|
2019-12-01 02:28:31 +00:00
|
|
|
set path_list [list]
|
2007-05-08 03:35:48 +00:00
|
|
|
set after {}
|
|
|
|
foreach path $paths {
|
|
|
|
switch -glob -- [lindex $file_states($path) 0] {
|
2008-09-30 08:12:16 +00:00
|
|
|
_U -
|
|
|
|
U? {
|
|
|
|
if {$path eq $current_diff_path} {
|
|
|
|
unlock_index
|
|
|
|
merge_stage_workdir $path
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
2007-05-08 03:35:48 +00:00
|
|
|
_O -
|
|
|
|
?M -
|
|
|
|
?D -
|
2008-09-30 08:12:16 +00:00
|
|
|
?T {
|
2019-12-01 02:28:31 +00:00
|
|
|
lappend path_list $path
|
2007-05-08 03:35:48 +00:00
|
|
|
if {$path eq $current_diff_path} {
|
|
|
|
set after {reshow_diff;}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-01 02:28:31 +00:00
|
|
|
if {$path_list eq {}} {
|
2007-05-08 03:35:48 +00:00
|
|
|
unlock_index
|
|
|
|
} else {
|
|
|
|
update_index \
|
|
|
|
$txt \
|
2019-12-01 02:28:31 +00:00
|
|
|
$path_list \
|
Subject: git-gui: fix syntax error because of missing semicolon
For some asynchronous operations, we build a chain of callbacks to
execute when the operation is done. These callbacks are held in $after,
and a new callback can be added by appending to $after. Once the
operation is done, $after is executed as a script.
But if we don't append a semi-colon after the procedure calls, they will
appear to Tcl as arguments to the previous procedure's arguments. So,
for example, if $after is "foo", and we just append "bar", then $after
becomes "foo bar", and bar will be treated as an argument to foo. If foo
does not accept any optional arguments, it would result in Tcl throwing
an error. If instead we do append a semi-colon, $after will look like
"foo;bar;", and these will be treated as two separate procedure calls.
Before d9c6469 (git-gui: update status bar to track operations,
2019-12-01), this problem was masked because ui_ready/ui_status did
accept an optional argument. In d9c6469, ui_ready stopped accepting an
optional argument, and this error started showing up.
Another instance of this problem is when a call to ui_status without a
trailing semicolon. ui_status never accepted an optional argument to
begin with, but the issue never managed to surface.
So, fix these errors by making sure we always append a semi-colon after
procedure calls when multiple callbacks are involved in $after.
Helped-by: Pratyush Yadav <me@yadavpratyush.com>
Signed-off-by: Ansgar Röber <ansgar.roeber@rwth-aachen.de>
2020-04-09 18:03:25 +00:00
|
|
|
[concat $after {ui_status [mc "Ready to commit."];}]
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc do_add_selection {} {
|
|
|
|
global current_diff_path selected_paths
|
|
|
|
|
|
|
|
if {[array size selected_paths] > 0} {
|
|
|
|
add_helper \
|
2016-05-08 10:52:54 +00:00
|
|
|
[mc "Adding selected files"] \
|
2007-05-08 03:35:48 +00:00
|
|
|
[array names selected_paths]
|
|
|
|
} elseif {$current_diff_path ne {}} {
|
|
|
|
add_helper \
|
2007-09-13 13:19:05 +00:00
|
|
|
[mc "Adding %s" [short_path $current_diff_path]] \
|
2007-05-08 03:35:48 +00:00
|
|
|
[list $current_diff_path]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc do_add_all {} {
|
|
|
|
global file_states
|
|
|
|
|
|
|
|
set paths [list]
|
2011-10-14 19:25:20 +00:00
|
|
|
set untracked_paths [list]
|
2007-05-08 03:35:48 +00:00
|
|
|
foreach path [array names file_states] {
|
|
|
|
switch -glob -- [lindex $file_states($path) 0] {
|
|
|
|
U? {continue}
|
|
|
|
?M -
|
2008-08-22 20:10:27 +00:00
|
|
|
?T -
|
2007-05-08 03:35:48 +00:00
|
|
|
?D {lappend paths $path}
|
2011-10-14 19:25:20 +00:00
|
|
|
?O {lappend untracked_paths $path}
|
2011-05-27 15:40:24 +00:00
|
|
|
}
|
|
|
|
}
|
2011-10-14 19:25:20 +00:00
|
|
|
if {[llength $untracked_paths]} {
|
2011-10-14 19:25:21 +00:00
|
|
|
set reply 0
|
|
|
|
switch -- [get_config gui.stageuntracked] {
|
|
|
|
no {
|
|
|
|
set reply 0
|
|
|
|
}
|
|
|
|
yes {
|
|
|
|
set reply 1
|
|
|
|
}
|
|
|
|
ask -
|
|
|
|
default {
|
2011-10-18 08:32:22 +00:00
|
|
|
set reply [ask_popup [mc "Stage %d untracked files?" \
|
|
|
|
[llength $untracked_paths]]]
|
2011-10-14 19:25:21 +00:00
|
|
|
}
|
|
|
|
}
|
2011-05-27 15:40:24 +00:00
|
|
|
if {$reply} {
|
2011-10-14 19:25:20 +00:00
|
|
|
set paths [concat $paths $untracked_paths]
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
}
|
2016-05-08 10:52:54 +00:00
|
|
|
add_helper [mc "Adding all changed files"] $paths
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
# Copied from TclLib package "lambda".
|
|
|
|
proc lambda {arguments body args} {
|
|
|
|
return [list ::apply [list $arguments $body] {*}$args]
|
|
|
|
}
|
|
|
|
|
2007-05-08 03:35:48 +00:00
|
|
|
proc revert_helper {txt paths} {
|
|
|
|
global file_states current_diff_path
|
|
|
|
|
|
|
|
if {![lock_index begin-update]} return
|
|
|
|
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
# Common "after" functionality that waits until multiple asynchronous
|
|
|
|
# operations are complete (by waiting for them to activate their notes
|
|
|
|
# on the chord).
|
|
|
|
#
|
|
|
|
# The asynchronous operations are each indicated below by a comment
|
|
|
|
# before the code block that starts the async operation.
|
2020-02-17 15:39:29 +00:00
|
|
|
set after_chord [SimpleChord::new {
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
if {[string trim $err] != ""} {
|
|
|
|
rescan_on_error $err
|
|
|
|
} else {
|
|
|
|
unlock_index
|
|
|
|
if {$should_reshow_diff} { reshow_diff }
|
|
|
|
ui_ready
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
|
|
|
|
$after_chord eval { set should_reshow_diff 0 }
|
|
|
|
|
|
|
|
# This function captures an error for processing when after_chord is
|
|
|
|
# completed. (The chord is curried into the lambda function.)
|
|
|
|
set capture_error [lambda \
|
|
|
|
{chord error} \
|
|
|
|
{ $chord eval [list set err $error] } \
|
|
|
|
$after_chord]
|
|
|
|
|
|
|
|
# We don't know how many notes we're going to create (it's dynamic based
|
|
|
|
# on conditional paths below), so create a common note that will delay
|
|
|
|
# the chord's completion until we activate it, and then activate it
|
|
|
|
# after all the other notes have been created.
|
|
|
|
set after_common_note [$after_chord add_note]
|
|
|
|
|
2019-12-01 02:28:31 +00:00
|
|
|
set path_list [list]
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
set untracked_list [list]
|
|
|
|
|
2007-05-08 03:35:48 +00:00
|
|
|
foreach path $paths {
|
|
|
|
switch -glob -- [lindex $file_states($path) 0] {
|
|
|
|
U? {continue}
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
?O {
|
|
|
|
lappend untracked_list $path
|
|
|
|
}
|
2007-05-08 03:35:48 +00:00
|
|
|
?M -
|
2008-08-22 20:10:27 +00:00
|
|
|
?T -
|
2007-05-08 03:35:48 +00:00
|
|
|
?D {
|
2019-12-01 02:28:31 +00:00
|
|
|
lappend path_list $path
|
2007-05-08 03:35:48 +00:00
|
|
|
if {$path eq $current_diff_path} {
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
$after_chord eval { set should_reshow_diff 1 }
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
set path_cnt [llength $path_list]
|
|
|
|
set untracked_cnt [llength $untracked_list]
|
|
|
|
|
|
|
|
# Asynchronous operation: revert changes by checking them out afresh
|
|
|
|
# from the index.
|
|
|
|
if {$path_cnt > 0} {
|
|
|
|
# Split question between singular and plural cases, because
|
|
|
|
# such distinction is needed in some languages. Previously, the
|
|
|
|
# code used "Revert changes in" for both, but that can't work
|
|
|
|
# in languages where 'in' must be combined with word from
|
|
|
|
# rest of string (in different way for both cases of course).
|
|
|
|
#
|
|
|
|
# FIXME: Unfortunately, even that isn't enough in some languages
|
|
|
|
# as they have quite complex plural-form rules. Unfortunately,
|
|
|
|
# msgcat doesn't seem to support that kind of string
|
|
|
|
# translation.
|
|
|
|
#
|
|
|
|
if {$path_cnt == 1} {
|
|
|
|
set query [mc \
|
|
|
|
"Revert changes in file %s?" \
|
|
|
|
[short_path [lindex $path_list]] \
|
|
|
|
]
|
|
|
|
} else {
|
|
|
|
set query [mc \
|
|
|
|
"Revert changes in these %i files?" \
|
|
|
|
$path_cnt]
|
|
|
|
}
|
2007-07-21 12:21:34 +00:00
|
|
|
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
set reply [tk_dialog \
|
|
|
|
.confirm_revert \
|
|
|
|
"[appname] ([reponame])" \
|
|
|
|
"$query
|
|
|
|
|
|
|
|
[mc "Any unstaged changes will be permanently lost by the revert."]" \
|
|
|
|
question \
|
|
|
|
1 \
|
|
|
|
[mc "Do Nothing"] \
|
|
|
|
[mc "Revert Changes"] \
|
|
|
|
]
|
|
|
|
|
|
|
|
if {$reply == 1} {
|
2020-02-17 15:39:29 +00:00
|
|
|
set note [$after_chord add_note]
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
checkout_index \
|
|
|
|
$txt \
|
|
|
|
$path_list \
|
2020-02-17 15:39:29 +00:00
|
|
|
[list $note activate] \
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
$capture_error
|
|
|
|
}
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
# Asynchronous operation: Deletion of untracked files.
|
|
|
|
if {$untracked_cnt > 0} {
|
|
|
|
# Split question between singular and plural cases, because
|
|
|
|
# such distinction is needed in some languages.
|
|
|
|
#
|
|
|
|
# FIXME: Unfortunately, even that isn't enough in some languages
|
|
|
|
# as they have quite complex plural-form rules. Unfortunately,
|
|
|
|
# msgcat doesn't seem to support that kind of string
|
|
|
|
# translation.
|
|
|
|
#
|
|
|
|
if {$untracked_cnt == 1} {
|
|
|
|
set query [mc \
|
|
|
|
"Delete untracked file %s?" \
|
|
|
|
[short_path [lindex $untracked_list]] \
|
|
|
|
]
|
|
|
|
} else {
|
|
|
|
set query [mc \
|
|
|
|
"Delete these %i untracked files?" \
|
|
|
|
$untracked_cnt \
|
|
|
|
]
|
|
|
|
}
|
2008-01-08 20:21:15 +00:00
|
|
|
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
set reply [tk_dialog \
|
|
|
|
.confirm_revert \
|
|
|
|
"[appname] ([reponame])" \
|
|
|
|
"$query
|
|
|
|
|
|
|
|
[mc "Files will be permanently deleted."]" \
|
|
|
|
question \
|
|
|
|
1 \
|
|
|
|
[mc "Do Nothing"] \
|
|
|
|
[mc "Delete Files"] \
|
|
|
|
]
|
|
|
|
|
|
|
|
if {$reply == 1} {
|
|
|
|
$after_chord eval { set should_reshow_diff 1 }
|
|
|
|
|
2020-02-17 15:39:29 +00:00
|
|
|
set note [$after_chord add_note]
|
|
|
|
delete_files $untracked_list [list $note activate]
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Activate the common note. If no other notes were created, this
|
|
|
|
# completes the chord. If other notes were created, then this common
|
|
|
|
# note prevents a race condition where the chord might complete early.
|
2020-02-17 15:39:29 +00:00
|
|
|
$after_common_note activate
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Delete all of the specified files, performing deletion in batches to allow the
|
|
|
|
# UI to remain responsive and updated.
|
|
|
|
proc delete_files {path_list after} {
|
|
|
|
# Enable progress bar status updates
|
|
|
|
set status_bar_operation [$::main_status \
|
|
|
|
start \
|
|
|
|
[mc "Deleting"] \
|
|
|
|
[mc "files"]]
|
|
|
|
|
|
|
|
set path_index 0
|
|
|
|
set deletion_errors [list]
|
|
|
|
set batch_size 50
|
|
|
|
|
|
|
|
delete_helper \
|
|
|
|
$path_list \
|
|
|
|
$path_index \
|
|
|
|
$deletion_errors \
|
|
|
|
$batch_size \
|
|
|
|
$status_bar_operation \
|
|
|
|
$after
|
|
|
|
}
|
|
|
|
|
|
|
|
# Helper function to delete a list of files in batches. Each call deletes one
|
|
|
|
# batch of files, and then schedules a call for the next batch after any UI
|
|
|
|
# messages have been processed.
|
|
|
|
proc delete_helper {path_list path_index deletion_errors batch_size \
|
|
|
|
status_bar_operation after} {
|
|
|
|
global file_states
|
|
|
|
|
|
|
|
set path_cnt [llength $path_list]
|
|
|
|
|
|
|
|
set batch_remaining $batch_size
|
|
|
|
|
|
|
|
while {$batch_remaining > 0} {
|
|
|
|
if {$path_index >= $path_cnt} { break }
|
|
|
|
|
|
|
|
set path [lindex $path_list $path_index]
|
|
|
|
|
|
|
|
set deletion_failed [catch {file delete -- $path} deletion_error]
|
|
|
|
|
|
|
|
if {$deletion_failed} {
|
|
|
|
lappend deletion_errors [list "$deletion_error"]
|
|
|
|
} else {
|
|
|
|
remove_empty_directories [file dirname $path]
|
|
|
|
|
|
|
|
# Don't assume the deletion worked. Remove the file from
|
|
|
|
# the UI, but only if it no longer exists.
|
|
|
|
if {![path_exists $path]} {
|
|
|
|
unset file_states($path)
|
|
|
|
display_file $path __
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
incr path_index 1
|
|
|
|
incr batch_remaining -1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Update the progress bar to indicate that this batch has been
|
|
|
|
# completed. The update will be visible when this procedure returns
|
|
|
|
# and allows the UI thread to process messages.
|
|
|
|
$status_bar_operation update $path_index $path_cnt
|
|
|
|
|
|
|
|
if {$path_index < $path_cnt} {
|
|
|
|
# The Tcler's Wiki lists this as the best practice for keeping
|
|
|
|
# a UI active and processing messages during a long-running
|
|
|
|
# operation.
|
|
|
|
|
|
|
|
after idle [list after 0 [list \
|
|
|
|
delete_helper \
|
2019-12-01 02:28:31 +00:00
|
|
|
$path_list \
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
$path_index \
|
|
|
|
$deletion_errors \
|
|
|
|
$batch_size \
|
|
|
|
$status_bar_operation \
|
|
|
|
$after
|
|
|
|
]]
|
2007-05-08 03:35:48 +00:00
|
|
|
} else {
|
git-gui: revert untracked files by deleting them
Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.
A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.
Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.
Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-01 02:28:33 +00:00
|
|
|
# Finish the status bar operation.
|
|
|
|
$status_bar_operation stop
|
|
|
|
|
|
|
|
# Report error, if any, based on how many deletions failed.
|
|
|
|
set deletion_error_cnt [llength $deletion_errors]
|
|
|
|
|
|
|
|
if {($deletion_error_cnt > 0)
|
|
|
|
&& ($deletion_error_cnt <= [MAX_VERBOSE_FILES_IN_DELETION_ERROR])} {
|
|
|
|
set error_text [mc "Encountered errors deleting files:\n"]
|
|
|
|
|
|
|
|
foreach deletion_error $deletion_errors {
|
|
|
|
append error_text "* [lindex $deletion_error 0]\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
error_popup $error_text
|
|
|
|
} elseif {$deletion_error_cnt == $path_cnt} {
|
|
|
|
error_popup [mc \
|
|
|
|
"None of the %d selected files could be deleted." \
|
|
|
|
$path_cnt \
|
|
|
|
]
|
|
|
|
} elseif {$deletion_error_cnt > 1} {
|
|
|
|
error_popup [mc \
|
|
|
|
"%d of the %d selected files could not be deleted." \
|
|
|
|
$deletion_error_cnt \
|
|
|
|
$path_cnt \
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
uplevel #0 $after
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc MAX_VERBOSE_FILES_IN_DELETION_ERROR {} { return 10; }
|
|
|
|
|
|
|
|
# This function is from the TCL documentation:
|
|
|
|
#
|
|
|
|
# https://wiki.tcl-lang.org/page/file+exists
|
|
|
|
#
|
|
|
|
# [file exists] returns false if the path does exist but is a symlink to a path
|
|
|
|
# that doesn't exist. This proc returns true if the path exists, regardless of
|
|
|
|
# whether it is a symlink and whether it is broken.
|
|
|
|
proc path_exists {name} {
|
|
|
|
expr {![catch {file lstat $name finfo}]}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Remove as many empty directories as we can starting at the specified path,
|
|
|
|
# walking up the directory tree. If we encounter a directory that is not
|
|
|
|
# empty, or if a directory deletion fails, then we stop the operation and
|
|
|
|
# return to the caller. Even if this procedure fails to delete any
|
|
|
|
# directories at all, it does not report failure.
|
|
|
|
proc remove_empty_directories {directory_path} {
|
|
|
|
set parent_path [file dirname $directory_path]
|
|
|
|
|
|
|
|
while {$parent_path != $directory_path} {
|
|
|
|
set contents [glob -nocomplain -dir $directory_path *]
|
|
|
|
|
|
|
|
if {[llength $contents] > 0} { break }
|
|
|
|
if {[catch {file delete -- $directory_path}]} { break }
|
|
|
|
|
|
|
|
set directory_path $parent_path
|
|
|
|
set parent_path [file dirname $directory_path]
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc do_revert_selection {} {
|
|
|
|
global current_diff_path selected_paths
|
|
|
|
|
|
|
|
if {[array size selected_paths] > 0} {
|
|
|
|
revert_helper \
|
2008-09-04 09:50:53 +00:00
|
|
|
[mc "Reverting selected files"] \
|
2007-05-08 03:35:48 +00:00
|
|
|
[array names selected_paths]
|
|
|
|
} elseif {$current_diff_path ne {}} {
|
|
|
|
revert_helper \
|
2008-09-04 09:50:53 +00:00
|
|
|
[mc "Reverting %s" [short_path $current_diff_path]] \
|
2007-05-08 03:35:48 +00:00
|
|
|
[list $current_diff_path]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc do_select_commit_type {} {
|
2019-09-13 06:02:30 +00:00
|
|
|
global commit_type commit_type_is_amend
|
2007-05-08 03:35:48 +00:00
|
|
|
|
2019-09-13 06:02:30 +00:00
|
|
|
if {$commit_type_is_amend == 0
|
2007-05-08 03:35:48 +00:00
|
|
|
&& [string match amend* $commit_type]} {
|
|
|
|
create_new_commit
|
2019-09-13 06:02:30 +00:00
|
|
|
} elseif {$commit_type_is_amend == 1
|
2007-05-08 03:35:48 +00:00
|
|
|
&& ![string match amend* $commit_type]} {
|
|
|
|
load_last_commit
|
|
|
|
|
|
|
|
# The amend request was rejected...
|
|
|
|
#
|
|
|
|
if {![string match amend* $commit_type]} {
|
2019-09-13 06:02:30 +00:00
|
|
|
set commit_type_is_amend 0
|
2007-05-08 03:35:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|