提交 71b08148 编写于 作者: M Martin Langhoff 提交者: Junio C Hamano

cvsimport: ignore CVSPS_NO_BRANCH and impossible branches

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: NMartin Langhoff <martin@catalyst.net.nz>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 b19ee24b
......@@ -595,7 +595,11 @@ ()
}
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 @@ sub commit {
$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 @@ sub commit {
}
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 @@ sub commit {
close(H);
unless(open(H,"> $git_dir/refs/heads/$branch")) {
print STDERR "Could not create branch $branch: $!\n";
$ignorebranch{$branch} = 1;
$state=11;
next;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册