Check-in [27470a9304]
Not logged in
Overview

SHA1 Hash:27470a9304a6123594dba78eee4681d7980ea10e
Date: 2007-10-13 21:15:30
User: aku
Comment:Extended pass I to capture the 'file executable' info of rcs archives. Currently the only way to store this info in the destination will be the use of fossil tags.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified tools/cvs2fossil/lib/c2f_file.tcl from [880ea7b085] to [f6e7796985].

@@ -29,13 +29,14 @@
 
 snit::type ::vc::fossil::import::cvs::file {
     # # ## ### ##### ######## #############
     ## Public API
 
-    constructor {path project} {
-	set mypath    $path
-	set myproject $project
+    constructor {path executable project} {
+	set mypath       $path
+	set myexecutable $executable
+	set myproject    $project
 	return
     }
 
     method path    {} { return $mypath }
     method project {} { return $myproject }
@@ -186,11 +187,12 @@
     method done {} {}
 
     # # ## ### ##### ######## #############
     ## State
 
-    variable mypath            {} ; # Path of our rcs archive.
+    variable mypath            {} ; # Path of the file's rcs archive.
+    variable myexecutable      0  ; # Boolean flag 'file executable'.
     variable myproject         {} ; # Reference to the project object
 				    # the file belongs to.
     variable myrev -array      {} ; # Maps revision number to the
 				    # associated revision object.
     variable myrevisions       {} ; # Same as myrev, but a list,
@@ -225,11 +227,10 @@
 			     # reverse of definition.  I.e. a smaller
 			     # number means 'Defined earlier', means
 			     # 'Created later'.
 
     ### TODO ###
-    ### File flag - executable,
     ### RCS mode info (kb, kkb, ...)
 
     # # ## ### ##### ######## #############
     ## Internal methods
 

Modified tools/cvs2fossil/lib/c2f_pcollar.tcl from [97283400ae] to [5368abc30d].

@@ -72,10 +72,11 @@
 	state writing file {
 	    fid     INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
 	    pid     INTEGER  NOT NULL  REFERENCES project,       -- project the file belongs to
 	    name    TEXT     NOT NULL,
 	    visible TEXT     NOT NULL,
+	    exec    INTEGER  NOT NULL, -- boolean, 'file executable'.
 	    UNIQUE (pid, name)         -- file names are unique within a project
 	}
 	return
     }
 
@@ -108,11 +109,11 @@
 		    trouble fatal "    $base/$rcs"
 		    continue
 		}
 
 		log write 4 collar "Found   $rcs"
-		$project add $rcs $usr
+		$project addfile $rcs $usr [file executable $rcs]
 
 		incr n
 		if {[log verbosity?] < 4} {
 		    log progress 0 collar $n {}
 		}

Modified tools/cvs2fossil/lib/c2f_project.tcl from [28c5638d78] to [beed7d8406].

@@ -16,12 +16,13 @@
 ## Requirements
 
 package require Tcl 8.4                               ; # Required runtime.
 package require snit                                  ; # OO system.
 package require vc::fossil::import::cvs::file         ; # CVS archive file.
-package require vc::fossil::import::cvs::state        ; # State storage
-package require vc::fossil::import::cvs::project::sym ; # Per project symbols
+package require vc::fossil::import::cvs::state        ; # State storage.
+package require vc::fossil::import::cvs::project::sym ; # Per project symbols.
+package require struct::list                          ; # Advanced list operations..
 
 # # ## ### ##### ######## ############# #####################
 ##
 
 snit::type ::vc::fossil::import::cvs::project {
@@ -39,12 +40,12 @@
     method printbase {} {
 	if {$mybase eq ""} {return <Repository>}
 	return $mybase
     }
 
-    method add {rcs usr} {
-	set myfiles($rcs) $usr
+    method addfile {rcs usr executable} {
+	set myfiles($rcs) [list $usr $executable]
 	return
     }
 
     method filenames {} {
 	return [lsort -dict [array names myfiles]]
@@ -78,14 +79,15 @@
 	    set pid [state id]
 
 	    # Then all files, with proper backreference to their
 	    # project.
 
-	    foreach {rcs usr} [array get myfiles] {
+	    foreach {rcs item} [array get myfiles] {
+		struct::list assign $item usr executable
 		state run {
-		    INSERT INTO file (fid,  pid,  name, visible)
-		    VALUES           (NULL, $pid, $rcs, $usr);
+		    INSERT INTO file (fid,  pid,  name, visible, exec)
+		    VALUES           (NULL, $pid, $rcs, $usr,    $executable);
 		}
 	    }
 	}
 	return
     }
@@ -122,12 +124,13 @@
     }
 
     proc EmptyFiles {fv} {
 	upvar 1 $fv myfiles self self
 	set res {}
-	foreach f [lsort -dict [array names myfiles]] {
-	    lappend res [file %AUTO% $f $self]
+	foreach item [lsort -dict [array names myfiles]] {
+	    struct::list assign $item f executable
+	    lappend res [file %AUTO% $f $executable $self]
 	}
 	return $res
     }
 
     # # ## ### ##### ######## #############