Skip to content

Commit

Permalink
git-svn: handle merge-base failures
Browse files Browse the repository at this point in the history
Change git-svn to warn and continue when merge-base fails while processing svn
merge tickets.

merge-base can fail when a partial branch is created and merged back to trunk
in svn, because it cannot find a common ancestor between the partial branch and
trunk.

Signed-off-by: Andrew Myrick <amyrick@apple.com>
Acked-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
  • Loading branch information
Andrew Myrick authored and Eric Wong committed Jan 23, 2010
1 parent 1cef650 commit 41c0169
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -3158,10 +3158,21 @@ sub find_extra_svn_parents {
my $ranges = $ranges{$merge_tip};

# check out 'new' tips
my $merge_base = command_oneline(
"merge-base",
@$parents, $merge_tip,
);
my $merge_base;
eval {
$merge_base = command_oneline(
"merge-base",
@$parents, $merge_tip,
);
};
if ($@) {
die "An error occurred during merge-base"
unless $@->isa("Git::Error::Command");

warn "W: Cannot find common ancestor between ".
"@$parents and $merge_tip. Ignoring merge info.\n";
next;
}

# double check that there are no missing non-merge commits
my (@incomplete) = check_cherry_pick(
Expand Down

0 comments on commit 41c0169

Please sign in to comment.