summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b19ee24)
raw | patch | inline | side by side (parent: b19ee24)
author | Martin Langhoff <martin@catalyst.net.nz> | |
Sun, 11 Jun 2006 08:12:09 +0000 (20:12 +1200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 17 Jun 2006 05:45:11 +0000 (22:45 -0700) |
cvsps output often contains references to CVSPS_NO_BRANCH, commits
that it could not trace to a branch. Ignore that branch.
Additionally, cvsps will sometimes draw circular relationships
between branches -- where two branches are recorded as opening
from the other. In those cases, and where the ancestor branch
hasn't been seen, ignore it.
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
that it could not trace to a branch. Ignore that branch.
Additionally, cvsps will sometimes draw circular relationships
between branches -- where two branches are recorded as opening
from the other. In those cases, and where the ancestor branch
hasn't been seen, ignore it.
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-cvsimport.perl | patch | blob | history |
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 76f6246a31b86dd54ca0556f76a8511d73be8ec7..d83c52fcb205f86eb86dd2875c6f88c3a8a7223f 100755 (executable)
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
}
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 = ();
$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;
}
unless(open(H,"$git_dir/refs/heads/$ancestor")) {
print STDERR "Branch $ancestor does not exist!\n";
+ $ignorebranch{$branch} = 1;
$state=11;
next;
}
close(H);
unless(open(H,"> $git_dir/refs/heads/$branch")) {
print STDERR "Could not create branch $branch: $!\n";
+ $ignorebranch{$branch} = 1;
$state=11;
next;
}