Diff
Not logged in

Differences From:

File tools/lib/fossil.tcl part of check-in [df91d389d5] - First semi-complete app for import from CVS. Trunk only, wholesale only. by aku on 2007-09-04 05:36:56. [view]

To:

File tools/lib/fossil.tcl part of check-in [492531e3a8] - Importer extended to allow capture of exact fossil commit command by aku on 2007-09-04 22:00:31. [view]

@@ -46,14 +46,28 @@
     variable fr {}
 
     # Fossil application
     variable fossil [auto_execok fossil]
+
+    # Debug the commit command (write a Tcl script containing the
+    # exact command used). And the file the data goes to.
+    variable debugcommit 0
+    variable dcfile      {}
 }
 
+proc ::fossil::debugcommit {flag} {
+    variable debugcommit $flag
+    if {$debugcommit} {
+	variable dcfile [file normalize cvs2fossil_commit.tcl]
+    }
+    return
+}
 
 proc ::fossil::commit {appname nosign meta ignore} {
     variable fossil
     variable lastuuid
+    variable debugcommit
+    variable dcfile
 
     # Commit the current state of the workspace. Scan for new and
     # removed files and issue the appropriate fossil add/rm commands
     # before actually comitting.
@@ -98,14 +112,20 @@
 			   "-- Originally by $user @ $tstamp" \
 			   "-- Imported by $appname" \
 			   $message] \n]
 
+    if {$nosign} {
+	set cmd [list exec $fossil commit -m $message --nosign]
+    } else {
+	set cmd [list exec $fossil commit -m $message]
+    }
+
+    if {$debugcommit} {
+	fileutil::writeFile $dcfile "\#!tclsh\n$cmd\n"
+    }
+
     if {[catch {
-	if {$nosign} {
-	    exec $fossil commit -m $message --nosign
-	} else {
-	    exec $fossil commit -m $message
-	}
+	eval $cmd
     } line]} {
 	if {![string match "*nothing has changed*" $line]} {
 	    return -code error $line
 	}