From: Eric Wong <normalperson@yhbt.net>
To: Junio C Hamano <junkio@cox.net>
Cc: Ben Williamson <benw@pobox.com>, git@vger.kernel.org
Subject: [PATCH] git-svn: fix fetching new directories copies when using SVN:: libs
Date: Thu, 20 Jul 2006 01:43:01 -0700 [thread overview]
Message-ID: <20060720084301.GA29440@localdomain> (raw)
In-Reply-To: <20060720034841.GA28298@localdomain>
Log output from SVN doesn't list all the new files that were
added if a new directory was copied from an existing place in
the repository. This means we'll have to do some extra work and
traverse new directories ourselves.
This has been updated from the original patch to defer traversed
adds until all removals have been done. Please disregard the
original.
Thanks to Ben Williamson for the excellent bug report and
testing.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-svn.perl | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 89ad840..6453771 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2709,6 +2709,12 @@ sub libsvn_fetch {
} else {
die "Unrecognized action: $m, ($f r$rev)\n";
}
+ } elsif ($t == $SVN::Node::dir && $m =~ /^[AR]$/) {
+ my @traversed = ();
+ libsvn_traverse($gui, '', $f, $rev, \@traversed);
+ foreach (@traversed) {
+ push @amr, [ $m, $_ ]
+ }
}
$pool->clear;
}
@@ -2778,7 +2784,7 @@ sub libsvn_parse_revision {
}
sub libsvn_traverse {
- my ($gui, $pfx, $path, $rev) = @_;
+ my ($gui, $pfx, $path, $rev, $files) = @_;
my $cwd = "$pfx/$path";
my $pool = SVN::Pool->new;
$cwd =~ s#^/+##g;
@@ -2786,10 +2792,15 @@ sub libsvn_traverse {
foreach my $d (keys %$dirent) {
my $t = $dirent->{$d}->kind;
if ($t == $SVN::Node::dir) {
- libsvn_traverse($gui, $cwd, $d, $rev);
+ libsvn_traverse($gui, $cwd, $d, $rev, $files);
} elsif ($t == $SVN::Node::file) {
- print "\tA\t$cwd/$d\n" unless $_q;
- libsvn_get_file($gui, "$cwd/$d", $rev);
+ my $file = "$cwd/$d";
+ if (defined $files) {
+ push @$files, $file;
+ } else {
+ print "\tA\t$file\n" unless $_q;
+ libsvn_get_file($gui, $file, $rev);
+ }
}
}
$pool->clear;
@@ -2913,9 +2924,7 @@ sub libsvn_new_tree {
}
my ($paths, $rev, $author, $date, $msg) = @_;
open my $gui, '| git-update-index -z --index-info' or croak $!;
- my $pool = SVN::Pool->new;
- libsvn_traverse($gui, '', $SVN_PATH, $rev, $pool);
- $pool->clear;
+ libsvn_traverse($gui, '', $SVN_PATH, $rev);
close $gui or croak $?;
return libsvn_log_entry($rev, $author, $date, $msg);
}
--
1.4.1.g9d8f
next prev parent reply other threads:[~2006-07-20 8:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-20 2:02 git-svn: Missing files Ben Williamson
2006-07-20 2:09 ` Ben Williamson
2006-07-20 2:48 ` Eric Wong
2006-07-20 3:06 ` Eric Wong
2006-07-20 4:31 ` Ben Williamson
2006-07-20 3:48 ` [PATCH] " Eric Wong
2006-07-20 5:51 ` Ben Williamson
2006-07-20 8:43 ` Eric Wong [this message]
2006-07-24 6:42 ` [PATCH] git-svn: fix fetching new directories copies when using SVN:: libs Junio C Hamano
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=20060720084301.GA29440@localdomain \
--to=normalperson@yhbt.net \
--cc=benw@pobox.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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).