aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-01-30 00:35:18 -0800
committerEric Wong <normalperson@yhbt.net>2007-02-23 00:57:10 -0800
commit289370578ca5833641fbb59813173ac6db1986d1 (patch)
tree68478bcbc9175b2edbe4c76f80c4f36a3eac0252 /git-svn.perl
parent5d3b7cd5fe5d0410915cc68b641415901e1b113e (diff)
downloadgit-289370578ca5833641fbb59813173ac6db1986d1.tar.gz
git-289370578ca5833641fbb59813173ac6db1986d1.tar.xz
git-svn: fetch tracks initial change with --follow-parent
We were still skipping path information from get_log if we are tracking /r9270/drunk/subversion/bindings/..., but got something like this in the log: A /r9270/drunk (from /r9270/trunk:14) Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl17
1 files changed, 14 insertions, 3 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 4e357dfce..b0248c948 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1090,6 +1090,19 @@ sub revisions_eq {
return 1;
}
+sub match_paths {
+ my ($self, $paths) = @_;
+ return 1 if $paths->{'/'};
+ $self->{path_regex} ||= qr/^\/\Q$self->{path}\E\/?/;
+ grep /$self->{path_regex}/, keys %$paths and return 1;
+ my $c = '';
+ foreach (split m#/#, $self->rel_path) {
+ $c .= "/$_";
+ return 1 if $paths->{$c};
+ }
+ return 0;
+}
+
sub find_parent_branch {
my ($self, $paths, $rev) = @_;
return undef unless $::_follow_parent;
@@ -2313,7 +2326,6 @@ sub gs_fetch_loop_common {
if (my $last_commit = $gs->last_commit) {
$gs->assert_index_clean($last_commit);
}
- $gs->{path_regex} = qr/^\/\Q$gs->{path}\E\/?/;
}
while (1) {
my @revs;
@@ -2339,8 +2351,7 @@ sub gs_fetch_loop_common {
my ($paths, $r) = @$_;
foreach my $gs (@gs) {
if ($paths) {
- grep /$gs->{path_regex}/, keys %$paths
- or next;
+ $gs->match_paths($paths) or next;
}
next if defined $gs->rev_db_get($r);
if (my $log_entry = $gs->do_fetch($paths, $r)) {