ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/svn2cvs/svn2cvs
(Generate patch)

Comparing svn2cvs (file contents):
Revision 1.1 by yakumo_izuru, Mon Sep 30 00:29:31 2024 UTC vs.
Revision 1.5 by nishi, Thu Oct 17 09:56:18 2024 UTC

# Line 11 | Line 11 | set rev "[lindex $argv 3]"
11   set old "[pwd]"
12   set log [exec svn log --incremental "$svn" -r "$rev" | tail -n1]
13  
14 + set added ""
15 + set removed ""
16 +
17   exec -ignorestderr svn up "$svn" -r "$rev"
18   exec -ignorestderr cvs up -d "$cvs"
19  
20   proc rescan {path prefix} {
21 <        global svn cvs cache old
21 >        global svn cvs cache old added
22          foreach name [glob -tails -nocomplain -directory "$path" *] {
23                  if { [file type "$path/$name"] == "directory" } {
24                          if { ! [file exists "$cvs/$prefix/$name"] } {
25                                  file mkdir "$cvs/$prefix/$name"
26                                  file mkdir "$cache/$prefix/$name"
27                                  cd "$cvs"
28 <                                exec -ignorestderr cvs add "[string range "$prefix/$name" 1 [string length "$prefix/$name"]]"
28 >                                lappend added "[string range "$prefix/$name" 1 [string length "$prefix/$name"]]"
29                                  cd "$old"
30                          }
31                          rescan "$path/$name" "$prefix/$name"
# Line 36 | Line 39 | proc rescan {path prefix} {
39                                  file copy -force "$path/$name" "$cvs/$prefix/$name"
40                                  file copy -force "$path/$name" "$cache/$prefix/$name"
41                                  cd "$cvs"
42 <                                exec -ignorestderr cvs add "[string range "$prefix/$name" 1 [string length "$prefix/$name"]]"
42 >                                lappend added "[string range "$prefix/$name" 1 [string length "$prefix/$name"]]"
43                                  cd "$old"
44                          } else {
45                                  set hash1 [::sha2::sha256 -hex -filename "$path/$name"]
# Line 54 | Line 57 | proc rescan {path prefix} {
57   }
58  
59   proc remove_left {path prefix} {
60 <        global svn cvs cache old
60 >        global svn cvs cache old removed
61          foreach name [glob -tails -nocomplain -directory "$path" *] {
62                  if { [file type "$path/$name"] == "directory" } {
63                          if { "$name" != "CVS" } {
# Line 64 | Line 67 | proc remove_left {path prefix} {
67                          if { [file exists "$cvs/$prefix/$name"] && ![file exists "$svn/$prefix/$name"] } {
68                                  cd "$cvs"
69                                  file delete "[string range "$prefix/$name" 1 [string length "$prefix/$name"]]"
70 <                                exec -ignorestderr cvs rm "[string range "$prefix/$name" 1 [string length "$prefix/$name"]]"
70 >                                lappend removed "[string range "$prefix/$name" 1 [string length "$prefix/$name"]]"
71                                  cd "$old"
72                                  file delete "$cache/$prefix/$name"
73  
# Line 77 | Line 80 | rescan "$svn" ""
80   remove_left "$cvs" ""
81  
82   cd "$cvs"
83 + if { "$added" != "" } {
84 +        eval exec -ignorestderr cvs add \"[join $added "\" \""]\" >/dev/stdout 2>@1
85 + }
86 + if { "$removed" != "" } {
87 +        eval exec -ignorestderr cvs rm \"[join $added "\" \""]\" >/dev/stdout 2>@1
88 + }
89   exec -ignorestderr cvs ci -m "$log"
90   cd "$old"
91  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines