threads / patch / 2849

patchsvnimport: exit cleanly when we are up to date

Subject: [PATCH] svnimport: exit cleanly when we are up to date

## tl;dr

One message between Dec 15, 2005 and Dec 15, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Martin Langhoff· Dec 15, 2005, 06:26 UTC · lore

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>
---
 git-svnimport.perl |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
0116ebb61f1e11b3c43d4e80ac899d81f24a62d4
Show changes to git-svnimport.perl +7 −0
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 65868a9..cb241d1 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;
-- 
0.99.9.GIT

← back to recent threads