Skip to content

Commit

Permalink
svnimport: exit cleanly when we are up to date
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Langhoff authored and Junio C Hamano committed Dec 15, 2005
1 parent 31ec6ab commit 988eece
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions git-svnimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 988eece

Please sign in to comment.