Fossil SCM
Added placeholder code to the fossil accessor class for the import of a revision. currently only logging the call.
Commit
f9e0d23d97e9bce240ff9ea8b9373304ef63bc6e
Parent
9e1b461b2f7fd63…
1 file changed
+25
| --- tools/cvs2fossil/lib/c2f_fossil.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_fossil.tcl | ||
| @@ -92,10 +92,35 @@ | ||
| 92 | 92 | $self RestorePwd |
| 93 | 93 | |
| 94 | 94 | log write 3 fossil Done. |
| 95 | 95 | return [array get id] |
| 96 | 96 | } |
| 97 | + | |
| 98 | + method importrevision {label user message date parent revisions} { | |
| 99 | + # TODO = Write the actual import, and up the log level. | |
| 100 | + | |
| 101 | + log write 2 fossil {== $user @ [clock format $date]} | |
| 102 | + log write 2 fossil {-> $parent} | |
| 103 | + log write 2 fossil {%% [join [split $message \n] "\n%% "]} | |
| 104 | + | |
| 105 | + set uuids {} | |
| 106 | + foreach {uuid fname revnr} $revisions { | |
| 107 | + lappend uuids $uuid | |
| 108 | + log write 2 fossil {** $fname/$revnr = <$uuid>} | |
| 109 | + } | |
| 110 | + | |
| 111 | + # Massage the commit message to remember the old user name | |
| 112 | + # which did the commit in CVS. | |
| 113 | + | |
| 114 | + set message "By $user:\n$message" | |
| 115 | + | |
| 116 | + # run fossil test-command performing the import. | |
| 117 | + # | |
| 118 | + | |
| 119 | + log write 2 fossil {== $label} | |
| 120 | + return $label ; # FAKE a uuid for the moment | |
| 121 | + } | |
| 97 | 122 | |
| 98 | 123 | method finalize {destination} { |
| 99 | 124 | ::file rename -force $myrepository $destination |
| 100 | 125 | ::file delete -force $myworkspace |
| 101 | 126 | $self destroy |
| 102 | 127 |
| --- tools/cvs2fossil/lib/c2f_fossil.tcl | |
| +++ tools/cvs2fossil/lib/c2f_fossil.tcl | |
| @@ -92,10 +92,35 @@ | |
| 92 | $self RestorePwd |
| 93 | |
| 94 | log write 3 fossil Done. |
| 95 | return [array get id] |
| 96 | } |
| 97 | |
| 98 | method finalize {destination} { |
| 99 | ::file rename -force $myrepository $destination |
| 100 | ::file delete -force $myworkspace |
| 101 | $self destroy |
| 102 |
| --- tools/cvs2fossil/lib/c2f_fossil.tcl | |
| +++ tools/cvs2fossil/lib/c2f_fossil.tcl | |
| @@ -92,10 +92,35 @@ | |
| 92 | $self RestorePwd |
| 93 | |
| 94 | log write 3 fossil Done. |
| 95 | return [array get id] |
| 96 | } |
| 97 | |
| 98 | method importrevision {label user message date parent revisions} { |
| 99 | # TODO = Write the actual import, and up the log level. |
| 100 | |
| 101 | log write 2 fossil {== $user @ [clock format $date]} |
| 102 | log write 2 fossil {-> $parent} |
| 103 | log write 2 fossil {%% [join [split $message \n] "\n%% "]} |
| 104 | |
| 105 | set uuids {} |
| 106 | foreach {uuid fname revnr} $revisions { |
| 107 | lappend uuids $uuid |
| 108 | log write 2 fossil {** $fname/$revnr = <$uuid>} |
| 109 | } |
| 110 | |
| 111 | # Massage the commit message to remember the old user name |
| 112 | # which did the commit in CVS. |
| 113 | |
| 114 | set message "By $user:\n$message" |
| 115 | |
| 116 | # run fossil test-command performing the import. |
| 117 | # |
| 118 | |
| 119 | log write 2 fossil {== $label} |
| 120 | return $label ; # FAKE a uuid for the moment |
| 121 | } |
| 122 | |
| 123 | method finalize {destination} { |
| 124 | ::file rename -force $myrepository $destination |
| 125 | ::file delete -force $myworkspace |
| 126 | $self destroy |
| 127 |