summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-09-08 23:33:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-09-09 09:30:33 (GMT)
commit7b02b85a66fee6b357e02f9e70dd0baa0fd24308 (patch)
tree669e311d54227e9bc883b51951b3274ebd6bd270
parent5701115aa7cfe7edd57c2483085456a37e27a5ba (diff)
downloadgit-7b02b85a66fee6b357e02f9e70dd0baa0fd24308.zip
git-7b02b85a66fee6b357e02f9e70dd0baa0fd24308.tar.gz
git-7b02b85a66fee6b357e02f9e70dd0baa0fd24308.tar.bz2
git-svn: understand grafts when doing dcommit
Use the rev-list --parents functionality to read the parents of the commit. cat-file only shows the raw object with the original parents and doesn't take into account grafts; so we'll rely on rev-list machinery for the smarts here. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-svn.perl11
1 files changed, 3 insertions, 8 deletions
diff --git a/git-svn.perl b/git-svn.perl
index fbd4691..f818160 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -841,14 +841,9 @@ sub working_head_info {
sub read_commit_parents {
my ($parents, $c) = @_;
- my ($fh, $ctx) = command_output_pipe(qw/cat-file commit/, $c);
- while (<$fh>) {
- chomp;
- last if '';
- /^parent ($sha1)/ or next;
- push @{$parents->{$c}}, $1;
- }
- close $fh; # break the pipe
+ chomp(my $p = command_oneline(qw/rev-list --parents -1/, $c));
+ $p =~ s/^($c)\s*// or die "rev-list --parents -1 $c failed!\n";
+ @{$parents->{$c}} = split(/ /, $p);
}
sub linearize_history {