X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-cvsimport.perl;h=d83c52fcb205f86eb86dd2875c6f88c3a8a7223f;hb=71b08148366bbc4d02b3477e7ded35b049206f89;hp=af331d9c4316a56db7bd4b3cfb4f1d5d8d5f6de5;hpb=f2054be4c4816d8c363dc867f462bc0af9031c02;p=git.git diff --git a/git-cvsimport.perl b/git-cvsimport.perl index af331d9c..d83c52fc 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -23,7 +23,7 @@ use File::Basename qw(basename dirname); use Time::Local; use IO::Socket; use IO::Pipe; -use POSIX qw(strftime dup2 :errno_h); +use POSIX qw(strftime dup2 ENOENT); use IPC::Open2; $SIG{'PIPE'}="IGNORE"; @@ -595,7 +595,11 @@ sub write_tree () { } my($patchset,$date,$author_name,$author_email,$branch,$ancestor,$tag,$logmsg); -my(@old,@new,@skipped); +my(@old,@new,@skipped,%ignorebranch); + +# commits that cvsps cannot place anywhere... +$ignorebranch{'#CVSPS_NO_BRANCH'} = 1; + sub commit { update_index(@old, @new); @old = @new = (); @@ -751,7 +755,16 @@ while() { $state = 11; next; } + if (exists $ignorebranch{$branch}) { + print STDERR "Skipping $branch\n"; + $state = 11; + next; + } if($ancestor) { + if($ancestor eq $branch) { + print STDERR "Branch $branch erroneously stems from itself -- changed ancestor to $opt_o\n"; + $ancestor = $opt_o; + } if(-f "$git_dir/refs/heads/$branch") { print STDERR "Branch $branch already exists!\n"; $state=11; @@ -759,6 +772,7 @@ while() { } unless(open(H,"$git_dir/refs/heads/$ancestor")) { print STDERR "Branch $ancestor does not exist!\n"; + $ignorebranch{$branch} = 1; $state=11; next; } @@ -766,6 +780,7 @@ while() { close(H); unless(open(H,"> $git_dir/refs/heads/$branch")) { print STDERR "Could not create branch $branch: $!\n"; + $ignorebranch{$branch} = 1; $state=11; next; }