Overview
SHA1 Hash: | 3cd599cacdd9e2b09f159230e4f5f28bf5f831e7 |
---|---|
Date: | 2008-01-31 05:39:51 |
User: | aku |
Comment: | Moved the most complex parts of pushto into their own commands. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified tools/cvs2fossil/lib/c2f_prev.tcl from [5b323107c1] to [696f01d05d].
@@ -408,10 +408,46 @@ # - List of the file revisions in the changeset. struct::list assign [$myproject getmeta $mysrcid] __ branch user message struct::list assign $branch __ lodname + # Perform the import. As part of that convert the list of + # items in the changeset into uuids and printable data. + + set uuid [Updatestate state $lodname \ + [$repository importrevision [$self str] \ + $user $message $date \ + [Getparent state $lodname $myproject] \ + [Getrevisioninfo $myitems]]] + + # Remember the whole changeset / uuid mapping, for the tags. + + state run { + INSERT INTO csuuid (cid, uuid) + VALUES ($myid, $uuid) + } + return + } + + proc Getrevisioninfo {revisions} { + set theset ('[join $revisions {','}]') + set revisions {} + foreach {uuid fname revnr} [state run [subst -nocommands -nobackslashes { + SELECT U.uuid, F.name, R.rev + FROM revision R, revuuid U, file F + WHERE R.rid IN $theset -- All specified revisions + AND U.rid = R.rid -- get fossil uuid of revision + AND F.fid = R.fid -- get file of revision + }]] { + lappend revisions $uuid $fname $revnr + } + return $revisions + } + + proc Getparent {sv lodname project} { + upvar 1 $sv state + # The parent is determined via the line-of-development (LOD) # information of each changeset, and the history of # imports. The last changeset committed to the same LOD is # taken as the parent of the current changeset. If the # changeset is the first on that LOD it can be either spawned @@ -427,54 +463,36 @@ # the various possibilities of its interaction with the # trunk are not fully handled. if {[info exists state($lodname)]} { # LOD exists and has already been committed to. - set parent $state($lodname) - } else { - # LOD has not been committed to before, this is the first - # time. Determine the name of the parent LOD. - - set plodname [[[$myproject getsymbol $lodname] parent] name] - - if {[info exists state($plodname)]} { - # The parental LOD has been committed to, take that - # last changeset as the spawnpoint for the new LOD. - set parent $state($plodname) - } else { - # The parental LOD is not defined (yet). This LOD is - # detached. We choose as our parent the automatic - # empty root baseline of the target repository. - set parent {} - } - } - - # Perform the import. As part of that convert the list of - # items in the changeset into uuids and printable data. - - set theset ('[join $myitems {','}]') - set uuid [$repository importrevision [$self str] \ - $user $message $date $parent \ - [state run [subst -nocommands -nobackslashes { - SELECT U.uuid, F.name, R.rev - FROM revision R, revuuid U, file F - WHERE R.rid IN $theset -- All specified revisions - AND U.rid = R.rid -- get fossil uuid of revision - AND F.fid = R.fid -- get file of revision - }]]] - + return $state($lodname) + } + + # LOD has not been committed to before, this is the first + # time. Determine the name of the parent LOD. + + set lodname [[[$project getsymbol $lodname] parent] name] + + if {[info exists state($lodname)]} { + # The parental LOD has been committed to, take that last + # changeset as the spawnpoint for the new LOD. + return $state($lodname) + } + + # The parental LOD is not defined (yet). This LOD is + # detached. We choose as our parent the automatic empty root + # baseline of the target repository. + return {} + } + + proc Updatestate {sv lodname uuid} { # Remember the imported changeset in the state, under our LOD. + upvar 1 $sv state set state($lodname) $uuid - - # Remember the whole changeset / uuid mapping, for the tags. - - state run { - INSERT INTO csuuid (cid, uuid) - VALUES ($myid, $uuid) - } - return + return $uuid } typemethod split {cset args} { # As part of the creation of the new changesets specified in # ARGS as sets of items, all subsets of CSET's item set, CSET