@matheusbsbs / matheus-bagliano / commits / 9bf046372b
Fork 0

git-svn: better error reporting if --follow-parent fails

This will be useful to me when I try more special-cases of parent-tracking. Signed-off-by: Eric Wong <normalperson@yhbt.net>

Eric Wong committed Jan 23, 2007 at 13:03 UTC 9bf046372b370fba8958ba6ef9dc63b232d7637c
1 file changed +14 -3
git-svn.perl
+14 -3
@@ -1056,10 +1056,12 @@ sub revisions_eq {
1056
1057 sub find_parent_branch {
1058 my ($self, $paths, $rev) = @_;
1059 + return undef unless $::_follow_parent;
1060
1061 # look for a parent from another branch:
1061 - my $i = $paths->{'/'.$self->rel_path} or return;
1062 - my $branch_from = $i->copyfrom_path or return;
1062 + my $abs_path = '/'.$self->rel_path;
1063 + my $i = $paths->{$abs_path} or goto not_found;
1064 + my $branch_from = $i->copyfrom_path or goto not_found;
1065 my $r = $i->copyfrom_rev;
1066 my $repos_root = $self->ra->{repos_root};
1067 my $url = $self->ra->{url};
@@ -1118,7 +1120,16 @@ sub find_parent_branch {
1120 }
1121 return $self->make_log_entry($rev, [$parent], $ed);
1122 }
1121 - print STDERR "Branch parent not found...\n";
1123 +not_found:
1124 + print STDERR "Branch parent for path: '$abs_path' not found\n";
1125 + return undef unless $paths;
1126 + foreach my $p (sort keys %$paths) {
1127 + print STDERR ' ', $p->action, ' ', $p;
1128 + if (my $cp_from = $p->copyfrom_path) {
1129 + print STDERR "(from $cp_from:", $p->copyfrom_rev, ')';
1130 + }
1131 + print STDERR "\n";
1132 + }
1133 return undef;
1134 }
1135