Check-in [2a98ac44bd]
Not logged in
Overview

SHA1 Hash:2a98ac44bd535270ce50afb7f20ec3955bff6d83
Date: 2007-10-02 03:05:43
User: aku
Comment:Third attempt at getting a cvs importer which can handle branches. Using cvs2svn code and design notes as a guide.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Added tools/cvs2fossil/cvs2fossil version [df73a69477]

@@ -1,1 +1,32 @@
+#!/bin/sh
+## -*- tcl -*- \
+exec tclsh "$0" ${1+"$@"}
+
+# # ## ### ##### ######## ############# #####################
+## Copyright (c) 2007 Andreas Kupries.
+#
+# This software is licensed as described in the file LICENSE, which
+# you should have received as part of this distribution.
+#
+# This software consists of voluntary contributions made by many
+# individuals.  For exact contribution history, see the revision
+# history and logs, available at http://fossil-scm.hwaci.com/fossil
+# # ## ### ##### ######## ############# #####################
+
+## Command line application wrapped around the import packages.
+
+# # ## ### ##### ######## ############# #####################
+## Requirements, extended package management for local packages.
+
+lappend auto_path [file join [file dirname [info script]] lib]
+
+package require Tcl 8.4                 ; # Required runtime.
+package require vc::fossil::import::cvs ; # Main functionality.
+
+# # ## ### ##### ######## ############# #####################
+## Execution
+
+vc::fossil::import::cvs run $argv
+exit 0
 
+# # ## ### ##### ######## ############# #####################

Added tools/cvs2fossil/doc/LICENSE version [aede671429]

@@ -1,1 +1,19 @@
+This code is under the same license as fossil itself.
+
+- - -- --- ----- ---------
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License version 2 as published by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this library; if not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA  02111-1307, USA.
 
+- - -- --- ----- ---------

Added tools/cvs2fossil/doc/README version [6d655c3f82]

@@ -1,1 +1,7 @@
 
+[Acknowledge the work done by the creators of and submitters to the
+cvs2svn project/application. Needed their documentation, notes, and
+code as guide for this implementation.]
+
+[Determine if their license allows me to copy their notes here for
+reference.]

Added tools/cvs2fossil/lib/c2f_option.tcl version [db1981ab35]

@@ -1,1 +1,128 @@
+## -*- tcl -*-
+# # ## ### ##### ######## ############# #####################
+## Copyright (c) 2007 Andreas Kupries.
+#
+# This software is licensed as described in the file LICENSE, which
+# you should have received as part of this distribution.
+#
+# This software consists of voluntary contributions made by many
+# individuals.  For exact contribution history, see the revision
+# history and logs, available at http://fossil-scm.hwaci.com/fossil
+# # ## ### ##### ######## ############# #####################
+
+## Option database, processes the command line. Note that not all of
+## the option information is stored here. Parts are propagated to
+## other pieces of the system and handled there, via option
+## delegation
+
+# # ## ### ##### ######## ############# #####################
+## Requirements
+
+package require Tcl 8.4                         ; # Required runtime.
+package require snit                            ; # OO system
+
+# # ## ### ##### ######## ############# #####################
+##
+
+snit::type ::vc::fossil::import::cvs::option {
+    # # ## ### ##### ######## #############
+    ## Public API, Options.
+
+    # --help, --help-passes, -h
+    # --version
+    # --project
+    # --cache (conversion status, ala config.cache)
+
+    # -o, --output
+    # --dry-run
+    # --trunk-only
+    # --force-branch RE
+    # --force-tag RE
+    # --symbol-transform RE:XX
+    # --exclude
+    # -p, --passes
+    # -v, --verbose
+    # -q, --quiet
+
+    # # ## ### ##### ######## #############
+    ## Public API, Methods
+
+    typemethod process {arguments} {
+	# Syntax of arguments: ?option ?value?...? /path/to/cvs/repository
+
+	while {[IsOption arguments -> option]} {
+	    switch -exact -- $option {
+		-h            -
+		--help        PrintHelp
+		--help-passes PrintHelpPasses
+		--version     PrintVersion
+		--project     {
+		    #cvs::repository addproject [Value arguments]
+		}
+		--cache       {
+		    # [Value arguments]
+		}
+		default {
+		    Usage $badoption$option\n$gethelp
+		}
+	    }
+	}
+
+	if {[llength $arguments] > 1} Usage
+	if {[llength $arguments] < 1} { Usage $nocvs }
+	#cvs::repository setbase [lindex $arguments 0]
+
+	Validate
+	return
+    }
+
+    # # ## ### ##### ######## #############
+    ## Internal methods and state
+
+    typevariable nocvs     "       The cvs-repository-path is missing."
+    typevariable badoption "       Bad option "
+    typevariable gethelp   "       Use --help to get help."
+
+    proc IsOption {av _ ov} {
+	upvar 1 $av arguments $ov option
+	set candidate [lindex $arguments 0]
+	if {![string match -* $candidate]} {return 0}
+	set option    $candidate
+	set arguments [lrange $arguments 1 end]
+	return 1
+    }
+
+    proc Value {av} {
+	upvar 1 $av arguments
+	set v         [lindex $arguments 0]
+	set arguments [lrange $arguments 1 end]
+	return $v
+    }
+
+    proc Validate {} {
+	return
+    }
+
+    proc Usage {{text {}}} {
+	global argv0
+	if {$text ne ""} {set text \n$text}
+	#trouble fatal "Usage: $argv0 ?option ?value?...? cvs-repository-path$text"
+	puts "Usage: $argv0 ?option ?value?...? cvs-repository-path$text"
+	exit 1
+    }
+
+    # # ## ### ##### ######## #############
+    ## Configuration
+
+    pragma -hasinstances   no ; # singleton
+    pragma -hastypeinfo    no ; # no introspection
+    pragma -hastypedestroy no ; # immortal
+
+    # # ## ### ##### ######## #############
+}
+
+# # ## ### ##### ######## ############# #####################
+## Ready
 
+package provide vc::fossil::import::cvs::option 1.0
+return

Added tools/cvs2fossil/lib/cvs2fossil.tcl version [2ea7561a94]

@@ -1,1 +1,59 @@
+## -*- tcl -*-
+# # ## ### ##### ######## ############# #####################
+## Copyright (c) 2007 Andreas Kupries.
+#
+# This software is licensed as described in the file LICENSE, which
+# you should have received as part of this distribution.
+#
+# This software consists of voluntary contributions made by many
+# individuals.  For exact contribution history, see the revision
+# history and logs, available at http://fossil-scm.hwaci.com/fossil
+# # ## ### ##### ######## ############# #####################
+
+## Main package of the cvs conversion/import facility. Loads the
+## required pieces and controls their interaction.
+
+# # ## ### ##### ######## ############# #####################
+## Requirements
+
+package require Tcl 8.4                         ; # Required runtime.
+package require snit                            ; # OO system
+package require vc::fossil::import::cvs::option ; # Cmd line parsing & database
+
+# # ## ### ##### ######## ############# #####################
+##
+
+snit::type ::vc::fossil::import::cvs {
+    # # ## ### ##### ######## #############
+    ## Public API, Methods
+
+    typemethod run {arguments} {
+	option process $arguments
+
+	# Run a series of passes over the cvs repository to extract,
+	# filter, and order its historical information. Which passes
+	# are actually run is determined through the specified options
+	# and their defaults.
+
+	foreach pass [option passes] {
+	    $pass run
+	}
+
+	return
+    }
+
+    # # ## ### ##### ######## #############
+    ## Configuration
+
+    pragma -hasinstances   no ; # singleton
+    pragma -hastypeinfo    no ; # no introspection
+    pragma -hastypedestroy no ; # immortal
+
+    # # ## ### ##### ######## #############
+}
+
+# # ## ### ##### ######## ############# #####################
+## Ready
 
+package provide vc::fossil::import::cvs 1.0
+return

Added tools/cvs2fossil/lib/pkgIndex.tcl version [5b7b443336]

@@ -1,1 +1,7 @@
-
+# # ## ### ##### ######## ############# #####################
+## Package management.
+## Index of the local packages required by cvs2fossil
+# # ## ### ##### ######## ############# #####################
+if {![package vsatisfies [package require Tcl] 8.4]} return
+package ifneeded vc::fossil::import::cvs         1.0 [list source [file join $dir cvs2fossil.tcl]]
+package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]]

Deleted tools/import-cvs.tcl version [6f6129caeb]

Deleted tools/lib/cvs.tcl version [c60b1c7187]

Deleted tools/lib/cvs_branch.tcl version [152bdf4197]

Deleted tools/lib/cvs_cmd.tcl version [47fea6fc5d]

Deleted tools/lib/cvs_csets.tcl version [4ade9049c6]

Deleted tools/lib/cvs_files.tcl version [24c1271ded]

Deleted tools/lib/cvs_sig.tcl version [c7b83a7c1c]

Deleted tools/lib/cvs_timeline.tcl version [09c55e80b2]

Deleted tools/lib/fossil.tcl version [6aae29bf14]

Deleted tools/lib/fossil_cmd.tcl version [49d37a1b8b]

Deleted tools/lib/import_map.tcl version [44f7107846]

Deleted tools/lib/import_statistics.tcl version [afdce6cc23]

Deleted tools/lib/importcvs.tcl version [55d61c3242]

Deleted tools/lib/log.tcl version [edfb9cfb1e]

Deleted tools/lib/pkgIndex.tcl version [fde05dafaa]

Deleted tools/lib/rcsparser.tcl version [f2a4e1c864]

Deleted tools/lib/trouble.tcl version [a4a0b8a72b]