svnimport: exit cleanly when we are up to date
Now we detect that the SVN repo does not have new commits for us and exit cleanly, removing the lockfile. With this, svnimport supports being run on a cronjob to maintain a SVN2GIT gateway. Signed-off-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Martin Langhoff committed
Dec 15, 2005 at 19:26 UTC
988eece42aa4c1c6b7c4cdfd102748c19acba7ed
1 file changed
+7
git-svnimport.perl
+7
@@ -736,6 +736,13 @@ sub commit_all {
736
}
737
738
$opt_l = $svn->{'maxrev'} if not defined $opt_l or $opt_l > $svn->{'maxrev'};
739
+
740
+if ($svn->{'maxrev'} < $current_rev) {
741
+ print "Up to date: no new revisions to fetch!\n" if $opt_v;
742
+ unlink("$git_dir/SVN2GIT_HEAD");
743
+ exit;
744
+}
745
+
746
print "Fetching from $current_rev to $opt_l ...\n" if $opt_v;
747
748
my $pool=SVN::Pool->new;