From: Martin Langhoff Date: Thu, 15 Dec 2005 06:26:46 +0000 (+1300) Subject: svnimport: exit cleanly when we are up to date X-Git-Tag: v1.0.0^2~41 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/988eece42aa4c1c6b7c4cdfd102748c19acba7ed 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 Signed-off-by: Junio C Hamano --- diff --git a/git-svnimport.perl b/git-svnimport.perl index 65868a91e5..cb241d1b51 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -736,6 +736,13 @@ sub commit_all { } $opt_l = $svn->{'maxrev'} if not defined $opt_l or $opt_l > $svn->{'maxrev'}; + +if ($svn->{'maxrev'} < $current_rev) { + print "Up to date: no new revisions to fetch!\n" if $opt_v; + unlink("$git_dir/SVN2GIT_HEAD"); + exit; +} + print "Fetching from $current_rev to $opt_l ...\n" if $opt_v; my $pool=SVN::Pool->new;