aboutsummaryrefslogtreecommitdiff
path: root/git-svnimport.perl
diff options
context:
space:
mode:
authorMartin Langhoff <martin@catalyst.net.nz>2005-12-15 19:26:46 +1300
committerJunio C Hamano <junkio@cox.net>2005-12-14 22:24:46 -0800
commit988eece42aa4c1c6b7c4cdfd102748c19acba7ed (patch)
tree21e5806721f0ee7e0a0bd20448a8f1a45e6847bb /git-svnimport.perl
parent31ec6abf887ec95642cbe82fe61076e975494ab0 (diff)
downloadgit-988eece42aa4c1c6b7c4cdfd102748c19acba7ed.tar.gz
git-988eece42aa4c1c6b7c4cdfd102748c19acba7ed.tar.xz
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>
Diffstat (limited to 'git-svnimport.perl')
-rwxr-xr-xgit-svnimport.perl7
1 files changed, 7 insertions, 0 deletions
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 65868a91e..cb241d1b5 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;