Skip to content

Commit 988eece

Browse files
Martin LanghoffJunio C Hamano
authored andcommitted
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>
1 parent 31ec6ab commit 988eece

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

git-svnimport.perl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,13 @@ sub commit_all {
736736
}
737737

738738
$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+
739746
print "Fetching from $current_rev to $opt_l ...\n" if $opt_v;
740747

741748
my $pool=SVN::Pool->new;

0 commit comments

Comments
 (0)