From: Sasha Khapyorsky Date: Sun, 07 Jan 2007 18:59:06 GMT Subject: Re: [PATCH] git-svnimport: support for incremental import Message-ID: <20070107185906.GD18379@sashak.voltaire.com> In-Reply-To: <204011cb0701071012g30cb69a5h4622d94574d10521@mail.gmail.com> On 10:12 Sun 07 Jan , Chris Lee wrote: > On 1/6/07, Sasha Khapyorsky wrote: > >This adds ability to do import "in chunks" (default 1000 revisions), > >after each chunk git repo will be repacked. The option -R is used to > >change default value of chunk size (or how often repository will > >repacked). > > Actually, I just noticed an issue here with this - it appears to be > double-importing the edge revisions. > > So if I started with -s 349000 and tell it to repack every 1000 > revisions, it's now importing every thousandth revision twice. Indeed. There is the fix: diff --git a/git-svnimport.perl b/git-svnimport.perl index afbbe63..f1f1a7d 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -943,10 +943,10 @@ if ($opt_l < $current_rev) { print "Processing from $current_rev to $opt_l ...\n" if $opt_v; my $from_rev; -my $to_rev = $current_rev; +my $to_rev = $current_rev - 1; while ($to_rev < $opt_l) { - $from_rev = $to_rev; + $from_rev = $to_rev + 1; $to_rev = $from_rev + $repack_after; $to_rev = $opt_l if $opt_l < $to_rev; print "Fetching from $from_rev to $to_rev ...\n" if $opt_v; Sasha