From: Alex Vandiver <alex@chmrr.net>
To: git@vger.kernel.org
Subject: [PATCH 2/5] git-svn: Make merge metadata accessible to make_log_entry
Date: Wed, 2 Dec 2009 14:07:51 -0500 [thread overview]
Message-ID: <1259780874-14706-3-git-send-email-alex@chmrr.net> (raw)
In-Reply-To: <1259780874-14706-1-git-send-email-alex@chmrr.net>
Signed-off-by: Alex Vandiver <alex@chmrr.net>
---
git-svn.perl | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 53bf20c..5337326 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2924,7 +2924,7 @@ sub check_author {
}
sub find_extra_svk_parents {
- my ($self, $ed, $tickets, $parents) = @_;
+ my ($self, $ed, $tickets, $parents, $merges) = @_;
# aha! svk:merge property changed...
my @tickets = split "\n", $tickets;
my @known_parents;
@@ -2944,14 +2944,15 @@ sub find_extra_svk_parents {
# wahey! we found it, but it might be
# an old one (!)
push @known_parents, [ $rev, $commit ];
+ push @known_parents, [ $rev, $path, $commit ];
}
}
}
# Ordering matters; highest-numbered commit merge tickets
# first, as they may account for later merge ticket additions
# or changes.
- @known_parents = map {$_->[1]} sort {$b->[0] <=> $a->[0]} @known_parents;
- for my $parent ( @known_parents ) {
+ for my $merge ( sort {$b->[0] <=> $a->[0]} @known_parents ) {
+ my ($rev, $path, $parent) = @{$merge};
my @cmd = ('rev-list', $parent, map { "^$_" } @$parents );
my ($msg_fh, $ctx) = command_output_pipe(@cmd);
my $new;
@@ -2963,6 +2964,7 @@ sub find_extra_svk_parents {
print STDERR
"Found merge parent (svk:merge ticket): $parent\n";
push @$parents, $parent;
+ push @$merges, "$path:$rev";
}
}
}
@@ -3061,27 +3063,31 @@ sub make_log_entry {
my ($self, $rev, $parents, $ed) = @_;
my $untracked = $self->get_untracked($ed);
- my @parents = @$parents;
+ my %log_entry = ( parents => $parents,
+ merged_branches => [],
+ revision => $rev,
+ log => '');
my $ps = $ed->{path_strip} || "";
for my $path ( grep { m/$ps/ } %{$ed->{dir_prop}} ) {
my $props = $ed->{dir_prop}{$path};
if ( $props->{"svk:merge"} ) {
$self->find_extra_svk_parents
- ($ed, $props->{"svk:merge"}, \@parents);
+ ($ed,
+ $props->{"svk:merge"},
+ $log_entry{parents},
+ $log_entry{merged_branches});
}
if ( $props->{"svn:mergeinfo"} ) {
$self->find_extra_svn_parents
($ed,
$props->{"svn:mergeinfo"},
- \@parents);
+ $log_entry{parents});
}
}
open my $un, '>>', "$self->{dir}/unhandled.log" or croak $!;
print $un "r$rev\n" or croak $!;
print $un $_, "\n" foreach @$untracked;
- my %log_entry = ( parents => \@parents, revision => $rev,
- log => '');
my $headrev;
my $logged = delete $self->{logged_rev_props};
--
1.6.6.rc0.327.g032bc
next prev parent reply other threads:[~2009-12-02 19:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 19:07 [PATCH 0/5] git-svn: svk log message cleanup Alex Vandiver
2009-12-02 19:07 ` [PATCH 1/5] git-svn: Allow setting the committer and author date separately Alex Vandiver
2009-12-02 19:07 ` Alex Vandiver [this message]
2009-12-02 20:46 ` [PATCH 2/5] git-svn: Make merge metadata accessible to make_log_entry Alex Vandiver
2009-12-05 22:32 ` Eric Wong
2009-12-05 22:51 ` Alex Vandiver
2009-12-05 22:59 ` [spf:guess] " Sam Vilain
2009-12-05 23:10 ` Alex Vandiver
2009-12-19 22:24 ` Alex Vandiver
2009-12-02 19:07 ` [PATCH 3/5] git-svn: Strip SVK headers, optionally parsing author information Alex Vandiver
2009-12-02 19:07 ` [PATCH 4/5] git-svn: Provide a default "empty commit message" so the metadata is not the header Alex Vandiver
2009-12-02 19:07 ` [PATCH 5/5] git-svn: Correct a copy-and-pasted misleading comment Alex Vandiver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1259780874-14706-3-git-send-email-alex@chmrr.net \
--to=alex@chmrr.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).