[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
patch for cvs and tkcvs to allow better handling of unedit/reset from tk
From: |
niraj gupta |
Subject: |
patch for cvs and tkcvs to allow better handling of unedit/reset from tkcvs |
Date: |
Tue, 13 Nov 2001 11:32:32 -0800 |
sorry the patch on tkcvs got screwed up here is the patch again
cheers
niraj gupta
--- tkcvs-7.0.2/tkcvs/cvs.tcl Sun Oct 14 23:24:33 2001
+++ cvs.tcl Tue Nov 13 11:15:50 2001
@@ -217,15 +217,29 @@
set commandline "cvs -d $cvscfg(cvsroot) -n -l update \"$file\""
gen_log:log C "$commandline"
catch {eval "exec $commandline"} view_this
- # Its OK if its locally added
- if {([llength $view_this] > 0) && ![string match "A*" $view_this] } {
- gen_log:log D "$view_this"
- cvsfail "File $file is not up-to-date"
- gen_log:log T "LEAVE -- cvs unedit failed"
- return
+ if {([llength $view_this] > 0) && [string match "M*" $view_this] } {
+ set mess "You are about to unedit a file"
+ append mess " which has been locally modified"
+ append mess " all changes will be lost\n"
+ append mess "\n\t$file"
+ append mess"\n\nAre you sure?"
+ if {[cvsconfirm $mess] == 1} {
+ gen_log:log D "$view_this"
+ cvsfail "File $file is not up-to-date"
+ gen_log:log T "LEAVE -- cvs unedit failed"
+ return
+ }
+ } else {
+ # Its OK if its locally added
+ if {([llength $view_this] > 0) && ![string match "A*" $view_this] } {
+ gen_log:log D "$view_this"
+ cvsfail "File $file is not up-to-date"
+ gen_log:log T "LEAVE -- cvs unedit failed"
+ return
+ }
}
- set commandline "$cvs -d $cvscfg(cvsroot) unedit \"$file\""
+ set commandline "$cvs -d $cvscfg(cvsroot) unedit -q \"$file\""
gen_log:log C "$commandline"
set ret [catch {eval "exec $commandline"} view_this]
if {$ret != 0} {